From 33e22a421cd299e22958210c2757dcf55d8f2aef Mon Sep 17 00:00:00 2001 From: RameshT Date: Wed, 21 Aug 2024 12:04:30 +0530 Subject: [PATCH] Your commit message --- .eslintrc.json | 15 +- .gitignore | 1 + .husky/.gitignore | 1 + .husky/pre-commit | 30 +- .husky/pre-commit-js-css | 11 +- .php-cs-fixer.cache | 2 +- .php-cs-fixer.php | 49 + .prettier.rc.json | 16 + .prettierignore | 25 +- .prettierrc.json | 15 - application/config/config.php | 54 +- application/controllers/Form.php | 37 - application/controllers/Form_controller.php | 20 +- application/controllers/Testing/Dummy.php | 54 + application/controllers/Testing/Form.php | 42 + application/controllers/dummy.php | 39 - assets/css/editview.css | 2 +- assets/js/edit_form_views.js | 205 +- assets/js/scripts.js | 380 +- assets/js/updation.js | 109 +- bootstrap.php | 3 + composer.json | 21 +- composer.lock | 516 +- custom_sniffs/Sniffs/NamespaceSniff.php | 57 + eslint.config.mjs => eslint.mjs.txt | 0 node_modules/.bin/esparse | 1 - node_modules/.bin/esvalidate | 1 - node_modules/.package-lock.json | 1157 ++- node_modules/@eslint/eslintrc/CHANGELOG.md | 50 - node_modules/@eslint/eslintrc/LICENSE | 12 +- node_modules/@eslint/eslintrc/README.md | 74 +- .../@eslint/eslintrc/conf/config-schema.js | 4 +- .../@eslint/eslintrc/conf/environments.js | 41 +- .../@eslint/eslintrc/conf/eslint-all.js | 12 - .../eslintrc/conf/eslint-recommended.js | 12 - .../lib/cascading-config-array-factory.js | 39 +- .../eslintrc/lib/config-array-factory.js | 104 +- .../eslintrc/lib/config-array/config-array.js | 37 +- .../lib/config-array/config-dependency.js | 16 +- .../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 | 64 +- node_modules/@eslint/eslintrc/lib/index.js | 68 +- .../@eslint/eslintrc/lib/shared/ajv.js | 165 +- .../@eslint/eslintrc/lib/shared/config-ops.js | 217 +- .../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 +- node_modules/@eslint/eslintrc/package.json | 67 +- node_modules/@eslint/js/package.json | 2 +- .../@humanwhocodes/config-array/README.md | 100 +- .../@humanwhocodes/config-array/api.js | 757 +- .../@humanwhocodes/config-array/package.json | 30 +- .../@humanwhocodes/object-schema/.eslintrc.js | 29 - .../.github/workflows/nodejs-test.yml | 27 - .../.github/workflows/release-please.yml | 39 - .../@humanwhocodes/object-schema/CHANGELOG.md | 32 + .../@humanwhocodes/object-schema/package.json | 7 +- .../object-schema/src/object-schema.js | 86 +- .../object-schema/tests/merge-strategy.js | 66 - .../object-schema/tests/object-schema.js | 611 -- .../tests/validation-strategy.js | 186 - node_modules/acorn/CHANGELOG.md | 290 + node_modules/acorn/LICENSE | 2 +- node_modules/acorn/README.md | 79 +- node_modules/acorn/bin/acorn | 4 +- node_modules/acorn/dist/acorn.d.ts | 1051 ++- node_modules/acorn/dist/acorn.js | 2995 ++++--- node_modules/acorn/dist/acorn.js.map | 1 - node_modules/acorn/dist/acorn.mjs | 2983 ++++--- node_modules/acorn/dist/acorn.mjs.d.ts | 2 - node_modules/acorn/dist/acorn.mjs.map | 1 - node_modules/acorn/dist/bin.js | 68 +- node_modules/acorn/package.json | 25 +- node_modules/ansi-colors/LICENSE | 21 - node_modules/ansi-colors/README.md | 315 - node_modules/ansi-colors/index.js | 184 - node_modules/ansi-colors/package.json | 129 - node_modules/ansi-colors/symbols.js | 69 - node_modules/ansi-colors/types/index.d.ts | 235 - node_modules/argparse/CHANGELOG.md | 199 +- node_modules/argparse/LICENSE | 267 +- node_modules/argparse/README.md | 253 +- node_modules/argparse/index.js | 3 - node_modules/argparse/lib/action.js | 146 - node_modules/argparse/lib/action/append.js | 53 - .../argparse/lib/action/append/constant.js | 47 - node_modules/argparse/lib/action/count.js | 40 - node_modules/argparse/lib/action/help.js | 47 - node_modules/argparse/lib/action/store.js | 50 - .../argparse/lib/action/store/constant.js | 43 - .../argparse/lib/action/store/false.js | 27 - .../argparse/lib/action/store/true.js | 26 - .../argparse/lib/action/subparsers.js | 149 - node_modules/argparse/lib/action/version.js | 47 - node_modules/argparse/lib/action_container.js | 482 -- node_modules/argparse/lib/argparse.js | 14 - node_modules/argparse/lib/argument/error.js | 50 - .../argparse/lib/argument/exclusive.js | 54 - node_modules/argparse/lib/argument/group.js | 75 - node_modules/argparse/lib/argument_parser.js | 1161 --- node_modules/argparse/lib/const.js | 21 - .../argparse/lib/help/added_formatters.js | 87 - node_modules/argparse/lib/help/formatter.js | 795 -- node_modules/argparse/lib/namespace.js | 76 - node_modules/argparse/lib/utils.js | 57 - node_modules/argparse/package.json | 29 +- node_modules/astral-regex/index.d.ts | 28 - node_modules/astral-regex/index.js | 6 - node_modules/astral-regex/license | 9 - node_modules/astral-regex/package.json | 33 - node_modules/astral-regex/readme.md | 46 - .../full-chromium-versions.js | 3 + .../full-chromium-versions.json | 2 +- .../electron-to-chromium/full-versions.js | 3 +- .../electron-to-chromium/full-versions.json | 2 +- .../electron-to-chromium/package.json | 2 +- node_modules/enquirer/LICENSE | 21 - node_modules/enquirer/README.md | 1839 ----- node_modules/enquirer/index.d.ts | 156 - node_modules/enquirer/index.js | 254 - node_modules/enquirer/lib/ansi.js | 125 - 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 | 245 - node_modules/enquirer/lib/placeholder.js | 63 - node_modules/enquirer/lib/prompt.js | 497 -- .../enquirer/lib/prompts/autocomplete.js | 118 - .../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 | 195 - 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/queue.js | 33 - 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 | 664 -- 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 | 209 - node_modules/enquirer/lib/utils.js | 279 - .../node_modules/ansi-regex/index.d.ts | 37 - .../enquirer/node_modules/ansi-regex/index.js | 10 - .../enquirer/node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 55 - .../node_modules/ansi-regex/readme.md | 78 - .../node_modules/strip-ansi/index.d.ts | 17 - .../enquirer/node_modules/strip-ansi/index.js | 4 - .../enquirer/node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 54 - .../node_modules/strip-ansi/readme.md | 46 - node_modules/enquirer/package.json | 112 - node_modules/eslint-scope/CHANGELOG.md | 70 - node_modules/eslint-scope/README.md | 38 +- 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 | 61 +- .../eslint-scope/lib/scope-manager.js | 66 +- node_modules/eslint-scope/lib/scope.js | 82 +- node_modules/eslint-scope/lib/variable.js | 7 +- node_modules/eslint-scope/package.json | 53 +- node_modules/eslint-utils/README.md | 38 - node_modules/eslint-utils/index.js | 1880 ----- node_modules/eslint-utils/index.js.map | 1 - node_modules/eslint-utils/index.mjs | 1838 ----- node_modules/eslint-utils/index.mjs.map | 1 - .../eslint-visitor-keys/CHANGELOG.md | 25 - .../node_modules/eslint-visitor-keys/LICENSE | 201 - .../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 | 40 - node_modules/eslint-utils/package.json | 65 - node_modules/eslint-visitor-keys/CHANGELOG.md | 36 - node_modules/eslint-visitor-keys/README.md | 23 +- node_modules/eslint-visitor-keys/lib/index.js | 90 +- .../eslint-visitor-keys/lib/visitor-keys.json | 289 - node_modules/eslint-visitor-keys/package.json | 71 +- node_modules/eslint/CHANGELOG.md | 6553 --------------- node_modules/eslint/LICENSE | 2 +- node_modules/eslint/README.md | 166 +- node_modules/eslint/bin/eslint.js | 61 +- node_modules/eslint/conf/category-list.json | 39 - node_modules/eslint/conf/eslint-all.js | 31 - .../eslint/conf/eslint-recommended.js | 72 - node_modules/eslint/lib/api.js | 54 +- .../eslint/lib/cli-engine/cli-engine.js | 154 +- .../eslint/lib/cli-engine/file-enumerator.js | 27 +- .../lib/cli-engine/formatters/codeframe.js | 138 - .../eslint/lib/cli-engine/formatters/html.js | 147 +- .../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 | 30 +- .../eslint/lib/cli-engine/xml-escape.js | 2 +- node_modules/eslint/lib/cli.js | 215 +- .../eslint/lib/config/default-config.js | 35 +- .../eslint/lib/config/flat-config-array.js | 191 +- .../eslint/lib/config/flat-config-schema.js | 384 +- .../eslint/lib/config/rule-validator.js | 89 +- node_modules/eslint/lib/eslint/eslint.js | 82 +- node_modules/eslint/lib/eslint/index.js | 4 +- node_modules/eslint/lib/init/autoconfig.js | 348 - node_modules/eslint/lib/init/config-file.js | 144 - .../eslint/lib/init/config-initializer.js | 704 -- 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 | 434 +- .../code-path-analysis/code-path-analyzer.js | 212 +- .../code-path-analysis/code-path-segment.js | 83 +- .../code-path-analysis/code-path-state.js | 1374 +++- .../linter/code-path-analysis/code-path.js | 182 +- .../code-path-analysis/debug-helpers.js | 12 +- .../linter/code-path-analysis/fork-context.js | 246 +- .../linter/code-path-analysis/id-generator.js | 5 +- .../lib/linter/config-comment-parser.js | 58 +- node_modules/eslint/lib/linter/linter.js | 996 ++- .../eslint/lib/linter/node-event-generator.js | 12 +- .../eslint/lib/linter/report-translator.js | 43 +- 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 | 555 +- .../eslint/lib/rule-tester/rule-tester.js | 327 +- .../eslint/lib/rules/accessor-pairs.js | 90 +- .../eslint/lib/rules/array-bracket-newline.js | 11 +- .../eslint/lib/rules/array-bracket-spacing.js | 11 +- .../eslint/lib/rules/array-callback-return.js | 212 +- .../eslint/lib/rules/array-element-newline.js | 26 +- .../eslint/lib/rules/arrow-body-style.js | 8 +- node_modules/eslint/lib/rules/arrow-parens.js | 11 +- .../eslint/lib/rules/arrow-spacing.js | 11 +- .../eslint/lib/rules/block-scoped-var.js | 29 +- .../eslint/lib/rules/block-spacing.js | 24 +- node_modules/eslint/lib/rules/brace-style.js | 17 +- .../eslint/lib/rules/callback-return.js | 13 +- node_modules/eslint/lib/rules/camelcase.js | 450 +- .../eslint/lib/rules/capitalized-comments.js | 10 +- .../lib/rules/class-methods-use-this.js | 80 +- node_modules/eslint/lib/rules/comma-dangle.js | 48 +- .../eslint/lib/rules/comma-spacing.js | 87 +- node_modules/eslint/lib/rules/comma-style.js | 11 +- node_modules/eslint/lib/rules/complexity.js | 116 +- .../lib/rules/computed-property-spacing.js | 14 +- .../eslint/lib/rules/consistent-return.js | 49 +- .../eslint/lib/rules/consistent-this.js | 16 +- .../eslint/lib/rules/constructor-super.js | 57 +- node_modules/eslint/lib/rules/curly.js | 8 +- .../eslint/lib/rules/default-case-last.js | 6 +- node_modules/eslint/lib/rules/default-case.js | 12 +- .../eslint/lib/rules/default-param-last.js | 8 +- node_modules/eslint/lib/rules/dot-location.js | 11 +- node_modules/eslint/lib/rules/dot-notation.js | 16 +- node_modules/eslint/lib/rules/eol-last.js | 18 +- node_modules/eslint/lib/rules/eqeqeq.js | 10 +- .../eslint/lib/rules/for-direction.js | 68 +- .../eslint/lib/rules/func-call-spacing.js | 11 +- .../eslint/lib/rules/func-name-matching.js | 24 +- node_modules/eslint/lib/rules/func-names.js | 11 +- node_modules/eslint/lib/rules/func-style.js | 6 +- .../rules/function-call-argument-newline.js | 11 +- .../lib/rules/function-paren-newline.js | 29 +- .../lib/rules/generator-star-spacing.js | 11 +- .../eslint/lib/rules/getter-return.js | 71 +- .../eslint/lib/rules/global-require.js | 20 +- .../lib/rules/grouped-accessor-pairs.js | 83 +- node_modules/eslint/lib/rules/guard-for-in.js | 6 +- .../eslint/lib/rules/handle-callback-err.js | 10 +- node_modules/eslint/lib/rules/id-blacklist.js | 27 +- node_modules/eslint/lib/rules/id-denylist.js | 68 +- node_modules/eslint/lib/rules/id-length.js | 60 +- node_modules/eslint/lib/rules/id-match.js | 99 +- .../lib/rules/implicit-arrow-linebreak.js | 11 +- .../eslint/lib/rules/indent-legacy.js | 21 +- node_modules/eslint/lib/rules/indent.js | 311 +- node_modules/eslint/lib/rules/index.js | 9 +- .../eslint/lib/rules/init-declarations.js | 6 +- node_modules/eslint/lib/rules/jsx-quotes.js | 11 +- node_modules/eslint/lib/rules/key-spacing.js | 165 +- .../eslint/lib/rules/keyword-spacing.js | 83 +- .../eslint/lib/rules/line-comment-position.js | 8 +- .../eslint/lib/rules/linebreak-style.js | 11 +- .../eslint/lib/rules/lines-around-comment.js | 100 +- .../lib/rules/lines-around-directive.js | 10 +- .../lib/rules/lines-between-class-members.js | 162 +- .../eslint/lib/rules/max-classes-per-file.js | 44 +- node_modules/eslint/lib/rules/max-depth.js | 8 +- node_modules/eslint/lib/rules/max-len.js | 43 +- .../lib/rules/max-lines-per-function.js | 10 +- node_modules/eslint/lib/rules/max-lines.js | 26 +- .../eslint/lib/rules/max-nested-callbacks.js | 6 +- node_modules/eslint/lib/rules/max-params.js | 8 +- .../lib/rules/max-statements-per-line.js | 11 +- .../eslint/lib/rules/max-statements.js | 16 +- .../lib/rules/multiline-comment-style.js | 53 +- .../eslint/lib/rules/multiline-ternary.js | 15 +- node_modules/eslint/lib/rules/new-cap.js | 15 +- node_modules/eslint/lib/rules/new-parens.js | 30 +- .../eslint/lib/rules/newline-after-var.js | 18 +- .../eslint/lib/rules/newline-before-return.js | 12 +- .../lib/rules/newline-per-chained-call.js | 13 +- node_modules/eslint/lib/rules/no-alert.js | 10 +- .../eslint/lib/rules/no-array-constructor.js | 97 +- .../lib/rules/no-async-promise-executor.js | 8 +- .../eslint/lib/rules/no-await-in-loop.js | 6 +- node_modules/eslint/lib/rules/no-bitwise.js | 20 +- .../eslint/lib/rules/no-buffer-constructor.js | 7 +- node_modules/eslint/lib/rules/no-caller.js | 6 +- .../eslint/lib/rules/no-case-declarations.js | 6 +- .../eslint/lib/rules/no-catch-shadow.js | 10 +- .../eslint/lib/rules/no-class-assign.js | 10 +- .../eslint/lib/rules/no-compare-neg-zero.js | 6 +- .../eslint/lib/rules/no-cond-assign.js | 8 +- .../eslint/lib/rules/no-confusing-arrow.js | 19 +- node_modules/eslint/lib/rules/no-console.js | 89 +- .../eslint/lib/rules/no-const-assign.js | 10 +- .../eslint/lib/rules/no-constant-condition.js | 160 +- .../eslint/lib/rules/no-constructor-return.js | 6 +- node_modules/eslint/lib/rules/no-continue.js | 6 +- .../eslint/lib/rules/no-control-regex.js | 56 +- node_modules/eslint/lib/rules/no-debugger.js | 6 +- .../eslint/lib/rules/no-delete-var.js | 6 +- node_modules/eslint/lib/rules/no-div-regex.js | 8 +- node_modules/eslint/lib/rules/no-dupe-args.js | 10 +- .../eslint/lib/rules/no-dupe-class-members.js | 15 +- .../eslint/lib/rules/no-dupe-else-if.js | 8 +- node_modules/eslint/lib/rules/no-dupe-keys.js | 7 +- .../eslint/lib/rules/no-duplicate-case.js | 8 +- .../eslint/lib/rules/no-duplicate-imports.js | 6 +- .../eslint/lib/rules/no-else-return.js | 33 +- .../lib/rules/no-empty-character-class.js | 60 +- .../eslint/lib/rules/no-empty-function.js | 10 +- .../eslint/lib/rules/no-empty-pattern.js | 47 +- node_modules/eslint/lib/rules/no-empty.js | 29 +- node_modules/eslint/lib/rules/no-eq-null.js | 6 +- node_modules/eslint/lib/rules/no-eval.js | 53 +- node_modules/eslint/lib/rules/no-ex-assign.js | 10 +- .../eslint/lib/rules/no-extend-native.js | 11 +- .../eslint/lib/rules/no-extra-bind.js | 8 +- .../eslint/lib/rules/no-extra-boolean-cast.js | 19 +- .../eslint/lib/rules/no-extra-label.js | 8 +- .../eslint/lib/rules/no-extra-parens.js | 146 +- .../eslint/lib/rules/no-extra-semi.js | 53 +- .../eslint/lib/rules/no-fallthrough.js | 97 +- .../eslint/lib/rules/no-floating-decimal.js | 11 +- .../eslint/lib/rules/no-func-assign.js | 10 +- .../eslint/lib/rules/no-global-assign.js | 13 +- .../eslint/lib/rules/no-implicit-coercion.js | 45 +- .../eslint/lib/rules/no-implicit-globals.js | 16 +- .../eslint/lib/rules/no-implied-eval.js | 15 +- .../eslint/lib/rules/no-import-assign.js | 14 +- .../eslint/lib/rules/no-inline-comments.js | 8 +- .../eslint/lib/rules/no-inner-declarations.js | 36 +- .../eslint/lib/rules/no-invalid-regexp.js | 93 +- .../eslint/lib/rules/no-invalid-this.js | 107 +- .../lib/rules/no-irregular-whitespace.js | 33 +- node_modules/eslint/lib/rules/no-iterator.js | 6 +- node_modules/eslint/lib/rules/no-label-var.js | 9 +- node_modules/eslint/lib/rules/no-labels.js | 8 +- .../eslint/lib/rules/no-lone-blocks.js | 32 +- node_modules/eslint/lib/rules/no-lonely-if.js | 13 +- node_modules/eslint/lib/rules/no-loop-func.js | 16 +- .../eslint/lib/rules/no-loss-of-precision.js | 32 +- .../eslint/lib/rules/no-magic-numbers.js | 31 +- .../rules/no-misleading-character-class.js | 182 +- .../eslint/lib/rules/no-mixed-operators.js | 15 +- .../eslint/lib/rules/no-mixed-requires.js | 9 +- .../lib/rules/no-mixed-spaces-and-tabs.js | 11 +- .../eslint/lib/rules/no-multi-assign.js | 27 +- .../eslint/lib/rules/no-multi-spaces.js | 13 +- node_modules/eslint/lib/rules/no-multi-str.js | 6 +- .../lib/rules/no-multiple-empty-lines.js | 11 +- .../eslint/lib/rules/no-native-reassign.js | 13 +- .../eslint/lib/rules/no-negated-condition.js | 6 +- .../eslint/lib/rules/no-negated-in-lhs.js | 6 +- .../eslint/lib/rules/no-nested-ternary.js | 6 +- node_modules/eslint/lib/rules/no-new-func.js | 55 +- .../eslint/lib/rules/no-new-object.js | 20 +- .../eslint/lib/rules/no-new-require.js | 7 +- .../eslint/lib/rules/no-new-symbol.js | 20 +- .../eslint/lib/rules/no-new-wrappers.js | 30 +- node_modules/eslint/lib/rules/no-new.js | 6 +- .../lib/rules/no-nonoctal-decimal-escape.js | 13 +- node_modules/eslint/lib/rules/no-obj-calls.js | 22 +- .../eslint/lib/rules/no-octal-escape.js | 6 +- node_modules/eslint/lib/rules/no-octal.js | 10 +- .../eslint/lib/rules/no-param-reassign.js | 9 +- .../eslint/lib/rules/no-path-concat.js | 7 +- node_modules/eslint/lib/rules/no-plusplus.js | 6 +- .../eslint/lib/rules/no-process-env.js | 7 +- .../eslint/lib/rules/no-process-exit.js | 7 +- .../lib/rules/no-promise-executor-return.js | 182 +- node_modules/eslint/lib/rules/no-proto.js | 6 +- .../eslint/lib/rules/no-prototype-builtins.js | 104 +- node_modules/eslint/lib/rules/no-redeclare.js | 16 +- .../eslint/lib/rules/no-regex-spaces.js | 33 +- .../eslint/lib/rules/no-restricted-exports.js | 137 +- .../eslint/lib/rules/no-restricted-globals.js | 14 +- .../eslint/lib/rules/no-restricted-imports.js | 155 +- .../eslint/lib/rules/no-restricted-modules.js | 31 +- .../lib/rules/no-restricted-properties.js | 51 +- .../eslint/lib/rules/no-restricted-syntax.js | 8 +- .../eslint/lib/rules/no-return-assign.js | 8 +- .../eslint/lib/rules/no-return-await.js | 42 +- .../eslint/lib/rules/no-script-url.js | 9 +- .../eslint/lib/rules/no-self-assign.js | 10 +- .../eslint/lib/rules/no-self-compare.js | 8 +- node_modules/eslint/lib/rules/no-sequences.js | 8 +- .../eslint/lib/rules/no-setter-return.js | 12 +- .../lib/rules/no-shadow-restricted-names.js | 9 +- node_modules/eslint/lib/rules/no-shadow.js | 158 +- .../eslint/lib/rules/no-spaced-func.js | 8 +- .../eslint/lib/rules/no-sparse-arrays.js | 8 +- node_modules/eslint/lib/rules/no-sync.js | 9 +- node_modules/eslint/lib/rules/no-tabs.js | 11 +- .../lib/rules/no-template-curly-in-string.js | 6 +- node_modules/eslint/lib/rules/no-ternary.js | 6 +- .../eslint/lib/rules/no-this-before-super.js | 55 +- .../eslint/lib/rules/no-throw-literal.js | 6 +- .../eslint/lib/rules/no-trailing-spaces.js | 11 +- .../eslint/lib/rules/no-undef-init.js | 10 +- node_modules/eslint/lib/rules/no-undef.js | 11 +- node_modules/eslint/lib/rules/no-undefined.js | 12 +- .../eslint/lib/rules/no-underscore-dangle.js | 90 +- .../lib/rules/no-unexpected-multiline.js | 8 +- .../lib/rules/no-unmodified-loop-condition.js | 12 +- .../eslint/lib/rules/no-unneeded-ternary.js | 10 +- .../eslint/lib/rules/no-unreachable-loop.js | 65 +- .../eslint/lib/rules/no-unreachable.js | 103 +- .../eslint/lib/rules/no-unsafe-finally.js | 6 +- .../eslint/lib/rules/no-unsafe-negation.js | 11 +- .../lib/rules/no-unsafe-optional-chaining.js | 8 +- .../eslint/lib/rules/no-unused-expressions.js | 33 +- .../eslint/lib/rules/no-unused-labels.js | 67 +- .../eslint/lib/rules/no-unused-vars.js | 107 +- .../eslint/lib/rules/no-use-before-define.js | 287 +- .../lib/rules/no-useless-backreference.js | 26 +- .../eslint/lib/rules/no-useless-call.js | 8 +- .../eslint/lib/rules/no-useless-catch.js | 6 +- .../lib/rules/no-useless-computed-key.js | 99 +- .../eslint/lib/rules/no-useless-concat.js | 8 +- .../lib/rules/no-useless-constructor.js | 6 +- .../eslint/lib/rules/no-useless-escape.js | 251 +- .../eslint/lib/rules/no-useless-rename.js | 20 +- .../eslint/lib/rules/no-useless-return.js | 91 +- node_modules/eslint/lib/rules/no-var.js | 16 +- node_modules/eslint/lib/rules/no-void.js | 6 +- .../eslint/lib/rules/no-warning-comments.js | 95 +- .../rules/no-whitespace-before-property.js | 11 +- node_modules/eslint/lib/rules/no-with.js | 6 +- .../rules/nonblock-statement-body-position.js | 11 +- .../eslint/lib/rules/object-curly-newline.js | 11 +- .../eslint/lib/rules/object-curly-spacing.js | 15 +- .../lib/rules/object-property-newline.js | 11 +- .../eslint/lib/rules/object-shorthand.js | 38 +- .../lib/rules/one-var-declaration-per-line.js | 9 +- node_modules/eslint/lib/rules/one-var.js | 16 +- .../eslint/lib/rules/operator-assignment.js | 36 +- .../eslint/lib/rules/operator-linebreak.js | 40 +- .../eslint/lib/rules/padded-blocks.js | 22 +- .../rules/padding-line-between-statements.js | 76 +- .../eslint/lib/rules/prefer-arrow-callback.js | 20 +- node_modules/eslint/lib/rules/prefer-const.js | 28 +- .../eslint/lib/rules/prefer-destructuring.js | 16 +- .../rules/prefer-exponentiation-operator.js | 21 +- .../lib/rules/prefer-named-capture-group.js | 104 +- .../lib/rules/prefer-numeric-literals.js | 8 +- .../eslint/lib/rules/prefer-object-spread.js | 33 +- .../lib/rules/prefer-promise-reject-errors.js | 9 +- .../eslint/lib/rules/prefer-reflect.js | 10 +- .../eslint/lib/rules/prefer-regex-literals.js | 375 +- .../eslint/lib/rules/prefer-rest-params.js | 15 +- .../eslint/lib/rules/prefer-spread.js | 8 +- .../eslint/lib/rules/prefer-template.js | 10 +- node_modules/eslint/lib/rules/quote-props.js | 31 +- node_modules/eslint/lib/rules/quotes.js | 55 +- node_modules/eslint/lib/rules/radix.js | 31 +- .../lib/rules/require-atomic-updates.js | 86 +- .../eslint/lib/rules/require-await.js | 8 +- .../eslint/lib/rules/require-jsdoc.js | 9 +- .../lib/rules/require-unicode-regexp.js | 84 +- .../eslint/lib/rules/require-yield.js | 7 +- .../eslint/lib/rules/rest-spread-spacing.js | 11 +- node_modules/eslint/lib/rules/semi-spacing.js | 14 +- node_modules/eslint/lib/rules/semi-style.js | 37 +- node_modules/eslint/lib/rules/semi.js | 140 +- node_modules/eslint/lib/rules/sort-imports.js | 8 +- node_modules/eslint/lib/rules/sort-keys.js | 49 +- node_modules/eslint/lib/rules/sort-vars.js | 8 +- .../eslint/lib/rules/space-before-blocks.js | 27 +- .../lib/rules/space-before-function-paren.js | 11 +- .../eslint/lib/rules/space-in-parens.js | 11 +- .../eslint/lib/rules/space-infix-ops.js | 37 +- .../eslint/lib/rules/space-unary-ops.js | 11 +- .../eslint/lib/rules/spaced-comment.js | 13 +- node_modules/eslint/lib/rules/strict.js | 8 +- .../eslint/lib/rules/switch-colon-spacing.js | 25 +- .../eslint/lib/rules/symbol-description.js | 18 +- .../lib/rules/template-curly-spacing.js | 11 +- .../eslint/lib/rules/template-tag-spacing.js | 11 +- node_modules/eslint/lib/rules/unicode-bom.js | 8 +- node_modules/eslint/lib/rules/use-isnan.js | 6 +- .../eslint/lib/rules/utils/ast-utils.js | 551 +- .../lib/rules/utils/lazy-loading-rule-map.js | 6 +- node_modules/eslint/lib/rules/valid-jsdoc.js | 11 +- node_modules/eslint/lib/rules/valid-typeof.js | 64 +- node_modules/eslint/lib/rules/vars-on-top.js | 45 +- node_modules/eslint/lib/rules/wrap-iife.js | 13 +- node_modules/eslint/lib/rules/wrap-regex.js | 16 +- .../eslint/lib/rules/yield-star-spacing.js | 11 +- node_modules/eslint/lib/rules/yoda.js | 25 +- node_modules/eslint/lib/shared/ajv.js | 2 +- .../eslint/lib/shared/config-validator.js | 23 +- .../eslint/lib/shared/deprecation-warnings.js | 9 +- node_modules/eslint/lib/shared/logging.js | 4 +- .../lib/shared/relative-module-resolver.js | 10 +- .../eslint/lib/shared/runtime-info.js | 5 +- .../eslint/lib/shared/string-utils.js | 40 +- node_modules/eslint/lib/shared/traverser.js | 4 +- node_modules/eslint/lib/shared/types.js | 76 +- .../eslint/lib/source-code/source-code.js | 484 +- .../lib/source-code/token-store/cursor.js | 4 +- .../lib/source-code/token-store/index.js | 2 +- .../lib/source-code/token-store/utils.js | 55 +- .../eslint/messages/all-files-ignored.js | 2 +- .../eslint/messages/extend-config-missing.js | 2 +- .../eslint/messages/failed-to-read-json.js | 2 +- .../eslint/messages/file-not-found.js | 2 +- .../eslint/messages/no-config-found.js | 6 +- .../eslint/messages/plugin-invalid.js | 2 +- .../eslint/messages/plugin-missing.js | 2 +- .../print-config-with-directory-path.js | 4 +- .../eslint/messages/whitespace-found.js | 2 +- node_modules/eslint/node_modules/.bin/semver | 1 - .../node_modules/@babel/code-frame/LICENSE | 22 - .../node_modules/@babel/code-frame/README.md | 19 - .../@babel/code-frame/lib/index.js | 167 - .../@babel/code-frame/package.json | 25 - .../eslint/node_modules/semver/LICENSE | 15 - .../eslint/node_modules/semver/README.md | 654 -- .../eslint/node_modules/semver/bin/semver.js | 188 - .../node_modules/semver/classes/comparator.js | 141 - .../node_modules/semver/classes/index.js | 5 - .../node_modules/semver/classes/range.js | 554 -- .../node_modules/semver/classes/semver.js | 302 - .../node_modules/semver/functions/clean.js | 6 - .../node_modules/semver/functions/cmp.js | 52 - .../node_modules/semver/functions/coerce.js | 60 - .../semver/functions/compare-build.js | 7 - .../semver/functions/compare-loose.js | 3 - .../node_modules/semver/functions/compare.js | 5 - .../node_modules/semver/functions/diff.js | 65 - .../node_modules/semver/functions/eq.js | 3 - .../node_modules/semver/functions/gt.js | 3 - .../node_modules/semver/functions/gte.js | 3 - .../node_modules/semver/functions/inc.js | 19 - .../node_modules/semver/functions/lt.js | 3 - .../node_modules/semver/functions/lte.js | 3 - .../node_modules/semver/functions/major.js | 3 - .../node_modules/semver/functions/minor.js | 3 - .../node_modules/semver/functions/neq.js | 3 - .../node_modules/semver/functions/parse.js | 16 - .../node_modules/semver/functions/patch.js | 3 - .../semver/functions/prerelease.js | 6 - .../node_modules/semver/functions/rcompare.js | 3 - .../node_modules/semver/functions/rsort.js | 3 - .../semver/functions/satisfies.js | 10 - .../node_modules/semver/functions/sort.js | 3 - .../node_modules/semver/functions/valid.js | 6 - .../eslint/node_modules/semver/index.js | 89 - .../node_modules/semver/internal/constants.js | 35 - .../node_modules/semver/internal/debug.js | 9 - .../semver/internal/identifiers.js | 23 - .../node_modules/semver/internal/lrucache.js | 40 - .../semver/internal/parse-options.js | 15 - .../eslint/node_modules/semver/internal/re.js | 217 - .../eslint/node_modules/semver/package.json | 77 - .../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 | 61 - .../node_modules/semver/ranges/outside.js | 80 - .../node_modules/semver/ranges/simplify.js | 47 - .../node_modules/semver/ranges/subset.js | 247 - .../semver/ranges/to-comparators.js | 8 - .../node_modules/semver/ranges/valid.js | 11 - node_modules/eslint/package.json | 159 +- node_modules/espree/CHANGELOG.md | 509 -- node_modules/espree/README.md | 49 +- node_modules/espree/espree.js | 56 +- node_modules/espree/lib/ast-node-types.js | 96 - node_modules/espree/lib/espree.js | 155 +- node_modules/espree/lib/features.js | 4 +- node_modules/espree/lib/options.js | 105 +- node_modules/espree/lib/token-translator.js | 20 +- node_modules/espree/lib/visitor-keys.js | 123 - .../eslint-visitor-keys/CHANGELOG.md | 25 - .../node_modules/eslint-visitor-keys/LICENSE | 201 - .../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 | 40 - node_modules/espree/package.json | 78 +- node_modules/esprima/ChangeLog | 235 - node_modules/esprima/LICENSE.BSD | 21 - node_modules/esprima/README.md | 46 - node_modules/esprima/bin/esparse.js | 139 - node_modules/esprima/bin/esvalidate.js | 236 - node_modules/esprima/dist/esprima.js | 6709 ---------------- node_modules/esprima/package.json | 112 - .../esquery/node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../esquery/node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 805 -- .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 40 - .../node_modules/estraverse/.jshintrc | 16 - .../node_modules/estraverse/LICENSE.BSD | 19 - .../node_modules/estraverse/README.md | 153 - .../node_modules/estraverse/estraverse.js | 805 -- .../node_modules/estraverse/gulpfile.js | 70 - .../node_modules/estraverse/package.json | 40 - node_modules/estraverse/estraverse.js | 25 +- node_modules/estraverse/package.json | 2 +- node_modules/fast-uri/.gitattributes | 2 - node_modules/fast-uri/.github/.stale.yml | 21 - node_modules/fast-uri/.github/dependabot.yml | 13 - .../fast-uri/.github/tests_checker.yml | 8 - .../fast-uri/.github/workflows/ci.yml | 23 - .../.github/workflows/package-manager-ci.yml | 20 - node_modules/fast-uri/.taprc | 3 - node_modules/fast-uri/LICENSE | 30 - node_modules/fast-uri/README.md | 125 - node_modules/fast-uri/benchmark.js | 105 - node_modules/fast-uri/index.js | 309 - node_modules/fast-uri/lib/schemes.js | 188 - node_modules/fast-uri/lib/scopedChars.js | 30 - node_modules/fast-uri/lib/utils.js | 242 - node_modules/fast-uri/package.json | 39 - node_modules/fast-uri/test/ajv.test.js | 39 - .../fast-uri/test/compatibility.test.js | 130 - node_modules/fast-uri/test/equal.test.js | 104 - node_modules/fast-uri/test/parse.test.js | 319 - node_modules/fast-uri/test/resolve.test.js | 76 - node_modules/fast-uri/test/serialize.test.js | 144 - node_modules/fast-uri/test/uri-js.test.js | 940 --- node_modules/fast-uri/test/util.test.js | 24 - node_modules/fast-uri/types/index.d.ts | 53 - node_modules/fast-uri/types/index.test-d.ts | 17 - .../functional-red-black-tree/.npmignore | 16 - .../functional-red-black-tree/LICENSE | 22 - .../functional-red-black-tree/README.md | 237 - .../functional-red-black-tree/bench/test.js | 11 - .../functional-red-black-tree/package.json | 40 - .../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 | 30 +- node_modules/ignore/CHANGELOG.md | 19 - node_modules/ignore/LICENSE-MIT | 0 node_modules/ignore/README.md | 171 +- node_modules/ignore/index.d.ts | 42 +- node_modules/ignore/index.js | 525 +- node_modules/ignore/legacy.js | 563 +- node_modules/ignore/package.json | 51 +- node_modules/js-yaml/CHANGELOG.md | 61 +- node_modules/js-yaml/README.md | 107 +- node_modules/js-yaml/bin/js-yaml.js | 40 +- node_modules/js-yaml/dist/js-yaml.js | 7049 ++++++++--------- node_modules/js-yaml/dist/js-yaml.min.js | 3 +- node_modules/js-yaml/index.js | 44 +- node_modules/js-yaml/lib/js-yaml.js | 39 - node_modules/js-yaml/lib/js-yaml/common.js | 59 - node_modules/js-yaml/lib/js-yaml/dumper.js | 850 -- node_modules/js-yaml/lib/js-yaml/exception.js | 43 - node_modules/js-yaml/lib/js-yaml/loader.js | 1644 ---- node_modules/js-yaml/lib/js-yaml/mark.js | 76 - node_modules/js-yaml/lib/js-yaml/schema.js | 108 - .../js-yaml/lib/js-yaml/schema/core.js | 18 - .../lib/js-yaml/schema/default_full.js | 25 - .../lib/js-yaml/schema/default_safe.js | 28 - .../js-yaml/lib/js-yaml/schema/failsafe.js | 17 - .../js-yaml/lib/js-yaml/schema/json.js | 25 - node_modules/js-yaml/lib/js-yaml/type.js | 61 - .../js-yaml/lib/js-yaml/type/binary.js | 138 - node_modules/js-yaml/lib/js-yaml/type/bool.js | 35 - .../js-yaml/lib/js-yaml/type/float.js | 116 - node_modules/js-yaml/lib/js-yaml/type/int.js | 173 - .../js-yaml/lib/js-yaml/type/js/function.js | 93 - .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 - .../js-yaml/lib/js-yaml/type/js/undefined.js | 28 - node_modules/js-yaml/lib/js-yaml/type/map.js | 8 - .../js-yaml/lib/js-yaml/type/merge.js | 12 - node_modules/js-yaml/lib/js-yaml/type/null.js | 34 - node_modules/js-yaml/lib/js-yaml/type/omap.js | 44 - .../js-yaml/lib/js-yaml/type/pairs.js | 53 - node_modules/js-yaml/lib/js-yaml/type/seq.js | 8 - node_modules/js-yaml/lib/js-yaml/type/set.js | 29 - node_modules/js-yaml/lib/js-yaml/type/str.js | 8 - .../js-yaml/lib/js-yaml/type/timestamp.js | 88 - node_modules/js-yaml/package.json | 41 +- node_modules/lint-staged/README.md | 26 +- node_modules/lint-staged/bin/lint-staged.js | 2 +- node_modules/lint-staged/lib/chunkFiles.js | 2 +- node_modules/lint-staged/lib/generateTasks.js | 3 +- node_modules/lint-staged/lib/gitWorkflow.js | 8 +- node_modules/lint-staged/lib/index.js | 14 +- node_modules/lint-staged/lib/makeCmdTasks.js | 6 +- .../lint-staged/lib/resolveGitRepo.js | 46 +- node_modules/lint-staged/lib/resolveTaskFn.js | 8 +- node_modules/lint-staged/lib/runAll.js | 18 +- node_modules/lint-staged/lib/searchConfigs.js | 10 +- .../lint-staged/lib/validateOptions.js | 4 +- node_modules/lint-staged/package.json | 20 +- node_modules/lodash.truncate/LICENSE | 47 - node_modules/lodash.truncate/README.md | 18 - node_modules/lodash.truncate/index.js | 632 -- node_modules/lodash.truncate/package.json | 17 - node_modules/ms/index.js | 2 +- node_modules/ms/license.md | 2 +- node_modules/ms/package.json | 9 +- node_modules/ms/readme.md | 3 +- 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 | 26 - node_modules/regexpp/README.md | 178 - node_modules/regexpp/index.d.ts | 248 - node_modules/regexpp/index.js | 2096 ----- node_modules/regexpp/index.js.map | 1 - node_modules/regexpp/index.mjs | 2087 ----- node_modules/regexpp/index.mjs.map | 1 - node_modules/regexpp/package.json | 91 - node_modules/require-from-string/index.js | 34 - node_modules/require-from-string/license | 21 - node_modules/require-from-string/package.json | 28 - node_modules/require-from-string/readme.md | 56 - node_modules/sprintf-js/.npmignore | 1 - node_modules/sprintf-js/LICENSE | 24 - node_modules/sprintf-js/README.md | 88 - node_modules/sprintf-js/bower.json | 14 - node_modules/sprintf-js/demo/angular.html | 20 - .../sprintf-js/dist/angular-sprintf.min.js | 4 - .../dist/angular-sprintf.min.js.map | 1 - .../sprintf-js/dist/angular-sprintf.min.map | 1 - node_modules/sprintf-js/dist/sprintf.min.js | 4 - .../sprintf-js/dist/sprintf.min.js.map | 1 - node_modules/sprintf-js/dist/sprintf.min.map | 1 - node_modules/sprintf-js/gruntfile.js | 36 - node_modules/sprintf-js/package.json | 22 - .../sprintf-js/src/angular-sprintf.js | 18 - node_modules/sprintf-js/src/sprintf.js | 208 - node_modules/sprintf-js/test/test.js | 82 - node_modules/table/LICENSE | 24 - node_modules/table/README.md | 837 -- .../table/dist/src/alignSpanningCell.d.ts | 7 - .../table/dist/src/alignSpanningCell.js | 48 - .../table/dist/src/alignSpanningCell.js.map | 1 - node_modules/table/dist/src/alignString.d.ts | 6 - node_modules/table/dist/src/alignString.js | 60 - .../table/dist/src/alignString.js.map | 1 - .../table/dist/src/alignTableData.d.ts | 2 - node_modules/table/dist/src/alignTableData.js | 20 - .../table/dist/src/alignTableData.js.map | 1 - .../table/dist/src/calculateCellHeight.d.ts | 4 - .../table/dist/src/calculateCellHeight.js | 12 - .../table/dist/src/calculateCellHeight.js.map | 1 - .../src/calculateMaximumColumnWidths.d.ts | 7 - .../dist/src/calculateMaximumColumnWidths.js | 36 - .../src/calculateMaximumColumnWidths.js.map | 1 - .../dist/src/calculateOutputColumnWidths.d.ts | 2 - .../dist/src/calculateOutputColumnWidths.js | 10 - .../src/calculateOutputColumnWidths.js.map | 1 - .../table/dist/src/calculateRowHeights.d.ts | 5 - .../table/dist/src/calculateRowHeights.js | 42 - .../table/dist/src/calculateRowHeights.js.map | 1 - .../dist/src/calculateSpanningCellWidth.d.ts | 3 - .../dist/src/calculateSpanningCellWidth.js | 26 - .../src/calculateSpanningCellWidth.js.map | 1 - node_modules/table/dist/src/createStream.d.ts | 2 - node_modules/table/dist/src/createStream.js | 74 - .../table/dist/src/createStream.js.map | 1 - node_modules/table/dist/src/drawBorder.d.ts | 34 - node_modules/table/dist/src/drawBorder.js | 202 - node_modules/table/dist/src/drawBorder.js.map | 1 - node_modules/table/dist/src/drawContent.d.ts | 14 - node_modules/table/dist/src/drawContent.js | 51 - .../table/dist/src/drawContent.js.map | 1 - node_modules/table/dist/src/drawRow.d.ts | 10 - node_modules/table/dist/src/drawRow.js | 25 - node_modules/table/dist/src/drawRow.js.map | 1 - node_modules/table/dist/src/drawTable.d.ts | 2 - node_modules/table/dist/src/drawTable.js | 31 - node_modules/table/dist/src/drawTable.js.map | 1 - .../table/dist/src/generated/validators.d.ts | 13 - .../table/dist/src/generated/validators.js | 2694 ------- .../dist/src/generated/validators.js.map | 1 - .../table/dist/src/getBorderCharacters.d.ts | 2 - .../table/dist/src/getBorderCharacters.js | 105 - .../table/dist/src/getBorderCharacters.js.map | 1 - node_modules/table/dist/src/index.d.ts | 5 - node_modules/table/dist/src/index.js | 21 - node_modules/table/dist/src/index.js.map | 1 - .../table/dist/src/injectHeaderConfig.d.ts | 3 - .../table/dist/src/injectHeaderConfig.js | 29 - .../table/dist/src/injectHeaderConfig.js.map | 1 - .../table/dist/src/makeRangeConfig.d.ts | 3 - .../table/dist/src/makeRangeConfig.js | 18 - .../table/dist/src/makeRangeConfig.js.map | 1 - .../table/dist/src/makeStreamConfig.d.ts | 7 - .../table/dist/src/makeStreamConfig.js | 43 - .../table/dist/src/makeStreamConfig.js.map | 1 - .../table/dist/src/makeTableConfig.d.ts | 7 - .../table/dist/src/makeTableConfig.js | 62 - .../table/dist/src/makeTableConfig.js.map | 1 - .../dist/src/mapDataUsingRowHeights.d.ts | 4 - .../table/dist/src/mapDataUsingRowHeights.js | 52 - .../dist/src/mapDataUsingRowHeights.js.map | 1 - node_modules/table/dist/src/padTableData.d.ts | 3 - node_modules/table/dist/src/padTableData.js | 23 - .../table/dist/src/padTableData.js.map | 1 - .../table/dist/src/schemas/config.json | 95 - .../table/dist/src/schemas/shared.json | 139 - .../table/dist/src/schemas/streamConfig.json | 25 - .../table/dist/src/spanningCellManager.d.ts | 23 - .../table/dist/src/spanningCellManager.js | 95 - .../table/dist/src/spanningCellManager.js.map | 1 - .../table/dist/src/stringifyTableData.d.ts | 2 - .../table/dist/src/stringifyTableData.js | 13 - .../table/dist/src/stringifyTableData.js.map | 1 - node_modules/table/dist/src/table.d.ts | 2 - node_modules/table/dist/src/table.js | 32 - node_modules/table/dist/src/table.js.map | 1 - .../table/dist/src/truncateTableData.d.ts | 6 - .../table/dist/src/truncateTableData.js | 24 - .../table/dist/src/truncateTableData.js.map | 1 - node_modules/table/dist/src/types/api.d.ts | 130 - node_modules/table/dist/src/types/api.js | 3 - node_modules/table/dist/src/types/api.js.map | 1 - .../table/dist/src/types/internal.d.ts | 1 - node_modules/table/dist/src/types/internal.js | 3 - .../table/dist/src/types/internal.js.map | 1 - node_modules/table/dist/src/utils.d.ts | 9 - node_modules/table/dist/src/utils.js | 134 - node_modules/table/dist/src/utils.js.map | 1 - .../table/dist/src/validateConfig.d.ts | 2 - node_modules/table/dist/src/validateConfig.js | 27 - .../table/dist/src/validateConfig.js.map | 1 - .../dist/src/validateSpanningCellConfig.d.ts | 3 - .../dist/src/validateSpanningCellConfig.js | 46 - .../src/validateSpanningCellConfig.js.map | 1 - .../table/dist/src/validateTableData.d.ts | 1 - .../table/dist/src/validateTableData.js | 32 - .../table/dist/src/validateTableData.js.map | 1 - node_modules/table/dist/src/wrapCell.d.ts | 8 - node_modules/table/dist/src/wrapCell.js | 33 - node_modules/table/dist/src/wrapCell.js.map | 1 - node_modules/table/dist/src/wrapString.d.ts | 9 - node_modules/table/dist/src/wrapString.js | 27 - node_modules/table/dist/src/wrapString.js.map | 1 - node_modules/table/dist/src/wrapWord.d.ts | 1 - node_modules/table/dist/src/wrapWord.js | 42 - node_modules/table/dist/src/wrapWord.js.map | 1 - .../table/node_modules/ajv/.runkit_example.js | 23 - node_modules/table/node_modules/ajv/LICENSE | 22 - node_modules/table/node_modules/ajv/README.md | 207 - .../table/node_modules/ajv/dist/2019.d.ts | 19 - .../table/node_modules/ajv/dist/2019.js | 61 - .../table/node_modules/ajv/dist/2019.js.map | 1 - .../table/node_modules/ajv/dist/2020.d.ts | 19 - .../table/node_modules/ajv/dist/2020.js | 55 - .../table/node_modules/ajv/dist/2020.js.map | 1 - .../table/node_modules/ajv/dist/ajv.d.ts | 18 - .../table/node_modules/ajv/dist/ajv.js | 50 - .../table/node_modules/ajv/dist/ajv.js.map | 1 - .../ajv/dist/compile/codegen/code.d.ts | 40 - .../ajv/dist/compile/codegen/code.js | 156 - .../ajv/dist/compile/codegen/code.js.map | 1 - .../ajv/dist/compile/codegen/index.d.ts | 79 - .../ajv/dist/compile/codegen/index.js | 697 -- .../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 - .../node_modules/ajv/dist/compile/errors.d.ts | 13 - .../node_modules/ajv/dist/compile/errors.js | 123 - .../ajv/dist/compile/errors.js.map | 1 - .../node_modules/ajv/dist/compile/index.d.ts | 80 - .../node_modules/ajv/dist/compile/index.js | 242 - .../ajv/dist/compile/index.js.map | 1 - .../ajv/dist/compile/jtd/parse.d.ts | 4 - .../ajv/dist/compile/jtd/parse.js | 350 - .../ajv/dist/compile/jtd/parse.js.map | 1 - .../ajv/dist/compile/jtd/serialize.d.ts | 4 - .../ajv/dist/compile/jtd/serialize.js | 229 - .../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/ref_error.d.ts | 6 - .../ajv/dist/compile/ref_error.js | 12 - .../ajv/dist/compile/ref_error.js.map | 1 - .../ajv/dist/compile/resolve.d.ts | 12 - .../node_modules/ajv/dist/compile/resolve.js | 155 - .../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 - .../node_modules/ajv/dist/compile/util.d.ts | 40 - .../node_modules/ajv/dist/compile/util.js | 178 - .../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 | 203 - .../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 | 42 - .../ajv/dist/compile/validate/index.js | 520 -- .../ajv/dist/compile/validate/index.js.map | 1 - .../ajv/dist/compile/validate/keyword.d.ts | 8 - .../ajv/dist/compile/validate/keyword.js | 124 - .../ajv/dist/compile/validate/keyword.js.map | 1 - .../ajv/dist/compile/validate/subschema.d.ts | 47 - .../ajv/dist/compile/validate/subschema.js | 81 - .../dist/compile/validate/subschema.js.map | 1 - .../table/node_modules/ajv/dist/core.d.ts | 173 - .../table/node_modules/ajv/dist/core.js | 618 -- .../table/node_modules/ajv/dist/core.js.map | 1 - .../table/node_modules/ajv/dist/jtd.d.ts | 47 - .../table/node_modules/ajv/dist/jtd.js | 72 - .../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 - .../dist/refs/json-schema-2020-12/index.d.ts | 2 - .../dist/refs/json-schema-2020-12/index.js | 30 - .../refs/json-schema-2020-12/index.js.map | 1 - .../json-schema-2020-12/meta/applicator.json | 48 - .../json-schema-2020-12/meta/content.json | 17 - .../refs/json-schema-2020-12/meta/core.json | 51 - .../meta/format-annotation.json | 14 - .../json-schema-2020-12/meta/meta-data.json | 37 - .../json-schema-2020-12/meta/unevaluated.json | 15 - .../json-schema-2020-12/meta/validation.json | 90 - .../dist/refs/json-schema-2020-12/schema.json | 55 - .../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 - .../node_modules/ajv/dist/runtime/equal.d.ts | 6 - .../node_modules/ajv/dist/runtime/equal.js | 7 - .../ajv/dist/runtime/equal.js.map | 1 - .../ajv/dist/runtime/parseJson.d.ts | 18 - .../ajv/dist/runtime/parseJson.js | 185 - .../ajv/dist/runtime/parseJson.js.map | 1 - .../node_modules/ajv/dist/runtime/quote.d.ts | 5 - .../node_modules/ajv/dist/runtime/quote.js | 30 - .../ajv/dist/runtime/quote.js.map | 1 - .../node_modules/ajv/dist/runtime/re2.d.ts | 6 - .../node_modules/ajv/dist/runtime/re2.js | 6 - .../node_modules/ajv/dist/runtime/re2.js.map | 1 - .../ajv/dist/runtime/timestamp.d.ts | 5 - .../ajv/dist/runtime/timestamp.js | 42 - .../ajv/dist/runtime/timestamp.js.map | 1 - .../ajv/dist/runtime/ucs2length.d.ts | 5 - .../ajv/dist/runtime/ucs2length.js | 24 - .../ajv/dist/runtime/ucs2length.js.map | 1 - .../node_modules/ajv/dist/runtime/uri.d.ts | 6 - .../node_modules/ajv/dist/runtime/uri.js | 6 - .../node_modules/ajv/dist/runtime/uri.js.map | 1 - .../ajv/dist/runtime/validation_error.d.ts | 7 - .../ajv/dist/runtime/validation_error.js | 11 - .../ajv/dist/runtime/validation_error.js.map | 1 - .../ajv/dist/standalone/index.d.ts | 6 - .../node_modules/ajv/dist/standalone/index.js | 90 - .../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 | 183 - .../node_modules/ajv/dist/types/index.js | 3 - .../node_modules/ajv/dist/types/index.js.map | 1 - .../ajv/dist/types/json-schema.d.ts | 125 - .../ajv/dist/types/json-schema.js | 3 - .../ajv/dist/types/json-schema.js.map | 1 - .../ajv/dist/types/jtd-schema.d.ts | 174 - .../node_modules/ajv/dist/types/jtd-schema.js | 3 - .../ajv/dist/types/jtd-schema.js.map | 1 - .../applicator/additionalItems.d.ts | 8 - .../applicator/additionalItems.js | 49 - .../applicator/additionalItems.js.map | 1 - .../applicator/additionalProperties.d.ts | 6 - .../applicator/additionalProperties.js | 106 - .../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 | 12 - .../dist/vocabularies/applicator/anyOf.js.map | 1 - .../vocabularies/applicator/contains.d.ts | 7 - .../dist/vocabularies/applicator/contains.js | 95 - .../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 | 66 - .../dist/vocabularies/applicator/if.js.map | 1 - .../dist/vocabularies/applicator/index.d.ts | 13 - .../ajv/dist/vocabularies/applicator/index.js | 44 - .../dist/vocabularies/applicator/index.js.map | 1 - .../dist/vocabularies/applicator/items.d.ts | 5 - .../ajv/dist/vocabularies/applicator/items.js | 52 - .../dist/vocabularies/applicator/items.js.map | 1 - .../vocabularies/applicator/items2020.d.ts | 6 - .../dist/vocabularies/applicator/items2020.js | 30 - .../vocabularies/applicator/items2020.js.map | 1 - .../ajv/dist/vocabularies/applicator/not.d.ts | 4 - .../ajv/dist/vocabularies/applicator/not.js | 26 - .../dist/vocabularies/applicator/not.js.map | 1 - .../dist/vocabularies/applicator/oneOf.d.ts | 6 - .../ajv/dist/vocabularies/applicator/oneOf.js | 60 - .../dist/vocabularies/applicator/oneOf.js.map | 1 - .../applicator/patternProperties.d.ts | 3 - .../applicator/patternProperties.js | 75 - .../applicator/patternProperties.js.map | 1 - .../vocabularies/applicator/prefixItems.d.ts | 3 - .../vocabularies/applicator/prefixItems.js | 12 - .../applicator/prefixItems.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 | 131 - .../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 | 122 - .../ajv/dist/vocabularies/core/ref.js.map | 1 - .../vocabularies/discriminator/index.d.ts | 5 - .../dist/vocabularies/discriminator/index.js | 104 - .../vocabularies/discriminator/index.js.map | 1 - .../vocabularies/discriminator/types.d.ts | 10 - .../dist/vocabularies/discriminator/types.js | 9 - .../vocabularies/discriminator/types.js.map | 1 - .../ajv/dist/vocabularies/draft2020.d.ts | 3 - .../ajv/dist/vocabularies/draft2020.js | 23 - .../ajv/dist/vocabularies/draft2020.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 | 30 - .../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 | 9 - .../ajv/dist/vocabularies/errors.js | 3 - .../ajv/dist/vocabularies/errors.js.map | 1 - .../ajv/dist/vocabularies/format/format.d.ts | 8 - .../ajv/dist/vocabularies/format/format.js | 92 - .../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 | 6 - .../dist/vocabularies/jtd/discriminator.js | 71 - .../vocabularies/jtd/discriminator.js.map | 1 - .../ajv/dist/vocabularies/jtd/elements.d.ts | 5 - .../ajv/dist/vocabularies/jtd/elements.js | 24 - .../ajv/dist/vocabularies/jtd/elements.js.map | 1 - .../ajv/dist/vocabularies/jtd/enum.d.ts | 6 - .../ajv/dist/vocabularies/jtd/enum.js | 43 - .../ajv/dist/vocabularies/jtd/enum.js.map | 1 - .../ajv/dist/vocabularies/jtd/error.d.ts | 9 - .../ajv/dist/vocabularies/jtd/error.js | 20 - .../ajv/dist/vocabularies/jtd/error.js.map | 1 - .../ajv/dist/vocabularies/jtd/index.d.ts | 10 - .../ajv/dist/vocabularies/jtd/index.js | 29 - .../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 | 15 - .../jtd/optionalProperties.js.map | 1 - .../ajv/dist/vocabularies/jtd/properties.d.ts | 22 - .../ajv/dist/vocabularies/jtd/properties.js | 149 - .../dist/vocabularies/jtd/properties.js.map | 1 - .../ajv/dist/vocabularies/jtd/ref.d.ts | 4 - .../ajv/dist/vocabularies/jtd/ref.js | 67 - .../ajv/dist/vocabularies/jtd/ref.js.map | 1 - .../ajv/dist/vocabularies/jtd/type.d.ts | 10 - .../ajv/dist/vocabularies/jtd/type.js | 69 - .../ajv/dist/vocabularies/jtd/type.js.map | 1 - .../ajv/dist/vocabularies/jtd/union.d.ts | 3 - .../ajv/dist/vocabularies/jtd/union.js | 12 - .../ajv/dist/vocabularies/jtd/union.js.map | 1 - .../ajv/dist/vocabularies/jtd/values.d.ts | 5 - .../ajv/dist/vocabularies/jtd/values.js | 51 - .../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 | 40 - .../unevaluated/unevaluatedItems.js.map | 1 - .../unevaluated/unevaluatedProperties.d.ts | 6 - .../unevaluated/unevaluatedProperties.js | 65 - .../unevaluated/unevaluatedProperties.js.map | 1 - .../dist/vocabularies/validation/const.d.ts | 6 - .../ajv/dist/vocabularies/validation/const.js | 25 - .../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 | 48 - .../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 | 27 - .../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 | 24 - .../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 | 64 - .../validation/uniqueItems.js.map | 1 - .../table/node_modules/ajv/lib/2019.ts | 81 - .../table/node_modules/ajv/lib/2020.ts | 75 - .../table/node_modules/ajv/lib/ajv.ts | 70 - .../ajv/lib/compile/codegen/code.ts | 169 - .../ajv/lib/compile/codegen/index.ts | 852 -- .../ajv/lib/compile/codegen/scope.ts | 215 - .../node_modules/ajv/lib/compile/errors.ts | 184 - .../node_modules/ajv/lib/compile/index.ts | 324 - .../node_modules/ajv/lib/compile/jtd/parse.ts | 411 - .../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/ref_error.ts | 13 - .../node_modules/ajv/lib/compile/resolve.ts | 149 - .../node_modules/ajv/lib/compile/rules.ts | 50 - .../node_modules/ajv/lib/compile/util.ts | 213 - .../ajv/lib/compile/validate/applicability.ts | 22 - .../ajv/lib/compile/validate/boolSchema.ts | 47 - .../ajv/lib/compile/validate/dataType.ts | 230 - .../ajv/lib/compile/validate/defaults.ts | 32 - .../ajv/lib/compile/validate/index.ts | 582 -- .../ajv/lib/compile/validate/keyword.ts | 171 - .../ajv/lib/compile/validate/subschema.ts | 135 - .../table/node_modules/ajv/lib/core.ts | 891 --- .../table/node_modules/ajv/lib/jtd.ts | 132 - .../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-2020-12/index.ts | 30 - .../json-schema-2020-12/meta/applicator.json | 48 - .../json-schema-2020-12/meta/content.json | 17 - .../refs/json-schema-2020-12/meta/core.json | 51 - .../meta/format-annotation.json | 14 - .../json-schema-2020-12/meta/meta-data.json | 37 - .../json-schema-2020-12/meta/unevaluated.json | 15 - .../json-schema-2020-12/meta/validation.json | 90 - .../lib/refs/json-schema-2020-12/schema.json | 55 - .../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/equal.ts | 7 - .../node_modules/ajv/lib/runtime/parseJson.ts | 177 - .../node_modules/ajv/lib/runtime/quote.ts | 31 - .../table/node_modules/ajv/lib/runtime/re2.ts | 6 - .../node_modules/ajv/lib/runtime/timestamp.ts | 46 - .../ajv/lib/runtime/ucs2length.ts | 20 - .../table/node_modules/ajv/lib/runtime/uri.ts | 6 - .../ajv/lib/runtime/validation_error.ts | 13 - .../node_modules/ajv/lib/standalone/index.ts | 100 - .../ajv/lib/standalone/instance.ts | 36 - .../table/node_modules/ajv/lib/types/index.ts | 244 - .../node_modules/ajv/lib/types/json-schema.ts | 187 - .../node_modules/ajv/lib/types/jtd-schema.ts | 273 - .../applicator/additionalItems.ts | 56 - .../applicator/additionalProperties.ts | 118 - .../ajv/lib/vocabularies/applicator/allOf.ts | 22 - .../ajv/lib/vocabularies/applicator/anyOf.ts | 14 - .../lib/vocabularies/applicator/contains.ts | 109 - .../vocabularies/applicator/dependencies.ts | 112 - .../applicator/dependentSchemas.ts | 11 - .../ajv/lib/vocabularies/applicator/if.ts | 80 - .../ajv/lib/vocabularies/applicator/index.ts | 53 - .../ajv/lib/vocabularies/applicator/items.ts | 59 - .../lib/vocabularies/applicator/items2020.ts | 36 - .../ajv/lib/vocabularies/applicator/not.ts | 38 - .../ajv/lib/vocabularies/applicator/oneOf.ts | 82 - .../applicator/patternProperties.ts | 91 - .../vocabularies/applicator/prefixItems.ts | 12 - .../lib/vocabularies/applicator/properties.ts | 57 - .../vocabularies/applicator/propertyNames.ts | 50 - .../lib/vocabularies/applicator/thenElse.ts | 13 - .../node_modules/ajv/lib/vocabularies/code.ts | 168 - .../ajv/lib/vocabularies/core/id.ts | 10 - .../ajv/lib/vocabularies/core/index.ts | 16 - .../ajv/lib/vocabularies/core/ref.ts | 129 - .../lib/vocabularies/discriminator/index.ts | 113 - .../lib/vocabularies/discriminator/types.ts | 12 - .../ajv/lib/vocabularies/draft2020.ts | 23 - .../ajv/lib/vocabularies/draft7.ts | 17 - .../lib/vocabularies/dynamic/dynamicAnchor.ts | 31 - .../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 | 18 - .../ajv/lib/vocabularies/format/format.ts | 120 - .../ajv/lib/vocabularies/format/index.ts | 6 - .../ajv/lib/vocabularies/jtd/discriminator.ts | 89 - .../ajv/lib/vocabularies/jtd/elements.ts | 32 - .../ajv/lib/vocabularies/jtd/enum.ts | 45 - .../ajv/lib/vocabularies/jtd/error.ts | 23 - .../ajv/lib/vocabularies/jtd/index.ts | 37 - .../ajv/lib/vocabularies/jtd/metadata.ts | 24 - .../ajv/lib/vocabularies/jtd/nullable.ts | 21 - .../vocabularies/jtd/optionalProperties.ts | 15 - .../ajv/lib/vocabularies/jtd/properties.ts | 184 - .../ajv/lib/vocabularies/jtd/ref.ts | 76 - .../ajv/lib/vocabularies/jtd/type.ts | 75 - .../ajv/lib/vocabularies/jtd/union.ts | 12 - .../ajv/lib/vocabularies/jtd/values.ts | 58 - .../ajv/lib/vocabularies/metadata.ts | 17 - .../node_modules/ajv/lib/vocabularies/next.ts | 8 - .../ajv/lib/vocabularies/unevaluated/index.ts | 7 - .../unevaluated/unevaluatedItems.ts | 47 - .../unevaluated/unevaluatedProperties.ts | 85 - .../ajv/lib/vocabularies/validation/const.ts | 28 - .../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 | 30 - .../vocabularies/validation/limitNumber.ts | 42 - .../validation/limitProperties.ts | 26 - .../lib/vocabularies/validation/multipleOf.ts | 34 - .../lib/vocabularies/validation/pattern.ts | 28 - .../lib/vocabularies/validation/required.ts | 98 - .../vocabularies/validation/uniqueItems.ts | 79 - .../table/node_modules/ajv/package.json | 126 - .../table/node_modules/ansi-regex/index.d.ts | 37 - .../table/node_modules/ansi-regex/index.js | 10 - .../table/node_modules/ansi-regex/license | 9 - .../node_modules/ansi-regex/package.json | 55 - .../table/node_modules/ansi-regex/readme.md | 78 - .../table/node_modules/ansi-styles/index.d.ts | 345 - .../table/node_modules/ansi-styles/index.js | 163 - .../table/node_modules/ansi-styles/license | 9 - .../node_modules/ansi-styles/package.json | 56 - .../table/node_modules/ansi-styles/readme.md | 152 - .../node_modules/color-convert/CHANGELOG.md | 54 - .../table/node_modules/color-convert/LICENSE | 21 - .../node_modules/color-convert/README.md | 68 - .../node_modules/color-convert/conversions.js | 839 -- .../table/node_modules/color-convert/index.js | 81 - .../node_modules/color-convert/package.json | 48 - .../table/node_modules/color-convert/route.js | 97 - .../table/node_modules/color-name/README.md | 11 - .../table/node_modules/color-name/index.js | 152 - .../node_modules/color-name/package.json | 28 - .../node_modules/emoji-regex/LICENSE-MIT.txt | 20 - .../table/node_modules/emoji-regex/README.md | 73 - .../node_modules/emoji-regex/es2015/index.js | 6 - .../node_modules/emoji-regex/es2015/text.js | 6 - .../table/node_modules/emoji-regex/index.d.ts | 23 - .../table/node_modules/emoji-regex/index.js | 6 - .../node_modules/emoji-regex/package.json | 50 - .../table/node_modules/emoji-regex/text.js | 6 - .../is-fullwidth-code-point/index.d.ts | 17 - .../is-fullwidth-code-point/index.js | 50 - .../is-fullwidth-code-point/license | 9 - .../is-fullwidth-code-point/package.json | 42 - .../is-fullwidth-code-point/readme.md | 39 - .../json-schema-traverse/.eslintrc.yml | 27 - .../json-schema-traverse/.github/FUNDING.yml | 2 - .../.github/workflows/build.yml | 28 - .../.github/workflows/publish.yml | 27 - .../node_modules/json-schema-traverse/LICENSE | 21 - .../json-schema-traverse/README.md | 95 - .../json-schema-traverse/index.d.ts | 40 - .../json-schema-traverse/index.js | 93 - .../json-schema-traverse/package.json | 43 - .../json-schema-traverse/spec/.eslintrc.yml | 6 - .../spec/fixtures/schema.js | 125 - .../json-schema-traverse/spec/index.spec.js | 171 - .../table/node_modules/slice-ansi/index.js | 103 - .../table/node_modules/slice-ansi/license | 10 - .../node_modules/slice-ansi/package.json | 52 - .../table/node_modules/slice-ansi/readme.md | 66 - .../node_modules/string-width/index.d.ts | 29 - .../table/node_modules/string-width/index.js | 47 - .../table/node_modules/string-width/license | 9 - .../node_modules/string-width/package.json | 56 - .../table/node_modules/string-width/readme.md | 50 - .../table/node_modules/strip-ansi/index.d.ts | 17 - .../table/node_modules/strip-ansi/index.js | 4 - .../table/node_modules/strip-ansi/license | 9 - .../node_modules/strip-ansi/package.json | 54 - .../table/node_modules/strip-ansi/readme.md | 46 - node_modules/table/package.json | 77 - node_modules/v8-compile-cache/LICENSE | 21 - node_modules/v8-compile-cache/README.md | 55 - node_modules/v8-compile-cache/package.json | 34 - .../v8-compile-cache/v8-compile-cache.js | 373 - .../dist/compose/compose-collection.js | 18 +- .../yaml/browser/dist/compose/compose-node.js | 2 +- .../browser/dist/compose/resolve-block-map.js | 2 +- .../browser/dist/compose/resolve-props.js | 6 +- .../yaml/browser/dist/nodes/Collection.js | 1 - node_modules/yaml/browser/dist/parse/lexer.js | 8 +- .../browser/dist/stringify/foldFlowLines.js | 2 + node_modules/yaml/dist/cli.d.ts | 3 +- node_modules/yaml/dist/cli.mjs | 12 +- .../yaml/dist/compose/compose-collection.d.ts | 8 +- .../yaml/dist/compose/compose-collection.js | 18 +- .../yaml/dist/compose/compose-node.d.ts | 1 + .../yaml/dist/compose/compose-node.js | 2 +- .../yaml/dist/compose/resolve-block-map.d.ts | 3 +- .../yaml/dist/compose/resolve-block-map.js | 2 +- .../yaml/dist/compose/resolve-block-seq.d.ts | 2 +- .../yaml/dist/compose/resolve-props.d.ts | 2 +- .../yaml/dist/compose/resolve-props.js | 6 +- node_modules/yaml/dist/nodes/Collection.d.ts | 1 - node_modules/yaml/dist/nodes/Collection.js | 1 - node_modules/yaml/dist/nodes/identity.d.ts | 2 +- node_modules/yaml/dist/parse/lexer.js | 8 +- .../yaml/dist/schema/yaml-1.1/omap.d.ts | 6 +- .../yaml/dist/stringify/foldFlowLines.js | 2 + node_modules/yaml/package.json | 2 +- package-lock.json | 1161 ++- package.json | 6 +- phpcs.xml | 37 +- phpcs_config.txt | 3 + phpcs_errors.json | 2 + .../.gitkeep => phpcs_errors_processed.json | 0 preprocess-js.sh | 14 - ruleset.xml | 10 + setup_phpcs.php | 22 + vendor/autoload.php | 2 +- vendor/composer/ClassLoader.php | 6 +- vendor/composer/InstalledVersions.php | 6 +- vendor/composer/autoload_psr4.php | 5 + vendor/composer/autoload_static.php | 75 +- vendor/composer/installed.json | 524 +- vendor/composer/installed.php | 35 +- vendor/composer/platform_check.php | 8 +- .../LICENSE.md | 3 +- .../README.md | 285 + .../composer.json | 71 + .../src/Plugin.php | 637 ++ .../phpstan/phpdoc-parser}/LICENSE | 4 +- vendor/phpstan/phpdoc-parser/README.md | 121 + vendor/phpstan/phpdoc-parser/composer.json | 44 + .../src/Ast/AbstractNodeVisitor.php | 34 + .../phpdoc-parser/src/Ast/Attribute.php | 16 + .../Ast/ConstExpr/ConstExprArrayItemNode.php | 36 + .../src/Ast/ConstExpr/ConstExprArrayNode.php | 30 + .../src/Ast/ConstExpr/ConstExprFalseNode.php | 17 + .../src/Ast/ConstExpr/ConstExprFloatNode.php | 26 + .../Ast/ConstExpr/ConstExprIntegerNode.php | 26 + .../src/Ast/ConstExpr/ConstExprNode.php | 10 + .../src/Ast/ConstExpr/ConstExprNullNode.php | 17 + .../src/Ast/ConstExpr/ConstExprStringNode.php | 26 + .../src/Ast/ConstExpr/ConstExprTrueNode.php | 17 + .../src/Ast/ConstExpr/ConstFetchNode.php | 35 + .../ConstExpr/DoctrineConstExprStringNode.php | 42 + .../QuoteAwareConstExprStringNode.php | 78 + vendor/phpstan/phpdoc-parser/src/Ast/Node.php | 22 + .../phpdoc-parser/src/Ast/NodeAttributes.php | 38 + .../phpdoc-parser/src/Ast/NodeTraverser.php | 312 + .../phpdoc-parser/src/Ast/NodeVisitor.php | 87 + .../src/Ast/NodeVisitor/CloningVisitor.php | 20 + .../Ast/PhpDoc/AssertTagMethodValueNode.php | 50 + .../Ast/PhpDoc/AssertTagPropertyValueNode.php | 50 + .../src/Ast/PhpDoc/AssertTagValueNode.php | 46 + .../src/Ast/PhpDoc/DeprecatedTagValueNode.php | 27 + .../PhpDoc/Doctrine/DoctrineAnnotation.php | 35 + .../Ast/PhpDoc/Doctrine/DoctrineArgument.php | 43 + .../src/Ast/PhpDoc/Doctrine/DoctrineArray.php | 32 + .../Ast/PhpDoc/Doctrine/DoctrineArrayItem.php | 47 + .../PhpDoc/Doctrine/DoctrineTagValueNode.php | 36 + .../src/Ast/PhpDoc/ExtendsTagValueNode.php | 32 + .../src/Ast/PhpDoc/GenericTagValueNode.php | 26 + .../src/Ast/PhpDoc/ImplementsTagValueNode.php | 32 + .../src/Ast/PhpDoc/InvalidTagValueNode.php | 53 + .../src/Ast/PhpDoc/MethodTagValueNode.php | 58 + .../PhpDoc/MethodTagValueParameterNode.php | 49 + .../src/Ast/PhpDoc/MixinTagValueNode.php | 32 + .../PhpDoc/ParamClosureThisTagValueNode.php | 35 + ...ImmediatelyInvokedCallableTagValueNode.php | 30 + .../ParamLaterInvokedCallableTagValueNode.php | 30 + .../src/Ast/PhpDoc/ParamOutTagValueNode.php | 35 + .../src/Ast/PhpDoc/ParamTagValueNode.php | 46 + .../src/Ast/PhpDoc/PhpDocChildNode.php | 10 + .../src/Ast/PhpDoc/PhpDocNode.php | 438 + .../src/Ast/PhpDoc/PhpDocTagNode.php | 36 + .../src/Ast/PhpDoc/PhpDocTagValueNode.php | 10 + .../src/Ast/PhpDoc/PhpDocTextNode.php | 26 + .../src/Ast/PhpDoc/PropertyTagValueNode.php | 36 + .../Ast/PhpDoc/RequireExtendsTagValueNode.php | 32 + .../PhpDoc/RequireImplementsTagValueNode.php | 32 + .../src/Ast/PhpDoc/ReturnTagValueNode.php | 32 + .../src/Ast/PhpDoc/SelfOutTagValueNode.php | 32 + .../src/Ast/PhpDoc/TemplateTagValueNode.php | 45 + .../src/Ast/PhpDoc/ThrowsTagValueNode.php | 32 + .../PhpDoc/TypeAliasImportTagValueNode.php | 38 + .../src/Ast/PhpDoc/TypeAliasTagValueNode.php | 32 + .../Ast/PhpDoc/TypelessParamTagValueNode.php | 41 + .../src/Ast/PhpDoc/UsesTagValueNode.php | 32 + .../src/Ast/PhpDoc/VarTagValueNode.php | 36 + .../src/Ast/Type/ArrayShapeItemNode.php | 49 + .../src/Ast/Type/ArrayShapeNode.php | 48 + .../src/Ast/Type/ArrayTypeNode.php | 34 + .../src/Ast/Type/CallableTypeNode.php | 52 + .../Ast/Type/CallableTypeParameterNode.php | 48 + .../Type/ConditionalTypeForParameterNode.php | 49 + .../src/Ast/Type/ConditionalTypeNode.php | 49 + .../src/Ast/Type/ConstTypeNode.php | 26 + .../src/Ast/Type/GenericTypeNode.php | 58 + .../src/Ast/Type/IdentifierTypeNode.php | 26 + .../src/Ast/Type/IntersectionTypeNode.php | 37 + .../src/Ast/Type/InvalidTypeNode.php | 38 + .../src/Ast/Type/NullableTypeNode.php | 26 + .../src/Ast/Type/ObjectShapeItemNode.php | 48 + .../src/Ast/Type/ObjectShapeNode.php | 31 + .../src/Ast/Type/OffsetAccessTypeNode.php | 36 + .../src/Ast/Type/ThisTypeNode.php | 17 + .../phpdoc-parser/src/Ast/Type/TypeNode.php | 10 + .../src/Ast/Type/UnionTypeNode.php | 37 + .../phpstan/phpdoc-parser/src/Lexer/Lexer.php | 198 + .../src/Parser/ConstExprParser.php | 333 + .../src/Parser/ParserException.php | 106 + .../phpdoc-parser/src/Parser/PhpDocParser.php | 1289 +++ .../src/Parser/StringUnescaper.php | 96 + .../src/Parser/TokenIterator.php | 383 + .../phpdoc-parser/src/Parser/TypeParser.php | 1026 +++ .../phpdoc-parser/src/Printer/DiffElem.php | 44 + .../phpdoc-parser/src/Printer/Differ.php | 196 + .../phpdoc-parser/src/Printer/Printer.php | 858 ++ vendor/slevomat/coding-standard/.editorconfig | 10 + vendor/slevomat/coding-standard/.typos.toml | 10 + .../coding-standard/CODE_OF_CONDUCT.md | 74 + .../slevomat/coding-standard/LICENSE.md | 16 +- vendor/slevomat/coding-standard/README.md | 319 + .../Helpers/Annotation.php | 66 + .../Helpers/AnnotationHelper.php | 366 + .../Helpers/AnnotationTypeHelper.php | 409 + .../Helpers/ArrayHelper.php | 232 + .../Helpers/ArrayKeyValue.php | 172 + .../Helpers/Attribute.php | 60 + .../Helpers/AttributeHelper.php | 153 + .../Helpers/CatchHelper.php | 83 + .../Helpers/ClassHelper.php | 120 + .../Helpers/Comment.php | 33 + .../Helpers/CommentHelper.php | 102 + .../Helpers/ConditionHelper.php | 355 + .../Helpers/ConstantHelper.php | 79 + .../Helpers/DocCommentHelper.php | 275 + .../Helpers/EmptyFileException.php | 33 + .../Helpers/FixerHelper.php | 55 + .../Helpers/FunctionHelper.php | 572 ++ .../Helpers/IdentificatorHelper.php | 216 + .../Helpers/IndentationHelper.php | 106 + .../Helpers/NamespaceHelper.php | 201 + .../Helpers/ParameterHelper.php | 34 + .../Helpers/ParsedDocComment.php | 108 + .../Helpers/PhpDocParserHelper.php | 82 + .../Helpers/PropertyHelper.php | 140 + .../Helpers/ReferencedName.php | 75 + .../Helpers/ReferencedNameHelper.php | 532 ++ .../Helpers/ScopeHelper.php | 65 + .../Helpers/SniffLocalCache.php | 49 + .../Helpers/SniffSettingsHelper.php | 90 + .../Helpers/StringHelper.php | 25 + .../Helpers/SuppressHelper.php | 83 + .../Helpers/TernaryOperatorHelper.php | 182 + .../Helpers/TokenHelper.php | 534 ++ .../TokenPointerOutOfBoundsException.php | 47 + .../Helpers/TypeHelper.php | 35 + .../Helpers/TypeHint.php | 59 + .../Helpers/TypeHintHelper.php | 417 + .../Helpers/UseStatement.php | 135 + .../Helpers/UseStatementHelper.php | 270 + .../Helpers/VariableHelper.php | 178 + .../Helpers/YodaHelper.php | 358 + .../AlphabeticallySortedByKeysSniff.php | 85 + .../Sniffs/Arrays/ArrayAccessSniff.php | 76 + .../DisallowImplicitArrayCreationSniff.php | 280 + .../Arrays/DisallowPartiallyKeyedSniff.php | 42 + ...MultiLineArrayEndBracketPlacementSniff.php | 60 + .../Arrays/SingleLineArrayWhitespaceSniff.php | 228 + .../Sniffs/Arrays/TrailingArrayCommaSniff.php | 80 + .../AttributeAndTargetSpacingSniff.php | 120 + .../Attributes/AttributesOrderSniff.php | 197 + .../DisallowAttributesJoiningSniff.php | 72 + ...DisallowMultipleAttributesPerLineSniff.php | 82 + .../RequireAttributeAfterDocCommentSniff.php | 86 + .../Classes/AbstractMethodSignature.php | 69 + ...ractPropertyConstantAndEnumCaseSpacing.php | 137 + .../Classes/BackedEnumTypeSpacingSniff.php | 121 + .../Classes/ClassConstantVisibilitySniff.php | 87 + .../Sniffs/Classes/ClassLengthSniff.php | 64 + .../Classes/ClassMemberSpacingSniff.php | 278 + .../Sniffs/Classes/ClassStructureSniff.php | 666 ++ .../Sniffs/Classes/ConstantSpacingSniff.php | 79 + ...allowConstructorPropertyPromotionSniff.php | 69 + ...llowLateStaticBindingForConstantsSniff.php | 71 + .../DisallowMultiConstantDefinitionSniff.php | 128 + .../DisallowMultiPropertyDefinitionSniff.php | 168 + ...llowStringExpressionPropertyFetchSniff.php | 84 + .../EmptyLinesAroundClassBracesSniff.php | 159 + .../Sniffs/Classes/EnumCaseSpacingSniff.php | 54 + .../Classes/ForbiddenPublicPropertySniff.php | 77 + .../Sniffs/Classes/MethodSpacingSniff.php | 133 + .../Classes/MissingClassGroupsException.php | 23 + .../Classes/ModernClassNameReferenceSniff.php | 178 + .../Sniffs/Classes/ParentCallSpacingSniff.php | 122 + .../Classes/PropertyDeclarationSniff.php | 401 + .../Sniffs/Classes/PropertySpacingSniff.php | 87 + .../Classes/RequireAbstractOrFinalSniff.php | 62 + ...quireConstructorPropertyPromotionSniff.php | 398 + .../RequireMultiLineMethodSignatureSniff.php | 176 + .../Classes/RequireSelfReferenceSniff.php | 118 + .../RequireSingleLineMethodSignatureSniff.php | 130 + .../SuperfluousAbstractClassNamingSniff.php | 70 + .../Classes/SuperfluousErrorNamingSniff.php | 55 + .../SuperfluousExceptionNamingSniff.php | 55 + .../SuperfluousInterfaceNamingSniff.php | 63 + .../Classes/SuperfluousTraitNamingSniff.php | 50 + .../Classes/TraitUseDeclarationSniff.php | 101 + .../Sniffs/Classes/TraitUseSpacingSniff.php | 304 + .../UnsupportedClassGroupException.php | 16 + .../Classes/UselessLateStaticBindingSniff.php | 72 + .../AbstractRequireOneLineDocComment.php | 137 + .../Sniffs/Commenting/AnnotationNameSniff.php | 299 + .../DeprecatedAnnotationDeclarationSniff.php | 50 + .../DisallowCommentAfterCodeSniff.php | 135 + ...DisallowOneLinePropertyDocCommentSniff.php | 108 + .../Commenting/DocCommentSpacingSniff.php | 781 ++ .../Sniffs/Commenting/EmptyCommentSniff.php | 198 + .../Commenting/ForbiddenAnnotationsSniff.php | 132 + .../Commenting/ForbiddenCommentsSniff.php | 132 + .../InlineDocCommentDeclarationSniff.php | 495 ++ .../RequireOneLineDocCommentSniff.php | 19 + .../RequireOneLinePropertyDocCommentSniff.php | 61 + .../UselessFunctionDocCommentSniff.php | 143 + .../UselessInheritDocCommentSniff.php | 118 + .../Sniffs/Complexity/CognitiveSniff.php | 310 + .../AbstractControlStructureSpacing.php | 510 ++ .../AbstractLineCondition.php | 128 + .../AssignmentInConditionSniff.php | 115 + .../BlockControlStructureSpacingSniff.php | 113 + ...inueWithoutIntegerOperandInSwitchSniff.php | 63 + .../ControlStructures/DisallowEmptySniff.php | 33 + .../DisallowNullSafeObjectOperatorSniff.php | 33 + .../DisallowShortTernaryOperatorSniff.php | 72 + ...wTrailingMultiLineTernaryOperatorSniff.php | 88 + .../DisallowYodaComparisonSniff.php | 88 + .../ControlStructures/EarlyExitSniff.php | 480 ++ .../JumpStatementsSpacingSniff.php | 282 + .../LanguageConstructWithParenthesesSniff.php | 102 + .../NewWithParenthesesSniff.php | 114 + .../NewWithoutParenthesesSniff.php | 106 + .../RequireMultiLineConditionSniff.php | 188 + .../RequireMultiLineTernaryOperatorSniff.php | 178 + .../RequireNullCoalesceEqualOperatorSniff.php | 99 + .../RequireNullCoalesceOperatorSniff.php | 217 + .../RequireNullSafeObjectOperatorSniff.php | 513 ++ .../RequireShortTernaryOperatorSniff.php | 87 + .../RequireSingleLineConditionSniff.php | 105 + .../RequireTernaryOperatorSniff.php | 266 + .../RequireYodaComparisonSniff.php | 74 + .../UnsupportedKeywordException.php | 17 + .../UselessIfConditionWithReturnSniff.php | 216 + .../UselessTernaryOperatorSniff.php | 105 + .../Sniffs/Exceptions/DeadCatchSniff.php | 56 + .../DisallowNonCapturingCatchSniff.php | 46 + .../ReferenceThrowableOnlySniff.php | 139 + .../RequireNonCapturingCatchSniff.php | 170 + .../Sniffs/Files/FileLengthSniff.php | 63 + .../Files/FilepathNamespaceExtractor.php | 88 + .../Sniffs/Files/LineLengthSniff.php | 138 + .../Files/TypeNameMatchesFileNameSniff.php | 188 + .../Sniffs/Functions/AbstractLineCall.php | 102 + .../ArrowFunctionDeclarationSniff.php | 181 + .../Functions/DisallowArrowFunctionSniff.php | 33 + .../Functions/DisallowEmptyFunctionSniff.php | 69 + .../Functions/DisallowNamedArgumentsSniff.php | 40 + .../DisallowTrailingCommaInCallSniff.php | 95 + ...DisallowTrailingCommaInClosureUseSniff.php | 86 + ...isallowTrailingCommaInDeclarationSniff.php | 74 + .../Sniffs/Functions/FunctionLengthSniff.php | 68 + .../Functions/NamedArgumentSpacingSniff.php | 79 + .../Functions/RequireArrowFunctionSniff.php | 158 + .../Functions/RequireMultiLineCallSniff.php | 243 + .../Functions/RequireSingleLineCallSniff.php | 200 + .../RequireTrailingCommaInCallSniff.php | 104 + .../RequireTrailingCommaInClosureUseSniff.php | 85 + ...RequireTrailingCommaInDeclarationSniff.php | 77 + .../Sniffs/Functions/StaticClosureSniff.php | 103 + .../Sniffs/Functions/StrictCallSniff.php | 127 + ...dInheritedVariablePassedToClosureSniff.php | 150 + .../Sniffs/Functions/UnusedParameterSniff.php | 107 + .../UselessParameterDefaultValueSniff.php | 88 + .../AbstractFullyQualifiedGlobalReference.php | 172 + .../AlphabeticallySortedUsesSniff.php | 240 + .../Namespaces/DisallowGroupUseSniff.php | 37 + ...llyQualifiedClassNameInAnnotationSniff.php | 173 + .../FullyQualifiedExceptionsSniff.php | 162 + .../FullyQualifiedGlobalConstantsSniff.php | 26 + .../FullyQualifiedGlobalFunctionsSniff.php | 45 + .../Namespaces/MultipleUsesPerLineSniff.php | 48 + .../Namespaces/NamespaceDeclarationSniff.php | 147 + .../Namespaces/NamespaceSpacingSniff.php | 164 + .../ReferenceUsedNamesOnlySniff.php | 779 ++ .../RequireOneNamespaceInFileSniff.php | 58 + .../Sniffs/Namespaces/UnusedUsesSniff.php | 294 + .../UseDoesNotStartWithBackslashSniff.php | 74 + .../Namespaces/UseFromSameNamespaceSniff.php | 90 + .../UseOnlyWhitelistedNamespacesSniff.php | 78 + .../Sniffs/Namespaces/UseSpacingSniff.php | 343 + .../Sniffs/Namespaces/UselessAliasSniff.php | 82 + .../DisallowNumericLiteralSeparatorSniff.php | 55 + .../RequireNumericLiteralSeparatorSniff.php | 82 + .../Operators/DisallowEqualOperatorsSniff.php | 60 + ...lowIncrementAndDecrementOperatorsSniff.php | 65 + .../NegationOperatorSpacingSniff.php | 125 + ...RequireCombinedAssignmentOperatorSniff.php | 149 + ...oneIncrementAndDecrementOperatorsSniff.php | 118 + .../Operators/SpreadOperatorSpacingSniff.php | 71 + .../DisallowDirectMagicInvokeCallSniff.php | 67 + .../Sniffs/PHP/DisallowReferenceSniff.php | 99 + .../Sniffs/PHP/ForbiddenClassesSniff.php | 272 + ...ptimizedFunctionsWithoutUnpackingSniff.php | 114 + .../Sniffs/PHP/ReferenceSpacingSniff.php | 131 + .../PHP/RequireExplicitAssertionSniff.php | 472 ++ .../Sniffs/PHP/RequireNowdocSniff.php | 74 + .../Sniffs/PHP/ShortListSniff.php | 50 + .../Sniffs/PHP/TypeCastSniff.php | 119 + .../Sniffs/PHP/UselessParenthesesSniff.php | 579 ++ .../Sniffs/PHP/UselessSemicolonSniff.php | 160 + .../Strings/DisallowVariableParsingSniff.php | 154 + .../Sniffs/TestCase.php | 236 + .../TypeHints/DeclareStrictTypesSniff.php | 262 + .../DisallowArrayTypeHintSyntaxSniff.php | 307 + .../TypeHints/DisallowMixedTypeHintSniff.php | 72 + .../Sniffs/TypeHints/LongTypeHintsSniff.php | 92 + .../NullTypeHintOnLastPositionSniff.php | 109 + .../NullableTypeForNullDefaultValueSniff.php | 125 + .../TypeHints/ParameterTypeHintSniff.php | 688 ++ .../ParameterTypeHintSpacingSniff.php | 154 + .../TypeHints/PropertyTypeHintSniff.php | 692 ++ .../Sniffs/TypeHints/ReturnTypeHintSniff.php | 732 ++ .../TypeHints/ReturnTypeHintSpacingSniff.php | 172 + .../TypeHints/UnionTypeHintFormatSniff.php | 248 + .../UselessConstantTypeHintSniff.php | 85 + .../DisallowSuperGlobalVariableSniff.php | 52 + .../DisallowVariableVariableSniff.php | 35 + .../DuplicateAssignmentToVariableSniff.php | 70 + .../Sniffs/Variables/UnusedVariableSniff.php | 709 ++ .../Sniffs/Variables/UselessVariableSniff.php | 417 + .../Whitespaces/DuplicateSpacesSniff.php | 175 + .../SlevomatCodingStandard/ruleset.xml | 4 + .../coding-standard/autoload-bootstrap.php | 11 + vendor/slevomat/coding-standard/composer.json | 50 + vendor/slevomat/coding-standard/doc/arrays.md | 44 + .../coding-standard/doc/attributes.md | 48 + .../slevomat/coding-standard/doc/classes.md | 284 + .../coding-standard/doc/commenting.md | 118 + .../coding-standard/doc/complexity.md | 10 + .../coding-standard/doc/control-structures.md | 258 + .../coding-standard/doc/exceptions.md | 31 + vendor/slevomat/coding-standard/doc/files.md | 59 + .../slevomat/coding-standard/doc/functions.md | 136 + .../coding-standard/doc/namespaces.md | 186 + .../slevomat/coding-standard/doc/numbers.md | 16 + .../slevomat/coding-standard/doc/operators.md | 33 + vendor/slevomat/coding-standard/doc/php.md | 80 + .../slevomat/coding-standard/doc/strings.md | 11 + .../coding-standard/doc/type-hints.md | 130 + .../slevomat/coding-standard/doc/variables.md | 31 + .../coding-standard/doc/whitespaces.md | 13 + .../php_codesniffer/CodeSniffer.conf | 5 + 1812 files changed, 75241 insertions(+), 103269 deletions(-) create mode 100644 .gitignore create mode 100644 .php-cs-fixer.php create mode 100644 .prettier.rc.json delete mode 100644 .prettierrc.json delete mode 100644 application/controllers/Form.php create mode 100644 application/controllers/Testing/Dummy.php create mode 100644 application/controllers/Testing/Form.php delete mode 100644 application/controllers/dummy.php create mode 100644 bootstrap.php create mode 100644 custom_sniffs/Sniffs/NamespaceSniff.php rename eslint.config.mjs => eslint.mjs.txt (100%) delete mode 120000 node_modules/.bin/esparse delete mode 120000 node_modules/.bin/esvalidate 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 delete mode 100644 node_modules/@humanwhocodes/object-schema/.eslintrc.js delete mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml delete mode 100644 node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml delete mode 100644 node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js delete mode 100644 node_modules/@humanwhocodes/object-schema/tests/object-schema.js delete mode 100644 node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js delete mode 100644 node_modules/acorn/dist/acorn.js.map delete mode 100644 node_modules/acorn/dist/acorn.mjs.d.ts delete mode 100644 node_modules/acorn/dist/acorn.mjs.map delete mode 100644 node_modules/ansi-colors/LICENSE 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/argparse/index.js delete mode 100644 node_modules/argparse/lib/action.js delete mode 100644 node_modules/argparse/lib/action/append.js delete mode 100644 node_modules/argparse/lib/action/append/constant.js delete mode 100644 node_modules/argparse/lib/action/count.js delete mode 100644 node_modules/argparse/lib/action/help.js delete mode 100644 node_modules/argparse/lib/action/store.js delete mode 100644 node_modules/argparse/lib/action/store/constant.js delete mode 100644 node_modules/argparse/lib/action/store/false.js delete mode 100644 node_modules/argparse/lib/action/store/true.js delete mode 100644 node_modules/argparse/lib/action/subparsers.js delete mode 100644 node_modules/argparse/lib/action/version.js delete mode 100644 node_modules/argparse/lib/action_container.js delete mode 100644 node_modules/argparse/lib/argparse.js delete mode 100644 node_modules/argparse/lib/argument/error.js delete mode 100644 node_modules/argparse/lib/argument/exclusive.js delete mode 100644 node_modules/argparse/lib/argument/group.js delete mode 100644 node_modules/argparse/lib/argument_parser.js delete mode 100644 node_modules/argparse/lib/const.js delete mode 100644 node_modules/argparse/lib/help/added_formatters.js delete mode 100644 node_modules/argparse/lib/help/formatter.js delete mode 100644 node_modules/argparse/lib/namespace.js delete mode 100644 node_modules/argparse/lib/utils.js 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/license delete mode 100644 node_modules/astral-regex/package.json delete mode 100644 node_modules/astral-regex/readme.md delete mode 100644 node_modules/enquirer/LICENSE 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/queue.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/node_modules/ansi-regex/index.d.ts delete mode 100644 node_modules/enquirer/node_modules/ansi-regex/index.js delete mode 100644 node_modules/enquirer/node_modules/ansi-regex/license delete mode 100644 node_modules/enquirer/node_modules/ansi-regex/package.json delete mode 100644 node_modules/enquirer/node_modules/ansi-regex/readme.md delete mode 100644 node_modules/enquirer/node_modules/strip-ansi/index.d.ts delete mode 100644 node_modules/enquirer/node_modules/strip-ansi/index.js delete mode 100644 node_modules/enquirer/node_modules/strip-ansi/license delete mode 100644 node_modules/enquirer/node_modules/strip-ansi/package.json delete mode 100644 node_modules/enquirer/node_modules/strip-ansi/readme.md delete mode 100644 node_modules/enquirer/package.json delete mode 100644 node_modules/eslint-scope/CHANGELOG.md delete mode 100644 node_modules/eslint-utils/README.md delete mode 100644 node_modules/eslint-utils/index.js delete mode 100644 node_modules/eslint-utils/index.js.map delete mode 100644 node_modules/eslint-utils/index.mjs 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/LICENSE 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 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/category-list.json delete mode 100644 node_modules/eslint/conf/eslint-all.js delete mode 100644 node_modules/eslint/conf/eslint-recommended.js delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/codeframe.js delete mode 100644 node_modules/eslint/lib/cli-engine/formatters/table.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 delete mode 120000 node_modules/eslint/node_modules/.bin/semver delete mode 100644 node_modules/eslint/node_modules/@babel/code-frame/LICENSE 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 delete mode 100644 node_modules/eslint/node_modules/semver/LICENSE 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/lrucache.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 delete mode 100644 node_modules/espree/lib/ast-node-types.js delete mode 100644 node_modules/espree/lib/visitor-keys.js delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/CHANGELOG.md delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/LICENSE 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/lib/visitor-keys.json delete mode 100644 node_modules/espree/node_modules/eslint-visitor-keys/package.json delete mode 100644 node_modules/esprima/ChangeLog delete mode 100644 node_modules/esprima/LICENSE.BSD delete mode 100644 node_modules/esprima/README.md delete mode 100755 node_modules/esprima/bin/esparse.js delete mode 100755 node_modules/esprima/bin/esvalidate.js delete mode 100644 node_modules/esprima/dist/esprima.js delete mode 100644 node_modules/esprima/package.json delete mode 100644 node_modules/esquery/node_modules/estraverse/.jshintrc delete mode 100644 node_modules/esquery/node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/esquery/node_modules/estraverse/README.md delete mode 100644 node_modules/esquery/node_modules/estraverse/estraverse.js delete mode 100644 node_modules/esquery/node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/esquery/node_modules/estraverse/package.json delete mode 100644 node_modules/esrecurse/node_modules/estraverse/.jshintrc delete mode 100644 node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD delete mode 100644 node_modules/esrecurse/node_modules/estraverse/README.md delete mode 100644 node_modules/esrecurse/node_modules/estraverse/estraverse.js delete mode 100644 node_modules/esrecurse/node_modules/estraverse/gulpfile.js delete mode 100644 node_modules/esrecurse/node_modules/estraverse/package.json delete mode 100644 node_modules/fast-uri/.gitattributes delete mode 100644 node_modules/fast-uri/.github/.stale.yml delete mode 100644 node_modules/fast-uri/.github/dependabot.yml delete mode 100644 node_modules/fast-uri/.github/tests_checker.yml delete mode 100644 node_modules/fast-uri/.github/workflows/ci.yml delete mode 100644 node_modules/fast-uri/.github/workflows/package-manager-ci.yml delete mode 100644 node_modules/fast-uri/.taprc delete mode 100644 node_modules/fast-uri/LICENSE delete mode 100644 node_modules/fast-uri/README.md delete mode 100644 node_modules/fast-uri/benchmark.js delete mode 100644 node_modules/fast-uri/index.js delete mode 100644 node_modules/fast-uri/lib/schemes.js delete mode 100644 node_modules/fast-uri/lib/scopedChars.js delete mode 100644 node_modules/fast-uri/lib/utils.js delete mode 100644 node_modules/fast-uri/package.json delete mode 100644 node_modules/fast-uri/test/ajv.test.js delete mode 100644 node_modules/fast-uri/test/compatibility.test.js delete mode 100644 node_modules/fast-uri/test/equal.test.js delete mode 100644 node_modules/fast-uri/test/parse.test.js delete mode 100644 node_modules/fast-uri/test/resolve.test.js delete mode 100644 node_modules/fast-uri/test/serialize.test.js delete mode 100644 node_modules/fast-uri/test/uri-js.test.js delete mode 100644 node_modules/fast-uri/test/util.test.js delete mode 100644 node_modules/fast-uri/types/index.d.ts delete mode 100644 node_modules/fast-uri/types/index.test-d.ts delete mode 100644 node_modules/functional-red-black-tree/.npmignore delete mode 100644 node_modules/functional-red-black-tree/LICENSE 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 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 delete mode 100644 node_modules/js-yaml/lib/js-yaml.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/common.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/dumper.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/exception.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/loader.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/mark.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema/core.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_full.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_safe.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema/failsafe.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/schema/json.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/binary.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/bool.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/float.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/int.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/function.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/regexp.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/undefined.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/map.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/merge.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/null.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/omap.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/pairs.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/seq.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/set.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/str.js delete mode 100644 node_modules/js-yaml/lib/js-yaml/type/timestamp.js delete mode 100644 node_modules/lodash.truncate/LICENSE delete mode 100644 node_modules/lodash.truncate/README.md delete mode 100644 node_modules/lodash.truncate/index.js delete mode 100644 node_modules/lodash.truncate/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 delete mode 100644 node_modules/regexpp/README.md delete mode 100644 node_modules/regexpp/index.d.ts delete mode 100644 node_modules/regexpp/index.js delete mode 100644 node_modules/regexpp/index.js.map delete mode 100644 node_modules/regexpp/index.mjs 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 delete mode 100644 node_modules/sprintf-js/.npmignore delete mode 100644 node_modules/sprintf-js/LICENSE delete mode 100644 node_modules/sprintf-js/README.md delete mode 100644 node_modules/sprintf-js/bower.json delete mode 100644 node_modules/sprintf-js/demo/angular.html delete mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js delete mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js.map delete mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.map delete mode 100644 node_modules/sprintf-js/dist/sprintf.min.js delete mode 100644 node_modules/sprintf-js/dist/sprintf.min.js.map delete mode 100644 node_modules/sprintf-js/dist/sprintf.min.map delete mode 100644 node_modules/sprintf-js/gruntfile.js delete mode 100644 node_modules/sprintf-js/package.json delete mode 100644 node_modules/sprintf-js/src/angular-sprintf.js delete mode 100644 node_modules/sprintf-js/src/sprintf.js delete mode 100644 node_modules/sprintf-js/test/test.js delete mode 100644 node_modules/table/LICENSE delete mode 100644 node_modules/table/README.md delete mode 100644 node_modules/table/dist/src/alignSpanningCell.d.ts delete mode 100644 node_modules/table/dist/src/alignSpanningCell.js delete mode 100644 node_modules/table/dist/src/alignSpanningCell.js.map delete mode 100644 node_modules/table/dist/src/alignString.d.ts delete mode 100644 node_modules/table/dist/src/alignString.js delete mode 100644 node_modules/table/dist/src/alignString.js.map delete mode 100644 node_modules/table/dist/src/alignTableData.d.ts delete mode 100644 node_modules/table/dist/src/alignTableData.js delete mode 100644 node_modules/table/dist/src/alignTableData.js.map delete mode 100644 node_modules/table/dist/src/calculateCellHeight.d.ts delete mode 100644 node_modules/table/dist/src/calculateCellHeight.js delete mode 100644 node_modules/table/dist/src/calculateCellHeight.js.map delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js delete mode 100644 node_modules/table/dist/src/calculateMaximumColumnWidths.js.map delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.d.ts delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js delete mode 100644 node_modules/table/dist/src/calculateOutputColumnWidths.js.map delete mode 100644 node_modules/table/dist/src/calculateRowHeights.d.ts delete mode 100644 node_modules/table/dist/src/calculateRowHeights.js delete mode 100644 node_modules/table/dist/src/calculateRowHeights.js.map delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.d.ts delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js delete mode 100644 node_modules/table/dist/src/calculateSpanningCellWidth.js.map delete mode 100644 node_modules/table/dist/src/createStream.d.ts delete mode 100644 node_modules/table/dist/src/createStream.js delete mode 100644 node_modules/table/dist/src/createStream.js.map delete mode 100644 node_modules/table/dist/src/drawBorder.d.ts delete mode 100644 node_modules/table/dist/src/drawBorder.js delete mode 100644 node_modules/table/dist/src/drawBorder.js.map delete mode 100644 node_modules/table/dist/src/drawContent.d.ts delete mode 100644 node_modules/table/dist/src/drawContent.js delete mode 100644 node_modules/table/dist/src/drawContent.js.map delete mode 100644 node_modules/table/dist/src/drawRow.d.ts delete mode 100644 node_modules/table/dist/src/drawRow.js delete mode 100644 node_modules/table/dist/src/drawRow.js.map delete mode 100644 node_modules/table/dist/src/drawTable.d.ts delete mode 100644 node_modules/table/dist/src/drawTable.js delete mode 100644 node_modules/table/dist/src/drawTable.js.map delete mode 100644 node_modules/table/dist/src/generated/validators.d.ts delete mode 100644 node_modules/table/dist/src/generated/validators.js delete mode 100644 node_modules/table/dist/src/generated/validators.js.map delete mode 100644 node_modules/table/dist/src/getBorderCharacters.d.ts delete mode 100644 node_modules/table/dist/src/getBorderCharacters.js delete mode 100644 node_modules/table/dist/src/getBorderCharacters.js.map delete mode 100644 node_modules/table/dist/src/index.d.ts delete mode 100644 node_modules/table/dist/src/index.js delete mode 100644 node_modules/table/dist/src/index.js.map delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.d.ts delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.js delete mode 100644 node_modules/table/dist/src/injectHeaderConfig.js.map delete mode 100644 node_modules/table/dist/src/makeRangeConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeRangeConfig.js delete mode 100644 node_modules/table/dist/src/makeRangeConfig.js.map delete mode 100644 node_modules/table/dist/src/makeStreamConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeStreamConfig.js delete mode 100644 node_modules/table/dist/src/makeStreamConfig.js.map delete mode 100644 node_modules/table/dist/src/makeTableConfig.d.ts delete mode 100644 node_modules/table/dist/src/makeTableConfig.js delete mode 100644 node_modules/table/dist/src/makeTableConfig.js.map delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.d.ts delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js delete mode 100644 node_modules/table/dist/src/mapDataUsingRowHeights.js.map delete mode 100644 node_modules/table/dist/src/padTableData.d.ts delete mode 100644 node_modules/table/dist/src/padTableData.js delete mode 100644 node_modules/table/dist/src/padTableData.js.map delete mode 100644 node_modules/table/dist/src/schemas/config.json delete mode 100644 node_modules/table/dist/src/schemas/shared.json delete mode 100644 node_modules/table/dist/src/schemas/streamConfig.json delete mode 100644 node_modules/table/dist/src/spanningCellManager.d.ts delete mode 100644 node_modules/table/dist/src/spanningCellManager.js delete mode 100644 node_modules/table/dist/src/spanningCellManager.js.map delete mode 100644 node_modules/table/dist/src/stringifyTableData.d.ts delete mode 100644 node_modules/table/dist/src/stringifyTableData.js delete mode 100644 node_modules/table/dist/src/stringifyTableData.js.map delete mode 100644 node_modules/table/dist/src/table.d.ts delete mode 100644 node_modules/table/dist/src/table.js delete mode 100644 node_modules/table/dist/src/table.js.map delete mode 100644 node_modules/table/dist/src/truncateTableData.d.ts delete mode 100644 node_modules/table/dist/src/truncateTableData.js delete mode 100644 node_modules/table/dist/src/truncateTableData.js.map delete mode 100644 node_modules/table/dist/src/types/api.d.ts delete mode 100644 node_modules/table/dist/src/types/api.js delete mode 100644 node_modules/table/dist/src/types/api.js.map delete mode 100644 node_modules/table/dist/src/types/internal.d.ts delete mode 100644 node_modules/table/dist/src/types/internal.js delete mode 100644 node_modules/table/dist/src/types/internal.js.map delete mode 100644 node_modules/table/dist/src/utils.d.ts delete mode 100644 node_modules/table/dist/src/utils.js delete mode 100644 node_modules/table/dist/src/utils.js.map delete mode 100644 node_modules/table/dist/src/validateConfig.d.ts delete mode 100644 node_modules/table/dist/src/validateConfig.js delete mode 100644 node_modules/table/dist/src/validateConfig.js.map delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.d.ts delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js delete mode 100644 node_modules/table/dist/src/validateSpanningCellConfig.js.map delete mode 100644 node_modules/table/dist/src/validateTableData.d.ts delete mode 100644 node_modules/table/dist/src/validateTableData.js delete mode 100644 node_modules/table/dist/src/validateTableData.js.map delete mode 100644 node_modules/table/dist/src/wrapCell.d.ts delete mode 100644 node_modules/table/dist/src/wrapCell.js delete mode 100644 node_modules/table/dist/src/wrapCell.js.map delete mode 100644 node_modules/table/dist/src/wrapString.d.ts delete mode 100644 node_modules/table/dist/src/wrapString.js delete mode 100644 node_modules/table/dist/src/wrapString.js.map delete mode 100644 node_modules/table/dist/src/wrapWord.d.ts delete mode 100644 node_modules/table/dist/src/wrapWord.js delete mode 100644 node_modules/table/dist/src/wrapWord.js.map delete mode 100644 node_modules/table/node_modules/ajv/.runkit_example.js delete mode 100644 node_modules/table/node_modules/ajv/LICENSE 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/2020.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/2020.js delete mode 100644 node_modules/table/node_modules/ajv/dist/2020.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/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/ref_error.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/ref_error.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/ref_error.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/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/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/compile/validate/subschema.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js delete mode 100644 node_modules/table/node_modules/ajv/dist/compile/validate/subschema.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-2020-12/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json delete mode 100644 node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/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/equal.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/equal.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/equal.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/runtime/re2.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/re2.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/re2.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/timestamp.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/timestamp.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/timestamp.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/ucs2length.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/uri.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/uri.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/validation_error.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/validation_error.js delete mode 100644 node_modules/table/node_modules/ajv/dist/runtime/validation_error.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 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 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 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/items2020.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.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/prefixItems.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.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/discriminator/index.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js.map delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.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 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/error.d.ts delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js delete mode 100644 node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.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/2020.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/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/ref_error.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/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/keyword.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/compile/validate/subschema.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-2020-12/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json delete mode 100644 node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/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/equal.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/runtime/re2.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/timestamp.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/ucs2length.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/uri.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/runtime/validation_error.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/items2020.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/prefixItems.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/discriminator/index.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/types.ts delete mode 100644 node_modules/table/node_modules/ajv/lib/vocabularies/draft2020.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/error.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/ansi-regex/index.d.ts delete mode 100644 node_modules/table/node_modules/ansi-regex/index.js delete mode 100644 node_modules/table/node_modules/ansi-regex/license delete mode 100644 node_modules/table/node_modules/ansi-regex/package.json delete mode 100644 node_modules/table/node_modules/ansi-regex/readme.md delete mode 100644 node_modules/table/node_modules/ansi-styles/index.d.ts delete mode 100644 node_modules/table/node_modules/ansi-styles/index.js delete mode 100644 node_modules/table/node_modules/ansi-styles/license delete mode 100644 node_modules/table/node_modules/ansi-styles/package.json delete mode 100644 node_modules/table/node_modules/ansi-styles/readme.md delete mode 100644 node_modules/table/node_modules/color-convert/CHANGELOG.md delete mode 100644 node_modules/table/node_modules/color-convert/LICENSE delete mode 100644 node_modules/table/node_modules/color-convert/README.md delete mode 100644 node_modules/table/node_modules/color-convert/conversions.js delete mode 100644 node_modules/table/node_modules/color-convert/index.js delete mode 100644 node_modules/table/node_modules/color-convert/package.json delete mode 100644 node_modules/table/node_modules/color-convert/route.js delete mode 100644 node_modules/table/node_modules/color-name/README.md delete mode 100644 node_modules/table/node_modules/color-name/index.js delete mode 100644 node_modules/table/node_modules/color-name/package.json delete mode 100644 node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt delete mode 100644 node_modules/table/node_modules/emoji-regex/README.md delete mode 100644 node_modules/table/node_modules/emoji-regex/es2015/index.js delete mode 100644 node_modules/table/node_modules/emoji-regex/es2015/text.js delete mode 100644 node_modules/table/node_modules/emoji-regex/index.d.ts delete mode 100644 node_modules/table/node_modules/emoji-regex/index.js delete mode 100644 node_modules/table/node_modules/emoji-regex/package.json delete mode 100644 node_modules/table/node_modules/emoji-regex/text.js delete mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/index.d.ts delete mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/index.js delete mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/license delete mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/package.json delete mode 100644 node_modules/table/node_modules/is-fullwidth-code-point/readme.md 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/LICENSE 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 100755 node_modules/table/node_modules/slice-ansi/index.js delete mode 100644 node_modules/table/node_modules/slice-ansi/license delete mode 100644 node_modules/table/node_modules/slice-ansi/package.json delete mode 100644 node_modules/table/node_modules/slice-ansi/readme.md delete mode 100644 node_modules/table/node_modules/string-width/index.d.ts delete mode 100644 node_modules/table/node_modules/string-width/index.js delete mode 100644 node_modules/table/node_modules/string-width/license delete mode 100644 node_modules/table/node_modules/string-width/package.json delete mode 100644 node_modules/table/node_modules/string-width/readme.md delete mode 100644 node_modules/table/node_modules/strip-ansi/index.d.ts delete mode 100644 node_modules/table/node_modules/strip-ansi/index.js delete mode 100644 node_modules/table/node_modules/strip-ansi/license delete mode 100644 node_modules/table/node_modules/strip-ansi/package.json delete mode 100644 node_modules/table/node_modules/strip-ansi/readme.md delete mode 100644 node_modules/table/package.json delete mode 100644 node_modules/v8-compile-cache/LICENSE 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 phpcs_config.txt create mode 100644 phpcs_errors.json rename node_modules/fast-uri/test/.gitkeep => phpcs_errors_processed.json (100%) delete mode 100644 preprocess-js.sh create mode 100644 ruleset.xml create mode 100644 setup_phpcs.php rename node_modules/regexpp/LICENSE => vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md (90%) create mode 100644 vendor/dealerdirect/phpcodesniffer-composer-installer/README.md create mode 100644 vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json create mode 100644 vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php rename {node_modules/eslint-utils => vendor/phpstan/phpdoc-parser}/LICENSE (95%) create mode 100644 vendor/phpstan/phpdoc-parser/README.md create mode 100644 vendor/phpstan/phpdoc-parser/composer.json create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Attribute.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayItemNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFloatNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNullNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprStringNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstFetchNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/DoctrineConstExprStringNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Node.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/NodeAttributes.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/NodeTraverser.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamClosureThisTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamImmediatelyInvokedCallableTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamLaterInvokedCallableTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTextNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireExtendsTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireImplementsTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/TypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Ast/Type/UnionTypeNode.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Printer/Differ.php create mode 100644 vendor/phpstan/phpdoc-parser/src/Printer/Printer.php create mode 100644 vendor/slevomat/coding-standard/.editorconfig create mode 100644 vendor/slevomat/coding-standard/.typos.toml create mode 100644 vendor/slevomat/coding-standard/CODE_OF_CONDUCT.md rename node_modules/table/node_modules/color-name/LICENSE => vendor/slevomat/coding-standard/LICENSE.md (95%) create mode 100644 vendor/slevomat/coding-standard/README.md create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Attribute.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Comment.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CommentHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/EmptyFileException.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IdentificatorHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParameterHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PropertyHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedName.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/StringHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SuppressHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TernaryOperatorHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenPointerOutOfBoundsException.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHint.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatement.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/VariableHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributesOrderSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowAttributesJoiningSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowMultipleAttributesPerLineSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractMethodSignature.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/BackedEnumTypeSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassLengthSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassMemberSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowConstructorPropertyPromotionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowLateStaticBindingForConstantsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiConstantDefinitionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiPropertyDefinitionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EmptyLinesAroundClassBracesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MethodSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireAbstractOrFinalSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousAbstractClassNamingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousErrorNamingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousExceptionNamingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousInterfaceNamingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousTraitNamingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/UnsupportedClassGroupException.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/UselessLateStaticBindingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AbstractRequireOneLineDocComment.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/EmptyCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLineDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessInheritDocCommentSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractLineCondition.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AssignmentInConditionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowContinueWithoutIntegerOperandInSwitchSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowEmptySniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowNullSafeObjectOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowShortTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowYodaComparisonSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/LanguageConstructWithParenthesesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithoutParenthesesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineConditionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireSingleLineConditionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireYodaComparisonSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UnsupportedKeywordException.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessIfConditionWithReturnSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DisallowNonCapturingCatchSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/RequireNonCapturingCatchSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FileLengthSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/LineLengthSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/AbstractLineCall.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/ArrowFunctionDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowArrowFunctionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowEmptyFunctionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowNamedArgumentsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInClosureUseSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/FunctionLengthSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/NamedArgumentSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireMultiLineCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireSingleLineCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInClosureUseSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StaticClosureSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StrictCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedInheritedVariablePassedToClosureSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedParameterSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UselessParameterDefaultValueSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/DisallowGroupUseSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalConstantsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/MultipleUsesPerLineSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceDeclarationSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/RequireOneNamespaceInFileSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseFromSameNamespaceSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UselessAliasSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/DisallowNumericLiteralSeparatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/RequireNumericLiteralSeparatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowEqualOperatorsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowIncrementAndDecrementOperatorsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/NegationOperatorSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/SpreadOperatorSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowDirectMagicInvokeCallSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowReferenceSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ReferenceSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireNowdocSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ShortListSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/TypeCastSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessParenthesesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessSemicolonSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullableTypeForNullDefaultValueSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowSuperGlobalVariableSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DuplicateAssignmentToVariableSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php create mode 100644 vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml create mode 100644 vendor/slevomat/coding-standard/autoload-bootstrap.php create mode 100644 vendor/slevomat/coding-standard/composer.json create mode 100644 vendor/slevomat/coding-standard/doc/arrays.md create mode 100644 vendor/slevomat/coding-standard/doc/attributes.md create mode 100644 vendor/slevomat/coding-standard/doc/classes.md create mode 100644 vendor/slevomat/coding-standard/doc/commenting.md create mode 100644 vendor/slevomat/coding-standard/doc/complexity.md create mode 100644 vendor/slevomat/coding-standard/doc/control-structures.md create mode 100644 vendor/slevomat/coding-standard/doc/exceptions.md create mode 100644 vendor/slevomat/coding-standard/doc/files.md create mode 100644 vendor/slevomat/coding-standard/doc/functions.md create mode 100644 vendor/slevomat/coding-standard/doc/namespaces.md create mode 100644 vendor/slevomat/coding-standard/doc/numbers.md create mode 100644 vendor/slevomat/coding-standard/doc/operators.md create mode 100644 vendor/slevomat/coding-standard/doc/php.md create mode 100644 vendor/slevomat/coding-standard/doc/strings.md create mode 100644 vendor/slevomat/coding-standard/doc/type-hints.md create mode 100644 vendor/slevomat/coding-standard/doc/variables.md create mode 100644 vendor/slevomat/coding-standard/doc/whitespaces.md create mode 100644 vendor/squizlabs/php_codesniffer/CodeSniffer.conf diff --git a/.eslintrc.json b/.eslintrc.json index 4e2bda7..0f00979 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,19 +1,18 @@ { -"env": { - "browser": true, - "jquery": true - }, - "parser": "@babel/eslint-parser", + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module" }, "plugins": [ - "prettier" + "prettier", + "@typescript-eslint" ], "extends": [ "eslint:recommended", - "prettier" + "plugin:prettier/recommended", + "prettier", + "plugin:@typescript-eslint/recommended" ], "rules": { "prettier/prettier": "error", @@ -27,6 +26,4 @@ "window": "readonly", "console": "readonly" } - } - \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/.husky/.gitignore b/.husky/.gitignore index e69de29..31354ec 100644 --- a/.husky/.gitignore +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit index 3ac6972..eaddfe8 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,11 +1,13 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" + # Run JS/CSS checks .husky/pre-commit-js-css if [ $? -ne 0 ]; then echo "JS/CSS checks failed" exit 1 fi + # Get the list of staged PHP files STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.php$') @@ -41,26 +43,38 @@ if [ $SYNTAX_ERRORS -ne 0 ]; then exit 1 fi -# Run PHPCBF to auto-fix issues -echo "Running PHPCBF..." -for FILE in $STAGED_FILES; do - /home/aissel/.config/composer/vendor/bin/phpcbf --standard=/var/www/html/google_forms/phpcs.xml "$FILE" || true -done - # Run PHP CS Fixer to auto-fix issues echo "Running PHP CS Fixer..." for FILE in $STAGED_FILES; do /home/aissel/.config/composer/vendor/bin/php-cs-fixer fix "$FILE" done -# Re-run PHPCS to check for unresolved coding standard violations + + +# Run PHPCS to check for unresolv//cheks for the file path & the nampespaceed coding standard violations echo "Running PHPCS..." +ERROR_FILE="/var/www/html/google_forms/phpcs_errors.json" # Specify your error file path and format here + +# Run PHPCS, display errors in the terminal, and store them in the JSON file +echo "$STAGED_FILES" | xargs -n 1 /home/aissel/.config/composer/vendor/bin/phpcs --standard=/var/www/html/google_forms/phpcs.xml --report=json | tee "$ERROR_FILE" + + + + + +# Additionally, run PHPCS to show output in terminal in standard format echo "$STAGED_FILES" | xargs -n 1 /home/aissel/.config/composer/vendor/bin/phpcs --standard=/var/www/html/google_forms/phpcs.xml +# Check if there were any errors reported + +if grep -q '"errors":' "$ERROR_FILE"; then + echo "PHPCS errors detected. Please fix them before committing." + exit 1 +fi + # Add the fixed files back to the staging area for FILE in $STAGED_FILES; do git add "$FILE" done - echo "Pre-commit checks completed." diff --git a/.husky/pre-commit-js-css b/.husky/pre-commit-js-css index ed325fb..ea32252 100755 --- a/.husky/pre-commit-js-css +++ b/.husky/pre-commit-js-css @@ -24,14 +24,17 @@ for FILE in $STAGED_FILES; do npx prettier --write "$FILE" done -# Run ESLint + +# Run ESLint for JS/TS files only echo "Running ESLint..." ESLINT_ERRORS=0 for FILE in $STAGED_FILES; do + if echo "$FILE" | grep -E '\.(js|jsx|ts|tsx)$' > /dev/null; then ESLINT_OUTPUT=$(npx eslint "$FILE" 2>&1) - if [ $? -ne 0 ]; then - display_errors "$ESLINT_OUTPUT" - ESLINT_ERRORS=1 + if [ $? -ne 0 ]; then + display_errors "$ESLINT_OUTPUT" + ESLINT_ERRORS=1 + fi fi done diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 8e457cb..0c2fbf7 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"7.4.33","version":"3.61.1:v3.61.1#94a87189f55814e6cabca2d9a33b06de384a2ab8","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"application\/controllers\/Forms.php":"e8ae7bfcbae1bc80e70f622ffe96ce7b","application\/config\/autoload.php":"90f7f4225172adc15a46ac972b8bcd6f","application\/config\/config.php":"1ee662163430ed8bf83aa39f9ebdb688","application\/config\/constants.php":"ef12156cd9e5e32cb19402bf6f2cad06","application\/config\/database.php":"24d2bcb421841a3fd4c4b871b9027f32","application\/config\/doctypes.php":"7eddd29800c2264aac3f7dd9293374bd","application\/config\/foreign_chars.php":"c7ea97a67d4396b45aeb4930d8eda512","application\/config\/hooks.php":"ffcc75362e730c47870dec0a012605ae","application\/config\/memcached.php":"0d50eca9f8fc3920ddaf739d30b14b56","application\/config\/migration.php":"d1e6c2ebf1c991dcf007695c2df08d1a","application\/config\/mimes.php":"c699b2730c1d3a29f8401278d8969ea5","application\/config\/profiler.php":"28868d1f8fc4624854c23af8e7a219dc","application\/config\/routes.php":"1eaba9e0e687a248bfc04d266c943bb2","application\/config\/smileys.php":"a98913263a1408e7d81d0524ce0bfc40","application\/config\/user_agents.php":"5fdf76f696bb758f20489d799926c68b","application\/controllers\/Form_controller.php":"6d4e85404bed0caf40ca480b23203b06","application\/controllers\/Homepage.php":"5ecd299057c79e5dd5559ae89d38ea46","application\/controllers\/New_form.php":"8220d31e03e98cc119dbce037c36954b","application\/controllers\/New_form_controller.php":"ecddf1b73584483e5d12e298f6d9ba3c","application\/controllers\/Publish_controller.php":"4f24a039308ab4a6b44635b4a89888c6","application\/controllers\/Response_submit.php":"70a1fbcf3461207bb5c66e2cedcfc6f8","application\/controllers\/Users.php":"3e26145fa0f2fd54b402e90e83f86f96","application\/controllers\/Welcome.php":"ed4589b05486740f34ad99cf830c2f17","application\/models\/Create_model.php":"98654ee2b9f1c8aeb566cd6e3eea5dfa","application\/models\/Form_model.php":"fb239a6456cab1234b4f5f4202568e3b","application\/models\/Frontend_model.php":"2724a8f36530b75d2272090d2ebe59dd","application\/models\/New_form_model.php":"3eb5b9e0ad907f2a6bf08620e176eb41","application\/models\/Preview_model.php":"f01359eba02ce961d3102bf0cb684d1d","application\/models\/Publish_model.php":"2e509e25ca80dcabc9bb7a6130bbe22b","application\/models\/Response_model.php":"3160c902fdf4ec8a277bda66be91e3e0","application\/models\/Updation_model.php":"1a50524ad837413d9907cea1ae81fb49","application\/models\/User_model.php":"dd6567d927a2533bda1191b2f1461a5e","application\/views\/Forms\/summary.php":"224c96d30c65c0d60875566aa88dcb06","application\/views\/Tables\/draft.php":"4549948d0adb9a1d7a677d33203ff208","application\/views\/Tables\/list_forms.php":"0fac0bc673531d5427d96ef21571e80d","application\/views\/allresponse_details_view.php":"f4d346c42706cfc06a4f8a0b1a47f39a","application\/views\/edit_form_view.php":"62ebe6d08399f2b04f2212c7088a102a","application\/views\/errors\/cli\/error_404.php":"ab7c73a43373ff8fd77d6d2034b578bc","application\/views\/errors\/cli\/error_db.php":"3398097fd14c5782db485b1c4cb0352e","application\/views\/errors\/cli\/error_exception.php":"a40bf92c30ee10f9be3fe89ec1dc1900","application\/views\/errors\/cli\/error_general.php":"ab7c73a43373ff8fd77d6d2034b578bc","application\/views\/errors\/cli\/error_php.php":"7ff9e26afd01a696d82e5488c66fcc99","application\/views\/errors\/html\/error_404.php":"7784599e65836951ff31ae4c7446b001","application\/views\/errors\/html\/error_db.php":"c36cc9bd59da98ec356beb1ea0234f46","application\/views\/errors\/html\/error_exception.php":"f98492c2e7b31080bf118a7a526b3dc2","application\/views\/errors\/html\/error_general.php":"27b1348acd4e2d3060aa7be631b7027e","application\/views\/errors\/html\/error_php.php":"e5a9ff1642b0ed57c5059bc48b73c81d","application\/views\/form_preview.php":"95540a5f307d7a60e5f23c0e75869f84","application\/views\/form_preview_back.php":"19e28f2c098b0908b29a2f0bdab59cf3","application\/views\/publish_view.php":"861a9e10fc267e92308bae349c6bbb1b","application\/views\/response_details_view.php":"8e613ad0c6c7e372cb96d1738ad5dc34","application\/views\/response_submit.php":"2bdadaa83642a4ed312a0b21e0518285","application\/views\/responses\/response_summary.php":"1003e732218d081eab088c2b3cf22168","application\/views\/responses\/summary.php":"479e8624380d8dbbcbe0dd3742bf6c3b","application\/views\/responses_list.php":"9b8d3c10492b1fee85e61b46ad94f7f2","application\/views\/templates\/header.php":"75c8b8623f9b56a4aad38d709b7782ec","application\/views\/users\/login.php":"7f5ed5e2c739a296f01a33f6df1e84d6","application\/views\/welcome_message.php":"5ba907fc3b6eb82440f06c71eb4b320a","composer-setup.php":"ce8d2c27a2909f21b13a5b1b32a099b8","index.php":"c4ddfe0ba5b354634bdc33ba0ce08e7d","system\/core\/Benchmark.php":"781704e5e8bb9be93059b75947321cd0","system\/core\/CodeIgniter.php":"16dabab8d87b694574e47ff9fc5bc61e","system\/core\/Common.php":"1578235fcb6c257993ca7a1f033ba972","system\/core\/Config.php":"ee242aa6850d1c514a5ea8771c459e8f","system\/core\/Controller.php":"e977b1b9e6e03899f550a9ec13e45d2c","system\/core\/Exceptions.php":"68bc8b6e922036db8fa1c8b8dd72f004","system\/core\/Hooks.php":"9b3ba363f2e136b1fe589fe1dfa709bb","system\/core\/Input.php":"fc121bf160506347966d102599057709","system\/core\/Lang.php":"5624426418dcafd7db57f9de3b48785e","system\/core\/Loader.php":"d44a99d3090b8766c86260acd3a15083","system\/core\/Log.php":"aef3c873bc4d4341da279a14baf90f77","system\/core\/Model.php":"7f7a4c3d50d07d14374cdda6bee15efb","system\/core\/Output.php":"8d4ce0b939b4a59ea53c25ff4785d510","system\/core\/Router.php":"f7fc6cc9a71b112e6d2e1fdce78645fb","system\/core\/Security.php":"77553f2c533d5029ffe4cfcefb0d9808","system\/core\/URI.php":"2d97091f83184c9e99041b914dd9d6fe","system\/core\/Utf8.php":"b922ec85ba0a2c3f538d7ef586218d24","system\/core\/compat\/hash.php":"126a93a69e272b4a452c743298e24c6c","system\/core\/compat\/mbstring.php":"16c8bae24d093ae55a89ba6ce218e919","system\/core\/compat\/password.php":"01210e60d3de9de1a619007fbf71ab40","system\/core\/compat\/standard.php":"a0c75780574a89722192680db21dbc2d","system\/database\/DB.php":"fb92bc47ab62231657ebfc77ea6a1ff8","system\/database\/DB_cache.php":"a4d8f1d96569e88d0fa1adaa67585f7c","system\/database\/DB_driver.php":"6f4ca71bcfc6dff6c294068205cbfe1e","system\/database\/DB_forge.php":"a7c3313fac926f0329a632c4b5a92479","system\/database\/DB_query_builder.php":"f7f275f3f29a2829f4ce46920c6d8233","system\/database\/DB_result.php":"c894f44837f6216b205c7f9a71b9a69e","system\/database\/DB_utility.php":"227c095a12fa810ffd1ce478880c9305","system\/database\/drivers\/cubrid\/cubrid_driver.php":"7a0343b6d5bb2aa2f6425518e82994ed","system\/database\/drivers\/cubrid\/cubrid_forge.php":"01f019230805af39c6281637afd24edf","system\/database\/drivers\/cubrid\/cubrid_result.php":"c24164e0cfd1d18bfd5850c0ec27b65b","system\/database\/drivers\/cubrid\/cubrid_utility.php":"e2d916d40475ea16047cdd281a9a8f75","system\/database\/drivers\/ibase\/ibase_driver.php":"2923311d42f9d2882fdffe6af1776ad7","system\/database\/drivers\/ibase\/ibase_forge.php":"8041eb013c8df2cf5e8226e11881d7ed","system\/database\/drivers\/ibase\/ibase_result.php":"4de721a3f5d1ed650c80fb05ad108029","system\/database\/drivers\/ibase\/ibase_utility.php":"55db1d7e0139b91eda606c4068784dbd","system\/database\/drivers\/mssql\/mssql_driver.php":"70c1834618fc96ab37305e9919b79a10","system\/database\/drivers\/mssql\/mssql_forge.php":"caca0fa5ebda7cb4f94a277d0075f851","system\/database\/drivers\/mssql\/mssql_result.php":"e089e7a6029c90fbf62b84b64a2617ad","system\/database\/drivers\/mssql\/mssql_utility.php":"c50f4ee3833257af9328a2263816b87d","system\/database\/drivers\/mysql\/mysql_driver.php":"4c307312ba1a880122c3861b8e659a22","system\/database\/drivers\/mysql\/mysql_forge.php":"fcd109f17ef51662a8c4ec0b03ae0042","system\/database\/drivers\/mysql\/mysql_result.php":"a8e87e917e95a3fecb2d42bc26616bc5","system\/database\/drivers\/mysql\/mysql_utility.php":"3e5b236aa12a6f27190da670b3be2a64","system\/database\/drivers\/mysqli\/mysqli_driver.php":"aba7a32f663fe293bec96495772755fe","system\/database\/drivers\/mysqli\/mysqli_forge.php":"beaae46bb065d8aefb7857be952f1eaa","system\/database\/drivers\/mysqli\/mysqli_result.php":"3c0ffea9d8acdfa0ad12a2ecbf85477c","system\/database\/drivers\/mysqli\/mysqli_utility.php":"58a5000049a56e4996836582d2631132","system\/database\/drivers\/oci8\/oci8_driver.php":"5c44ed2d8ed8354bdda01369a9b3b7c0","system\/database\/drivers\/oci8\/oci8_forge.php":"7b6b329d22e529f6e52f81aecc0d5232","system\/database\/drivers\/oci8\/oci8_result.php":"378e9b983c39341af737d8366ed77dae","system\/database\/drivers\/oci8\/oci8_utility.php":"e3c21736463c979198d32a2fec760874","system\/database\/drivers\/odbc\/odbc_driver.php":"4d429cd6a780d968d1f3f21310d7172c","system\/database\/drivers\/odbc\/odbc_forge.php":"a06d2484e4bba001600e6c101a3736e7","system\/database\/drivers\/odbc\/odbc_result.php":"76a550d26439a8ff6e642efd7c375ad3","system\/database\/drivers\/odbc\/odbc_utility.php":"97384fd9d613c3a72b26264dac4fde06","system\/database\/drivers\/pdo\/pdo_driver.php":"2444c0ef3d9848074f2a545eb8f84517","system\/database\/drivers\/pdo\/pdo_forge.php":"ff0e906d5733205182f01ddbd2a1a405","system\/database\/drivers\/pdo\/pdo_result.php":"2e7303b3bbbf3c8c17db277c074ac963","system\/database\/drivers\/pdo\/pdo_utility.php":"e0e5d830650e34743b8ad1c6b7fcfd5b","system\/database\/drivers\/pdo\/subdrivers\/pdo_4d_driver.php":"d81badd1dd96012b9b012d8ca5c804f8","system\/database\/drivers\/pdo\/subdrivers\/pdo_4d_forge.php":"c3ed5535d50aba4182f744efbed9afb0","system\/database\/drivers\/pdo\/subdrivers\/pdo_cubrid_driver.php":"1e5875dcd41f0adcaa4ca06f5b4750c2","system\/database\/drivers\/pdo\/subdrivers\/pdo_cubrid_forge.php":"666ac10df341c08efef5a2951fa88cd6","system\/database\/drivers\/pdo\/subdrivers\/pdo_dblib_driver.php":"26fb538ca95f763f5ab1cdfde516a4e2","system\/database\/drivers\/pdo\/subdrivers\/pdo_dblib_forge.php":"cbbb37ee93e0d76c570afb9955667aae","system\/database\/drivers\/pdo\/subdrivers\/pdo_firebird_driver.php":"840bd7030949805b6b8a50341a104d4d","system\/database\/drivers\/pdo\/subdrivers\/pdo_firebird_forge.php":"dd0702da7e0f59cb003ae158c3258449","system\/database\/drivers\/pdo\/subdrivers\/pdo_ibm_driver.php":"f95642c6f224ed221b5bf72c00d01064","system\/database\/drivers\/pdo\/subdrivers\/pdo_ibm_forge.php":"06198121b93a060333d641ac532b4840","system\/database\/drivers\/pdo\/subdrivers\/pdo_informix_driver.php":"dceba0e81abec0de6007cb237a30cf3b","system\/database\/drivers\/pdo\/subdrivers\/pdo_informix_forge.php":"e9336d3712e7353a88ceb626e0774483","system\/database\/drivers\/pdo\/subdrivers\/pdo_mysql_driver.php":"7a8823a2c52c48cee3a5c1c8784f2d97","system\/database\/drivers\/pdo\/subdrivers\/pdo_mysql_forge.php":"c67002213823442afacee6e9f44081c5","system\/database\/drivers\/pdo\/subdrivers\/pdo_oci_driver.php":"d98c80bb2cc1cc9e61d6c607147ef843","system\/database\/drivers\/pdo\/subdrivers\/pdo_oci_forge.php":"8fac16bb590f7a44f0bdc16d2b1da329","system\/database\/drivers\/pdo\/subdrivers\/pdo_odbc_driver.php":"98b2169ab6cdea67dd3018f7190866f9","system\/database\/drivers\/pdo\/subdrivers\/pdo_odbc_forge.php":"5b09b1a382b182d13a46bfe1b419ab8c","system\/database\/drivers\/pdo\/subdrivers\/pdo_pgsql_driver.php":"fc28307fc55db0e662019c228f11b644","system\/database\/drivers\/pdo\/subdrivers\/pdo_pgsql_forge.php":"91b2f168e66103942c4e25f92f8ef111","system\/database\/drivers\/pdo\/subdrivers\/pdo_sqlite_driver.php":"37f54d2c0e1a71034cbdf179be35fadb","system\/database\/drivers\/pdo\/subdrivers\/pdo_sqlite_forge.php":"5f971e602d054a00ca9ea12e429c4221","system\/database\/drivers\/pdo\/subdrivers\/pdo_sqlsrv_driver.php":"485d2987c6d61e97070e287e3394419b","system\/database\/drivers\/pdo\/subdrivers\/pdo_sqlsrv_forge.php":"d1c4caadc5bd48f526687c0cd65fe39c","system\/database\/drivers\/postgre\/postgre_driver.php":"5ce2491b64e1281c23f0b4239176a426","system\/database\/drivers\/postgre\/postgre_forge.php":"22450cc7ed73e1edf4b30e3019b52f21","system\/database\/drivers\/postgre\/postgre_result.php":"2f0903320c08867ac4074d256983cd5f","system\/database\/drivers\/postgre\/postgre_utility.php":"edf9dedd18e8fcef63c47b216d0e565b","system\/database\/drivers\/sqlite\/sqlite_driver.php":"3ad2b0ebc38069b6608ecb42dbb682d2","system\/database\/drivers\/sqlite\/sqlite_forge.php":"d053690d7b8fc4f581e188dbcb409265","system\/database\/drivers\/sqlite\/sqlite_result.php":"0a047433db53a14a0edf8d0a21f0f361","system\/database\/drivers\/sqlite\/sqlite_utility.php":"8b9050df676c2a4155d1a21e0f31a6ed","system\/database\/drivers\/sqlite3\/sqlite3_driver.php":"5cbf76d7a18a99b14bfd2eb629dcca1d","system\/database\/drivers\/sqlite3\/sqlite3_forge.php":"ff96368dcb358d1185f0985b2afbf771","system\/database\/drivers\/sqlite3\/sqlite3_result.php":"e05522b9c8f49bbeee77b2acc03bb0d2","system\/database\/drivers\/sqlite3\/sqlite3_utility.php":"93d847ad8c07c6ff055df3511557fd10","system\/database\/drivers\/sqlsrv\/sqlsrv_driver.php":"2ab2109a1db8a76e35a3a24b4162d7ee","system\/database\/drivers\/sqlsrv\/sqlsrv_forge.php":"171b1aa1e251cf1607b812843ccfec4f","system\/database\/drivers\/sqlsrv\/sqlsrv_result.php":"e36badb67fc83c87a31ae16c09624e57","system\/database\/drivers\/sqlsrv\/sqlsrv_utility.php":"3ff561f6d3e8bb371a3cf8ae308a0b30","system\/helpers\/array_helper.php":"f4b43eaee849e12de674534c13355ea8","system\/helpers\/captcha_helper.php":"bded29004d2a90e91fb92fb9a6f6238b","system\/helpers\/cookie_helper.php":"2847ac97c42a879f3c31a004bd58b324","system\/helpers\/date_helper.php":"fbb0dae65688eac2928da4714f654005","system\/helpers\/directory_helper.php":"60dfc0447f559907671c42ebe9c7295b","system\/helpers\/download_helper.php":"4d8678fff156105f2f79856275b4840d","system\/helpers\/email_helper.php":"6d28f4becf2ce3c54a220d78d3e99e9a","system\/helpers\/file_helper.php":"51aab8ff88c2c0bf116328e34d24d950","system\/helpers\/form_helper.php":"72111dbacd194d58f79d76703403d4f6","system\/helpers\/html_helper.php":"dbe44bfdbe0e10773dd1b340fa286c95","system\/helpers\/inflector_helper.php":"0515495dd5c7b4c5339250b682a728c6","system\/helpers\/language_helper.php":"4253bafdc215687d8a157142fb62d3e8","system\/helpers\/number_helper.php":"314834515d436b59fb95fcde8929ed76","system\/helpers\/path_helper.php":"defd4bf57bbea181fe16c0d92065d7ec","system\/helpers\/security_helper.php":"3ace3f3167c9761660e5ee86977f0dcf","system\/helpers\/smiley_helper.php":"3c1de1a9894c0b577877a9d81590d3bb","system\/helpers\/string_helper.php":"10a171a72e7430301c935aa470c78e9f","system\/helpers\/text_helper.php":"9781418f3c7f6af15a12ea07f8ea0d0a","system\/helpers\/typography_helper.php":"0acb262a3926c0ae5795efd6cf657701","system\/helpers\/url_helper.php":"5850436820a8e7b771024604d4216fdd","system\/helpers\/xml_helper.php":"214207bbe67b61b4604802240a7aa2cb","system\/language\/english\/calendar_lang.php":"649cec58cb9166a55b4de5b969eac36d","system\/language\/english\/date_lang.php":"0a7777bce89e1af36d4179375546c74d","system\/language\/english\/db_lang.php":"ec98dceff652f65eaa30f5b23d346889","system\/language\/english\/email_lang.php":"d1a05ea4d2f4284251a4966f9509121e","system\/language\/english\/form_validation_lang.php":"c973c8c7ff9911fd1b82e4d62803d75a","system\/language\/english\/ftp_lang.php":"cf169b69ce3368bb338d85718881c8de","system\/language\/english\/imglib_lang.php":"4e3c4c538ce413e48f1f3099a0d1aad0","system\/language\/english\/migration_lang.php":"5a2f094360c78fe38e37ca125cad91a1","system\/language\/english\/number_lang.php":"be58db84f7f0a8db069d899806f3bab7","system\/language\/english\/pagination_lang.php":"66a7350d84386ee34fdd4c40e5f3eda7","system\/language\/english\/profiler_lang.php":"0c186b2dc2552f00b7a110ecf3f9491c","system\/language\/english\/unit_test_lang.php":"4205d53f539088850a23ea4d43925bbc","system\/language\/english\/upload_lang.php":"ef564c3a7bbb74818829d5dfccc0775f","system\/libraries\/Cache\/Cache.php":"2ab03ed8bc5f0ca59a5aec71f6178f53","system\/libraries\/Cache\/drivers\/Cache_apc.php":"b684f5b3f71bc9de6904d3efea04f716","system\/libraries\/Cache\/drivers\/Cache_dummy.php":"5b8788954e19933e4a82751ca10b02f9","system\/libraries\/Cache\/drivers\/Cache_file.php":"9bde024b52de26f7105734104669d80f","system\/libraries\/Cache\/drivers\/Cache_memcached.php":"70ad96ad7d6a26d3c66df703ab8ec0cf","system\/libraries\/Cache\/drivers\/Cache_redis.php":"5fbba20fa0dc652d1cbd026f5c950f74","system\/libraries\/Cache\/drivers\/Cache_wincache.php":"50e322a6e1950e29e500625fd4bda0d9","system\/libraries\/Calendar.php":"ec8ccd958bcb6bfec0885bf879da7ec0","system\/libraries\/Cart.php":"9cb445beb3c7f7f94a87fb0e574073a2","system\/libraries\/Driver.php":"d0d00e465ffd7d67f5d7dd01e46dfd01","system\/libraries\/Email.php":"75e580c8fbca3fc3f498eb6595732999","system\/libraries\/Encrypt.php":"233e1a17f8a9253905e4e7654deabb97","system\/libraries\/Encryption.php":"d8e2c03c724485a113d4ad58291605ff","system\/libraries\/Form_validation.php":"4859018a4ee4f40f4b67d1166e5236d4","system\/libraries\/Ftp.php":"fb2eb101ae7d339e463211e564bac140","system\/libraries\/Image_lib.php":"17a3867961abbe580e2b4bd9c07c0e93","system\/libraries\/Javascript.php":"18d2311ed6f1de263f207e62e3d764cf","system\/libraries\/Javascript\/Jquery.php":"80096a7757be326943ccd2bd7ad7b8ef","system\/libraries\/Migration.php":"97c90f655218e6f9dc95e569649a7f28","system\/libraries\/Pagination.php":"2f21c669961ce0d25221e6e59fc902b2","system\/libraries\/Parser.php":"2ad508b96c8af8068f782bfe960d1470","system\/libraries\/Profiler.php":"4bb3d3080feec95b8fd4c87846137ef9","system\/libraries\/Session\/CI_Session_driver_interface.php":"ee29fc20d1757321b9b79797bc0f0ce4","system\/libraries\/Session\/OldSessionWrapper.php":"dfd644d116a776cc51fab730e3d84eca","system\/libraries\/Session\/PHP8SessionWrapper.php":"a953d1e7b6e2fcddf1a4ff51df5cc9b4","system\/libraries\/Session\/Session.php":"9c0be91fc2e2b1a823fe4c9eaa78e513","system\/libraries\/Session\/SessionHandlerInterface.php":"35ff7029c60fa9ed5a918a37a4581d4e","system\/libraries\/Session\/SessionUpdateTimestampHandlerInterface.php":"522378dd1fd7dda9080cc1a73f98b88f","system\/libraries\/Session\/Session_driver.php":"592f1d6061d3d5a67ceb54185e25417a","system\/libraries\/Session\/drivers\/Session_database_driver.php":"5c1e9cd75907bc47c11be09edf05cf02","system\/libraries\/Session\/drivers\/Session_files_driver.php":"725b8984254033d43c29bdecb5203a58","system\/libraries\/Session\/drivers\/Session_memcached_driver.php":"5d9584649c625fef5acf0dd77740bc00","system\/libraries\/Session\/drivers\/Session_redis_driver.php":"e58e8edf95dcc4269ed9d0d605955da0","system\/libraries\/Table.php":"2b00975245081ce1a6ca91f55d7bc230","system\/libraries\/Trackback.php":"caf40aefa9499fcf19530bc0514cfbe0","system\/libraries\/Typography.php":"7dc41bffbb1a2d2ba58ef7ce3e9ab447","system\/libraries\/Unit_test.php":"5edb82609c7bf9567ba4f5bdf41ab173","system\/libraries\/Upload.php":"0fb9151e8dbec6d246973b4d85993c38","system\/libraries\/User_agent.php":"eca2298fef5a082b3b434f2640438cf5","system\/libraries\/Xmlrpc.php":"cc86070fa9b617a5b08496e16bc21a20","system\/libraries\/Xmlrpcs.php":"98a5ed40ed4501f88e0380d96764dedb","system\/libraries\/Zip.php":"04ddbcbe1c9004f6dd92adc62a3d4937","vendor\/autoload.php":"f84b98c11f0761a4b44d8d138eaebcfa","vendor\/composer\/ClassLoader.php":"d9b44b93381fe8eaa478ea88b59c70f7","vendor\/composer\/InstalledVersions.php":"af9b50d09c898197f0938a894568ff7a","vendor\/composer\/autoload_classmap.php":"0d62d1ce217301b9f1ef4d123272c82b","vendor\/composer\/autoload_files.php":"f3684bc9898a513888dbe53ee88d2d19","vendor\/composer\/autoload_namespaces.php":"dcde5d0ec43444873b5c7da889da161a","vendor\/composer\/autoload_psr4.php":"4272ac84e5a503bd63326eb706f3c5a0","vendor\/composer\/autoload_real.php":"1ff2370b31757df52f54546586573299","vendor\/composer\/autoload_static.php":"44a0bf14f99cdc38252743c8c6dba3f7","vendor\/composer\/installed.php":"6e89c5b191d511d6461ae8fe269c6e20","vendor\/composer\/platform_check.php":"64be3cc49c2cbe182fab81b0cdd8681a","vendor\/doctrine\/instantiator\/src\/Doctrine\/Instantiator\/Exception\/ExceptionInterface.php":"2981a22bb9eae534f81619ee6bf26626","vendor\/doctrine\/instantiator\/src\/Doctrine\/Instantiator\/Exception\/InvalidArgumentException.php":"07983208e009e72ffb31a296d32fce1d","vendor\/doctrine\/instantiator\/src\/Doctrine\/Instantiator\/Exception\/UnexpectedValueException.php":"581e0fe1fe6ee934a7441eda37fd616f","vendor\/doctrine\/instantiator\/src\/Doctrine\/Instantiator\/Instantiator.php":"ef8684b7430e03788f85756a39856e91","vendor\/doctrine\/instantiator\/src\/Doctrine\/Instantiator\/InstantiatorInterface.php":"c3fd7ec7ad945af9e6f4e4d3c71738f2","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/DotDirectory.php":"442d5460ace135660467772a0aba181d","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/Quota.php":"2d48afd241e7e54efa1c993a308519a2","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/content\/FileContent.php":"3848f4d36e4ecaec9991f2327dc68ec6","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/content\/LargeFileContent.php":"9df59bd865300710ed585893f6c9520b","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/content\/SeekableFileContent.php":"08548348d32fc15b3f9eaf16c57bc789","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/content\/StringBasedFileContent.php":"e7022ca21e64e1eae3b527303edf6be7","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStream.php":"d61c4a5965a68d09785b45eaacc75129","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamAbstractContent.php":"88ec226fc133c618531bc801a70e1549","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamBlock.php":"62ba42a4d700f92993ead5b8ed1d7397","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamContainer.php":"b6c82dcc1aa2d200c0b338f94573dfab","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamContainerIterator.php":"a37c2e6c954634becc0eaa1bddafcf99","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamContent.php":"308bb5dceefab85fcb1bd07b473a238a","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamDirectory.php":"fc09a22894438df23a87674aab0a172c","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamException.php":"f7925fbd3cce6636918724a12328b00d","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamFile.php":"13044a3c2b48a5bfb409a71532040d7a","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/vfsStreamWrapper.php":"148690102d2b12a9f94ebf215650987e","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamAbstractVisitor.php":"aa253333114685d099f23a9a5a16c020","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamPrintVisitor.php":"c840d916a5d2eac7a0c306dca9a65467","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamStructureVisitor.php":"d73ec2814b88206ad6836da5393ccbb4","vendor\/mikey179\/vfsstream\/src\/main\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamVisitor.php":"82df8b7c03fa693a54642fc445d026c7","vendor\/mikey179\/vfsstream\/src\/test\/bootstrap.php":"fd40d0fc1a6dff8b35f714b01fea3d17","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/DirectoryIterationTestCase.php":"99b1e8eff412a8c952336e3e6d10244a","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/FilenameTestCase.php":"eabe75791fa95911ab19abded9e4bc78","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/Issue104TestCase.php":"effa5cbbafb4b5ad97b23c3e27cb5c92","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/PermissionsTestCase.php":"f0d008f273890312b3fe5b86baafc7f7","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/QuotaTestCase.php":"3586702c69f4fca4de1025c5965dae47","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/UnlinkTestCase.php":"5ad9a5e778f3c3d0b34715c2b30331bb","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/content\/LargeFileContentTestCase.php":"579c6085e6de09e6b3a6db07fbde0dbc","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/content\/StringBasedFileContentTestCase.php":"e3628b2f00eb6a2151d5b42e0345bab4","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/proxy\/vfsStreamWrapperRecordingProxy.php":"ff69bf71c16beb521d2b967ec258b318","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamAbstractContentTestCase.php":"8228048468552806032913bd8537a2f6","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamBlockTestCase.php":"9881a70d895558b642faf0cc141d3e5a","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamContainerIteratorTestCase.php":"d4964ae2b3c05f5528fc2b555d3eb7c6","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamDirectoryIssue134TestCase.php":"4559ab2c9290ed5d2a586f7470e87ac9","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamDirectoryIssue18TestCase.php":"913301c1280e97197d7925cbfc826033","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamDirectoryTestCase.php":"c9f83f35fe7aa9c9d2c3a67f1887f8ba","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamExLockTestCase.php":"83a57935e19dbb5fc8e6456305344fa3","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamFileTestCase.php":"fe8a92d498314a9cd8037bacd88791c0","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamGlobTestCase.php":"ccd87074ba7163a8eb484b6be2c61a22","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamResolveIncludePathTestCase.php":"1988a14d191896ec2eeb825fed226063","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamTestCase.php":"63bb7a276d8767dcd87397226a9e3569","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamUmaskTestCase.php":"9dfe192a55e7a01f6cf20498ef3128d9","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperAlreadyRegisteredTestCase.php":"080f87120231793b0c89e73ce55f1867","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperBaseTestCase.php":"35e2975525e44e8f4105f73c09a60949","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperDirSeparatorTestCase.php":"1a2e9a9663e31d351b4b6c833460fccb","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperDirTestCase.php":"f1b431b2c9dd11b66e6628cc6be41c4a","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperFileTestCase.php":"a647295329ecc8163427adea381c9151","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperFileTimesTestCase.php":"06098343a86bc944ad155961cd0ed138","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperFlockTestCase.php":"ae7d2f6d899aff9b11e2991173c2c2db","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperLargeFileTestCase.php":"1202c39893de4ef35233b328675583d9","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperQuotaTestCase.php":"3bff2d88f6b515dadf718cd4de8c08d6","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperSetOptionTestCase.php":"091d57fbcfcab5c278f71c200359c515","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperStreamSelectTestCase.php":"2d38b55e84a6567e9a2e8c6726b52513","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperTestCase.php":"e876ebf54bee6e6ab5d65f9e2f5ca602","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperUnregisterTestCase.php":"79a3cc6d402f2960dcba3673045524dc","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamWrapperWithoutRootTestCase.php":"0c5799bbc3eba95441fc6e5190e4e664","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/vfsStreamZipTestCase.php":"4187e294680dda041c986908b4b09e2a","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamAbstractVisitorTestCase.php":"94e5b5fd3e9cc9a163ec052174910ee4","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamPrintVisitorTestCase.php":"70669b5e71739692bbfbaef34a2fe6cb","vendor\/mikey179\/vfsstream\/src\/test\/php\/org\/bovigo\/vfs\/visitor\/vfsStreamStructureVisitorTestCase.php":"b8e89ed6262473bc5ce9a57d892a4b63","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/DeepCopy.php":"34150e6b34348c7ebc3c4bf919de8700","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Exception\/CloneException.php":"f0b605f048cdd7180ada857d4afe1cd5","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Exception\/PropertyException.php":"843be1d14a13fa78894f861cc8041b4a","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/ChainableFilter.php":"26482de22fd6dfb97ecd36826a294b29","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/Doctrine\/DoctrineCollectionFilter.php":"5cd25ecdf993d5d641b6ffd683d4b2db","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/Doctrine\/DoctrineEmptyCollectionFilter.php":"234d115ef8fbc2fcc1b528baf727716f","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/Doctrine\/DoctrineProxyFilter.php":"5348c16de509a60a571c03b24e764880","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/Filter.php":"b60d6265454c244027f57f1c00f29b28","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/KeepFilter.php":"9959f932c1cb7274233ca8c347e57410","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/ReplaceFilter.php":"348e8c3f07975ed1b0c4e94b5481dbab","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Filter\/SetNullFilter.php":"285be9f7039e6cdc1d91a8411a5d1eee","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Matcher\/Doctrine\/DoctrineProxyMatcher.php":"2cc050c9aeed476b1e9440726cea578f","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Matcher\/Matcher.php":"6d1d1f02f9eab0fc5c94ded9819adede","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Matcher\/PropertyMatcher.php":"69f652c00e03727d4fd245b50fa12152","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Matcher\/PropertyNameMatcher.php":"1d570199ca8584c451760fcf917db82a","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Matcher\/PropertyTypeMatcher.php":"a27405f604ad5ad462fcf423607cfb24","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/Reflection\/ReflectionHelper.php":"ea7ddf07dc247cabf264c37004d4d3c5","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/Date\/DateIntervalFilter.php":"cb4ee099abf3e6cb9f7a456f18f6122f","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/ReplaceFilter.php":"308c49a8b08869a1ff3d9e396393cba5","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/ShallowCopyFilter.php":"fdd9986377f422278114c275dabc3c4d","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/Spl\/ArrayObjectFilter.php":"bd28a18d4c20f435ceff01d374d919b5","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/Spl\/SplDoublyLinkedList.php":"53a1c5c4b2990a03c7d78ec4c52cb323","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/Spl\/SplDoublyLinkedListFilter.php":"d657ca385793aa652ef0410e8a416be3","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeFilter\/TypeFilter.php":"8f7119459a37a362429b49814759f5df","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/TypeMatcher\/TypeMatcher.php":"941aa1b76647d183ce84cf9b79488dff","vendor\/myclabs\/deep-copy\/src\/DeepCopy\/deep_copy.php":"a87df00f768658016e9486b8836952c3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder.php":"c6b70d82427de7d7e417cd18a9eb0fbc","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/ClassConst.php":"7510c28968dd225ab8578a1d90c0945a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Class_.php":"106d2301e5804824c3492ab60e009bc0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Declaration.php":"9c306a2ead7046aa22ec3cdc1cacebef","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/EnumCase.php":"38c9926641c701b8edf4b482f086f99f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Enum_.php":"9a806093a5cba348e5cd0fb586676ea6","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/FunctionLike.php":"fdc74c08484dc89aa34e8b59106d37fe","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Function_.php":"8e06bcbb2f5c1b03429222ccfa10ee18","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Interface_.php":"8f353b2aa8920ae23db825e95f09ab32","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Method.php":"ce700fb6726ee1f410d40b9c72f3672f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Namespace_.php":"b67885d0b1e1ea7a6650ade26871eff0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Param.php":"6651183619141251037d58f2c80f805e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Property.php":"b1ce093458b1470e22911675746ae974","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/TraitUse.php":"95c16379580972aa9271d4ec456dc85c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/TraitUseAdaptation.php":"6f9c1944d59495cbb6905d9eefa055b8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Trait_.php":"d56c853540397db8d6e8022857729dd7","vendor\/nikic\/php-parser\/lib\/PhpParser\/Builder\/Use_.php":"0c044d20b30089f966561b026d99ffc4","vendor\/nikic\/php-parser\/lib\/PhpParser\/BuilderFactory.php":"7266d09167a8b99912938eb94df1b2b5","vendor\/nikic\/php-parser\/lib\/PhpParser\/BuilderHelpers.php":"a4d527df2d1f7415835801e3587a8a45","vendor\/nikic\/php-parser\/lib\/PhpParser\/Comment.php":"9622b3fa11a72c54b1f76f613c492e6a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Comment\/Doc.php":"eac58516ee35b6177d2bc2616011238f","vendor\/nikic\/php-parser\/lib\/PhpParser\/ConstExprEvaluationException.php":"954513f76dd9e9c9f3da1a157243b857","vendor\/nikic\/php-parser\/lib\/PhpParser\/ConstExprEvaluator.php":"b6f40d87e40648b4bf680e2efef5ddbf","vendor\/nikic\/php-parser\/lib\/PhpParser\/Error.php":"563392382842db52463b6bf032b7ee23","vendor\/nikic\/php-parser\/lib\/PhpParser\/ErrorHandler.php":"1e7fa0da5b054a19e759935f449801c8","vendor\/nikic\/php-parser\/lib\/PhpParser\/ErrorHandler\/Collecting.php":"4ae754f782fcac517aac26f05cee67e5","vendor\/nikic\/php-parser\/lib\/PhpParser\/ErrorHandler\/Throwing.php":"d4125f18556e452ad3fcd1232693ab32","vendor\/nikic\/php-parser\/lib\/PhpParser\/Internal\/DiffElem.php":"5f52fbf655c6128d14da016dbacc5cf4","vendor\/nikic\/php-parser\/lib\/PhpParser\/Internal\/Differ.php":"9d5c0f79b53cd16f16d94f71e517942b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Internal\/PrintableNewAnonClassNode.php":"27e9c5616811a04b4c64672961bf7413","vendor\/nikic\/php-parser\/lib\/PhpParser\/Internal\/TokenPolyfill.php":"127773b12ab178448332cfe0f71caec3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Internal\/TokenStream.php":"6e1f7eb17753dfdafa968db024409f09","vendor\/nikic\/php-parser\/lib\/PhpParser\/JsonDecoder.php":"54009d61a636a43cacd6c38909ba8977","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer.php":"2cafba114ed4442f0949ef476b7860b0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/Emulative.php":"36bd9b3f1bb7654a83f5a5b51247c83d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/AttributeEmulator.php":"fa35b28413d44f387b3c38fd673f41e2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/EnumTokenEmulator.php":"666b1a9ac2bb15bb45c2a79d27c9f71b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/ExplicitOctalEmulator.php":"e918fe1f6c012c3e8f7daa2ab7d2759f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/KeywordEmulator.php":"e5fccadf020721f567782db1deb17181","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/MatchTokenEmulator.php":"b6e00ea98219cb0564bcc28c6350c7fb","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/NullsafeTokenEmulator.php":"b4faa81593e9fd50de5d978f0cbe7548","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/ReadonlyFunctionTokenEmulator.php":"d2de48e3c4b04fc6dfa1b8992ef137b5","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/ReadonlyTokenEmulator.php":"d77db7bc6a8ea22ee2369bc30f50dc0f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/ReverseEmulator.php":"ae95b4b165568332a3284cda4a105f07","vendor\/nikic\/php-parser\/lib\/PhpParser\/Lexer\/TokenEmulator\/TokenEmulator.php":"505aa1c71148c2261a4c245efa83b247","vendor\/nikic\/php-parser\/lib\/PhpParser\/Modifiers.php":"0e26032ab2fa09cc86f1f5f4423967ba","vendor\/nikic\/php-parser\/lib\/PhpParser\/NameContext.php":"efd7b971fea6980fe7e287a161d7474d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node.php":"10410526bc80d028a6c3c07a8d38e2a8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Arg.php":"37a271d8f260f5cc04dc20a3d75be3c3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/ArrayItem.php":"76833533d77d9c61f473b0c96e3a59e2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Attribute.php":"828088aa4c360bd17945e7816222c6c6","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/AttributeGroup.php":"8d80fb9be77b0b8b40e94d134e5bd8fe","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/ClosureUse.php":"4caf219519dd4fca7dcf0a50a46b55b9","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/ComplexType.php":"ae92991dff550a3c1b934fd30eeaaeeb","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Const_.php":"f8abd491b33784e769188176feaa9b64","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/DeclareItem.php":"d66f22189bc188791f6757f3b71334df","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr.php":"6cfad00a8dc2c545feb95112f4864f61","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ArrayDimFetch.php":"15f07be136936e7f602af29d9de57244","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ArrayItem.php":"4b898ba099487cecfede57008c8d7531","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Array_.php":"2c4c1a677a696ee3c63d9d8fd3fec22b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ArrowFunction.php":"14482855a540e15db7c54db856b48e8a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Assign.php":"f2973e3bfdd9d5f33309126a93333318","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp.php":"b401b9ca723d9628371c84168448bde4","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/BitwiseAnd.php":"21ec31cc554e113f3464e04697cf6027","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/BitwiseOr.php":"e22a193c3e7c8c30238221a86eb1b1f3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/BitwiseXor.php":"b0b9d31bc690687930bc633e71c05f3e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Coalesce.php":"71e432ba4477a4bbfedd4904430681f8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Concat.php":"3f6c6f6be4c2a88e27fc23d564e1aa04","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Div.php":"1b63127dd95ca8d563d086df29b327d4","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Minus.php":"e790f6a2dca966a5c7b9e69a89fbb7b0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Mod.php":"6d1dbb1d955d939ae5df63773c16146f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Mul.php":"2f7cc20630aa9391b27d214d80c21209","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Plus.php":"f4d6ed6ee7731e04cd39863106313356","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/Pow.php":"4c578906cd8ee8f245a2a9669dc352f2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/ShiftLeft.php":"c5d7d7701e4d81d63fcf60b6fcd006ff","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignOp\/ShiftRight.php":"2c1b4b84ef1b1fb32f8516a0009478d1","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/AssignRef.php":"a5943b67c4357d74282962e656ea4688","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp.php":"2d3d6a90de6a3fb25b124de593428272","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/BitwiseAnd.php":"7044e58fc0af541c6038059f15496216","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/BitwiseOr.php":"3eb4aa9ef6195faba2efbd8d9963d33a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/BitwiseXor.php":"54480cb967cb048ea2ad3439b703237b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/BooleanAnd.php":"8b6c0797ac32d04bc92766e1ded34d05","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/BooleanOr.php":"d33591a2c48ea21c0b1e65952817c8ec","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Coalesce.php":"1c36706c20ba7c472c6089aa6ea37801","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Concat.php":"0338e4cb49d9823cf0944c4075286de2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Div.php":"364b8388001626dcee1145d9c01ece7a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Equal.php":"ab79283503b264adbc728a9d81d1369d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Greater.php":"4e880ad331cde09386228958a12776af","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/GreaterOrEqual.php":"0682080159e3c29446ac191fe34567d8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Identical.php":"bef0425f638e038a1e92c50f2ca6eeca","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/LogicalAnd.php":"a58cc842f1f2c44915ce48c1af4c018a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/LogicalOr.php":"5aa69a82aea954e5b5c18aae9455022c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/LogicalXor.php":"c82ba3535ecc67dc9e591230b4721edd","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Minus.php":"05576821c49383f1bed61a7568eab0a8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Mod.php":"22fad6d53731232d6631b29d01befa78","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Mul.php":"524c5c5623030cb414676141fab2b4b6","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/NotEqual.php":"3defe542a9cf6dba4452c2ac4f66b939","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/NotIdentical.php":"fa0fd830171bd9d189a62498a83af8ad","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Plus.php":"4fd7d6caa4a8daac48c7cf5683939233","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Pow.php":"990db2a774831ec5ab3b3f1f4c66a8fa","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/ShiftLeft.php":"73ccd885be73e59aa6d029c998620d02","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/ShiftRight.php":"a12a1ee72bf0419537954016785d0293","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Smaller.php":"2884c4cb4dc37a9bd584fc6f43236ec9","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/SmallerOrEqual.php":"09bfa1c660e685696d8a040e1b51f9b0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BinaryOp\/Spaceship.php":"ca060eec3c9556d64fa26cf8eec685f1","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BitwiseNot.php":"ef75421dd4590a4f9ec26a5c525749c9","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/BooleanNot.php":"aef0d5fce4cf672b38f2810688cc5267","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/CallLike.php":"6ba0da232d2b51636696dfab02300080","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast.php":"d3e222fd20f9f52c3c6d47a20dcbe9a3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Array_.php":"809a32eec247038535e2fff14f566f70","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Bool_.php":"d4a91f5baa59780befcb22fa8c563a1d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Double.php":"567bcb56ba15bdbbce69d2f66f878fef","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Int_.php":"0c2cde059671a70b81c520e9e6afc784","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Object_.php":"5619bcab1d79142ec9d030797c7c2b53","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/String_.php":"bb2cd743da6e98c49b48b9232c24c10a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Cast\/Unset_.php":"264bab84a5333638f66fe63cd4d2648e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ClassConstFetch.php":"f3f9ffffa19b2f958f5a56494cb1121c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Clone_.php":"6581eac9a27a31bffd9787063aff8c4f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Closure.php":"e68c5f5a0841fc562365e32bc2771639","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ClosureUse.php":"4658c007d9fd977c8726a64a772dbc29","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ConstFetch.php":"117fa04e241499f67427ad5d5b456b58","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Empty_.php":"828a4d2fcec20a2e33d9182dd071acc0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Error.php":"93ce396ae2ff66a7cddeaa40d56aed6d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ErrorSuppress.php":"2e8eba5d3770b183736ade8cf5418dd2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Eval_.php":"bc267d496fffcce2286610540c44eedd","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Exit_.php":"0828f6610fdf7fdba2b2246edb79b1e1","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/FuncCall.php":"fc330f84b77d07d19929d8807aca63f0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Include_.php":"6d41477077a6034904d5fe762361e84e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Instanceof_.php":"fe0c228fe0ed3579e2391df84d001f2d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Isset_.php":"9217fc26ff73b3fa382a822176a461e2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/List_.php":"3eb91a2e676f4b50890de79b482ae101","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Match_.php":"d2b0d3bc02c632422e2775015a5b9bb9","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/MethodCall.php":"abdf1c806bf0ed6f905b27313648d39b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/New_.php":"4ebbc572c20ed4a9dd88b6c0aa02434f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/NullsafeMethodCall.php":"b3d508442e37477e58395faf95165c83","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/NullsafePropertyFetch.php":"76a853f18a5b5ec3702dddc7ccdadc6b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/PostDec.php":"60df0fbbf4fb19ea61514e8cb413ddc2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/PostInc.php":"eaabfa5ccd55020d8cafc8dbb245ad0f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/PreDec.php":"a783f74a5ed57138e83646436da2d525","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/PreInc.php":"c068510131a98392eed838756d079dce","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Print_.php":"3ddf822612274da555b161b922abfccf","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/PropertyFetch.php":"6df4b1623456fe06941335f6dec6da40","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/ShellExec.php":"cb8cc1079834065429aaf73a2c44014d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/StaticCall.php":"9e244d35a1084968a950b28e3f2452b0","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/StaticPropertyFetch.php":"c41492f299c87627fc71da327e2c8753","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Ternary.php":"9fafa6e6dbae68c6618f02467ffcb5b4","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Throw_.php":"3f4bbff46c0d84c3252a2d95a5bed793","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/UnaryMinus.php":"9525fb13094377e9b64c4b47693e5fe3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/UnaryPlus.php":"bd7128eddb803cf27003df1a28e9d8ff","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Variable.php":"672c55e91b7187ece3ead6e9021a39e7","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/YieldFrom.php":"9932e66f272974c9f2a6b0c5a21a604e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Expr\/Yield_.php":"cd5bf821cd1f8fb4688eb706d90f7c11","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/FunctionLike.php":"4fc5e1ebb2d4163a907eebd5ea4668aa","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Identifier.php":"15ca678b7ae99a95ff29076e348f81ac","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/InterpolatedStringPart.php":"5cefccad0ef06afae30c58be4deedddd","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/IntersectionType.php":"0adfb8fca5e407883288ca545438e9ca","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/MatchArm.php":"1814520097db9461e43dd546524111a1","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Name.php":"659dfdddd149ba28da1152268f689d6b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Name\/FullyQualified.php":"6ffafc4aa9acaa5f74955be14cde3193","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Name\/Relative.php":"ee7d7a62992952861cde645f95d8843b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/NullableType.php":"ddacab1589186acec7c575fcb250690a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Param.php":"ab40b4848a7553cade17590f45a11321","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/PropertyItem.php":"8e8e7410cf21ad663caca3a492cd0a24","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar.php":"514fe6f16e73a21309058bf34b92295c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/DNumber.php":"df6c2dade4a3d1a38969dec80014b6fe","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/Encapsed.php":"bfa31786e68b49a984493c0ec3c0f908","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/EncapsedStringPart.php":"564a0fbabf18690f88ff1f128cef1043","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/Float_.php":"6d86d00dc3bd1f04f23a0382ab3e847a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/Int_.php":"fe6136df2c75c43c2fcfd65f2e3bbdca","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/InterpolatedString.php":"b0648d5fcc87c76b54eae83313fcade7","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/LNumber.php":"034a5cfb2fd4c5e15422722f68e9a781","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst.php":"cd4decc8c2ade990360da8153065e4aa","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Class_.php":"51cc5f9d8235819f9c6f5be1e5944a9f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Dir.php":"3dba2f7fc34a665b3ee47fb1a096c7e6","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/File.php":"d099ed919ac99d314a79af4a6b1df75a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Function_.php":"b1e5647847112c4137358fb753cabb8f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Line.php":"5ecf5a8a5b99e7a6c5d9a362b972e4e3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Method.php":"befb9e59d3597fca642590f8f69d1859","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Namespace_.php":"bde852aa4d52f46f2c0dd033f1e0975d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/MagicConst\/Trait_.php":"c0a44b7366f23fafdceb12f756d29bed","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Scalar\/String_.php":"c90540f308c4592f4b80dd5caee184d6","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/StaticVar.php":"f6a71b733622dad367b92e3d5a18283b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt.php":"967645778af813e4707e61d50f3e9ba5","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Block.php":"1deddff1baeaa80a58947508161a96b7","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Break_.php":"ae9933fd1e68a4f1d23b2334148d2990","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Case_.php":"a239eacb2d9638697a954a6c72dffa8e","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Catch_.php":"ed013ebae0b80cc0a8b15cb3c094b6f2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/ClassConst.php":"34b51399d645afbd87c9c413a5c89d46","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/ClassLike.php":"7fc96c1088d37e586eaed3d2aeff6eac","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/ClassMethod.php":"9220750ba5a4e6a1977f5aa02cf73920","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Class_.php":"c7b0814a032e78a359fd829aa13246d8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Const_.php":"91e8a7dda1797830cc38b6c4a3826f09","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Continue_.php":"31601b13e858afef3df3b375226e8e3c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/DeclareDeclare.php":"d3de1fa1531406e0b718a0b210b7201b","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Declare_.php":"841c1b78adbc42ab6f966cd2b83dde25","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Do_.php":"24e0066014f259e288f1d853945ddc2f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Echo_.php":"ef6cb527f67eda3974dc6273da87c629","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/ElseIf_.php":"aaaef642df45824fe24800831c12acc2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Else_.php":"43b150b8262eb226d240ac33782e9723","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/EnumCase.php":"42587be5fd2db2f7183a305c21f1de57","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Enum_.php":"41a818af247bdc7e5d731fec90769bcb","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Expression.php":"b58ce14ab556e9dbf2639bf24b450a94","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Finally_.php":"5a9e2a4e220c555272bd3758e598e72a","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/For_.php":"faf5b9e65a7639c18f9c21d155f10f90","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Foreach_.php":"5c147af492c6661351b5074dade003f2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Function_.php":"cf705ce24391ba6d90ab63752dc1881d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Global_.php":"b7a8e242c6997490e9b49adcb0253040","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Goto_.php":"b9c1c7b1294037d6110bd56a221e7660","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/GroupUse.php":"f0f8c160aa8a9d192da623a7ccff7b8f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/HaltCompiler.php":"185067fc82c4f65b407713bc52feb0d9","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/If_.php":"74521d8f293236dfccd6aa5a8926d329","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/InlineHTML.php":"f9ef828fb5e69b8665bb023f1a9a8b94","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Interface_.php":"67171e6a61cdd61f7bc2835442aa8136","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Label.php":"d007b79dae4e335f10a209875e526670","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Namespace_.php":"077382ab3cf830fff0d5143793dfe6b8","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Nop.php":"bac6cfdbe751f5038eddc6bc837fd570","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Property.php":"e56a13640e7ffeed94d7cdec1a56b2db","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/PropertyProperty.php":"cfdab4a020dd075dd037ca42585bb1d2","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Return_.php":"4704776ae09ab68f3cf8c2a247f1184d","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/StaticVar.php":"5134e08bb50a9b8b1081f399104e4b99","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Static_.php":"16c13ef62e7c5f5bbcc6f5dab87e5be1","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Switch_.php":"726717b96c7171d43793a90da8223ddb","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/TraitUse.php":"a38acf994e1c06a0d145740bf57e7c4f","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/TraitUseAdaptation.php":"0a61233e136d2b8b7c036ad4ffef85cd","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/TraitUseAdaptation\/Alias.php":"7ef4da981d4c326dad5cf69e4c4358ab","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/TraitUseAdaptation\/Precedence.php":"e01b26db20086c7dffe7491ad28e4fe5","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Trait_.php":"5a9bd54701436d3778b8919a760a377c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/TryCatch.php":"4c616b70cb639b733005bafbc189d5c3","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Unset_.php":"06519ee118a335ff37b11d67af9ce504","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/UseUse.php":"3c154b70cd215a5132a9bcc8037df8cf","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/Use_.php":"f12f54d8ee9be8ba5ba2b0087ba754db","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/Stmt\/While_.php":"d716526d7cfabba8e6511dd21bb5fb62","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/UnionType.php":"08bb5ee013b1f61865d2280918ddcb9c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/UseItem.php":"ea171c829ff9f87353ff5d5a86cf8781","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/VarLikeIdentifier.php":"7d025f71931bb61ffbaa2aa61a0ec8f7","vendor\/nikic\/php-parser\/lib\/PhpParser\/Node\/VariadicPlaceholder.php":"3dffedec2f93cfe42b7656aecc6eeec1","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeAbstract.php":"d5f5b0bb5264a47a71abc8fee288ecee","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeDumper.php":"0163f3ff1125310aea03658177b0d953","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeFinder.php":"8a419229aab6c7f0d57cee9a2dd09ddf","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeTraverser.php":"8cd83925fb9ea0e251439f212f165716","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeTraverserInterface.php":"c7092fd4eb9c35efd6c466af226cd252","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor.php":"e3d912b5cb36fde79e4894ccf06e3fa8","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/CloningVisitor.php":"30d3bd012421d8dc05082b7a9f5b3d24","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/CommentAnnotatingVisitor.php":"56e0b572201455dd455ac866ab5e08a7","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/FindingVisitor.php":"1cddea2c24cf8ce68a267241627bed73","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/FirstFindingVisitor.php":"f4ec830b68abdfeff46c88b1d17897d5","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/NameResolver.php":"0fb0bbd7b73e7aab1ec83312ee3a651d","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/NodeConnectingVisitor.php":"4ff1864b0faf7721e9267d9047518746","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitor\/ParentConnectingVisitor.php":"3f385f0154ef4846b0674b3859dc3789","vendor\/nikic\/php-parser\/lib\/PhpParser\/NodeVisitorAbstract.php":"108d84b8160908265c90dfa33fb99cdc","vendor\/nikic\/php-parser\/lib\/PhpParser\/Parser.php":"b8d521579efa32a3bfa05c06eb085a90","vendor\/nikic\/php-parser\/lib\/PhpParser\/Parser\/Php7.php":"a41c00b81549f6e8eb2f32e3fdc4ae4c","vendor\/nikic\/php-parser\/lib\/PhpParser\/Parser\/Php8.php":"4596975b077b61496125ba5674bb582f","vendor\/nikic\/php-parser\/lib\/PhpParser\/ParserAbstract.php":"0d57cdd95fed2c90525b2d995ca6aee4","vendor\/nikic\/php-parser\/lib\/PhpParser\/ParserFactory.php":"7ac2c0355819b71fe90b48bbb8a1aee4","vendor\/nikic\/php-parser\/lib\/PhpParser\/PhpVersion.php":"b00794d5d3187e40a1c211cca82a4ba1","vendor\/nikic\/php-parser\/lib\/PhpParser\/PrettyPrinter.php":"db5049a32517642ad97831dfe10de6a0","vendor\/nikic\/php-parser\/lib\/PhpParser\/PrettyPrinter\/Standard.php":"a9846635bb6642a80a4f6e43d0be068b","vendor\/nikic\/php-parser\/lib\/PhpParser\/PrettyPrinterAbstract.php":"3662cb062f77f644d4562a268f80d076","vendor\/nikic\/php-parser\/lib\/PhpParser\/Token.php":"eb022e7403365a609dad853829917b94","vendor\/nikic\/php-parser\/lib\/PhpParser\/compatibility_tokens.php":"30c04cc87041bdaa7de84d5a08c52ab7","vendor\/phar-io\/manifest\/src\/ManifestDocumentMapper.php":"51398d88b8d07c012e02a8e72beb0c52","vendor\/phar-io\/manifest\/src\/ManifestLoader.php":"0f1b5c668b2f8e0b9d31fd8cd2da9dfc","vendor\/phar-io\/manifest\/src\/ManifestSerializer.php":"0b90643e3595429501461d3f25d44664","vendor\/phar-io\/manifest\/src\/exceptions\/ElementCollectionException.php":"0c06763a4ad39cbbe339ce6480ff3572","vendor\/phar-io\/manifest\/src\/exceptions\/Exception.php":"e963c7e5874e777eca1d7dc1635d91e5","vendor\/phar-io\/manifest\/src\/exceptions\/InvalidApplicationNameException.php":"fe409b8711f0d9f9e74951ad4e8f6c22","vendor\/phar-io\/manifest\/src\/exceptions\/InvalidEmailException.php":"fa1f4dfc7a7e9c80754a300bb7b93a3b","vendor\/phar-io\/manifest\/src\/exceptions\/InvalidUrlException.php":"cdd6c2e6ba11b170ddcdb6b292ed9494","vendor\/phar-io\/manifest\/src\/exceptions\/ManifestDocumentException.php":"8bb140b93190be33a3bf3b556d2df7d8","vendor\/phar-io\/manifest\/src\/exceptions\/ManifestDocumentLoadingException.php":"3724c003b16251e15b6ea172e005ba76","vendor\/phar-io\/manifest\/src\/exceptions\/ManifestDocumentMapperException.php":"a79ea0fa88d9580e80159b6ecead4f97","vendor\/phar-io\/manifest\/src\/exceptions\/ManifestElementException.php":"3ce8ce4cce98f9d6c8b01270d3902a4a","vendor\/phar-io\/manifest\/src\/exceptions\/ManifestLoaderException.php":"dca296afb6a199fbc7746c90843b8ada","vendor\/phar-io\/manifest\/src\/exceptions\/NoEmailAddressException.php":"6e8e62d5937cddfaf3559965196ea48a","vendor\/phar-io\/manifest\/src\/values\/Application.php":"23a45220f012a3e0772d561a82f75c64","vendor\/phar-io\/manifest\/src\/values\/ApplicationName.php":"70a4f8de569e78f852eac1579b70b45c","vendor\/phar-io\/manifest\/src\/values\/Author.php":"c021474b2dd56ff4abf9aae4f05e1608","vendor\/phar-io\/manifest\/src\/values\/AuthorCollection.php":"7ce38e0ade3d7cb5cb08b72863927125","vendor\/phar-io\/manifest\/src\/values\/AuthorCollectionIterator.php":"c01697efe00d38043e3d7f05fbad32fe","vendor\/phar-io\/manifest\/src\/values\/BundledComponent.php":"e17c344961cb95bd4138ee9ae772cdbb","vendor\/phar-io\/manifest\/src\/values\/BundledComponentCollection.php":"2d07fca9211957f5865fec269d15f8c2","vendor\/phar-io\/manifest\/src\/values\/BundledComponentCollectionIterator.php":"8ff03545a48468ea13cefb59c35e4b23","vendor\/phar-io\/manifest\/src\/values\/CopyrightInformation.php":"e7374f4256a15249e2084e0c6eaef1a7","vendor\/phar-io\/manifest\/src\/values\/Email.php":"57c49ec89b6df1e59a687d5dd37afebf","vendor\/phar-io\/manifest\/src\/values\/Extension.php":"a636fe76d79ccbaaef34491de618d87d","vendor\/phar-io\/manifest\/src\/values\/Library.php":"e08c724805f03550786e430bcc014e15","vendor\/phar-io\/manifest\/src\/values\/License.php":"133e48bf8bf3700bf2560756f84c0efc","vendor\/phar-io\/manifest\/src\/values\/Manifest.php":"b779e5c3910e9385b547a99cd5911d9e","vendor\/phar-io\/manifest\/src\/values\/PhpExtensionRequirement.php":"33e94339987ec45e5c8ac1a34e03f039","vendor\/phar-io\/manifest\/src\/values\/PhpVersionRequirement.php":"d3798ae2646b59c22c7e069a4ef1b6a1","vendor\/phar-io\/manifest\/src\/values\/Requirement.php":"d5c9de244b5fe070e10ac29db44df664","vendor\/phar-io\/manifest\/src\/values\/RequirementCollection.php":"5170bb94b2a4914cd3ace9f25ac499ce","vendor\/phar-io\/manifest\/src\/values\/RequirementCollectionIterator.php":"0114e2d1d9f4baf2174ccaa0eff1026c","vendor\/phar-io\/manifest\/src\/values\/Type.php":"8b5b6b17662fab614e73484dbc8d439b","vendor\/phar-io\/manifest\/src\/values\/Url.php":"1cb3d9e88251f6f592f49ba8a5aede2b","vendor\/phar-io\/manifest\/src\/xml\/AuthorElement.php":"cab16c78a66da7515c02e4ba6cb53ca6","vendor\/phar-io\/manifest\/src\/xml\/AuthorElementCollection.php":"81e165185ad820b82b24534090e24058","vendor\/phar-io\/manifest\/src\/xml\/BundlesElement.php":"baf35f775a4a91f9523579f09798af12","vendor\/phar-io\/manifest\/src\/xml\/ComponentElement.php":"f9d15fee50d996a08452232ca00705fd","vendor\/phar-io\/manifest\/src\/xml\/ComponentElementCollection.php":"5ad41bb657f19df855280d6081761e08","vendor\/phar-io\/manifest\/src\/xml\/ContainsElement.php":"be331da402c53d7703b95bf878073062","vendor\/phar-io\/manifest\/src\/xml\/CopyrightElement.php":"c6d216c472e67252df8af572de1d7682","vendor\/phar-io\/manifest\/src\/xml\/ElementCollection.php":"4530281ed033e515e93f4878d4d403f3","vendor\/phar-io\/manifest\/src\/xml\/ExtElement.php":"5ebbc6cf90744b30c7c48eec367a5613","vendor\/phar-io\/manifest\/src\/xml\/ExtElementCollection.php":"dc9b46c6a93de65fd813b1af6119743d","vendor\/phar-io\/manifest\/src\/xml\/ExtensionElement.php":"cee55d86dfada7240a841f00cc320bfd","vendor\/phar-io\/manifest\/src\/xml\/LicenseElement.php":"b47247f970f2ec73352a09a58769fdf9","vendor\/phar-io\/manifest\/src\/xml\/ManifestDocument.php":"fbaff30b3060f82db8bffd1a0896729f","vendor\/phar-io\/manifest\/src\/xml\/ManifestElement.php":"43189b78d09f4102de06d1107831cb0d","vendor\/phar-io\/manifest\/src\/xml\/PhpElement.php":"8ab9e37d7dd3974a1fdd67995ee6fa4d","vendor\/phar-io\/manifest\/src\/xml\/RequiresElement.php":"415295a11c3ba414e84a08f63776b305","vendor\/phar-io\/manifest\/tools\/php-cs-fixer.d\/PhpdocSingleLineVarFixer.php":"3f8ff8cf40c8f47d921a3b4091302a75","vendor\/phar-io\/version\/src\/BuildMetaData.php":"96ecabb4642666b664b3216d3dd85725","vendor\/phar-io\/version\/src\/PreReleaseSuffix.php":"dad645f9828e074722381659589c8410","vendor\/phar-io\/version\/src\/Version.php":"05a3817b52f7738112afb4c7683caaf3","vendor\/phar-io\/version\/src\/VersionConstraintParser.php":"ac0a1a3342abe5137055a1649045a59f","vendor\/phar-io\/version\/src\/VersionConstraintValue.php":"f4df51a3c58aa73019a46319f44ab033","vendor\/phar-io\/version\/src\/VersionNumber.php":"112bf819a8cdab58810b134033a3e7f0","vendor\/phar-io\/version\/src\/constraints\/AbstractVersionConstraint.php":"85e403c20816716fee1c7e9c7d954372","vendor\/phar-io\/version\/src\/constraints\/AndVersionConstraintGroup.php":"f0b7794ddbb1dbb5fed3d368793e53a1","vendor\/phar-io\/version\/src\/constraints\/AnyVersionConstraint.php":"07ccc5fa1e738a6de86c54cb94923b61","vendor\/phar-io\/version\/src\/constraints\/ExactVersionConstraint.php":"136ccf78b48b82807b47c84b56aca8ad","vendor\/phar-io\/version\/src\/constraints\/GreaterThanOrEqualToVersionConstraint.php":"67ba0a1137c73077884478cf81ce83e6","vendor\/phar-io\/version\/src\/constraints\/OrVersionConstraintGroup.php":"b8db7b005d2bcb6656aa1c224041cec2","vendor\/phar-io\/version\/src\/constraints\/SpecificMajorAndMinorVersionConstraint.php":"6234f595373723135657893c45f9cb2b","vendor\/phar-io\/version\/src\/constraints\/SpecificMajorVersionConstraint.php":"c675e5320fdf673573328e4794ea00ee","vendor\/phar-io\/version\/src\/constraints\/VersionConstraint.php":"aa82f303e9d230c46c31bc9bccc81a2f","vendor\/phar-io\/version\/src\/exceptions\/Exception.php":"eb7c15fe5e6caef11809316f04e8f5f8","vendor\/phar-io\/version\/src\/exceptions\/InvalidPreReleaseSuffixException.php":"5259703f30ece6f3058c9a8423e9bd47","vendor\/phar-io\/version\/src\/exceptions\/InvalidVersionException.php":"566e5de005e4a8de2190c156cbb4cf20","vendor\/phar-io\/version\/src\/exceptions\/NoBuildMetaDataException.php":"01bf99aac62ce2cdff7a6958eb9a8712","vendor\/phar-io\/version\/src\/exceptions\/NoPreReleaseSuffixException.php":"d4e4092feb45f0495366b2f9574b4208","vendor\/phar-io\/version\/src\/exceptions\/UnsupportedVersionConstraintException.php":"a481588043ecec7d803711ac61744775","vendor\/phpunit\/php-code-coverage\/src\/CodeCoverage.php":"9c7ee629987d3421cf4816cac294cac2","vendor\/phpunit\/php-code-coverage\/src\/Driver\/Driver.php":"63cbdcffdd3b1e9803c1f6cfebcdc846","vendor\/phpunit\/php-code-coverage\/src\/Driver\/PcovDriver.php":"3a1f35dcb93eb6acf908d350023d3ac7","vendor\/phpunit\/php-code-coverage\/src\/Driver\/PhpdbgDriver.php":"baa645d86eb3c173c5978f56faf08e8e","vendor\/phpunit\/php-code-coverage\/src\/Driver\/Selector.php":"e4301b61c3030f2eeee2ae677ffc24d7","vendor\/phpunit\/php-code-coverage\/src\/Driver\/Xdebug2Driver.php":"e896450c05ec003de0fb2f73d22f2353","vendor\/phpunit\/php-code-coverage\/src\/Driver\/Xdebug3Driver.php":"85a57bdf7cdf510e8f5636c0df439445","vendor\/phpunit\/php-code-coverage\/src\/Exception\/BranchAndPathCoverageNotSupportedException.php":"809f051458fd7e98e5a58db92bd4b45e","vendor\/phpunit\/php-code-coverage\/src\/Exception\/DeadCodeDetectionNotSupportedException.php":"3344586e32798197d30338051e1616fa","vendor\/phpunit\/php-code-coverage\/src\/Exception\/DirectoryCouldNotBeCreatedException.php":"c0bac08aeffb4cb1611d4d3b1731f787","vendor\/phpunit\/php-code-coverage\/src\/Exception\/Exception.php":"7cf274fff6b087c95454c60523ca4b35","vendor\/phpunit\/php-code-coverage\/src\/Exception\/InvalidArgumentException.php":"468466bdcf49437bce8fb4b658bdd2e8","vendor\/phpunit\/php-code-coverage\/src\/Exception\/NoCodeCoverageDriverAvailableException.php":"54449fd673ceb844d63c752b8cc4db57","vendor\/phpunit\/php-code-coverage\/src\/Exception\/NoCodeCoverageDriverWithPathCoverageSupportAvailableException.php":"0aa52d73d8e82e4beb04648ae42095d0","vendor\/phpunit\/php-code-coverage\/src\/Exception\/ParserException.php":"7cc13b00f170a7482cf8a5cc025d317c","vendor\/phpunit\/php-code-coverage\/src\/Exception\/PathExistsButIsNotDirectoryException.php":"bde91e757c8bc3a22acf9681e0b831c5","vendor\/phpunit\/php-code-coverage\/src\/Exception\/PcovNotAvailableException.php":"019bad4b34df3e299875bdb6ed84ace8","vendor\/phpunit\/php-code-coverage\/src\/Exception\/PhpdbgNotAvailableException.php":"2b422c8e23dd792bd6b29db0274cc5c3","vendor\/phpunit\/php-code-coverage\/src\/Exception\/ReflectionException.php":"bcc69fd8bcf298919357452429a8a19f","vendor\/phpunit\/php-code-coverage\/src\/Exception\/ReportAlreadyFinalizedException.php":"88c3f83222e0c6385c582d6b753f7e33","vendor\/phpunit\/php-code-coverage\/src\/Exception\/StaticAnalysisCacheNotConfiguredException.php":"4892fa61aba0fe79439be36f29323e0d","vendor\/phpunit\/php-code-coverage\/src\/Exception\/TestIdMissingException.php":"a9d7078a90c2c614856fe44ac2437d75","vendor\/phpunit\/php-code-coverage\/src\/Exception\/UnintentionallyCoveredCodeException.php":"67eb1c4585254327b8b0a4b799b79d8b","vendor\/phpunit\/php-code-coverage\/src\/Exception\/WriteOperationFailedException.php":"813c6146d44a4a4e2169e315a5f6d09d","vendor\/phpunit\/php-code-coverage\/src\/Exception\/WrongXdebugVersionException.php":"fc0f58dd0b381fbc9af3c84ccfbc908e","vendor\/phpunit\/php-code-coverage\/src\/Exception\/Xdebug2NotEnabledException.php":"cbe4b2fd87fb825ea0711849da888ab4","vendor\/phpunit\/php-code-coverage\/src\/Exception\/Xdebug3NotEnabledException.php":"effd2fb313c332e4685db029403f9acf","vendor\/phpunit\/php-code-coverage\/src\/Exception\/XdebugNotAvailableException.php":"afb65ee11bdd7f6d6ce5dba9d6a1e923","vendor\/phpunit\/php-code-coverage\/src\/Exception\/XmlException.php":"2de1035f9555a4cfd41fdfd793c97f05","vendor\/phpunit\/php-code-coverage\/src\/Filter.php":"594a74c0895af85f3a76bf86295ebdbe","vendor\/phpunit\/php-code-coverage\/src\/Node\/AbstractNode.php":"7e9e002f21809d50ef88f743ee06844a","vendor\/phpunit\/php-code-coverage\/src\/Node\/Builder.php":"92f82a19e961b87a0fc91b6a3f07c3d4","vendor\/phpunit\/php-code-coverage\/src\/Node\/CrapIndex.php":"a0890f7e26a4fe05a60a70ad0f700732","vendor\/phpunit\/php-code-coverage\/src\/Node\/Directory.php":"f356bc846c35a4b418e32443d421aef4","vendor\/phpunit\/php-code-coverage\/src\/Node\/File.php":"996e1c64cb85fd93c36a25007743dd5c","vendor\/phpunit\/php-code-coverage\/src\/Node\/Iterator.php":"4a194bf05c15a4dd86c5753fb05c6e96","vendor\/phpunit\/php-code-coverage\/src\/ProcessedCodeCoverageData.php":"4b6a905889e7deff41229f4e1ee35535","vendor\/phpunit\/php-code-coverage\/src\/RawCodeCoverageData.php":"c75e18b36b7221255a4242135d2c1f9a","vendor\/phpunit\/php-code-coverage\/src\/Report\/Clover.php":"40ca0f41c3af37c8599bcac24ac9641b","vendor\/phpunit\/php-code-coverage\/src\/Report\/Cobertura.php":"f6f93c9c582420824dea1da68d577d57","vendor\/phpunit\/php-code-coverage\/src\/Report\/Crap4j.php":"bbc1e754212d0b4dab1829dde4ee7297","vendor\/phpunit\/php-code-coverage\/src\/Report\/Html\/Facade.php":"b952e7b5a24272d01d70b0ea43057ed7","vendor\/phpunit\/php-code-coverage\/src\/Report\/Html\/Renderer.php":"12cb7cb8208ba25e48640d5c22eb83d1","vendor\/phpunit\/php-code-coverage\/src\/Report\/Html\/Renderer\/Dashboard.php":"de10db00fb5cb6dca253257a822edd9e","vendor\/phpunit\/php-code-coverage\/src\/Report\/Html\/Renderer\/Directory.php":"3b6e71458bc18934792f436b5ac04e6e","vendor\/phpunit\/php-code-coverage\/src\/Report\/Html\/Renderer\/File.php":"329389b75143a336efcfcc4059604578","vendor\/phpunit\/php-code-coverage\/src\/Report\/PHP.php":"01a85ec75a5cf30d29c77ed3feda7588","vendor\/phpunit\/php-code-coverage\/src\/Report\/Text.php":"625b8b4c0c0032a107e513758639e0f6","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/BuildInformation.php":"5335f90009623765b7e80f5eddc53634","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Coverage.php":"595c37ec97bb31ae4ed4dcd641388a8d","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Directory.php":"2d63dab5a3f1ea0336b6a372224efc6a","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Facade.php":"4d4b219b792265a3e5d9c7dc1766465d","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/File.php":"30c1c934a6bdd6d72ba215deea1ea42c","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Method.php":"8aea7cd6cc4f6c73243ec675fa92abe5","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Node.php":"7f22275d13701d41685791172066ebdd","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Project.php":"04dd407ad53f845e1fc513ecf3515392","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Report.php":"3586e13946f42e94b93bef2fa2968907","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Source.php":"70490a9ab93a62d6b78089b7e43d655f","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Tests.php":"a927979d5bec52aa82a800164df5f8f7","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Totals.php":"81e0d3431fdb8305fe0c0d8fa88ea670","vendor\/phpunit\/php-code-coverage\/src\/Report\/Xml\/Unit.php":"d8f7e8fd49dc2fa51b52690a2a095240","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/CacheWarmer.php":"7908982d18e7f49c7275a8e68d0298ca","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/CachingFileAnalyser.php":"8cf0577c1aae0f763fcf3d89fa776dc7","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/CodeUnitFindingVisitor.php":"0121fbc5935a11979468265b5c714752","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/ExecutableLinesFindingVisitor.php":"2c85caeaa94a64293b8a748c5ee24a7d","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/FileAnalyser.php":"25e82a3f2a8a3b41d9bca6c0bf4518d5","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/IgnoredLinesFindingVisitor.php":"ca1a23df6524bfc967c43bb47bc9f6d7","vendor\/phpunit\/php-code-coverage\/src\/StaticAnalysis\/ParsingFileAnalyser.php":"4d0005b48a38ad027a67f6cc431073e0","vendor\/phpunit\/php-code-coverage\/src\/Util\/Filesystem.php":"07a717bd81a5dc7cffc7ed01ef9c2d9d","vendor\/phpunit\/php-code-coverage\/src\/Util\/Percentage.php":"bcce1bfcfce2a30c2469cbe8f762c9f5","vendor\/phpunit\/php-code-coverage\/src\/Version.php":"06df8e60954a9d33075ab403949fc184","vendor\/phpunit\/php-file-iterator\/src\/Facade.php":"49ef13253d940d6ce8cd7221b337080e","vendor\/phpunit\/php-file-iterator\/src\/Factory.php":"6d58052a2c610fbb6fdc83a50620f59f","vendor\/phpunit\/php-file-iterator\/src\/Iterator.php":"f239a7a71e5032e9450b7a12d99d93b8","vendor\/phpunit\/php-invoker\/src\/Invoker.php":"72df4c4e2ff1f6914c47a124f22b7f83","vendor\/phpunit\/php-invoker\/src\/exceptions\/Exception.php":"cb3835673ae457b6c79800416d2a8ece","vendor\/phpunit\/php-invoker\/src\/exceptions\/ProcessControlExtensionNotLoadedException.php":"dfd111cd8053b4b3ed70207a752b0833","vendor\/phpunit\/php-invoker\/src\/exceptions\/TimeoutException.php":"79e70efffd27c620401c3f02f60d275b","vendor\/phpunit\/php-text-template\/src\/Template.php":"2ea9a09d6769c8ef5bed88775dd61fc0","vendor\/phpunit\/php-text-template\/src\/exceptions\/Exception.php":"ee1a1a96420bb02994155f4e90cb845b","vendor\/phpunit\/php-text-template\/src\/exceptions\/InvalidArgumentException.php":"055047d76a631cdb8df9154e66a2565b","vendor\/phpunit\/php-text-template\/src\/exceptions\/RuntimeException.php":"bbcd3904c6159bd05ae031395f8815fa","vendor\/phpunit\/php-timer\/src\/Duration.php":"bef78392a626690dec6fa36c00673f85","vendor\/phpunit\/php-timer\/src\/ResourceUsageFormatter.php":"03916c3dc3e5eaf6bbc567c590ce9da3","vendor\/phpunit\/php-timer\/src\/Timer.php":"9c973a6747e18c917f7907a6f6c844cc","vendor\/phpunit\/php-timer\/src\/exceptions\/Exception.php":"2e01ecff4ac554cb6dfab580b0353f3b","vendor\/phpunit\/php-timer\/src\/exceptions\/NoActiveTimerException.php":"a950602939ff44758d0b0f8a4e1e9503","vendor\/phpunit\/php-timer\/src\/exceptions\/TimeSinceStartOfRequestNotAvailableException.php":"757ab8ef9453e09072604be73b7bc5cf","vendor\/phpunit\/phpunit\/.phpstorm.meta.php":"c144d47348cdf525c1bfa4f1742c0567","vendor\/phpunit\/phpunit\/src\/Exception.php":"9c9bc006a2b2c6798b09178b953302af","vendor\/phpunit\/phpunit\/src\/Framework\/Assert.php":"a2cc598e53eb64f6a61465c6407c213d","vendor\/phpunit\/phpunit\/src\/Framework\/Assert\/Functions.php":"5a51fdd902728bf09d9d8fbd96e02f2a","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Boolean\/IsFalse.php":"0e9e9a545d179bad64bc6beac9944a24","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Boolean\/IsTrue.php":"9a68813f838dfd15fb24457894aa12e4","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Callback.php":"d42302b68be90503f2a9cc2cad461fb5","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Cardinality\/Count.php":"16a463577c8cbbbfbe05798a4b93c664","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Cardinality\/GreaterThan.php":"d2d19237c90e3e1249eb451535d72331","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Cardinality\/IsEmpty.php":"636129993a8a5bfea31fb820e7f94782","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Cardinality\/LessThan.php":"8cdfc69bf28a0b087642254e797bb643","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Cardinality\/SameSize.php":"9f34361d13e199a3dc2dfe8f5bb7b7cf","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Constraint.php":"e9b151dd82c2785b108195637c874967","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Equality\/IsEqual.php":"5f1df7d24324919789e2d3c6569fd80f","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Equality\/IsEqualCanonicalizing.php":"5a18bcbb13463065ee2dd8b826e7f556","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Equality\/IsEqualIgnoringCase.php":"f63e727899e2dc32e19a29862abad5f6","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Equality\/IsEqualWithDelta.php":"060c723464e5dd14404fc6cf33ee5c90","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Exception\/Exception.php":"d3317f22a143c6dae786b2ef7f0b2586","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Exception\/ExceptionCode.php":"7fff78284c78043e9ccdacc1863a3156","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Exception\/ExceptionMessage.php":"063b2660a7b0a1deb10e3dce26940608","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Exception\/ExceptionMessageRegularExpression.php":"cc2c25e38ea6e84bf034f7b0d76f5e43","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Filesystem\/DirectoryExists.php":"8bb7114dcd0a9674849b13676f0fcab7","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Filesystem\/FileExists.php":"c1efc78ae1a548336418c05d1c8fda33","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Filesystem\/IsReadable.php":"0ad3e2b726dd3c916321c8575ff5e14d","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Filesystem\/IsWritable.php":"412bad0ac8cc0edcbcc6fa368cb400d6","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/IsAnything.php":"6b811a4a2a4a1b28980fe375f89d74ee","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/IsIdentical.php":"33cd9f2e75bdbda81589a9c6505bb287","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/JsonMatches.php":"979f54a9ad4c4c600d8e755e91f50c50","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/JsonMatchesErrorMessageProvider.php":"42ae748a6e84556e1cbeff3090b5ca48","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Math\/IsFinite.php":"764b5391a94e4f4746ec047ca405c3bb","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Math\/IsInfinite.php":"90f3f7d47897d713d79b5003044cc14d","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Math\/IsNan.php":"bab8b6d64d7f12aee84554bfb86103cd","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Object\/ClassHasAttribute.php":"d406a64aedc785471629b85c38b262ac","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Object\/ClassHasStaticAttribute.php":"99ac5e2163d5935fbb308a21b4a2c1d3","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Object\/ObjectEquals.php":"13f23faed8a5b933a3066d4f997b946a","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Object\/ObjectHasAttribute.php":"d432a8784621b259bb4d57b336910ab1","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Object\/ObjectHasProperty.php":"8cb5803e913accadb7a15ae56d570d94","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/BinaryOperator.php":"e54ef86af7e233dcc2a76f8d0601db93","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/LogicalAnd.php":"4b66e0f559283e0a6cc6d069030b395e","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/LogicalNot.php":"36aa58f4668afe3222a2f5f53aee4582","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/LogicalOr.php":"40f015d1c5f8e0d77d20e1e40d7a0ead","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/LogicalXor.php":"de15ab220cc2ee012192ec2313af2033","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/Operator.php":"5aebbf9d84240451d88916c3d6dc3535","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Operator\/UnaryOperator.php":"95c38afee5dae3e741e4aac9c1b3df63","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/IsJson.php":"3b5ec1aefc648afed9f499879c18b672","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/RegularExpression.php":"1618f5a4765efd472ede13bb98bb021c","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/StringContains.php":"73a8f0afce53116ef73b76fb64bd83c4","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/StringEndsWith.php":"ec3a1743e12fb667d511a055a1b82017","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/StringMatchesFormatDescription.php":"479bb0ada8bcea02f2740954160e6db7","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/String\/StringStartsWith.php":"b75925d3453c5baf9efa379f21d12bce","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Traversable\/ArrayHasKey.php":"6dffe895c9376339b748a968d04a2a8f","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Traversable\/TraversableContains.php":"ee64819b91a0a4a5ba26787db39aa407","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Traversable\/TraversableContainsEqual.php":"a658ece1734c2dc6c8356dfc921102e0","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Traversable\/TraversableContainsIdentical.php":"78c24b19918247aff6fa2c87517e7903","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Traversable\/TraversableContainsOnly.php":"c108649bb05fd9744e529747ce24da4d","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Type\/IsInstanceOf.php":"90d5bc58bac9b3c8c91af9dc37afb440","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Type\/IsNull.php":"3d72b6225e3651ad630a4b5318a6b3be","vendor\/phpunit\/phpunit\/src\/Framework\/Constraint\/Type\/IsType.php":"fe92ebdd9906521fb78f496fb496a240","vendor\/phpunit\/phpunit\/src\/Framework\/DataProviderTestSuite.php":"4cf57b57d0733837b973f9ae7fd17934","vendor\/phpunit\/phpunit\/src\/Framework\/Error\/Deprecated.php":"ae5d8285ef580dd8f7d90d125a9cfdd9","vendor\/phpunit\/phpunit\/src\/Framework\/Error\/Error.php":"c11a4adda82440b65cac9deb81b433b9","vendor\/phpunit\/phpunit\/src\/Framework\/Error\/Notice.php":"1362822692b076b70566d516e3936ad5","vendor\/phpunit\/phpunit\/src\/Framework\/Error\/Warning.php":"61fcc328fc1fc8641eb4c2a8d572b7a5","vendor\/phpunit\/phpunit\/src\/Framework\/ErrorTestCase.php":"c47c174549369bd236e3af23a21915f8","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ActualValueIsNotAnObjectException.php":"b15236ea13e8fb56fea58a0f197a58bf","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/AssertionFailedError.php":"83df3dae29a27ba54eb8e25587e162fd","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/CodeCoverageException.php":"1d4a3f6cf0c5d2454861229d2ae8f01c","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ComparisonMethodDoesNotAcceptParameterTypeException.php":"3b3c3d8789a64ba76432792318730357","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ComparisonMethodDoesNotDeclareBoolReturnTypeException.php":"b7ca1f14b9a743b7244dc021cf5c0043","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ComparisonMethodDoesNotDeclareExactlyOneParameterException.php":"55f9dd3888d3fa97ed6c534798c5c80d","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ComparisonMethodDoesNotDeclareParameterTypeException.php":"f72bc99fe37384c6164cb80fb31c5e8e","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ComparisonMethodDoesNotExistException.php":"d55e50fbe201a9f5ee9d64161737d9b7","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/CoveredCodeNotExecutedException.php":"111b48ea6500f61337001e79cace77d9","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/Error.php":"9348755e92c30af1f028ac1c756c63fe","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/Exception.php":"cc1de87e7fda0d2c2d3c2e6cab6d98e3","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/ExpectationFailedException.php":"16784b6e8ae416fad6ed3a0332c7afc8","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/IncompleteTestError.php":"a8441aeb79852289ef6e6a5272a1175b","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/InvalidArgumentException.php":"45e2689b61a223bf238b8155461eae3d","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/InvalidCoversTargetException.php":"72ef7a8d04612ac100ee8ebec2e8bc42","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/InvalidDataProviderException.php":"c24408f13e004aff678aa9f15b280f18","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/MissingCoversAnnotationException.php":"7737b29f95df53e22d8f6e7f58fd5c0f","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/NoChildTestSuiteException.php":"10a31c5b1a03bc0eac6acc8cd3f9c49d","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/OutputError.php":"1878666f162e9ccc91a8aed189a1298c","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/PHPTAssertionFailedError.php":"3614775fca0d1e8557e51cbfd242d673","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/RiskyTestError.php":"eaade5060fc69511ebd3e10a88bb72a3","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/SkippedTestError.php":"6f57bd90bab1224ed71fcf59da0621c2","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/SkippedTestSuiteError.php":"9d26395af0fd69504bcedc5f409d1e1a","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/SyntheticError.php":"ca8ce8c0ce9fae8702f7318305f86d6f","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/SyntheticSkippedError.php":"f9f42fb308c23bbf66e98529430d52c1","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/UnintentionallyCoveredCodeError.php":"7bd066b7e1b8e54fff05ea1402fe8fec","vendor\/phpunit\/phpunit\/src\/Framework\/Exception\/Warning.php":"c751e6571e7ecaa53a73367984dee1d7","vendor\/phpunit\/phpunit\/src\/Framework\/ExceptionWrapper.php":"9a91a41ef34416cc244b48e1e2294a23","vendor\/phpunit\/phpunit\/src\/Framework\/ExecutionOrderDependency.php":"400718c752e3c1bec2c07c90cd99ee95","vendor\/phpunit\/phpunit\/src\/Framework\/IncompleteTest.php":"bda78297018e352278b25999c5d13d5a","vendor\/phpunit\/phpunit\/src\/Framework\/IncompleteTestCase.php":"56df4e33dbd5e87e97be43c20a908781","vendor\/phpunit\/phpunit\/src\/Framework\/InvalidParameterGroupException.php":"5d07cd2a11131734fb4ec2792015d512","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Api\/Api.php":"becfe39bf71ef72d3f0fafe1c132af62","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Api\/Method.php":"897c1fc19d1bdb7a7017106bc920443e","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/Identity.php":"de7fb6174b3647c24362147218bf1cbd","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/InvocationMocker.php":"316d7531aee795d8b1af6efbc7b88e65","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/InvocationStubber.php":"162865f03945890eb9348280c01d28d0","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/MethodNameMatch.php":"fe950e5822cc412c9066a6366dc3a403","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/ParametersMatch.php":"983645488ddbbbba0def4f5991eceb98","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Builder\/Stub.php":"dc2dd92a3ef6854f7413bf98908e454a","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/ConfigurableMethod.php":"5416926c083c11f471649c6acd285d30","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/BadMethodCallException.php":"886197de8625e599441f6247d222f276","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/CannotUseAddMethodsException.php":"0b8ab38e1c995812a9e9424a3f4b5bc2","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/CannotUseOnlyMethodsException.php":"5d564f91573f728e9cd0c22ec708a4b8","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ClassAlreadyExistsException.php":"56cd39869a2874f1061ff24271d392bf","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ClassIsFinalException.php":"6bdc9840de65ab3234cd8d074335a5b6","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ClassIsReadonlyException.php":"ef97d233d1a30da19e51bbe5de268e21","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ConfigurableMethodsAlreadyInitializedException.php":"b6d4a2a57917b244e610f84d11f011e1","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/DuplicateMethodException.php":"b3ef661ec5f6ab095521babb17a2b0fd","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/Exception.php":"7d707013cb0c092f58e7d89802b810e6","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/IncompatibleReturnValueException.php":"0bd5a6e978b2cec90faaea66648b30c8","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/InvalidMethodNameException.php":"7666fd37e4cd8fa9647e4b2143b7f434","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MatchBuilderNotFoundException.php":"9b90cc31b617eeb267a19952ce6bde9e","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MatcherAlreadyRegisteredException.php":"49beaec3a419bd8b6696f188673cd372","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MethodCannotBeConfiguredException.php":"654e3bc3184fea0cb3aa345f730e60d1","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MethodNameAlreadyConfiguredException.php":"8fe1a845789b859e042e283c1b9fd540","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MethodNameNotConfiguredException.php":"131172fe46ce8d5035558542308a7283","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/MethodParametersAlreadyConfiguredException.php":"c4adebae9e41d37c94b823e3d4f2250a","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/OriginalConstructorInvocationRequiredException.php":"90df1b71c2ed25fb851a4f5fcbc4bcb8","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ReflectionException.php":"631f1be1ed77d0c9065730609a649f17","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/ReturnValueNotConfiguredException.php":"daecf359743ca0f1625c44212a19f724","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/RuntimeException.php":"5ed98b8848284f800c6de843ca1113d5","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/SoapExtensionNotAvailableException.php":"2b7157cda61283d961633dbb313a34e2","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/UnknownClassException.php":"87110de9e501047c2d0e85c05c338f89","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/UnknownTraitException.php":"dca1b2b290c734fc38711e888a3d4a72","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Exception\/UnknownTypeException.php":"8d124cbb68e50293523f41b75d965948","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Generator.php":"8b8567e3c3310d2cffb49b6c6532293c","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Invocation.php":"b92a0cbcbe0580b58eb5b22952065a3f","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/InvocationHandler.php":"85aa2cdd00d9a4b1681adc33d5587bfd","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Matcher.php":"f3d8062331e548410534146129859040","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MethodNameConstraint.php":"d48c8464f5533e03c1a8cb00eb00a5b4","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockBuilder.php":"97e4accce8cefe1f90500501ff767af2","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockClass.php":"50ea4a76ef8882a0cb59bad39a60920c","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockMethod.php":"0323a64ea99a93ef65106faabbe6d693","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockMethodSet.php":"4c05af489b798a05a08af1527b493632","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockObject.php":"91027c1a4f9a92418782debac5fdab62","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockTrait.php":"538ca03861170c813a1cd823313bce52","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/MockType.php":"e2b3180022aae69b065aae16516723e6","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/AnyInvokedCount.php":"cba3a20e4d6dbd6e5390f5e91ff6d7b1","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/AnyParameters.php":"77ed7337db352b3e388cc2648eb4f515","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/ConsecutiveParameters.php":"0b334f63ce08858f6d9d6f770edb0611","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvocationOrder.php":"6d2dfb04dbd7d658f39663eee6965c92","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvokedAtIndex.php":"63344bebaabc376847b6c7eb35d5625e","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvokedAtLeastCount.php":"be13ac0825da6a0324d85971513b8a6e","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvokedAtLeastOnce.php":"3e28aabe0077b1ccb871f55db17eb530","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvokedAtMostCount.php":"0cd6baac83bbff51fcfddd0b07f84a8b","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/InvokedCount.php":"58b9d724e25c8e7cee0605f873c113d4","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/MethodName.php":"fae92b0056aee34597d1996ac051fb15","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/Parameters.php":"61460e52986881a0225805ac2af4cea6","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Rule\/ParametersRule.php":"40f6c91504c9b6c1e435bff96daa2850","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub.php":"24a47129d99696299bc01fee83adbbe0","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ConsecutiveCalls.php":"918825760ae382068fdcb1a6092cc94b","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/Exception.php":"337fc45528383c822332a9861d2de63c","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnArgument.php":"5eef83da7054a9b313f0de518ee4e929","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnCallback.php":"32d331a061a68d5c45edfdcd1ab34f4d","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnReference.php":"15200ea21dd003bac8a2a68438dddac2","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnSelf.php":"c3c56fb859f4889533e4a0f8da1663d5","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnStub.php":"0350085639aa6fe3e72eb9aa9441b089","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/ReturnValueMap.php":"6eda7169b8f5d4e90185efab168df50d","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Stub\/Stub.php":"d89f31d2e5212d9d613f464d0919536e","vendor\/phpunit\/phpunit\/src\/Framework\/MockObject\/Verifiable.php":"0b528587ab4b2312b8573ea4e37558ac","vendor\/phpunit\/phpunit\/src\/Framework\/Reorderable.php":"464424fe78d6f768b95320c6d6dbe669","vendor\/phpunit\/phpunit\/src\/Framework\/SelfDescribing.php":"20ec9b4b54e5355e6a4045b2f2323084","vendor\/phpunit\/phpunit\/src\/Framework\/SkippedTest.php":"7e86042ada8801366b331f97ea64e1c1","vendor\/phpunit\/phpunit\/src\/Framework\/SkippedTestCase.php":"dd7915cf3d3c9acd3e1abcd0112b77d6","vendor\/phpunit\/phpunit\/src\/Framework\/Test.php":"8dabda0d9faff6cfb76a16f8ff9b4235","vendor\/phpunit\/phpunit\/src\/Framework\/TestBuilder.php":"add128c01176573425ddf6f393d456e5","vendor\/phpunit\/phpunit\/src\/Framework\/TestCase.php":"1b3643cecae4db71333e980cc5501dfc","vendor\/phpunit\/phpunit\/src\/Framework\/TestFailure.php":"5dfb6805102ce52c26ab3e2766957c01","vendor\/phpunit\/phpunit\/src\/Framework\/TestListener.php":"7e848acdea8bc3bba9f1fca1db614fab","vendor\/phpunit\/phpunit\/src\/Framework\/TestListenerDefaultImplementation.php":"73cd199d3dc53ff8e3eeaff10d914916","vendor\/phpunit\/phpunit\/src\/Framework\/TestResult.php":"f02b968ddd04f828b1412b7bce82fd63","vendor\/phpunit\/phpunit\/src\/Framework\/TestSuite.php":"ebd139f2561516c038d5b87b2cc48767","vendor\/phpunit\/phpunit\/src\/Framework\/TestSuiteIterator.php":"71d416a9cd36f23e35c12bb24abeb590","vendor\/phpunit\/phpunit\/src\/Framework\/WarningTestCase.php":"d31b7a5ea642a3e71590fd08d0fce6a3","vendor\/phpunit\/phpunit\/src\/Runner\/BaseTestRunner.php":"0cc2db8080aa8ddc72911dc3c6a6a3cc","vendor\/phpunit\/phpunit\/src\/Runner\/DefaultTestResultCache.php":"136b3d0d289d9cc4b2231d572a5932e5","vendor\/phpunit\/phpunit\/src\/Runner\/Exception.php":"e7bf6c4a84ce75d5be0c1494066949b2","vendor\/phpunit\/phpunit\/src\/Runner\/Extension\/ExtensionHandler.php":"d304d1d43426e20db561de83259dfbc6","vendor\/phpunit\/phpunit\/src\/Runner\/Extension\/PharLoader.php":"b9f8ec5b4b00b83b78dbc0586cccc2d3","vendor\/phpunit\/phpunit\/src\/Runner\/Filter\/ExcludeGroupFilterIterator.php":"2c59ae925db0a7e0767c4e8d08fb825a","vendor\/phpunit\/phpunit\/src\/Runner\/Filter\/Factory.php":"968446288f18ac34d7c6d689ce796fbf","vendor\/phpunit\/phpunit\/src\/Runner\/Filter\/GroupFilterIterator.php":"cbf091b9497ecbae7a66700d2569b049","vendor\/phpunit\/phpunit\/src\/Runner\/Filter\/IncludeGroupFilterIterator.php":"6d5f1fffe5de9406b8881c368547304b","vendor\/phpunit\/phpunit\/src\/Runner\/Filter\/NameFilterIterator.php":"8620cb12728223738eed87e9f28679b9","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterIncompleteTestHook.php":"3ae9817e4aa5467843b01f1c4f0900e6","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterLastTestHook.php":"6364e0a4df49bbe449e47411811a4a58","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterRiskyTestHook.php":"d7c948fa44410ebaf8366ce0c2d39bf0","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterSkippedTestHook.php":"c3d670f0b9e39e775238b711f62813a3","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterSuccessfulTestHook.php":"c074063ea0c90f04ad7fa53eb9c88f46","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterTestErrorHook.php":"08794ae1d5e6733533d622f11fdf210b","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterTestFailureHook.php":"ff12bc9bf4905b8515d53ad8d4fd7e64","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterTestHook.php":"8d8e19646010a80e19af6c3f7c9b5d47","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/AfterTestWarningHook.php":"92a8e6f98de2bd3cda7acb70ddde2c67","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/BeforeFirstTestHook.php":"8f0ca462e40ec1fc2f0fca706e0b3337","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/BeforeTestHook.php":"8fd7acdfa41cac35e7c1aefcd42ccd45","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/Hook.php":"9523270b3cbba38ff3c3bca082b02089","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/TestHook.php":"f2b9add31f4aaf33177deae2416aec08","vendor\/phpunit\/phpunit\/src\/Runner\/Hook\/TestListenerAdapter.php":"754ae82bf0e4df83ee29b8281750f4a7","vendor\/phpunit\/phpunit\/src\/Runner\/NullTestResultCache.php":"17644d2d42f2ed5e024b5214719100cf","vendor\/phpunit\/phpunit\/src\/Runner\/PhptTestCase.php":"b1eb3a9ba7e104aacc079f612c30c7d4","vendor\/phpunit\/phpunit\/src\/Runner\/ResultCacheExtension.php":"b75af232ce51a5577f522db7e579d51a","vendor\/phpunit\/phpunit\/src\/Runner\/StandardTestSuiteLoader.php":"4dd63fa2b25561d145d937c39b69150f","vendor\/phpunit\/phpunit\/src\/Runner\/TestResultCache.php":"fe19dba56570dea1f6814e50e6fb8fb3","vendor\/phpunit\/phpunit\/src\/Runner\/TestSuiteLoader.php":"a81881e684e449b84212032b3d9e0407","vendor\/phpunit\/phpunit\/src\/Runner\/TestSuiteSorter.php":"08e052b174780ad24bac399d8ebd8db1","vendor\/phpunit\/phpunit\/src\/Runner\/Version.php":"cd4d84e8cb764560cfc88ca40f8d21e7","vendor\/phpunit\/phpunit\/src\/TextUI\/CliArguments\/Builder.php":"d60e9a9f8310f3ef81f80a6570121451","vendor\/phpunit\/phpunit\/src\/TextUI\/CliArguments\/Configuration.php":"fb67f353f9e37145def4eaca4d91dba1","vendor\/phpunit\/phpunit\/src\/TextUI\/CliArguments\/Exception.php":"a3c7102d3ee8f5f62359d875c59d09ac","vendor\/phpunit\/phpunit\/src\/TextUI\/CliArguments\/Mapper.php":"929bee0d80a2345b54df389b83d353bf","vendor\/phpunit\/phpunit\/src\/TextUI\/Command.php":"779088939ff665aff554c1dd5b0edff6","vendor\/phpunit\/phpunit\/src\/TextUI\/DefaultResultPrinter.php":"95e6efff9b5ded3e42b1c2115cbdbe0d","vendor\/phpunit\/phpunit\/src\/TextUI\/Exception\/Exception.php":"304d06aeb61aca442053cf962a9d03d4","vendor\/phpunit\/phpunit\/src\/TextUI\/Exception\/ReflectionException.php":"c689e5370301ec22943c2df3bbafd23c","vendor\/phpunit\/phpunit\/src\/TextUI\/Exception\/RuntimeException.php":"0b5cc114a92fc33cf31c2219aed60452","vendor\/phpunit\/phpunit\/src\/TextUI\/Exception\/TestDirectoryNotFoundException.php":"0e2b9e02c3e2929205c80cf382374495","vendor\/phpunit\/phpunit\/src\/TextUI\/Exception\/TestFileNotFoundException.php":"db1b944b53d408f71d0cd562efb32631","vendor\/phpunit\/phpunit\/src\/TextUI\/Help.php":"4107482ac4f666679e9107e0494bba0d","vendor\/phpunit\/phpunit\/src\/TextUI\/ResultPrinter.php":"b9dc28e3f66e5207cead441cd3196495","vendor\/phpunit\/phpunit\/src\/TextUI\/TestRunner.php":"b5b61afe97e4d3d7e83529d2c895f1ce","vendor\/phpunit\/phpunit\/src\/TextUI\/TestSuiteMapper.php":"de2f2c2d8b756d840f47d4eed2850667","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/CodeCoverage.php":"6f2750ed7316a8f626d3dfd815c41bc4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Filter\/Directory.php":"4455664549d30030a49dd7f4a07478c9","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Filter\/DirectoryCollection.php":"4b074700339f73cb39a8c9f322142d85","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Filter\/DirectoryCollectionIterator.php":"08371aed2d7558bc16972c397b12ca41","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/FilterMapper.php":"07d3b993660f02aa5e61fd7147134c5a","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Clover.php":"7e8b028e009b6141020feaf8dd3f754f","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Cobertura.php":"cef8713b171daee2102fe47fbc93d455","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Crap4j.php":"6b0a33735320216908c50b6e9e533245","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Html.php":"12b36dfba0309a8c5ae6fd5f09450e11","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Php.php":"7ab92f80392b7420a542931060cbbd2d","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Text.php":"703176168a6d0299f8e42c9a77257519","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/CodeCoverage\/Report\/Xml.php":"883456c4787060170117ef15ea170fd2","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Configuration.php":"4c00c12f5c24d99f3dd3fa8fd9d90471","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Exception.php":"b1c1871b79d3b97995865ed4c264a73d","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/Directory.php":"65e8e7085c39c46b119b9abbd73359c7","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/DirectoryCollection.php":"17bb6315c1775c2476e2e68b677370a4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/DirectoryCollectionIterator.php":"8e5b0a0b97a453775e7e9c25a0ad86fd","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/File.php":"118133873a57e4dbf5a0c7608c72ed2e","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/FileCollection.php":"97757053189e905af2761150b6456ca7","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Filesystem\/FileCollectionIterator.php":"d09ad2edbb2849002cf8da331c3e5592","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Generator.php":"bf456034eb0ff3d7a5007de9dfb5242e","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Group\/Group.php":"310bb3ae034c01e20fcb6dd6b43b34f7","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Group\/GroupCollection.php":"2e728f12d94933931db4379d43e91638","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Group\/GroupCollectionIterator.php":"e26064885917b8637032e48a7addc5c4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Group\/Groups.php":"97e7796b002e6c4122846661e1c6d3f5","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Loader.php":"473d3af62cc95abce953015fac655f1f","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/Junit.php":"0f63250cf962ac7452ee1129ed044fbf","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/Logging.php":"8663a4cc567ad76e7857c50967ceef6e","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/TeamCity.php":"29234c148f8955fc62fce37c88db77e1","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/TestDox\/Html.php":"24d2cd540a844c5c20ce7b523d1affcd","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/TestDox\/Text.php":"769b67f1d74e36f82ee2ce4e9fb115ec","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/TestDox\/Xml.php":"d060697f9d6adbb41145ea20d97db0ae","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Logging\/Text.php":"35cdc7e25f857272213dc6b4d7c1be5b","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/MigrationBuilder.php":"97882477a8a7f59e3b4bea1a7c74b88e","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/MigrationBuilderException.php":"e0d7a38e8c13399806c6b56a978553c0","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/MigrationException.php":"4d5996874c808eadc2626d33b24215b2","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/ConvertLogTypes.php":"dccf23175c58ee9b9767d45c2dd93fc1","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoverageCloverToReport.php":"e1b5570646c136935d5768c581ab0866","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoverageCrap4jToReport.php":"6f37d31efe8321023f8d07159fe98734","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoverageHtmlToReport.php":"bde97983607d5817c7493e36d748a03e","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoveragePhpToReport.php":"c74b3183a6e331dbbd35250216beeaf6","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoverageTextToReport.php":"c3132eef6568e1c7c79a89ce9e07e036","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/CoverageXmlToReport.php":"6a53c7202a6dceb9c4b43055e0906064","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/IntroduceCoverageElement.php":"58c927ed475c6be9910c5e0ce8dd1abb","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/LogToReportMigration.php":"34543436e9e7ed0ea8a0ec3428abc5b4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/Migration.php":"ae86a17363be3bcf765d6249dedeb9a0","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/MoveAttributesFromFilterWhitelistToCoverage.php":"2de5d919e6af1b5c57c28536f1d5ca76","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/MoveAttributesFromRootToCoverage.php":"fe57448a0ebacf63e7fac3b2844ac0a7","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/MoveWhitelistExcludesToCoverage.php":"a28a4780ffd9586896bc82c0ebfa847a","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/MoveWhitelistIncludesToCoverage.php":"93cdefb3cf05e7a6e638971cb76330e4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/RemoveCacheTokensAttribute.php":"ce9ecfcc49b89a95e4cb57622ade59ea","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/RemoveEmptyFilter.php":"cbf97a5ec3d75deed87b6e4c37a197db","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/RemoveLogTypes.php":"b561ce43a57d5f6ac559a61078864d36","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrations\/UpdateSchemaLocationTo93.php":"177dde03fbcaa22e519c58b2f9f4cfc4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/Migration\/Migrator.php":"ab552c73c8bc384eed2a1cf034c2ad1d","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/Constant.php":"2c354c96165637c4cc0b2c46011da97c","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/ConstantCollection.php":"b061abfc7a7ffac6754323d6b33f4011","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/ConstantCollectionIterator.php":"57018212982dff625ecf90346f64eab3","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/IniSetting.php":"0a26b750e8bfae5938d38108e57b6945","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/IniSettingCollection.php":"a3f9e527c3374b2e2b8075bb44b17132","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/IniSettingCollectionIterator.php":"766c130b654beced76810f693e2f3beb","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/Php.php":"5fe242fceaa2d05fb705d646b5ff8f1c","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/PhpHandler.php":"154d7756058577f86a40274adb501844","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/Variable.php":"96d12e68aad7ba79ce1c13c7997fbcdc","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/VariableCollection.php":"b803f802d8668d7cc9ddfa2d2836aec8","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHP\/VariableCollectionIterator.php":"2d9d05c2d414f364846d2820ab5d80fa","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHPUnit\/Extension.php":"d66e1a8fa78f8b10ffc9ca0d03c3f491","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHPUnit\/ExtensionCollection.php":"c58c4b7a7910ae59783c40d59b48cbf6","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHPUnit\/ExtensionCollectionIterator.php":"1414de99a4b227806546b95b70a407df","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/PHPUnit\/PHPUnit.php":"2cb654a9f57cc2eb3cc59cf111b1fec1","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestDirectory.php":"312dee4985aa64d6d7e29c19148a01c0","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestDirectoryCollection.php":"66b0201a09c5fa5584f3267332c97f44","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestDirectoryCollectionIterator.php":"7cc9e38e6ee468b1409a7aa4fcfa2675","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestFile.php":"6d2b0fed91c1ba6880d29fb1be1e3443","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestFileCollection.php":"a602229ce78a8472f8517037e2655217","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestFileCollectionIterator.php":"1ee538c28885c76ada9f8863c7474ea3","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestSuite.php":"e8471909030e3eb96fd73c50c7462ae4","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestSuiteCollection.php":"1bad0b9f8a3c1e2a7f19f835c007c39b","vendor\/phpunit\/phpunit\/src\/TextUI\/XmlConfiguration\/TestSuite\/TestSuiteCollectionIterator.php":"aae601436caabbb69de5295da6d01ae4","vendor\/phpunit\/phpunit\/src\/Util\/Annotation\/DocBlock.php":"bf94fb4a04ce7339268b9ee536e4a4bd","vendor\/phpunit\/phpunit\/src\/Util\/Annotation\/Registry.php":"d3290eea551b0ea45c1020eb3f657221","vendor\/phpunit\/phpunit\/src\/Util\/Blacklist.php":"46a21312ba49418b86b492ea9df7dbbd","vendor\/phpunit\/phpunit\/src\/Util\/Cloner.php":"7ecd89aea91937a56622cbbe54187fa5","vendor\/phpunit\/phpunit\/src\/Util\/Color.php":"5ee7174ab335306fa36b4b635de4dce8","vendor\/phpunit\/phpunit\/src\/Util\/ErrorHandler.php":"cdcf88d2f9ad7a7a3db8d746ad518b0f","vendor\/phpunit\/phpunit\/src\/Util\/Exception.php":"31e6cdb65e12d389f63f044193456471","vendor\/phpunit\/phpunit\/src\/Util\/ExcludeList.php":"c138e9df2056050ff5e71a3ec461a0de","vendor\/phpunit\/phpunit\/src\/Util\/FileLoader.php":"c9c5c4f73c83cb79298f20cd93eb12ba","vendor\/phpunit\/phpunit\/src\/Util\/Filesystem.php":"12ddc5622959a5b5cc4654dbd09f2f9b","vendor\/phpunit\/phpunit\/src\/Util\/Filter.php":"47e6375d26a40b8836110d62bc0a73c1","vendor\/phpunit\/phpunit\/src\/Util\/GlobalState.php":"8964ccc5f3b4711fdf86f8e5201da2a4","vendor\/phpunit\/phpunit\/src\/Util\/InvalidDataSetException.php":"e033ab1eacb5121a345d8ae66c83648d","vendor\/phpunit\/phpunit\/src\/Util\/Json.php":"f8091f985fe753b0359256b9ee786884","vendor\/phpunit\/phpunit\/src\/Util\/Log\/JUnit.php":"bee36e8c0d5cfee56d084adc49751d41","vendor\/phpunit\/phpunit\/src\/Util\/Log\/TeamCity.php":"2f4bda224f223e765d19c8fc40198718","vendor\/phpunit\/phpunit\/src\/Util\/PHP\/AbstractPhpProcess.php":"870cbf683154c621853b7a9f750eec74","vendor\/phpunit\/phpunit\/src\/Util\/PHP\/DefaultPhpProcess.php":"54494d3b7fbc38f75e1431a838bbb82a","vendor\/phpunit\/phpunit\/src\/Util\/PHP\/WindowsPhpProcess.php":"7e867cd6b99702d87ddd6874b8b1e010","vendor\/phpunit\/phpunit\/src\/Util\/Printer.php":"dbeb652c27cbf80084733fd8e49b8b5a","vendor\/phpunit\/phpunit\/src\/Util\/Reflection.php":"79913ded4238ed7e4d27a76bc24899ed","vendor\/phpunit\/phpunit\/src\/Util\/RegularExpression.php":"9701061063b19d113cfb9d78db108fde","vendor\/phpunit\/phpunit\/src\/Util\/Test.php":"87e14bc999c66e4b393e794b388a1eb1","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/CliTestDoxPrinter.php":"fbedbe642d6ac81701e4270a281763a5","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/HtmlResultPrinter.php":"f6c33df6cd6d97245ad7362e9ab0f8e5","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/NamePrettifier.php":"712d8477fd0be01fa50b09f27c3e870f","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/ResultPrinter.php":"30ae2eaa6b0eb053d1b67e29f82ced9b","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/TestDoxPrinter.php":"e17b5dba4567258d6c16c564b60b0159","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/TextResultPrinter.php":"7dc0026d8903bdf151c6aaa79cab6197","vendor\/phpunit\/phpunit\/src\/Util\/TestDox\/XmlResultPrinter.php":"38d1bb466fa99a66242e4b80040763ce","vendor\/phpunit\/phpunit\/src\/Util\/TextTestListRenderer.php":"9f4d739a7e68f5151c3721cfeb62211e","vendor\/phpunit\/phpunit\/src\/Util\/Type.php":"a88c809e4f7d57a461f2944c0fce4708","vendor\/phpunit\/phpunit\/src\/Util\/VersionComparisonOperator.php":"ccb783eff17ddef6dd34fb6ae294cacd","vendor\/phpunit\/phpunit\/src\/Util\/XdebugFilterScriptGenerator.php":"17bf137cfb6bfc7cdf0abe6c92a3b32d","vendor\/phpunit\/phpunit\/src\/Util\/Xml.php":"8b83a7c130bb26affb78ff4eb847ec7e","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/Exception.php":"43dc67b70f877274f54cfff52f914ca9","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/FailedSchemaDetectionResult.php":"9cfdefe4cafa69405cbee3efeafe6948","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/Loader.php":"69db7601685335c83cc01337a74e9585","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/SchemaDetectionResult.php":"ade6ca7ecd4e6a1a5cb31956e501b61d","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/SchemaDetector.php":"4af2f05c632fcd77d41dd80b9f6a7a5f","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/SchemaFinder.php":"b4722c56493dda54e7d101e6c1b47d7b","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/SnapshotNodeList.php":"0cda6782d7524da18e364ee78f275fd2","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/SuccessfulSchemaDetectionResult.php":"356eab8f0e3939feb50652583231eff5","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/ValidationResult.php":"09050cff96dee1e8a46c395a668e5ce9","vendor\/phpunit\/phpunit\/src\/Util\/Xml\/Validator.php":"b7c0f65d619d98dc582937b558e78347","vendor\/phpunit\/phpunit\/src\/Util\/XmlTestListRenderer.php":"d22e2ed41cd7f3f3ce8d1c727694bdf7","vendor\/sebastian\/cli-parser\/src\/Parser.php":"6605d6b7cc336991bd83f5ef704c2fd6","vendor\/sebastian\/cli-parser\/src\/exceptions\/AmbiguousOptionException.php":"97649ee037605ed7fa62bc3bce5377c7","vendor\/sebastian\/cli-parser\/src\/exceptions\/Exception.php":"9442a87802438c09a065327d13402a58","vendor\/sebastian\/cli-parser\/src\/exceptions\/OptionDoesNotAllowArgumentException.php":"0825400007384055327062a57d325c30","vendor\/sebastian\/cli-parser\/src\/exceptions\/RequiredOptionArgumentMissingException.php":"07dcf0428941018a2ea3ea7cb7772671","vendor\/sebastian\/cli-parser\/src\/exceptions\/UnknownOptionException.php":"5feb1315d53edac059dbcd2a1518b78c","vendor\/sebastian\/code-unit-reverse-lookup\/src\/Wizard.php":"bf7abaae38fe204f6bcb7ab0a474dc7c","vendor\/sebastian\/code-unit\/src\/ClassMethodUnit.php":"75b4443d89ccf1e37461b5d3744a3164","vendor\/sebastian\/code-unit\/src\/ClassUnit.php":"d209d0c80bde7fc662c2333ef380989e","vendor\/sebastian\/code-unit\/src\/CodeUnit.php":"a7f06de0c4405363ea6c13e97e2b6ecd","vendor\/sebastian\/code-unit\/src\/CodeUnitCollection.php":"a398dc67220ed01e16b81cd73ff73924","vendor\/sebastian\/code-unit\/src\/CodeUnitCollectionIterator.php":"6ba6e83d5ff8cfe1bfad87d21d796903","vendor\/sebastian\/code-unit\/src\/FunctionUnit.php":"ddb2952f34af047d034bd58956faf38c","vendor\/sebastian\/code-unit\/src\/InterfaceMethodUnit.php":"4ad74249cae15899a19fa79bd03be4e5","vendor\/sebastian\/code-unit\/src\/InterfaceUnit.php":"df258434b141e3b1dd85fceae3ba6955","vendor\/sebastian\/code-unit\/src\/Mapper.php":"fa93fd8a38f5dfce944d2610b7553ac5","vendor\/sebastian\/code-unit\/src\/TraitMethodUnit.php":"f472677cfb5e7fcc2042c516b8c6f044","vendor\/sebastian\/code-unit\/src\/TraitUnit.php":"b53b810324e6c24b369688adf1f8b296","vendor\/sebastian\/code-unit\/src\/exceptions\/Exception.php":"3bf61a36426ce9af2d33091c2c69ee32","vendor\/sebastian\/code-unit\/src\/exceptions\/InvalidCodeUnitException.php":"30b39434b2f2a90ca59807622d786ace","vendor\/sebastian\/code-unit\/src\/exceptions\/NoTraitException.php":"791e0105a7cbf633a461858366760cba","vendor\/sebastian\/code-unit\/src\/exceptions\/ReflectionException.php":"30ef37ca19c4e0c13e7a34968b78fb70","vendor\/sebastian\/comparator\/src\/ArrayComparator.php":"7962e7952441caea8d042c17950ca904","vendor\/sebastian\/comparator\/src\/Comparator.php":"7cd890fed8022e58f4b25aea951b2782","vendor\/sebastian\/comparator\/src\/ComparisonFailure.php":"fb0f63e669a64f98337acfcfa8f96ca4","vendor\/sebastian\/comparator\/src\/DOMNodeComparator.php":"54c82b952607eb2f8b27951572772a01","vendor\/sebastian\/comparator\/src\/DateTimeComparator.php":"a898c741d50b19e65e6113f83f28a21f","vendor\/sebastian\/comparator\/src\/DoubleComparator.php":"1941b52e5a924416bd16de865096793b","vendor\/sebastian\/comparator\/src\/ExceptionComparator.php":"a0483073c76ffa0f1b372999160567f0","vendor\/sebastian\/comparator\/src\/Factory.php":"6a93dc8f2fdd4d03d672315cc515cb55","vendor\/sebastian\/comparator\/src\/MockObjectComparator.php":"63a284d015d22a4c3a508b9837e789db","vendor\/sebastian\/comparator\/src\/NumericComparator.php":"c1010dca21fbda250f32f73a5fc0a4ff","vendor\/sebastian\/comparator\/src\/ObjectComparator.php":"e19b9564f4c9ea2c82cded71af939e92","vendor\/sebastian\/comparator\/src\/ResourceComparator.php":"bf485f9cc586021ac6ff39dbb96b6d86","vendor\/sebastian\/comparator\/src\/ScalarComparator.php":"a110b995699ea5e3eb0725f8017cb472","vendor\/sebastian\/comparator\/src\/SplObjectStorageComparator.php":"5ae32b5b0b07d6b2780ee7aeee85a189","vendor\/sebastian\/comparator\/src\/TypeComparator.php":"c113ed6301b07c99f86811d311d694fa","vendor\/sebastian\/comparator\/src\/exceptions\/Exception.php":"1e3c04dae6bf36cb84ade35829583722","vendor\/sebastian\/comparator\/src\/exceptions\/RuntimeException.php":"6d06d6c3bb9d7e797c6f2328ae8f1001","vendor\/sebastian\/complexity\/src\/Calculator.php":"ab1439bf20d05888ab9fa01b85180a7a","vendor\/sebastian\/complexity\/src\/Complexity\/Complexity.php":"58d3dfc8dcb748ed4ba60212ae4beb08","vendor\/sebastian\/complexity\/src\/Complexity\/ComplexityCollection.php":"8e379d9a054852dab0824d6adcec03ac","vendor\/sebastian\/complexity\/src\/Complexity\/ComplexityCollectionIterator.php":"fb3888452e189c2581b0cf5d06bfbf21","vendor\/sebastian\/complexity\/src\/Exception\/Exception.php":"0bad8027feac8b1f7a8a1d6be3b5b6a5","vendor\/sebastian\/complexity\/src\/Exception\/RuntimeException.php":"3550006b3bc2fb0f0028328130c670bd","vendor\/sebastian\/complexity\/src\/Visitor\/ComplexityCalculatingVisitor.php":"0afbeb28a419ea7cd9e7dc28f40afb18","vendor\/sebastian\/complexity\/src\/Visitor\/CyclomaticComplexityCalculatingVisitor.php":"b1c3d78b1de40ba209a7a9b15fd5d6b5","vendor\/sebastian\/diff\/src\/Chunk.php":"b3088d9a5e209fc37fc906fe0e71ffe2","vendor\/sebastian\/diff\/src\/Diff.php":"5ac17482e50e091dbb69e56dd147e2d1","vendor\/sebastian\/diff\/src\/Differ.php":"97d6d27e3f4dc2ec5d655b43979c819e","vendor\/sebastian\/diff\/src\/Exception\/ConfigurationException.php":"31b0fc23bdc84999a80e69fdade3c0fc","vendor\/sebastian\/diff\/src\/Exception\/Exception.php":"e769de777f4a7514d827d32fd189f41a","vendor\/sebastian\/diff\/src\/Exception\/InvalidArgumentException.php":"2304e31b113669c783a97a7db12b4b5c","vendor\/sebastian\/diff\/src\/Line.php":"31308132973888c9b1300509afc84f42","vendor\/sebastian\/diff\/src\/LongestCommonSubsequenceCalculator.php":"838d7d2b4591d109ec8028654b375f06","vendor\/sebastian\/diff\/src\/MemoryEfficientLongestCommonSubsequenceCalculator.php":"d1a4336bcb61da206c49d7bd513fd289","vendor\/sebastian\/diff\/src\/Output\/AbstractChunkOutputBuilder.php":"3353ff979b09023f85f4a1e6cf363c9f","vendor\/sebastian\/diff\/src\/Output\/DiffOnlyOutputBuilder.php":"02a1b093d3e52f641506ce31eb709749","vendor\/sebastian\/diff\/src\/Output\/DiffOutputBuilderInterface.php":"93536a892513cd75f22ee22006ccd593","vendor\/sebastian\/diff\/src\/Output\/StrictUnifiedDiffOutputBuilder.php":"c9485bb6ed519e213d6367bec28a0c16","vendor\/sebastian\/diff\/src\/Output\/UnifiedDiffOutputBuilder.php":"ed105ecde75ef317d82b82a200de6953","vendor\/sebastian\/diff\/src\/Parser.php":"f6d4204e4680bcdd1868d7d7801de807","vendor\/sebastian\/diff\/src\/TimeEfficientLongestCommonSubsequenceCalculator.php":"bfd78023ab169bb309f48c4b99045f60","vendor\/sebastian\/environment\/src\/Console.php":"3ecfa6abdb01795eb7bdc966dca5e098","vendor\/sebastian\/environment\/src\/OperatingSystem.php":"c87394cfc98eb15f75f28e61b55cb719","vendor\/sebastian\/environment\/src\/Runtime.php":"2035af604450a1ea35ff6d5e38a04c63","vendor\/sebastian\/exporter\/src\/Exporter.php":"614ce6d30f52b6c6668131fcb34a8592","vendor\/sebastian\/global-state\/src\/CodeExporter.php":"e2f963976ed71cf1b9760aeb93039d69","vendor\/sebastian\/global-state\/src\/ExcludeList.php":"5d61e48d68ba1b8ca013869c84865232","vendor\/sebastian\/global-state\/src\/Restorer.php":"da92f0594b0f065e73f145a366f55a34","vendor\/sebastian\/global-state\/src\/Snapshot.php":"bd66a2f500ce2583a39043a3fb2e075f","vendor\/sebastian\/global-state\/src\/exceptions\/Exception.php":"4b9b742ce3cd00f6db622b67dc8e7412","vendor\/sebastian\/global-state\/src\/exceptions\/RuntimeException.php":"685aab227af4968fcd4008e306f48998","vendor\/sebastian\/lines-of-code\/src\/Counter.php":"0b3d9d5d93ee84a13d10c59cee66d4be","vendor\/sebastian\/lines-of-code\/src\/Exception\/Exception.php":"e3897a61b6a90c3c741d4d29d51ce40a","vendor\/sebastian\/lines-of-code\/src\/Exception\/IllogicalValuesException.php":"c6f9e9eb5cef39b9a5d9ee21d83bbf0e","vendor\/sebastian\/lines-of-code\/src\/Exception\/NegativeValueException.php":"0cb551c1ef3ecac47ae0e03f82db01d1","vendor\/sebastian\/lines-of-code\/src\/Exception\/RuntimeException.php":"a2e55c7909e972f492def2d64c167c03","vendor\/sebastian\/lines-of-code\/src\/LineCountingVisitor.php":"7974706748a36dd2e0e0509eb173545e","vendor\/sebastian\/lines-of-code\/src\/LinesOfCode.php":"f2519bd74678768184d0fd12eff6060b","vendor\/sebastian\/object-enumerator\/src\/Enumerator.php":"28e9a55488e4d8e0f3a2a1275daca50d","vendor\/sebastian\/object-enumerator\/src\/Exception.php":"f7246fcbc603335f0546f8bf80881328","vendor\/sebastian\/object-enumerator\/src\/InvalidArgumentException.php":"2ba86f83408f76c4e86185316cea0100","vendor\/sebastian\/object-reflector\/src\/Exception.php":"fda5e3bc4068760ad3050b04d4c9a411","vendor\/sebastian\/object-reflector\/src\/InvalidArgumentException.php":"d980edf07438fc5884b3bc282e376b9f","vendor\/sebastian\/object-reflector\/src\/ObjectReflector.php":"22160ff4fcf0a3b8456f61b4051c26e5","vendor\/sebastian\/recursion-context\/src\/Context.php":"9888ae602dd131e93809f5e9fecdbaf6","vendor\/sebastian\/recursion-context\/src\/Exception.php":"4f4cac7f5104c81a3ce323ed9c58e5c4","vendor\/sebastian\/recursion-context\/src\/InvalidArgumentException.php":"01460b1f12fcd1a4f3b1c4e6f083e3ed","vendor\/sebastian\/resource-operations\/build\/generate.php":"9858f8a9db22c38bbed4fca0b33ef5b9","vendor\/sebastian\/resource-operations\/src\/ResourceOperations.php":"d12911023dda5a63cd9aa0580febedfc","vendor\/sebastian\/type\/src\/Parameter.php":"15a02bbf62506189f13a7b372d635fa0","vendor\/sebastian\/type\/src\/ReflectionMapper.php":"4169d6901bf075bb078875f07fc50012","vendor\/sebastian\/type\/src\/TypeName.php":"3bd3ffaead5e1f3a0086cba370e75a4e","vendor\/sebastian\/type\/src\/exception\/Exception.php":"7b1b09817679040f2244d2ba776042f6","vendor\/sebastian\/type\/src\/exception\/RuntimeException.php":"0a6b3580f5fa4ca488a5462031e9f21b","vendor\/sebastian\/type\/src\/type\/CallableType.php":"c0db785fdd5dd5e7894ddf1a0f7bb3b9","vendor\/sebastian\/type\/src\/type\/FalseType.php":"a71c0d438d1b24a8bd705bee1bff746d","vendor\/sebastian\/type\/src\/type\/GenericObjectType.php":"c7f890ef3f0ac08a8d81ee3e95cd51fe","vendor\/sebastian\/type\/src\/type\/IntersectionType.php":"4471c4c9be1dd1a91600b6adc78dd85a","vendor\/sebastian\/type\/src\/type\/IterableType.php":"3c5e21675748d84f07ea1f0bf9ad4be1","vendor\/sebastian\/type\/src\/type\/MixedType.php":"adf72bd83b635344188b176c23510101","vendor\/sebastian\/type\/src\/type\/NeverType.php":"e57317aabf40b9bab12448419941b83b","vendor\/sebastian\/type\/src\/type\/NullType.php":"47e1d9c989f96b2fc44fe63650bef0a2","vendor\/sebastian\/type\/src\/type\/ObjectType.php":"a293f6668c5ce4f84283924357e8c1dd","vendor\/sebastian\/type\/src\/type\/SimpleType.php":"f89ab436c3d5869c640241cec64b4b1c","vendor\/sebastian\/type\/src\/type\/StaticType.php":"14393caf1f8a3480d55a7f693718c2f0","vendor\/sebastian\/type\/src\/type\/TrueType.php":"b02956938cedfb6273694ac561730982","vendor\/sebastian\/type\/src\/type\/Type.php":"4f661486a51ae961a2e880977de31a31","vendor\/sebastian\/type\/src\/type\/UnionType.php":"e47508cc97fa1dbd50c18894b6ba3b56","vendor\/sebastian\/type\/src\/type\/UnknownType.php":"2c1a1b9545d50f42042909172bc67321","vendor\/sebastian\/type\/src\/type\/VoidType.php":"4141c6ac0035b29d06e340e6d941dc35","vendor\/sebastian\/version\/src\/Version.php":"7f59798f3c6fcdbf5703e13482967108","vendor\/squizlabs\/php_codesniffer\/autoload.php":"0d7c6269a821deb7f28c611c5cf5a34e","vendor\/squizlabs\/php_codesniffer\/src\/Config.php":"24bea1f4c878cc2132c376a8a69be900","vendor\/squizlabs\/php_codesniffer\/src\/Exceptions\/DeepExitException.php":"4de21e8d993c60e5309a2d5b02be7b47","vendor\/squizlabs\/php_codesniffer\/src\/Exceptions\/RuntimeException.php":"c99d30efa77e717459e6f97824f1f518","vendor\/squizlabs\/php_codesniffer\/src\/Exceptions\/TokenizerException.php":"2efcc310f2d42ecebfd45f48404d3366","vendor\/squizlabs\/php_codesniffer\/src\/Files\/DummyFile.php":"8e50bd7aca5a4d61659a1f4c5bde5d6b","vendor\/squizlabs\/php_codesniffer\/src\/Files\/File.php":"91eb8c342d5a59c6885579b8a12ab47e","vendor\/squizlabs\/php_codesniffer\/src\/Files\/FileList.php":"f7dfbc046d8df3ead7cf19da0d88b47b","vendor\/squizlabs\/php_codesniffer\/src\/Files\/LocalFile.php":"aba69b1d393e96d69d35b51f72b05b29","vendor\/squizlabs\/php_codesniffer\/src\/Filters\/ExactMatch.php":"bf6f842e0bed88711363109ca75e1547","vendor\/squizlabs\/php_codesniffer\/src\/Filters\/Filter.php":"d1d5aa99550c324809a3c59fb15162ce","vendor\/squizlabs\/php_codesniffer\/src\/Filters\/GitModified.php":"7c8ae581754ea716c39a3b3b8e2a2f06","vendor\/squizlabs\/php_codesniffer\/src\/Filters\/GitStaged.php":"5f6e1a05481cb420cf6a9933d533ae6b","vendor\/squizlabs\/php_codesniffer\/src\/Fixer.php":"2e2392271fa3817577ced02c50cec6e6","vendor\/squizlabs\/php_codesniffer\/src\/Generators\/Generator.php":"83cc48e6325a3a4331f0a80b131e5461","vendor\/squizlabs\/php_codesniffer\/src\/Generators\/HTML.php":"40d1c9a35ff4521c28f60d0b6636dc1f","vendor\/squizlabs\/php_codesniffer\/src\/Generators\/Markdown.php":"873ad763697ca77c4fda260b28c56c64","vendor\/squizlabs\/php_codesniffer\/src\/Generators\/Text.php":"35274a09f06e4054f951f62f06aabc4c","vendor\/squizlabs\/php_codesniffer\/src\/Reporter.php":"71a02b7316a7c327dbf48f3e1962f6c2","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Cbf.php":"5afeb273c828403571e9437a32fc4932","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Checkstyle.php":"4432951c9aa718b036c0ddde6c8c85f9","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Code.php":"595f0557e5b9098beff56f1cbaa0df36","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Csv.php":"5754bf58d6dae834bda0b944f7a1ab02","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Diff.php":"72882b757a8b3cd4536d6399630d105f","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Emacs.php":"e86feb583d1680853d3a0873147d26a7","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Full.php":"ef4dc71d18b82d70d7822060090afc42","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Gitblame.php":"85278c8b6a8885bacad3c9272ec42d5d","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Hgblame.php":"4d89500bd8725a82a4280b6580e89ee9","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Info.php":"93eb77b9496c73655752682782419266","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Json.php":"ba81f54e491d8fafdee7a4f28085f326","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Junit.php":"e3c37736aea31958afcf04ca7d1ba78d","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Notifysend.php":"c0409b4554845513cd4595d46e0db8d8","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Performance.php":"bb6118caa86ccd7fb26657ea02f9eeee","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Report.php":"20b5ba5bdb33210615ec1682d948ef89","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Source.php":"3edaef5d8410cb57c5af8e59e6b0d0cd","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Summary.php":"562a3aca8b1f7a000dafc70f3bad30c3","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Svnblame.php":"dd981565aa0d5c475f43d1a8bdc97728","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/VersionControl.php":"0db323d2de9f13d0c8488310809d9cf8","vendor\/squizlabs\/php_codesniffer\/src\/Reports\/Xml.php":"9c17a447db2e288ff01d27a65ebbbd14","vendor\/squizlabs\/php_codesniffer\/src\/Ruleset.php":"59d040680ca1374c9715556b6c0586b3","vendor\/squizlabs\/php_codesniffer\/src\/Runner.php":"92a353d0876a848c6a77af686c320c48","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/AbstractArraySniff.php":"f0bf74d5d233877c4d64982c0ad589ba","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/AbstractPatternSniff.php":"a73f5a1d5091c1b738077a3a043f85ac","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/AbstractScopeSniff.php":"f85d01ee9102e7f585215a2da3df9e51","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/AbstractVariableSniff.php":"d31e43882e2ef116d419fe13fd090885","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/DeprecatedSniff.php":"9ea0ad04b957d02f572a33f718837d23","vendor\/squizlabs\/php_codesniffer\/src\/Sniffs\/Sniff.php":"dd74c68867d27339e863715e3eff2831","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Arrays\/ArrayIndentSniff.php":"c398f11eb20888a271512a6a2fe5d9cd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Arrays\/DisallowLongArraySyntaxSniff.php":"db1f67bf3d1361e0bd102c58be65c36b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Arrays\/DisallowShortArraySyntaxSniff.php":"704ae01aded423be41c646cca14f6683","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Classes\/DuplicateClassNameSniff.php":"18a1b0e16f45ca92967b6ee0956d7c88","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Classes\/OpeningBraceSameLineSniff.php":"330fd5652704c1a0870b43c9563bb24d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/AssignmentInConditionSniff.php":"64353accc84b3678c7e80328b4368064","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/EmptyPHPStatementSniff.php":"371bd91cb194856c6d22dcd65b1221e3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/EmptyStatementSniff.php":"72e7c33ee9620d74b2609daa5147e073","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/ForLoopShouldBeWhileLoopSniff.php":"d54d3a2af0ca29da929f246b34760f98","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/ForLoopWithTestFunctionCallSniff.php":"5784839c7cffa883fc95a424e13ffbdf","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/JumbledIncrementerSniff.php":"1c55c2bf47c504602eb665a158d40eaf","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/RequireExplicitBooleanOperatorPrecedenceSniff.php":"190aa34184347b295a9ca7564ea4fe7c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/UnconditionalIfStatementSniff.php":"f02065bcb7b2d0b645fc2d4c53f499b6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/UnnecessaryFinalModifierSniff.php":"3cddadc6706926d1e0a64b0955675537","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/UnusedFunctionParameterSniff.php":"0949a609cefd7c70a8e788d871149f7c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/CodeAnalysis\/UselessOverridingMethodSniff.php":"7feef8e5f168a9bcb0dc9f3e55b76088","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Commenting\/DocCommentSniff.php":"ea63a1fcde7f7037afb08e603c11cab9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Commenting\/FixmeSniff.php":"aca176ed577c6f912730f564ce207c82","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Commenting\/TodoSniff.php":"8ca7f05c6ae5aaa27f89f4abad3b8173","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/ControlStructures\/DisallowYodaConditionsSniff.php":"0bfb9e4e8d0c8dcae3d943cfe3e5a736","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/ControlStructures\/InlineControlStructureSniff.php":"5b142fea908171fee18c430d6e140015","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Debug\/CSSLintSniff.php":"c67c53384f6f3c59a0faf23e381a22ab","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Debug\/ClosureLinterSniff.php":"4b04e585772191b6154717ed9a57df42","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Debug\/ESLintSniff.php":"ccd772b0cf47fbd59240ccac8c6520af","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Debug\/JSHintSniff.php":"f8bcfe379c81e66d1161b272f87f0df0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/ByteOrderMarkSniff.php":"8f36844f19caeec32d1eb19c06503a01","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/EndFileNewlineSniff.php":"be0456a8037c7c6f4f845d21e972a12d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/EndFileNoNewlineSniff.php":"af631a5015e3a9bc1c7fdcfa6ddd82cb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/ExecutableFileSniff.php":"2b9a9b3133f1197cece3993018ebb227","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/InlineHTMLSniff.php":"6d4140a7edace4f5197d3d96000eb4b8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/LineEndingsSniff.php":"7890502b0a031dd11ff329bfad8b78e1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/LineLengthSniff.php":"be4e11a39a8a9288336eea78cc400033","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/LowercasedFilenameSniff.php":"91eac9ad87844d04705ea69ca3a2785f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/OneClassPerFileSniff.php":"d84eee3d6f4d1cb87ad14c5bfccea34a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/OneInterfacePerFileSniff.php":"d997732dbe7c4046551d642567fff98a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/OneObjectStructurePerFileSniff.php":"f36d1e6671b6436bb1d17003a02db3bd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Files\/OneTraitPerFileSniff.php":"dddaf7f793650ecf0d60c4380fc1ac88","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/DisallowMultipleStatementsSniff.php":"1ea8144313f4d52f6e5a8dd8df177c3c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/MultipleStatementAlignmentSniff.php":"fe5754107ce56d760cf9a20002a9628c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/NoSpaceAfterCastSniff.php":"33bf84afb50f7bb204b60a69955df26a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/SpaceAfterCastSniff.php":"6e6d33e76b4661d45f82576a24584b6c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/SpaceAfterNotSniff.php":"eb2294dc38c77df8943c29a5ce60e494","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Formatting\/SpaceBeforeCastSniff.php":"521d1aa730f705c4cb94f49f3624c6d2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Functions\/CallTimePassByReferenceSniff.php":"e05bf8a729dce30afaea9731033b958e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Functions\/FunctionCallArgumentSpacingSniff.php":"2306a7ac3a5e14051b19cf6a77e1b3c1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Functions\/OpeningFunctionBraceBsdAllmanSniff.php":"bfb1344eedb5a55dc2afdfc82660e1a6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Functions\/OpeningFunctionBraceKernighanRitchieSniff.php":"79d2fcdc5f4c87669e69e47da6d76b57","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Metrics\/CyclomaticComplexitySniff.php":"0283576a33bd8150d5582972bb57edbe","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Metrics\/NestingLevelSniff.php":"a38001e85577ab78f49168ca1e19eb9b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/AbstractClassNamePrefixSniff.php":"c4a91981b282b7c546ab7932ca7710ac","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/CamelCapsFunctionNameSniff.php":"66a26395e6eb15e9186ab4605c8b8904","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/ConstructorNameSniff.php":"9504c6a1d853ca00def5adf89a2d8bd5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/InterfaceNameSuffixSniff.php":"afbe2cd17735af3456958f82d57067ef","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/TraitNameSuffixSniff.php":"b219c3cdc037c58fa4a24b242f1b5412","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/NamingConventions\/UpperCaseConstantNameSniff.php":"71bc6ac0c5c9cc7e7716f9cb8df7f760","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/BacktickOperatorSniff.php":"d0fdd88131cf0f3c026258ab42076634","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/CharacterBeforePHPOpeningTagSniff.php":"c193b2db015d2436f38782980c7fec31","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/ClosingPHPTagSniff.php":"202f249dff283ae73a31e289c8f340cc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/DeprecatedFunctionsSniff.php":"9272ebe8522cdb66dd161b1573e5e39b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/DisallowAlternativePHPTagsSniff.php":"3556f6f2a2c952ddb8990e59560b305f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/DisallowRequestSuperglobalSniff.php":"28bcffeb7dfa30d6801f9cbc8f636877","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/DisallowShortOpenTagSniff.php":"7fb814bd902eecda88cfe5715cc0132e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/DiscourageGotoSniff.php":"8921336a64e9776649cb51812ba4c739","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/ForbiddenFunctionsSniff.php":"edce7155878038cb714884cb27236240","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/LowerCaseConstantSniff.php":"bcd67502b828aa089bcf8e8b7c55d87e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/LowerCaseKeywordSniff.php":"a34be32d856d25e1af73a62f089094b5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/LowerCaseTypeSniff.php":"9a66751f874a6024c7e0761f8d41c158","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/NoSilencedErrorsSniff.php":"b4eeae6c8bdf10ccc970fa0c2c3d6f71","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/RequireStrictTypesSniff.php":"b0625b9990aace1181303ca6967d62b7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/SAPIUsageSniff.php":"6921cdf404957c7bcfd565944ce63136","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/SyntaxSniff.php":"5b7744c04ee5a3821f2dae469709f0af","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/PHP\/UpperCaseConstantSniff.php":"ec291fe93c8d1524cdec5f11aa147922","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/Strings\/UnnecessaryStringConcatSniff.php":"bed72d844a2bda28f59bc2e206146aab","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/VersionControl\/GitMergeConflictSniff.php":"08ee9694299aae85df7a17db2bb43c32","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/VersionControl\/SubversionPropertiesSniff.php":"3767fa833b108198b1e77d70f02fa3e0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/ArbitraryParenthesesSpacingSniff.php":"57d13df67cc5fcbfa7a90e6e55c36fac","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/DisallowSpaceIndentSniff.php":"fb68cbc740258e21295c7c0590a5a2f1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/DisallowTabIndentSniff.php":"8e2a835974f8c44616379dd2da3dd59c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/IncrementDecrementSpacingSniff.php":"cfd726db70f49dd5a7f6b93570377499","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/LanguageConstructSpacingSniff.php":"6bfc841a4bb39b509d5d149c8c74a856","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/ScopeIndentSniff.php":"e7da5cf1e22911d454d3800d5dbcf3b5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Sniffs\/WhiteSpace\/SpreadOperatorSpacingAfterSniff.php":"d8ecd010632475439bd1a7efba570e5e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Arrays\/ArrayIndentUnitTest.php":"7582c71c4899f8f2554e8dc434f9a353","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Arrays\/DisallowLongArraySyntaxUnitTest.php":"1d00d3d88cb4e68cea85d60437e0b409","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Arrays\/DisallowShortArraySyntaxUnitTest.php":"6c29b7bee92c226a04a4bf28a074d7ac","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Classes\/DuplicateClassNameUnitTest.php":"be98f634c2e7bd3ef997b7cbe1604312","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Classes\/OpeningBraceSameLineUnitTest.php":"2b2c02b636e55b41187e7f6f8c68ecef","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/AssignmentInConditionUnitTest.php":"08e63ac90909e610ea18bc9b68c52f45","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/EmptyPHPStatementUnitTest.php":"7790443359c7372bc541ba577cd41ebe","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/EmptyStatementUnitTest.php":"c1fc8fc7eb20dab097291e61148f51ba","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/ForLoopShouldBeWhileLoopUnitTest.php":"cada92797373ce17964aee6f21ac35ef","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/ForLoopWithTestFunctionCallUnitTest.php":"d62b01dd94d86f7cf91f42953f386409","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/JumbledIncrementerUnitTest.php":"ffcdc0d8daf84462a564760263602862","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/RequireExplicitBooleanOperatorPrecedenceUnitTest.php":"b4c9835cd01b3d560f0510c40e52176f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/UnconditionalIfStatementUnitTest.php":"9a4e3cd6b8b871bf981776309bb67212","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/UnnecessaryFinalModifierUnitTest.php":"71f5bbee1f55fcd154a417443b95807a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/UnusedFunctionParameterUnitTest.php":"ac387d7d898183ea6282128bfa58fb2f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/CodeAnalysis\/UselessOverridingMethodUnitTest.php":"ce72cb283352af30888fb9c2d6faa078","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Commenting\/DocCommentUnitTest.php":"9535747daee735ead33ffd1d277490d8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Commenting\/FixmeUnitTest.php":"601fd42e1803c68736935b6d5356ec31","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Commenting\/TodoUnitTest.php":"8227e241c3070abb0a5b5904d5507845","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/ControlStructures\/DisallowYodaConditionsUnitTest.php":"eb1221195fb0c1aa18e73d869b3a3b8f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/ControlStructures\/InlineControlStructureUnitTest.php":"98f410e565177a9422144d173af7efa7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Debug\/CSSLintUnitTest.php":"b10b5218c26163c695eb1674ea8293b4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Debug\/ClosureLinterUnitTest.php":"ddec8675f085e35bb5b8c691d4175fe9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Debug\/ESLintUnitTest.php":"8094b91b823e391af7346a4ffa9040e3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Debug\/JSHintUnitTest.php":"3dd9885e9e27e3bcd6743cd0bdbae822","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/ByteOrderMarkUnitTest.php":"e8a25ff116f616e0f56e4a5732972984","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/EndFileNewlineUnitTest.php":"cecf0fcecc3156b26024a0050ab8c141","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/EndFileNoNewlineUnitTest.php":"4eff3235c786e030b8cc2e819ee4c144","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/ExecutableFileUnitTest.php":"e7a0f2dea5cf3e097c5e29cb7e47335a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/InlineHTMLUnitTest.php":"aa67612911baede9cb69cbb32793f870","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/LineEndingsUnitTest.php":"f7d1b13e8f9b9d76f679ffdf439a0656","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/LineLengthUnitTest.php":"3184fed26c89816038d460b12464ae0d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/LowercasedFilenameUnitTest.php":"c1e549cae6b6b00c5c6a9c96ed1c25c0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/OneClassPerFileUnitTest.php":"f6367122f110f13f1686895e259c80ca","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/OneInterfacePerFileUnitTest.php":"f85b623fd29ab365e0ef3ebe03ad813d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/OneObjectStructurePerFileUnitTest.php":"1a186d7ce983e971399cab2d1693b11e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Files\/OneTraitPerFileUnitTest.php":"e052684f0b4a524dcc5a68847283f8cd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/DisallowMultipleStatementsUnitTest.php":"bb2ce6162c45492967deb09d88e4ccd5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/MultipleStatementAlignmentUnitTest.php":"f39eaff44a474dd1ff9ccb88d05d47d7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/NoSpaceAfterCastUnitTest.php":"0593bc8cba5dd0ed70ab14330010b7f6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/SpaceAfterCastUnitTest.php":"53b7cbcaf9c6bb4ddd271923a49bafa0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/SpaceAfterNotUnitTest.php":"2f204b7fc9f83e22d88952a4b8751ae4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Formatting\/SpaceBeforeCastUnitTest.php":"e3bd775a8f5821151a025b4f1250b6d9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Functions\/CallTimePassByReferenceUnitTest.php":"10a5f97bd80bee729f80db5a54bd2924","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Functions\/FunctionCallArgumentSpacingUnitTest.php":"60707e38401fc9e9f6c128be7a452fd5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Functions\/OpeningFunctionBraceBsdAllmanUnitTest.php":"f34453dd94e72770bb546c630541ef11","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Functions\/OpeningFunctionBraceKernighanRitchieUnitTest.php":"b7bc9ac8fd577b78fb063dbf068a2b0c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Metrics\/CyclomaticComplexityUnitTest.php":"9131ca19071565a459ef6981fdbfb488","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Metrics\/NestingLevelUnitTest.php":"d5679c1c7150a4b2717a7ec1e736d1ab","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/AbstractClassNamePrefixUnitTest.php":"f79cc0584afc13a03fdccf9920fd3507","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/CamelCapsFunctionNameUnitTest.php":"3030ff91caa3b94107a36e18b13eed73","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/ConstructorNameUnitTest.php":"cfc6a7d990cbac5d14df80e468ceb05b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/InterfaceNameSuffixUnitTest.php":"9391f5ec31caea528d7ee45dff6e9baf","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/TraitNameSuffixUnitTest.php":"1e4ffa0c28e4b9c144218fddb847a888","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/NamingConventions\/UpperCaseConstantNameUnitTest.php":"1c8617fb527c9d5ad0ec3476c1ce9a90","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/BacktickOperatorUnitTest.php":"fd80a7b55ef88199e6427535b727ff62","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/CharacterBeforePHPOpeningTagUnitTest.php":"4612fb121d896a99f2c8a1b6bb5bf8c5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/ClosingPHPTagUnitTest.php":"200c06e62714af42284290c4cda3ef71","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/DeprecatedFunctionsUnitTest.php":"a18714c42015c83ad672e590e6c9e575","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/DisallowAlternativePHPTagsUnitTest.php":"0105a136f412ac3177e5facecf85334c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/DisallowRequestSuperglobalUnitTest.php":"9a8a609e6def09073af0b0e4a6405684","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/DisallowShortOpenTagUnitTest.php":"6badc06403eb830ac47b36f4e841cf03","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/DiscourageGotoUnitTest.php":"d1c7cbdff49c8a8c2e5311fe237317e6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/ForbiddenFunctionsUnitTest.php":"867d008f6263ab91719d6f74af14102a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/LowerCaseConstantUnitTest.php":"906764efb03a19302cbcfb4ae16718a6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/LowerCaseKeywordUnitTest.php":"d35793b41302c4394a0080c4018da7f0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/LowerCaseTypeUnitTest.php":"eb13c8441c4b69ad003e6234d2089046","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/NoSilencedErrorsUnitTest.php":"e5e13c9e8d7c0b4752ac2ad9739f04c9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/RequireStrictTypesUnitTest.php":"adeb3a84b5f57c09c4c0dda66e7e9119","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/SAPIUsageUnitTest.php":"b2a19c4b9c66780e5d361b33a3926d7b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/SyntaxUnitTest.php":"55e5578cc5ecef23f853097d0faa68d9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/PHP\/UpperCaseConstantUnitTest.php":"96445133af8103502a301e76b167839f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/Strings\/UnnecessaryStringConcatUnitTest.php":"8356197e388bc23898bc33bc0064d968","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/VersionControl\/GitMergeConflictUnitTest.php":"11f56075d8ec5e1c98fdf6428053da8c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/VersionControl\/SubversionPropertiesUnitTest.php":"da86c19b5d777c613505d1f83d2d0d71","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/ArbitraryParenthesesSpacingUnitTest.php":"a0f058bfc2d0aa265f597814bf707eec","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/DisallowSpaceIndentUnitTest.php":"73fbf994a7dc0a8cfde24744c4ea3dc8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/DisallowTabIndentUnitTest.php":"8faa6bb414eaa28547a06ecc82045637","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/IncrementDecrementSpacingUnitTest.php":"0f39af2fc68ea3d39bc2d95b38ab6322","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/LanguageConstructSpacingUnitTest.php":"437b9f459fe77b9dfe87fe72dd86c967","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/ScopeIndentUnitTest.php":"1f2a01bf4c71293b08af905412c3652d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Generic\/Tests\/WhiteSpace\/SpreadOperatorSpacingAfterUnitTest.php":"22e755e47976e750252ffa030b2f1636","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/CSS\/BrowserSpecificStylesSniff.php":"8cf325ab2cb15954fec61d8903d1ed42","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Channels\/DisallowSelfActionsSniff.php":"26fa1ff6125a0020080196c7b28397e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Channels\/IncludeOwnSystemSniff.php":"2fd873a9036a21c35b90aae4431f140a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Channels\/IncludeSystemSniff.php":"81666270646faa8d8b31ac55e69f4171","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Channels\/UnusedSystemSniff.php":"b3d460cc39e5c7c287bfc4effb02dcbd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Commenting\/FunctionCommentSniff.php":"71e86d45d68fee5859811803602d3021","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Debug\/DebugCodeSniff.php":"293614ed418a6638034c011cd47382b8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Debug\/FirebugConsoleSniff.php":"f2c5371412a9c9d8bfbe5660d4316469","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Objects\/AssignThisSniff.php":"89d70abea850e0b7dbad4b02d61f525b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Objects\/CreateWidgetTypeCallbackSniff.php":"0c7144b886768fe33af2e030ddc15c0d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Objects\/DisallowNewWidgetSniff.php":"7087da66bfbc4470992d349c91faa6d8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/PHP\/AjaxNullComparisonSniff.php":"942f96b5f5a4606bc9609e5c525cc997","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/PHP\/EvalObjectFactorySniff.php":"987e0f11922ab0b9a830aa1808c7a7eb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/PHP\/GetRequestDataSniff.php":"25e64d725aad8c3ace518b1accd2d84f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/PHP\/ReturnFunctionValueSniff.php":"6a5ea2328e7840c7b4682d0d89d6562f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Sniffs\/Strings\/JoinStringsSniff.php":"2b68f6e04ebd3d5cfc9d58334a1b0df9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/CSS\/BrowserSpecificStylesUnitTest.php":"32016c2c3cfa8c563f800efc0742bf34","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Channels\/DisallowSelfActionsUnitTest.php":"7b9a7bd96522c562e484262259078c41","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Channels\/IncludeSystemUnitTest.php":"9a835d0200081c88f40abcd8cd5b38e0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Channels\/UnusedSystemUnitTest.php":"4491e8a7db99be320f78583948b87155","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Commenting\/FunctionCommentUnitTest.php":"906ef2e597445c2a55ea3eb1b2f49d63","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Debug\/DebugCodeUnitTest.php":"40c7cb0af69abbd327836025f0260dc1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Debug\/FirebugConsoleUnitTest.php":"6db28aeb39a72179a22d0bd4eed6619f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Objects\/AssignThisUnitTest.php":"09c11d56322480d394643ff3874f13bd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Objects\/CreateWidgetTypeCallbackUnitTest.php":"91a1ffac6f80b5035653bf430708e96d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Objects\/DisallowNewWidgetUnitTest.php":"cb8f2355fb11f5cfabb3608b0c6b6e21","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/PHP\/AjaxNullComparisonUnitTest.php":"c8092907c8f454246e62a22b75609316","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/PHP\/EvalObjectFactoryUnitTest.php":"e93c781e5881f118a17985bb61956107","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/PHP\/GetRequestDataUnitTest.php":"44df794cca18c9387fe76d9603a6e8dd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/PHP\/ReturnFunctionValueUnitTest.php":"9999c6c43c96e04f8d514a0407029a2b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/MySource\/Tests\/Strings\/JoinStringsUnitTest.php":"7d8e5b4d9d1398b4b02e35e81a2a5c51","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Classes\/ClassDeclarationSniff.php":"75cb65d6dec1d66f51eec5d564d9b6af","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Commenting\/ClassCommentSniff.php":"b129461fa6ff3e1e0d780bc069442c4f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Commenting\/FileCommentSniff.php":"5a959adbf6ec42dd3b7c579f8c807c5a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Commenting\/FunctionCommentSniff.php":"caa92803547e408975896ba1cc24b181","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Commenting\/InlineCommentSniff.php":"a70166baf68bcacf1640702b2a43515d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/ControlStructures\/ControlSignatureSniff.php":"9ad42a7be7848559ed828e577f9ab868","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/ControlStructures\/MultiLineConditionSniff.php":"1ab4caba06ddcdef39d81a5d8b603505","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Files\/IncludingFileSniff.php":"4731a25e94d2f0fd48707fcc9f06f143","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Formatting\/MultiLineAssignmentSniff.php":"1e3f3375c900dbf3d43cbae9bab22c4c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Functions\/FunctionCallSignatureSniff.php":"d6522f60f6c54d611cc370f3dbd49a69","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Functions\/FunctionDeclarationSniff.php":"5221d5cec21eb50511957fa2818c89b5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/Functions\/ValidDefaultValueSniff.php":"98e7dbf52dab9492a66a2553c3ab473d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/NamingConventions\/ValidClassNameSniff.php":"f1473cb47a6b0349cad937ef701bc153","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/NamingConventions\/ValidFunctionNameSniff.php":"eb5e89ed9f8f1d805d519c5f26e3bfca","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/NamingConventions\/ValidVariableNameSniff.php":"ff472ca49b6b30e457a9f65adf9e39ab","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/WhiteSpace\/ObjectOperatorIndentSniff.php":"3b607425c1c81a6c1fc1ecea7abf7c3e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/WhiteSpace\/ScopeClosingBraceSniff.php":"1b97b0ba130d9eea914ef081f908798e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Sniffs\/WhiteSpace\/ScopeIndentSniff.php":"a6b8bec6f4b78e4d3280428a282f59d4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Classes\/ClassDeclarationUnitTest.php":"6490df3b029eb4db76f18b963b462cc8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Commenting\/ClassCommentUnitTest.php":"2e1d2863a3eaf9c85847d03c903f17ef","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Commenting\/FileCommentUnitTest.php":"c719a0e852fcc4407eb62876d2f79052","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Commenting\/FunctionCommentUnitTest.php":"c89363e64028a3eac59c6b4da37e51cb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Commenting\/InlineCommentUnitTest.php":"7598b633e02e5992e06a6ed82441054e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/ControlStructures\/ControlSignatureUnitTest.php":"29ad6aa9b8bb05a21fadc7ca0bf318d5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/ControlStructures\/MultiLineConditionUnitTest.php":"4f5d8289f37e8bbd5402c7c38530ff64","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Files\/IncludingFileUnitTest.php":"09b73925538cd78910ba85c9130a0212","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Formatting\/MultiLineAssignmentUnitTest.php":"f7f3c40a59c39eae0eadcee364776fb7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Functions\/FunctionCallSignatureUnitTest.php":"2f275fa5c74bc15afc52335d4ef30dce","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Functions\/FunctionDeclarationUnitTest.php":"74bec7f144f66a7c35252b9aa094749f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/Functions\/ValidDefaultValueUnitTest.php":"d7150c403378cf8fbeed68bc4bfa686d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/NamingConventions\/ValidClassNameUnitTest.php":"c34a0b9de29291d331fff99f5fc25919","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/NamingConventions\/ValidFunctionNameUnitTest.php":"a80994e316459da426e4589f954bd039","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/NamingConventions\/ValidVariableNameUnitTest.php":"c02627ee852013f971204f57d3e65913","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/WhiteSpace\/ObjectOperatorIndentUnitTest.php":"b1e9a41577e5cc65f64c2b2b08f18654","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/WhiteSpace\/ScopeClosingBraceUnitTest.php":"0fdfacfcdfa9e0f1d3546acac468ca31","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PEAR\/Tests\/WhiteSpace\/ScopeIndentUnitTest.php":"6789293c776c918679e5b12fb74c7c9f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Sniffs\/Classes\/ClassDeclarationSniff.php":"f0f88d9b85b57728c3e74b9076db0161","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Sniffs\/Files\/SideEffectsSniff.php":"1a65717e5300b675cf2e1f5204d51cc1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Sniffs\/Methods\/CamelCapsMethodNameSniff.php":"ba656a6e6468cb99417186d3b06745b0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Tests\/Classes\/ClassDeclarationUnitTest.php":"74bdb890f4c35e41d81eb6c739020be4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Tests\/Files\/SideEffectsUnitTest.php":"28b4d7a8b0e2104875b0ee1028f0724c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR1\/Tests\/Methods\/CamelCapsMethodNameUnitTest.php":"380ec66a108059b35e36bc234373be80","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Classes\/AnonClassDeclarationSniff.php":"4e1c2c66ef8087ccbe03c343930911f6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Classes\/ClassInstantiationSniff.php":"ce2b8940ed15fd4cdcdea9271577c7e7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Classes\/ClosingBraceSniff.php":"342d897c69953770d64409e792f0df52","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Classes\/OpeningBraceSpaceSniff.php":"d163e2d07cb4f8124dbe101d028d8f22","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/ControlStructures\/BooleanOperatorPlacementSniff.php":"24e33d5365f5e56124306fb3bc57dfec","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/ControlStructures\/ControlStructureSpacingSniff.php":"4b1695126222ccc95a216c9263fd5c82","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Files\/DeclareStatementSniff.php":"a47fd6ea6040ab75a226511a0fb11ec5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Files\/FileHeaderSniff.php":"01aec9b19c0b5933580bf4430c506e4e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Files\/ImportStatementSniff.php":"a1ff24bb77305db43afb82aa923fb8cd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Files\/OpenTagSniff.php":"a4ff87c4a59f5fa66ddf49c1adaf16c8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Functions\/NullableTypeDeclarationSniff.php":"41d5afeb4f8113acd3ffc63f0b2bf2a5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Functions\/ReturnTypeDeclarationSniff.php":"49f9ad759eef7a87ca22abf9d4fce9fc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Keywords\/ShortFormTypeKeywordsSniff.php":"30c612468ca79b9c387f0845b8b849e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Namespaces\/CompoundNamespaceDepthSniff.php":"0d658601317bd8e3e4658a5b2126d4b9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Operators\/OperatorSpacingSniff.php":"cf99179b6c089b317dbb102d5ad2bafa","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Properties\/ConstantVisibilitySniff.php":"1e5e915dd6f492b38f1a3850b75b443e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Sniffs\/Traits\/UseDeclarationSniff.php":"9e006b4815260d69d6b126287e36031f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Classes\/AnonClassDeclarationUnitTest.php":"e81a502448e34f1fb1324ab220ff7480","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Classes\/ClassInstantiationUnitTest.php":"19641f9eb28733a075c59c62637e8796","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Classes\/ClosingBraceUnitTest.php":"64fa5d653fd02799f9b212452f3ec3d0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Classes\/OpeningBraceSpaceUnitTest.php":"382c10ac1aa5400e1e2669a789be93c8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/ControlStructures\/BooleanOperatorPlacementUnitTest.php":"46b17f9ff8d54021c7c49fdec5bd7c9f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/ControlStructures\/ControlStructureSpacingUnitTest.php":"f9afdf80b7a3dea28b39a274a97cce3d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Files\/DeclareStatementUnitTest.php":"9590c80c88c508257b2ed7c31dc39a1b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Files\/FileHeaderUnitTest.php":"60ed284f0ec7de9479a839421778cddc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Files\/ImportStatementUnitTest.php":"59d407333d114ae469b0aea12108eb53","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Files\/OpenTagUnitTest.php":"a4ea2a73f106a5193871fe1d4a30dbb0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Functions\/NullableTypeDeclarationUnitTest.php":"b5feeb96ae1d3ebdc351467c1927511b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Functions\/ReturnTypeDeclarationUnitTest.php":"a2efc788d2585f4db253550cacc5473a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Keywords\/ShortFormTypeKeywordsUnitTest.php":"78448d6e2be904b638d73889864d185c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Namespaces\/CompoundNamespaceDepthUnitTest.php":"760ba1ab8238a95654bddb0eb53a2628","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Operators\/OperatorSpacingUnitTest.php":"a191f362c9d68658f4bf5ca488ed3470","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Properties\/ConstantVisibilityUnitTest.php":"73965bb685dc17622b1a12f5c2b2b628","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR12\/Tests\/Traits\/UseDeclarationUnitTest.php":"2f951506ec44de58fda9ce955c65e085","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Classes\/ClassDeclarationSniff.php":"8a16fbce6268f52105a57defb80f6bbc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Classes\/PropertyDeclarationSniff.php":"81ca630e9790fcc296eaa793b6816257","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/ControlStructures\/ControlStructureSpacingSniff.php":"d906341543a8491bedb80ae79bd7c073","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/ControlStructures\/ElseIfDeclarationSniff.php":"f093948c0b914e21e95b7ff3f5650f78","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/ControlStructures\/SwitchDeclarationSniff.php":"5d5495571c779276f3f3a398fa98550e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Files\/ClosingTagSniff.php":"01d28afa7328f2e8135d4354769e8a1b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Files\/EndFileNewlineSniff.php":"640038f828ce222c94759a68fcbc974c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Methods\/FunctionCallSignatureSniff.php":"83ea663347ced1410cbbe898a3db84b8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Methods\/FunctionClosingBraceSniff.php":"0a2be97654984ac5af7c83f5acedb718","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Methods\/MethodDeclarationSniff.php":"12984a710fb52e9a44bec42759a5aace","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Namespaces\/NamespaceDeclarationSniff.php":"22dd989ebbde0d51094838b343010d8c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Sniffs\/Namespaces\/UseDeclarationSniff.php":"3948b5c26d6c5ee79f36816173f1811e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Classes\/ClassDeclarationUnitTest.php":"8ee278d62cc32e2e64dea29760f8abbe","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Classes\/PropertyDeclarationUnitTest.php":"f090834cd8573df5add3b180b0c839b2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/ControlStructures\/ControlStructureSpacingUnitTest.php":"168d03c7c8c8444711c1fc6caf9f45f9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/ControlStructures\/ElseIfDeclarationUnitTest.php":"87d6a4505790865ca9d1f9c40205cf4c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/ControlStructures\/SwitchDeclarationUnitTest.php":"2d1c25a79ea6d28b75672f00e1134f3b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Files\/ClosingTagUnitTest.php":"6c0bc2bbf61948ebf005cd1e9a756258","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Files\/EndFileNewlineUnitTest.php":"fdffd79139988b917772d6f51c4998d8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Methods\/FunctionCallSignatureUnitTest.php":"5dba7d0983da9bf7734b061fc2a80c56","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Methods\/FunctionClosingBraceUnitTest.php":"d369e307dee7e30e9deb0ba5d024fc45","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Methods\/MethodDeclarationUnitTest.php":"4af216ca071e03ed9f50a6e75f6de298","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Namespaces\/NamespaceDeclarationUnitTest.php":"0c7b89ee4ae1fa6cb407902de6554845","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/PSR2\/Tests\/Namespaces\/UseDeclarationUnitTest.php":"62d6a8dc52f5effdec32fc76069ca750","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Arrays\/ArrayBracketSpacingSniff.php":"fdcd74a939f2e7fc7282ef2e02897272","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Arrays\/ArrayDeclarationSniff.php":"e754ef61c5a0faa9c8fba92a5e839427","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ClassDefinitionClosingBraceSpaceSniff.php":"b2a4ef8de429da368fbc33a13f41cb24","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ClassDefinitionNameSpacingSniff.php":"196862c25c02993a6a9ab57ce4c8b45c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ClassDefinitionOpeningBraceSpaceSniff.php":"b62a706348bf893199bd94c9eb2ecc52","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ColonSpacingSniff.php":"a8ad13a49cdeb5175eed5eb2fe11ff19","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ColourDefinitionSniff.php":"79b7835a201e81349794385a3142c2bf","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/DisallowMultipleStyleDefinitionsSniff.php":"fec9e90c074c00a5b527c0afdd1fddc6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/DuplicateClassDefinitionSniff.php":"bd8d8bf1ed97add00db78f219ddb4248","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/DuplicateStyleDefinitionSniff.php":"69caebbffc5f67ff4b4dcfb1a902afec","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/EmptyClassDefinitionSniff.php":"699636e54dd23818af53eb2c00401a7a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/EmptyStyleDefinitionSniff.php":"9bfff954ef0e50802349813943ebe6db","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ForbiddenStylesSniff.php":"5e0a2b83de359cc17c5906f13d796fdb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/IndentationSniff.php":"bb9bc35bbc2a8e4c07d30378e4e15869","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/LowercaseStyleDefinitionSniff.php":"d2692f82494fddb712a7fbddf443b80b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/MissingColonSniff.php":"1b2f69fbdf3a7cb8fea6d776dafb81bc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/NamedColoursSniff.php":"4264e7f9e0578abaa6925dcb762bc1e3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/OpacitySniff.php":"8f0fd9bd5c12c589a49394de26c87e7c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/SemicolonSpacingSniff.php":"16edbb4703c50de8e4a42ab5fb81463e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/CSS\/ShorthandSizeSniff.php":"1ea9355aa75786dd0a6bb60814ed7f1d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/ClassDeclarationSniff.php":"efb00a84f353035db26300bd595816c1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/ClassFileNameSniff.php":"0bb0d33090c904cc9e0a2982e0249ea7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/DuplicatePropertySniff.php":"2c87d8ec278a982dfb585ad7f752489f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/LowercaseClassKeywordsSniff.php":"3a247bdcec1f4ff86bcb26b4aa8830fd","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/SelfMemberReferenceSniff.php":"a73f993251602066086d5b840469ad1d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Classes\/ValidClassNameSniff.php":"5953d0c1f9098b79a7fe645340f6f959","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/BlockCommentSniff.php":"32a74195c33dd7ebe576d24617c5181e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/ClassCommentSniff.php":"9120a595de605e0e57077a3efdd7be12","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/ClosingDeclarationCommentSniff.php":"377ab2e9e4d219176ff5fc0c7fdc0968","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/DocCommentAlignmentSniff.php":"9d414816c4a4cab1ff2e298c08442894","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/EmptyCatchCommentSniff.php":"a86b1ac0f5edbf2f41e5209c4187c27c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/FileCommentSniff.php":"61ecd044e2f01b32a8cb4e1d9d500ce5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/FunctionCommentSniff.php":"0e30c09ba26e44ff8ac4305a55dab3ee","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/FunctionCommentThrowTagSniff.php":"82bae30427c86965da0ced1136d7fb30","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/InlineCommentSniff.php":"086e3b8432aa2786aeade49b1e66dc6f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/LongConditionClosingCommentSniff.php":"ad54d38db09f915924b3e5ae29d8f97f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/PostStatementCommentSniff.php":"f1cb561cdf264799b42ad546e3be4162","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Commenting\/VariableCommentSniff.php":"a194ff15da809cd9b389024b231552b0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/ControlSignatureSniff.php":"44378c0111795fed55b6a575ef745ef7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/ElseIfDeclarationSniff.php":"180770bc876cfe7f1716da4b1be35cc2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/ForEachLoopDeclarationSniff.php":"0b8853ef3570d9e8bc682ba23a796a69","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/ForLoopDeclarationSniff.php":"97558f1e99861292bc90a3ac485d8b4b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/InlineIfDeclarationSniff.php":"7be39245de84496014b980446de54068","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/LowercaseDeclarationSniff.php":"ab73a308ddaa31b7f10d0b37e2a77ff1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/ControlStructures\/SwitchDeclarationSniff.php":"14eca585b6873fac6838e4be2ed6b259","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Debug\/JSLintSniff.php":"cb2c35d3b09f358921ca6f306d947160","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Debug\/JavaScriptLintSniff.php":"e94869516c7e385553988d1fa465aa7d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Files\/FileExtensionSniff.php":"3a623ac2b7e81645adc908bd0b1ce6e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Formatting\/OperatorBracketSniff.php":"fee7cd4b8afab8c0fb7422ab972b9ec0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/FunctionDeclarationArgumentSpacingSniff.php":"9327d896cfc47f25b02e10580eb0a24b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/FunctionDeclarationSniff.php":"30369081645b468ba867935b3cf6d9e6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/FunctionDuplicateArgumentSniff.php":"a808b1e1a8a1d57007e03a0ec753b5a8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/GlobalFunctionSniff.php":"6dbc966f24f44e658919577a48dfd9ab","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/LowercaseFunctionKeywordsSniff.php":"276fd42923196e87de815d582de2e4f5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Functions\/MultiLineFunctionDeclarationSniff.php":"df58737d5db5dd2d29df3b7d4fc09bf9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/NamingConventions\/ValidFunctionNameSniff.php":"32a4003a6fea6d1a53b41d864324d76b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/NamingConventions\/ValidVariableNameSniff.php":"0c1b6f0f0cf2e8fcaee1371a2d3dfcba","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Objects\/DisallowObjectStringIndexSniff.php":"906841bd8d3e7a85ddb7a47c49f117a0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Objects\/ObjectInstantiationSniff.php":"02cd2f12da4a2b81d3a8007661bb1896","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Objects\/ObjectMemberCommaSniff.php":"26ea3911470e787eedc900f8cc89c801","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Operators\/ComparisonOperatorUsageSniff.php":"981dfe7e0ed451cd85e4111994338b47","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Operators\/IncrementDecrementUsageSniff.php":"b74d94dec071a8802f8fedcd164e5fde","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Operators\/ValidLogicalOperatorsSniff.php":"6b95364bbc995f875aa3c5d70c7aa2e1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/CommentedOutCodeSniff.php":"660c54a072021bd5b5559ec193e845e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DisallowBooleanStatementSniff.php":"f36120830951e5cda9b4e23585a79712","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DisallowComparisonAssignmentSniff.php":"24b90b8ca9e6dd3b24b372045b1d14b3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DisallowInlineIfSniff.php":"40da5737fa32ba782284f677f78b779e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DisallowMultipleAssignmentsSniff.php":"a5b7a73cb7269376859bd23333794ca3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DisallowSizeFunctionsInLoopsSniff.php":"d4b764d80a88d20bf278a18d000e0765","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/DiscouragedFunctionsSniff.php":"d30c59ba6909d2a376cc9249fd24c65c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/EmbeddedPhpSniff.php":"78bfe0aa3508b56f5ae4a97a7775de29","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/EvalSniff.php":"2312299bcebcf2b2a14b0e543164b14d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/GlobalKeywordSniff.php":"88a4f60fe0b5d35a8e90c5a8a1c5c1c0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/HeredocSniff.php":"a02685c8b54b5e954c8dbfb502ee4aae","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/InnerFunctionsSniff.php":"59d27c98e7958546b3e94ff951bdc30f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/LowercasePHPFunctionsSniff.php":"0a71192f8ebd1e058d5a4299a16c4e2e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/PHP\/NonExecutableCodeSniff.php":"dadfab5eb0fac0a6ac238c96e0cdbaa0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Scope\/MemberVarScopeSniff.php":"edafd46804dbddb911580c1ff1c69874","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Scope\/MethodScopeSniff.php":"d65fd290d380008e20044504468a8c6a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Scope\/StaticThisUsageSniff.php":"4961f751f9f498157c24b3a55d1be465","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Strings\/ConcatenationSpacingSniff.php":"c3b0db7cd987533888b0208deb8c1b05","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Strings\/DoubleQuoteUsageSniff.php":"303e685be2b12f2396ee9dfbbc152f0f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/Strings\/EchoedStringsSniff.php":"f1604b140df40067686f45dbad859642","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/CastSpacingSniff.php":"71696fcf82021e9b6f41787b2d20de83","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/ControlStructureSpacingSniff.php":"9437a053c1a9c33a5cd6dc287699afdc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/FunctionClosingBraceSpaceSniff.php":"30f8897447dba5589aa33cb3dace73d5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/FunctionOpeningBraceSpaceSniff.php":"33d66b1ff633c66176ede489c13f8069","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/FunctionSpacingSniff.php":"11f32003f7e6fcbef5c482f1a5ec48f6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/LanguageConstructSpacingSniff.php":"6587f91bc7ef60247f0411b1919105f0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/LogicalOperatorSpacingSniff.php":"2061cba4d23a86fa4aeb580f551bdc05","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/MemberVarSpacingSniff.php":"0169cc96f4a37c5fef64d1bc6ff82fe4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/ObjectOperatorSpacingSniff.php":"4f57d4f468046df6bc996fa0d72780b1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/OperatorSpacingSniff.php":"d2121ff86d0168fcca467f9e5d72fc28","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/PropertyLabelSpacingSniff.php":"c7a22273eea7b3c7e3181dddba1ab2c4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/ScopeClosingBraceSniff.php":"f4bc175757f10cd05227e19ea94c0c5b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/ScopeKeywordSpacingSniff.php":"338bdb8a3817c5d3668680d17e0443c0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/SemicolonSpacingSniff.php":"f9b6b7f170bee29c741ecaec352e4184","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Sniffs\/WhiteSpace\/SuperfluousWhitespaceSniff.php":"2941cfb3bb196f47c6ef4bc6aeb43bca","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Arrays\/ArrayBracketSpacingUnitTest.php":"684677da23d43d6074d4f69d7980f3b0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Arrays\/ArrayDeclarationUnitTest.php":"1af5bfabf43ee75450e309a8ce1bd228","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ClassDefinitionClosingBraceSpaceUnitTest.php":"6b1ec4e3ac1ca98166c341ed19db99f9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ClassDefinitionNameSpacingUnitTest.php":"57c97b52f3999d6567a2d8a0f53e05d7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ClassDefinitionOpeningBraceSpaceUnitTest.php":"760be8dac092653b239a237a60132424","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ColonSpacingUnitTest.php":"3164c58c2ab8ddaba8d1a645ec2ba5e7","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ColourDefinitionUnitTest.php":"07f40f6716ee3be0ed1bd12c706e3461","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/DisallowMultipleStyleDefinitionsUnitTest.php":"ebc4226ea718823b335f86f18f4024bf","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/DuplicateClassDefinitionUnitTest.php":"21816afacc071b3a1225fae5b62f15bb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/DuplicateStyleDefinitionUnitTest.php":"a2c0f642452e2a8632e69d062b5ef81a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/EmptyClassDefinitionUnitTest.php":"47d3001b37db6a00272b8533b41628e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/EmptyStyleDefinitionUnitTest.php":"92e7855e68124ed2406a71eaa005a6a8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ForbiddenStylesUnitTest.php":"ac805f53abba90ee6b1f10f0de32ffc4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/IndentationUnitTest.php":"f429b104a3caa9d4afe9c696367e9925","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/LowercaseStyleDefinitionUnitTest.php":"da3eb19bd81fd3d37fca636e730c4ccb","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/MissingColonUnitTest.php":"767f04786d9edc3d8d06cdba66283db2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/NamedColoursUnitTest.php":"6ffddaf61c34c0ade72ec4f2d169becc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/OpacityUnitTest.php":"fe2ec3b4b195fbede8f56a7c641ccfd5","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/SemicolonSpacingUnitTest.php":"4adca5b4287112781c58bbf718b1a882","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/CSS\/ShorthandSizeUnitTest.php":"de800e188f7acb40726ba9449e2aac05","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/ClassDeclarationUnitTest.php":"ba1d3f29676de28d68bfe51f0e573b28","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/ClassFileNameUnitTest.php":"697221a63df87607a71e43793704f256","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/DuplicatePropertyUnitTest.php":"86c844b3d33bb667cb8bbe51b64c776a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/LowercaseClassKeywordsUnitTest.php":"12a4745b52530de1f4aa88d758fae162","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/SelfMemberReferenceUnitTest.php":"65603c5291de0d3fce3ad606220cdd6a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Classes\/ValidClassNameUnitTest.php":"88a813720f5f5d3e348bdf44a4af7d67","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/BlockCommentUnitTest.php":"1c0f53fcabdd7601ae9e79fa04fc113d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/ClassCommentUnitTest.php":"7ee34e6f321bd6282af3852452ee762c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/ClosingDeclarationCommentUnitTest.php":"b9d8bc140f181a3cbf65fb56e550bd12","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/DocCommentAlignmentUnitTest.php":"b6a38a1383efb3222fd622431f2439b2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/EmptyCatchCommentUnitTest.php":"4a4c300912429a3baa47cd09abb7fe1e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/FileCommentUnitTest.php":"47d0ea6e85a810f98ee5d5a076c6ad8c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/FunctionCommentThrowTagUnitTest.php":"2643fe7d1164d52d7034e0940aa3b82f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/FunctionCommentUnitTest.php":"df401f8a52cf614818ca7e5958c3f028","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/InlineCommentUnitTest.php":"9353aec80dea578353b9ac7a0a484405","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/LongConditionClosingCommentUnitTest.php":"fe91a1d68779d11664a1f4c4d6b77567","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/PostStatementCommentUnitTest.php":"afe62127aaaefdc81517fcdf9e9342c1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Commenting\/VariableCommentUnitTest.php":"8ed27309df2f6e6d57c123e3186eb0f3","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/ControlSignatureUnitTest.php":"cf1fe38be106aea572a023c4305e7562","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/ElseIfDeclarationUnitTest.php":"4a639cbe4a40ab7dcf7bfbaa6e9a5956","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/ForEachLoopDeclarationUnitTest.php":"40e421461af69dba8a60c48723e33099","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/ForLoopDeclarationUnitTest.php":"e4ee040d61d4d850a8938835e029dcf8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/InlineIfDeclarationUnitTest.php":"00b0e5bdebd07376d57066ebb9ac51ad","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/LowercaseDeclarationUnitTest.php":"fc4de341c3a899d7efc867ac613746e8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/ControlStructures\/SwitchDeclarationUnitTest.php":"409d780a98ff9b0fc58d212e6a2e5e3d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Debug\/JSLintUnitTest.php":"ef6d212e786285fe67884048b9e8ee58","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Debug\/JavaScriptLintUnitTest.php":"a860c5dcc82a46000fa10c3f41c389e4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Files\/FileExtensionUnitTest.php":"f8374a314fe246f965dc1971b6a32147","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Formatting\/OperatorBracketUnitTest.php":"ca503227a01ec9f6c99f5994e78a559f","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/FunctionDeclarationArgumentSpacingUnitTest.php":"2c92340b2abb1a8ce596a1d957bcc417","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/FunctionDeclarationUnitTest.php":"6a5b983a2b2003a860ea97ae5e4a5ce2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/FunctionDuplicateArgumentUnitTest.php":"511f1c77693fe6dff851d40a1d47d191","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/GlobalFunctionUnitTest.php":"6f3f123e1e4d5714b374b300e34b82f1","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/LowercaseFunctionKeywordsUnitTest.php":"630ab8e2c5665cca2517e0de2291730a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Functions\/MultiLineFunctionDeclarationUnitTest.php":"857707a3203deb9eb78b1ddfe057d82c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/NamingConventions\/ValidFunctionNameUnitTest.php":"1320ac5ccb5f4c2f6061de2947e624f4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/NamingConventions\/ValidVariableNameUnitTest.php":"9aceb904ee059b1c2e2c4afb86ef215a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Objects\/DisallowObjectStringIndexUnitTest.php":"b4e24aaf68e134e66344afde7936bb11","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Objects\/ObjectInstantiationUnitTest.php":"487907ad8c5cb57bfc89d2fd90687b39","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Objects\/ObjectMemberCommaUnitTest.php":"19f37bd0c0f054d100167a3e45b8c7d9","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Operators\/ComparisonOperatorUsageUnitTest.php":"1edc48c762ae9d453a8456264eee154d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Operators\/IncrementDecrementUsageUnitTest.php":"7140754b7996eb4ee7b2112fabd36a89","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Operators\/ValidLogicalOperatorsUnitTest.php":"bbd9c078704945b66a5e72c1413e6b1d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/CommentedOutCodeUnitTest.php":"5a81ed8f731d9c4ad50bb3f3689ca399","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DisallowBooleanStatementUnitTest.php":"5c0172b13a2ac958f091d89c3fc1c3a6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DisallowComparisonAssignmentUnitTest.php":"abaa205d4f1fee3fd3eca769d3c8a52b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DisallowInlineIfUnitTest.php":"b9ece49535b5d3e03278cdec36513e18","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DisallowMultipleAssignmentsUnitTest.php":"d522782622efdeff7d0a4bbb8232f371","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DisallowSizeFunctionsInLoopsUnitTest.php":"c5d25c940f71f854e33783f5a1b14a32","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/DiscouragedFunctionsUnitTest.php":"f1fccfd4e28042ae6a3fdf5e8a1a766b","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/EmbeddedPhpUnitTest.php":"b7bf2c3acbf32f8e190100b087068696","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/EvalUnitTest.php":"6591add25b1a24a4078f69036c101e5d","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/GlobalKeywordUnitTest.php":"2241b9158b6c143dda01b4efffb19099","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/HeredocUnitTest.php":"bee11f15aff4fb82fbdad38f77c944d4","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/InnerFunctionsUnitTest.php":"46832f575ea3d13f7e3127d01db8d10e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/LowercasePHPFunctionsUnitTest.php":"7e7c6b3460cdcf1156da5133dacc64da","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/PHP\/NonExecutableCodeUnitTest.php":"df69e4221083e071de25bc27bb9fe619","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Scope\/MemberVarScopeUnitTest.php":"0cded124417a4782a1a7fe0c9852930a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Scope\/MethodScopeUnitTest.php":"e7bb7581a83e2b132647459f43a2c270","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Scope\/StaticThisUsageUnitTest.php":"7db55f6a6d2d127ea4d49593ddf9b9d0","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Strings\/ConcatenationSpacingUnitTest.php":"f3c30c0f73c53033e275c0c08f846de8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Strings\/DoubleQuoteUsageUnitTest.php":"604c7688847057d74d0ad43877383527","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/Strings\/EchoedStringsUnitTest.php":"7d64abac0a711b0a73450337c57c8b80","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/CastSpacingUnitTest.php":"11b892bcbced10a97e5419e2b8e39675","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/ControlStructureSpacingUnitTest.php":"4e3d157a07a8b4079cf9041c269e8165","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/FunctionClosingBraceSpaceUnitTest.php":"81b4dbd4091d4431033bc4a292e6b780","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/FunctionOpeningBraceSpaceUnitTest.php":"a7aab90d60f1be2abb91af3ddace4086","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/FunctionSpacingUnitTest.php":"fbe8cf3397c9d39c512c92279e7138fc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/LanguageConstructSpacingUnitTest.php":"6af57822fabcfddd81e9f13739a1f8ba","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/LogicalOperatorSpacingUnitTest.php":"126f17cba66a4e653d6b5ed0fd592c7c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/MemberVarSpacingUnitTest.php":"184d9f88a642e1073e033a119495cabc","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/ObjectOperatorSpacingUnitTest.php":"dfe83f29879692873a8525ba91b5aef2","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/OperatorSpacingUnitTest.php":"706d303415b9ee811dd9a64524ed787a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/PropertyLabelSpacingUnitTest.php":"ae9817eb6f70ab8eb7dbdf5eb90495f6","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/ScopeClosingBraceUnitTest.php":"d86951abb00f2c61d913a02797534678","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/ScopeKeywordSpacingUnitTest.php":"a81498a39d65f032d2883ab535672716","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/SemicolonSpacingUnitTest.php":"402546d30af30f965c246978aab24616","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Squiz\/Tests\/WhiteSpace\/SuperfluousWhitespaceUnitTest.php":"6fd52c6e372cd41b98d5489370e34f7a","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Sniffs\/Debug\/CodeAnalyzerSniff.php":"d1af75648b5d6c1e4f4dccf8aa4afdfe","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Sniffs\/Files\/ClosingTagSniff.php":"d9da2a17fb7d6b1870414746a83bb47c","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Sniffs\/NamingConventions\/ValidVariableNameSniff.php":"1a5c09aafa25415f88803a926d86d936","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Tests\/Debug\/CodeAnalyzerUnitTest.php":"58c2d60caa8cb94cc663ab5a4b74ce2e","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Tests\/Files\/ClosingTagUnitTest.php":"1b75e904c8c0edfc157e1571b4a6bcb8","vendor\/squizlabs\/php_codesniffer\/src\/Standards\/Zend\/Tests\/NamingConventions\/ValidVariableNameUnitTest.php":"40b5cdff99d333b250237e3d77e23dc3","vendor\/squizlabs\/php_codesniffer\/src\/Tokenizers\/CSS.php":"23945afd610276405a7e15b09da69b0e","vendor\/squizlabs\/php_codesniffer\/src\/Tokenizers\/Comment.php":"246f9815e35db66fa856cb6ab5ed9972","vendor\/squizlabs\/php_codesniffer\/src\/Tokenizers\/JS.php":"d3b61895e75051408355cf4105af9281","vendor\/squizlabs\/php_codesniffer\/src\/Tokenizers\/PHP.php":"822855d4e1048b3e5c4f3f6fd8c4afa0","vendor\/squizlabs\/php_codesniffer\/src\/Tokenizers\/Tokenizer.php":"3393ff994f30bec0bf12eaf4e6c4bbc3","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Cache.php":"214d3febd916fdfa69e2549ac9de8065","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Common.php":"1f6336497b719521f94b73945efa2656","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Help.php":"ae93cc7fb27da9c847e699835fb0b619","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Standards.php":"415b7ed961f3ae153ce59a3ce1bb8beb","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Timing.php":"ef570cc454d15d9d62edd5fcc03120a1","vendor\/squizlabs\/php_codesniffer\/src\/Util\/Tokens.php":"22a6ce404b30c90a2a99b98c1d0109a7","vendor\/squizlabs\/php_codesniffer\/tests\/AllTests.php":"637979633c92c92307eb47e6012f9528","vendor\/squizlabs\/php_codesniffer\/tests\/ConfigDouble.php":"8282aa1385398edb9b91ee65f5ace919","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/AbstractMethodUnitTest.php":"2147add2fb142eedc3fc190507269104","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/AllTests.php":"c05c35d7af0165d7dd161315b2137753","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Autoloader\/DetermineLoadedClassTest.php":"21eb041f1fe060e25e0351da4ed98c3e","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Config\/ReportWidthTest.php":"48b09edf21683de41223323d3888fcfc","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Config\/SniffsExcludeArgsTest.php":"aaaaa2136b20a2109ffece9641a2db59","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/ErrorSuppressionTest.php":"4727557e4a29e5e23006675e656d9c89","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/FindEndOfStatementTest.php":"dd0652ec9ffa606be165e970951fda67","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/FindExtendedClassNameTest.php":"dad303edc9d41cf3555cb14b4ddde3e8","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/FindImplementedInterfaceNamesTest.php":"976f972c82eb2060bbf9fb5779bc28e4","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/FindStartOfStatementTest.php":"9e3335d27489c19c970ca3ba514b6075","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetClassPropertiesTest.php":"3186a1c6be7812e8d29843721fdbf8a5","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetConditionTest.php":"4caabea2cac21519473582794b76e429","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetDeclarationNameJSTest.php":"64cdbf52b097fda7c3058ecc35f81306","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetDeclarationNameTest.php":"ed43b24fcb5269a01d44215aed80164f","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetMemberPropertiesTest.php":"b713247559927f865fc3ca435726a217","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetMethodParametersParseError1Test.php":"1b8598b0f5b4ab15ddefae7d6e55d6cb","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetMethodParametersParseError2Test.php":"29553c0d54b2c09cc7242eb28aa2c231","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetMethodParametersTest.php":"30f69ba847e9c869c460728abab03d45","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetMethodPropertiesTest.php":"93cbbf33878d5c2b3b014c037ad7eafd","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/GetTokensAsStringTest.php":"af02558ec8b0128a3fbbeebe191ebffc","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/File\/IsReferenceTest.php":"8255737a280a1892c2daadafadeddf80","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Filters\/AbstractFilterTestCase.php":"94ac309f40fe70e2dc15cd2d06e787eb","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Filters\/Filter\/AcceptTest.php":"adf246c414321bb8e0f338146635c222","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Filters\/GitModifiedTest.php":"50463bbea01e312407b97c2a3be9a732","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Filters\/GitStagedTest.php":"737a2ab7647603b8b9d2bf935711a99f","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Fixer\/GenerateDiffTest.php":"08b18cd4ef1d504ffa20aabe429c8aec","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/ExplainTest.php":"ac23674360b6a49ebe759f240c14c541","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/Deprecated\/WithLongReplacementSniff.php":"ba8cef16ccacadb2cf6ae161b1a5aca8","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/Deprecated\/WithReplacementContainingLinuxNewlinesSniff.php":"a532a62b235538bfc61883eaae9fb60c","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/Deprecated\/WithReplacementContainingNewlinesSniff.php":"26430e4ca6b7c5bc58a58cb4daf65cbc","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/Deprecated\/WithReplacementSniff.php":"a8c003277f4968020fa14cd1f9b351bc","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/Deprecated\/WithoutReplacementSniff.php":"cc97f12a24d7cb7990d739ca2fb0f1eb","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/DeprecatedInvalid\/EmptyDeprecationVersionSniff.php":"7d1005516a1b2a7c025a77f529332970","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/DeprecatedInvalid\/EmptyRemovalVersionSniff.php":"77a03d1835c41d77acc1542d8c7b1a2c","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/DeprecatedInvalid\/InvalidDeprecationMessageSniff.php":"adb1c2d49122a51258f783fd8467e74b","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/DeprecatedInvalid\/InvalidDeprecationVersionSniff.php":"29b7c2b77437bcc2a56fa83aa4dc5bd5","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/DeprecatedInvalid\/InvalidRemovalVersionSniff.php":"04c28978c30a702659753570944e10b1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/SetProperty\/AllowedAsDeclaredSniff.php":"b6e3b4d87931fae1bc817d3162c43d54","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/SetProperty\/AllowedViaMagicMethodSniff.php":"564406c60e86bf069e41626e61abd73d","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/SetProperty\/AllowedViaStdClassSniff.php":"4ecc394bd136737db9170922d99bd776","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/Fixtures\/Sniffs\/SetProperty\/NotAllowedViaAttributeSniff.php":"bb065949d61a5da82ae4a633312eff15","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/RuleInclusionAbsoluteLinuxTest.php":"49d04577a3ba5b0b716b0083a4d3a3e5","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/RuleInclusionAbsoluteWindowsTest.php":"e1ae6cfd7e379e110cc635925d1431d8","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/RuleInclusionTest.php":"9b46ed6f8a5f02ef41609075da569c15","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/SetSniffPropertyTest.php":"420afb5477e29f58aaf817c6848d492f","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Ruleset\/ShowSniffDeprecationsTest.php":"577f1a1af98c0b4b0090e46e7ec9967d","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Sniffs\/AbstractArraySniffTest.php":"5c9d33527d2450f83077e17f3eb9c519","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Sniffs\/AbstractArraySniffTestable.php":"4325838333d5b95deb3a62133f380640","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/AbstractTokenizerTestCase.php":"cf23314dd5f16007350e4425fecd45a7","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/CommentTestCase.php":"6e7ae6a542a38310f20210b22578ffa3","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/LiveCoding1Test.php":"68185d9b2f47903a51e0584e03fb0f98","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/LiveCoding2Test.php":"847a7ab901206c8039abc0ba3803af0c","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/LiveCoding3Test.php":"364115cdb88a67fac3824ebc1bf49c68","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/LiveCoding4Test.php":"fb3a51b3f5325475646ce1dec2ca5c03","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/MultiLineDocBlockTest.php":"29054b729e33fa9f094213dd3b6134f4","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/PhpcsAnnotationsInDocBlockTest.php":"8734eb239eab5a71e605ddd319f27cf3","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Comment\/SingleLineDocBlockTest.php":"528ce9c27c1366fe255fd727f44e2d1d","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/AnonClassParenthesisOwnerTest.php":"cc9aba4fa2602a074d32b37d274e0fe2","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/ArrayKeywordTest.php":"a38cf83b022653c5d10c2696f8288d37","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/AttributesTest.php":"446c792286f704bf0b141da7f83b535c","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillEnumTest.php":"e8f73ae775aef5776171028ecc29c1dd","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillExplicitOctalNotationTest.php":"4cd24836014fd2936c09d4d19ac20a24","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillFnTokenTest.php":"89ad0b98651e4edb00a23cc3091d4b17","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillMatchTokenTest.php":"557d300e1a217f02c7f154fdee29fb30","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillNumericSeparatorTest.php":"54d7bd13371c0a39e51b787416050e74","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BackfillReadonlyTest.php":"3003b827837161cd2330ec035030d5af","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/BitwiseOrTest.php":"53941f683262502c45b4d183d6848dbd","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/ContextSensitiveKeywordsTest.php":"572d081bd7487dac960188c667e53061","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DNFTypesParseError1Test.php":"cb75065735574c6b291cc9f151d62de1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DNFTypesParseError2Test.php":"4f509ea959267dba3a6abcbe41694292","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DNFTypesTest.php":"b18d7cf91ef612ed43e3afd7e87740c1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DefaultKeywordTest.php":"33dec3b85a142c27970230d8b588458e","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DoubleArrowTest.php":"d2536cb64383df99cc674660ab39122f","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/DoubleQuotedStringTest.php":"10c658285a16c38cc4ec68f220d90b1b","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/EnumCaseTest.php":"ec91d544cd5d1641f66650548168fda1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/FinallyTest.php":"427481b098c3a8cac2ca295754e1a699","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/GotoLabelTest.php":"4362f6793884ddbe39ba51a28bb5e140","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/HeredocStringTest.php":"c62c2d14108feb44083479a2c7001f49","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/NamedFunctionCallArgumentsTest.php":"d4d2c8f76ed0708ea91e191fdeb5ba13","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/NullsafeObjectOperatorTest.php":"172c1ea5518be397ee84afde30aa48d1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/OtherContextSensitiveKeywordsTest.php":"70bfb51e082c3f52b7d5136ff85043c5","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/ResolveSimpleTokenTest.php":"5321b09a722594e5eaf46a6b49ad0a82","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/ShortArrayTest.php":"74a911c384aa10036ee013d2028c66e9","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/StableCommentWhitespaceTest.php":"3108f530b4afba392e8ec656e8ba7c52","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/StableCommentWhitespaceWinTest.php":"653cb138b472c6ab793a301b474a7e5d","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/TypeIntersectionTest.php":"7c70506af46e77b620e3d63f043fb253","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/TypedConstantsTest.php":"f3a0b812c797cb37a5d5a316c96616f1","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/PHP\/UndoNamespacedNameSingleTokenTest.php":"7cbb632c2977f64b27979da7caf54cc3","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/CreateParenthesisNestingMapDNFTypesTest.php":"8732e3bc67790151efcb04478a8c34ef","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/CreateTokenMapArrayParenthesesTest.php":"22295b5c5614a7ca33ad837028bc71c6","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/HeredocNowdocCloserTest.php":"bf2e32531a9963c2d0698d594f5b4178","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/RecurseScopeMapCaseKeywordConditionsTest.php":"25bdd4066d863334793275d226c5fc50","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/RecurseScopeMapDefaultKeywordConditionsTest.php":"2923193f8b41787dd95af04f3e343eef","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Tokenizer\/Tokenizer\/ScopeSettingWithNamespaceOperatorTest.php":"e2ef5376968e5fc854f24e2e26c1d849","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Util\/Common\/IsCamelCapsTest.php":"4c08460a77f371f24277d28ad7980a26","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Util\/Common\/StripColorsTest.php":"991425d82e0ffa54726b70b86d9ea1a4","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Util\/Common\/SuggestTypeTest.php":"94c09ef8987d8c075b929a0c4ee8b9cd","vendor\/squizlabs\/php_codesniffer\/tests\/Core\/Util\/Help\/HelpTest.php":"5bde4731f7a9e49717e5371750a9316e","vendor\/squizlabs\/php_codesniffer\/tests\/FileList.php":"3e15d7462722a7e8fe94d359d6f0fd9e","vendor\/squizlabs\/php_codesniffer\/tests\/Standards\/AbstractSniffUnitTest.php":"852346282e54496b1348788f51047b6b","vendor\/squizlabs\/php_codesniffer\/tests\/Standards\/AllSniffs.php":"579dee947b3c6f63c1430af5c9ff034c","vendor\/squizlabs\/php_codesniffer\/tests\/TestSuite.php":"79dbb6fb6f70fef1e77db943d3bef581","vendor\/squizlabs\/php_codesniffer\/tests\/TestSuite7.php":"015489fcba45206a8700dec3a05e9ba9","vendor\/squizlabs\/php_codesniffer\/tests\/bootstrap.php":"2e6ddb95f71587d9b2805ff2d004e088","vendor\/theseer\/tokenizer\/src\/Exception.php":"3d64756b634a6f52a8c57042dd6207a4","vendor\/theseer\/tokenizer\/src\/NamespaceUri.php":"25b079d1ef62cee15b95c46562536279","vendor\/theseer\/tokenizer\/src\/NamespaceUriException.php":"c85ed7b140508c7cf03e727e538ac818","vendor\/theseer\/tokenizer\/src\/Token.php":"34918603e5e0da62e8610849d5119d47","vendor\/theseer\/tokenizer\/src\/TokenCollection.php":"7165fc153bcdac2a74048bc9c00ea562","vendor\/theseer\/tokenizer\/src\/TokenCollectionException.php":"890ddd90a9f30a1e403c02485fbe3fb2","vendor\/theseer\/tokenizer\/src\/Tokenizer.php":"c0de81bd789015ee6f80d986a1884311","vendor\/theseer\/tokenizer\/src\/XMLSerializer.php":"e069fb5a188cec5422d8aa56316747a8","application\/controllers\/Form.php":"d711b59e5652200c6d01a9482ee684f5"}} \ No newline at end of file +{"php":"7.4.33","version":"3.61.1:v3.61.1#94a87189f55814e6cabca2d9a33b06de384a2ab8","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"align"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"blank_line_before_statement":{"statements":["return"]},"no_extra_blank_lines":{"tokens":["curly_brace_block","extra","parenthesis_brace_block","square_brace_block","throw","use"]},"trim_array_spaces":true,"whitespace_after_comma_in_array":true,"class_attributes_separation":{"elements":{"method":"one","property":"one"}},"space_after_semicolon":{"remove_in_empty_for_expressions":true},"no_unused_imports":true},"hashes":{"application\/controllers\/dummy.php":"30695a7059d902f4584b16ec747a1dbf","application\/controllers\/Dummy.php":"cede7c806c04222cba019c2c8a265696","application\/controllers\/Form.php":"894e7658bddbe35ea6c8d172f8b13f81","application\/controllers\/Testing\/Dummy.php":"fbe2a34bcebc86ee5f3a5c4a851b9365","application\/controllers\/Testing\/Form.php":"894e7658bddbe35ea6c8d172f8b13f81"}} \ No newline at end of file diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..96da8f7 --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,49 @@ +in(__DIR__) + ->name('*.php') + ->notName('*.blade.php') + ->exclude('vendor') + ->exclude('storage'); + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(false) // Equivalent to "php-cs-fixer.allowRisky": false + ->setIndent(" ") // Use four spaces for indentation + ->setLineEnding("\n") // Ensure line endings are consistent + ->setRules([ + '@PSR12' => true, // Apply PSR-12 standard + 'blank_line_after_namespace' => true, // Ensure there is a blank line after namespace declarations + 'blank_line_after_opening_tag' => true, // Ensure there is a blank line after the opening PHP tag + 'blank_line_before_statement' => [ + 'statements' => ['return'], // Ensure a blank line before return statements + ], + 'no_extra_blank_lines' => [ + 'tokens' => [ + 'curly_brace_block', + 'extra', + 'parenthesis_brace_block', + 'square_brace_block', + 'throw', + 'use', + ], + ], // Remove extra blank lines + 'no_whitespace_in_blank_line' => true, // Remove whitespace in blank lines + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], // Ensure consistent method argument spacing + 'trim_array_spaces' => true, // Remove spaces around array elements + 'binary_operator_spaces' => ['default' => 'align'], // Align binary operators + 'no_trailing_whitespace' => true, // Remove trailing whitespace + 'no_trailing_whitespace_in_comment' => true, // Remove trailing whitespace in comments + 'whitespace_after_comma_in_array' => true, // Ensure there is space after commas in arrays + 'single_blank_line_at_eof' => true, // Ensure there is a single blank line at the end of the file + 'single_class_element_per_statement' => ['elements' => ['property']], // Ensure single class element per statement + 'class_attributes_separation' => [ + 'elements' => [ + 'method' => 'one', // Ensure one blank line between methods + 'property' => 'one', // Ensure one blank line between properties + ], + ], + 'space_after_semicolon' => ['remove_in_empty_for_expressions' => true], // Handle space after semicolons + 'no_unused_imports' => true, // Remove unused use statements + ]) + ->setFinder($finder); diff --git a/.prettier.rc.json b/.prettier.rc.json new file mode 100644 index 0000000..b603d26 --- /dev/null +++ b/.prettier.rc.json @@ -0,0 +1,16 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "jsxSingleQuote": true, + "bracketSpacing": true, + "parser": "babel-ts", + "requirePragma": false, + "insertPragma": false, + "proseWrap": "preserve", + "htmlWhitespaceSensitivity": "css", + "endOfLine": "lf", + "embeddedLanguageFormatting": "off" + } + \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index b647d67..ffa2bf5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,22 +1,5 @@ -# Ignore node_modules directory -node_modules/ - -# Ignore build directory -build/ - -# Ignore all minified JavaScript files +node_modules +dist +build *.min.js - - -# Ignore specific files -public/vendor/jquery.js -public/vendor/bootstrap.js - -# Ignore all files in a specific directory -src/vendor/ - -# Ignore specific file -path/to/specific/file.js - -# Ignore all JavaScript files in a specific directory -src/vendor/*.js +*.min.css diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 1491020..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "trailingComma": "es5", - "tabWidth": 2, - "semi": false, - "singleQuote": true, - "jsxSingleQuote": true, - "bracketSpacing": true, - "parser": "babel-ts", - "requirePragma": false, - "insertPragma": false, - "proseWrap": "preserve", - "htmlWhitespaceSensitivity": "css", - "endOfLine": "lf", - "embeddedLanguageFormatting": "off" -} diff --git a/application/config/config.php b/application/config/config.php index bd39238..013fae0 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -186,9 +186,9 @@ $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'; | */ $config['enable_query_strings'] = false; -$config['controller_trigger'] = 'c'; -$config['function_trigger'] = 'm'; -$config['directory_trigger'] = 'd'; +$config['controller_trigger'] = 'c'; +$config['function_trigger'] = 'm'; +$config['directory_trigger'] = 'd'; /* |-------------------------------------------------------------------------- @@ -384,13 +384,13 @@ $config['encryption_key'] = ''; | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here. | */ -$config['sess_driver'] = 'files'; -$config['sess_cookie_name'] = 'ci_session'; -$config['sess_samesite'] = 'Lax'; -$config['sess_expiration'] = 7200; -$config['sess_save_path'] = null; -$config['sess_match_ip'] = false; -$config['sess_time_to_update'] = 300; +$config['sess_driver'] = 'files'; +$config['sess_cookie_name'] = 'ci_session'; +$config['sess_samesite'] = 'Lax'; +$config['sess_expiration'] = 7200; +$config['sess_save_path'] = null; +$config['sess_match_ip'] = false; +$config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = false; /* @@ -458,11 +458,11 @@ $config['global_xss_filtering'] = false; | 'csrf_regenerate' = Regenerate token on every submission | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ -$config['csrf_protection'] = false; -$config['csrf_token_name'] = 'csrf_test_name'; -$config['csrf_cookie_name'] = 'csrf_cookie_name'; -$config['csrf_expire'] = 7200; -$config['csrf_regenerate'] = true; +$config['csrf_protection'] = false; +$config['csrf_token_name'] = 'csrf_test_name'; +$config['csrf_cookie_name'] = 'csrf_cookie_name'; +$config['csrf_expire'] = 7200; +$config['csrf_regenerate'] = true; $config['csrf_exclude_uris'] = array(); /* @@ -530,4 +530,26 @@ $config['rewrite_short_tags'] = false; | Comma-separated: '10.0.1.200,192.168.5.0/24' | Array: array('10.0.1.200', '192.168.5.0/24') */ -$config['proxy_ips'] = ''; +// Autoload function to support namespaces in CodeIgniter 3 +// spl_autoload_register(function ($class) { +// // Convert namespace to the full file path +// $file = APPPATH . str_replace('\\', '/', $class) . '.php'; + +// // Check if the file exists and include it +// if (file_exists($file)) { +// require_once $file; +// } +// }); +// define('APPPATH', '/var/www/html/google_forms/'); + +spl_autoload_extensions('.php'); // Only Autoload PHP Files + +spl_autoload_register(function ($classname) { + // Convert namespace to the full file path + $classfile = APPPATH . str_replace('\\', '/', $classname) . '.php'; + + // Check if the file exists and include it + if (file_exists($classfile)) { + require_once($classfile); + } +}); diff --git a/application/controllers/Form.php b/application/controllers/Form.php deleted file mode 100644 index ba11406..0000000 --- a/application/controllers/Form.php +++ /dev/null @@ -1,37 +0,0 @@ -load->model('Form_model'); - } - public function submit() - { - - if (!$this->session->userdata('logged_in')) { - // If not logged in, redirect to login page - redirect('users/login'); - }$form_data = json_decode($this->input->raw_input_stream, true); - $this->load->model('Form_model'); - if ($this->Form_model->save_form($form_data)) { - $response = array('status' => 'success', 'message' => 'Form submitted successfully.'); - } else { - $response = array('status' => 'error', 'message' => 'Error submitting form.'); - } - - echo json_encode($response); - } - public function view($form_id) - { - $data['title'] = $this->Form_model->get_form_title($form_id); - if ($data['title'] === null) { - show_404(); // Show 404 if form_id is invalid - }$this->load->view('templates/forms_ui', $data); - } -} diff --git a/application/controllers/Form_controller.php b/application/controllers/Form_controller.php index 2ff8db4..4171482 100644 --- a/application/controllers/Form_controller.php +++ b/application/controllers/Form_controller.php @@ -15,16 +15,18 @@ class Form_controller extends CI_Controller // If not logged in, redirect to login page redirect('users/login'); } - $user_id = $this->session->userdata('user_id'); + $user_id = $this->session->userdata('user_id') - // Retrieve form title from the forms table using form_id - $form_title = 'Untitled Form'; // Default title - if ($form_id) { - $form = $this->Frontend_model->getFormById($form_id); - if ($form) { - $form_title = $form['title']; - } - } + + + // Retrieve form title from the forms table using form_id + $form_title = 'Untitled Form'; // Default title + if ($form_id) { + $form = $this->Frontend_model->getFormById($form_id); + if ($form) { + $form_title = $form['title']; + } + } // Fetch data from models $data['total_forms'] = $this->Form_model->get_total_forms($user_id); $data['published_forms'] = $this->Form_model->get_published_forms($user_id); diff --git a/application/controllers/Testing/Dummy.php b/application/controllers/Testing/Dummy.php new file mode 100644 index 0000000..0015636 --- /dev/null +++ b/application/controllers/Testing/Dummy.php @@ -0,0 +1,54 @@ +model->find($id); + + if ($item === null) { + $this->notFound(); + echo "r"; + + // This will trigger Squiz.PHP.NonExecutableCode + return; + + echo "This will never be executed"; + } + + // This will trigger Squiz.PHP.DiscouragedFunctions + eval('$x = 10;'); + + $this->render('views/item_view.php', ['item' => $item]); + } + + /** + * Display the index view with data. + * + * Retrieves data from the model and renders the index view. + */ + public function index(): void + { + // This will trigger Squiz.PHP.DisallowComparisonAssignment + $isValid = ($user->status === 'active'); + + // This will trigger Squiz.PHP.GlobalKeyword + global $db; + + $data = $this->model->getData(); + + // This introduces an undefined variable, but won't be caught by the specified sniffs + $this->render('views/example_view.php', ['data' => $data, 'user' => $userData]); + } +} diff --git a/application/controllers/Testing/Form.php b/application/controllers/Testing/Form.php new file mode 100644 index 0000000..6c48896 --- /dev/null +++ b/application/controllers/Testing/Form.php @@ -0,0 +1,42 @@ +load->model('Form_model'); + } + + public function submit(): void + { + if (!$this->session->userdata('logged_in')) { + // If not logged in, redirect to login page + redirect('users/login'); + } + + $response = $this->Form_model->save_form($form_data) ? array('status' => 'success', 'message' => 'Form submitted successfully.') + : array('status' => 'error', 'message' => 'Error submitting form.'); + + echo json_encode($response); + } + + public function view($form_id): void + { + $data['title'] = $this->Form_model->get_form_title($form_id); + + if ($data['title'] === null) { + // Show 404 if form_id is invalid + show_404(); + } + + $this->load->view('templates/forms_ui', $data); + } +} diff --git a/application/controllers/dummy.php b/application/controllers/dummy.php deleted file mode 100644 index e9c5ccb..0000000 --- a/application/controllers/dummy.php +++ /dev/null @@ -1,39 +0,0 @@ -model->find($id); - - if ($item === null) { - $this->notFound(); - - return; - } - - $this->render('views/item_view.php', ['item' => $item]); - } - - /** - * Display the index view with data. - * - * Retrieves data from the model and renders the index view. - * - * @return void - */ - public function index(): void - { - $data = $this->model->getData(); - - $this->render('views/example_view.php', ['data' => $data]); - } -} diff --git a/assets/css/editview.css b/assets/css/editview.css index 2dab19c..c43a21d 100644 --- a/assets/css/editview.css +++ b/assets/css/editview.css @@ -6,7 +6,7 @@ } .form-title, -.form-description { +.form- description { border: none; border-bottom: 1px solid #ccc; margin-bottom: 10px; diff --git a/assets/js/edit_form_views.js b/assets/js/edit_form_views.js index e30d248..39b997a 100644 --- a/assets/js/edit_form_views.js +++ b/assets/js/edit_form_views.js @@ -1,133 +1,72 @@ -$(document).ready(function () { - var base_url = ''; - - // Add section button functionality - $('#add-section-btn').on('click', function () { - var sectionHtml = ` -
-
- - - - -
-
-
- `; $('#form-container').append(sectionHtml); - }); - - // Add option button functionality - $(document).on('click', '.add-option-btn', function () { - var optionHtml = ` -
- - × -
- `; - $(this).siblings('.options-container').append(optionHtml); - }); - - // Delete option functionality - $(document).on('click', '.delete-option-icon', function () { - $(this).parent().remove(); - }); - - // Delete section functionality - $(document).on('click', '.delete-section-icon', function () { - $(this).closest('.form-section').remove(); - }); - - // Show/Hide "Add Option" button based on question type - $(document).on('change', '.custom-select', function () { - var type = $(this).val(); - var $section = $(this).closest('.form-section'); - if (type === 'multiple-choice' || type === 'checkboxes' || type === 'dropdown') { - $section.find('.add-option-btn').show(); - } else { - $section.find('.add-option-btn').hide(); - } - }).trigger('change'); // Trigger change to apply to existing sections - - // Submit button functionality - $('#submit-btn').on('click', function () { - var formData = collectFormData(); - formData['form_id'] = ; - - let validation = validateFormData(formData); - if (!validation.isValid) { - alert(validation.message); - return; - } - - $.ajax({ - url: base_url + 'Form_controller/update_form', - type: 'POST', - data: { formData: formData }, - dataType: 'JSON', - success: function (response) { - if (response.status === 'success') { - alert('Form updated successfully!'); - window.location.href = base_url + 'Form_controller/index_forms_draft'; - } else { - alert(response.message); - } - }, - error: function (error) { - alert('Error updating form!'); - console.log(error); - } - }); - }); - - // Collect form data function - function collectFormData() { - var formData = { - title: $('#form-title').val(), - description: $('#form-description').val(), - questions: [] - }; - - $('.form-section').each(function () { - var questionData = { - id: $(this).data('index'), - text: $(this).find('.untitled-question').val(), - type: $(this).find('.custom-select').val(), - required: $(this).find('.required-toggle').is(':checked') ? 1 : 0, // Correctly capture the required value - options: [] - }; - - $(this).find('.option-label').each(function () { - questionData.options.push($(this).val()); - }); - - formData.questions.push(questionData); - }); - - return formData; - } - function validateFormData(formData) { - for (let question of formData.questions) { - if (!question.text.trim()) { - return { isValid: false, message: 'All questions must have text.' }; - } - if ((question.type === 'multiple-choice' || question.type === 'checkboxes' || question.type === 'dropdown') && question.options.length === 0) { - return { isValid: false, message: 'All options-based questions must have at least one option.' }; - } - for (let option of question.options) { - if (!option.trim()) { - return { isValid: false, message: 'All options must have text.' }; - } - } - } - return { isValid: true }; - } -}); \ No newline at end of file +$(document).ready(function () { var base_url = '' // +// Add section button functionality +$('#add-section-btn').on('click', function () { +var sectionHtml = ` +
+
+ + + + +
+
+ +
+` $('#form-container').append(sectionHtml) }) // Add option button functionality +$(document).on('click', '.add-option-btn', function () { var optionHtml = ` +
+ + × +
+` $(this).siblings('.options-container').append(optionHtml) }) // Delete option +functionality $(document).on('click', '.delete-option-icon', function () { +$(this).parent().remove() }) // Delete section functionality +$(document).on('click', '.delete-section-icon', function () { +$(this).closest('.form-section').remove() }) // Show/Hide "Add Option" button +based on question type $(document) .on('change', '.custom-select', function () { +var type = $(this).val() var $section = $(this).closest('.form-section') if ( +type === 'multiple-choice' || type === 'checkboxes' || type === 'dropdown' ) { +$section.find('.add-option-btn').show() } else { +$section.find('.add-option-btn').hide() } }) .trigger('change') // Trigger +change to apply to existing sections // Submit button functionality +$('#submit-btn').on('click', function () { var formData = collectFormData() +formData['form_id'] = /* eslint-disable */ ; /* +eslint-enable */ let validation = validateFormData(formData) if +(!validation.isValid) { alert(validation.message) return } $.ajax({ url: +base_url + 'Form_controller/update_form', type: 'POST', data: { formData: +formData }, dataType: 'JSON', success: function (response) { if (response.status +=== 'success') { alert('Form updated successfully!') window.location.href = +base_url + 'Form_controller/index_forms_draft' } else { alert(response.message) +} }, error: function (error) { alert('Error updating form!') console.log(error) +}, }) }) // Collect form data function function collectFormData() { var formData += { title: $('#form-title').val(), description: $('#form-description').val(), +questions: [], } $('.form-section').each(function () { var questionData = { id: +$(this).data('index'), text: $(this).find('.untitled-question').val(), type: +$(this).find('.custom-select').val(), required: +$(this).find('.required-toggle').is(':checked') ? 1 : 0, // Correctly capture +the required value options: [], } $(this) .find('.option-label') .each(function +() { questionData.options.push($(this).val()) }) +formData.questions.push(questionData) }) return formData } function +validateFormData(formData) { for (let question of formData.questions) { if +(!question.text.trim()) { return { isValid: false, message: 'All questions must +have text.' } } if ( (question.type === 'multiple-choice' || question.type === +'checkboxes' || question.type === 'dropdown') && question.options.length === 0 ) +{ return { isValid: false, message: 'All options-based questions must have at +least one option.', } } for (let option of question.options) { if +(!option.trim()) { return { isValid: false, message: 'All options must have +text.' } } } } return { isValid: true } } }) diff --git a/assets/js/scripts.js b/assets/js/scripts.js index 2f93951..cbbd4a7 100644 --- a/assets/js/scripts.js +++ b/assets/js/scripts.js @@ -1,34 +1,34 @@ $(document).ready(function () { - let index = 1 - let activeSection = null + let index = 1; + let activeSection = null; function addOption(type, container) { // let optionIndex = container.children().length + 1; - let optionHtml - if (type === 'multiple-choice' || type === 'checkboxes') { + let optionHtml; + if (type === "multiple-choice" || type === "checkboxes") { optionHtml = ` -
- - - × -
- ` - } else if (type === 'dropdown') { +
+ + + × +
+ `; + } else if (type === "dropdown") { optionHtml = ` -
- - × -
- ` +
+ + × +
+ `; } - container.append(optionHtml) + container.append(optionHtml); } function createFormSection() { let newSection = `
- ${index === 1 ? '
' : ''} + ${index === 1 ? '
' : ""} ' - ) - } else if (type === 'paragraph') { + '', + ); + } else if (type === "paragraph") { container.append( - '' - ) + '', + ); } else { - addOption(type, container) + addOption(type, container); $(this) - .closest('.form-section') + .closest(".form-section") .append( - '' - ) + '', + ); } - }) + }); - $(document).on('click', '.add-option-btn', function () { - let type = $(this).closest('.form-section').find('.custom-select').val() - let container = $(this).closest('.form-section').find('.options-container') - addOption(type, container) - }) + $(document).on("click", ".add-option-btn", function () { + let type = $(this).closest(".form-section").find(".custom-select").val(); + let container = $(this).closest(".form-section").find(".options-container"); + addOption(type, container); + }); - $(document).on('click', '.delete-section-icon', function () { - let section = $(this).closest('.form-section') - let prevSection = section.prev('.form-section') - let nextSection = section.next('.form-section') - section.remove() - if (section.hasClass('active')) { - activeSection = null + $(document).on("click", ".delete-section-icon", function () { + let section = $(this).closest(".form-section"); + let prevSection = section.prev(".form-section"); + let nextSection = section.next(".form-section"); + section.remove(); + if (section.hasClass("active")) { + activeSection = null; } if (prevSection.length > 0) { prevSection - .find('.delete-section-icon') - .appendTo(prevSection.find('.form-section')) - activeSection = prevSection - row + .find(".delete-section-icon") + .appendTo(prevSection.find(".form-section")); + activeSection = prevSection; + row; } else if (nextSection.length > 0) { nextSection - .find('.delete-section-icon') - .appendTo(nextSection.find('.form-header')) - activeSection = nextSection + .find(".delete-section-icon") + .appendTo(nextSection.find(".form-header")); + activeSection = nextSection; } - positionAddSectionButton() - }) + positionAddSectionButton(); + }); - $(document).on('click', '.delete-option-icon', function () { - let option = $(this).closest('.option') - let container = option.closest('.options-container') - option.remove() - }) + $(document).on("click", ".delete-option-icon", function () { + let option = $(this).closest(".option"); + let container = option.closest(".options-container"); + option.remove(); + }); - $(document).on('click', '.required-toggle', function () { - $(this).closest('.form-section').toggleClass('required') - }) + $(document).on("click", ".required-toggle", function () { + $(this).closest(".form-section").toggleClass("required"); + }); - $('#preview-btn').on('click', function () { - let previewWindow = window.open('', '_blank') + $("#preview-btn").on("click", function () { + let previewWindow = window.open("", "_blank"); let previewContent = ` @@ -157,189 +157,189 @@ $(document).ready(function () {

Form Preview

- ` - $('.form-section').each(function () { - previewContent += '
' - previewContent += '
' + `; + $(".form-section").each(function () { + previewContent += '
'; + previewContent += '
'; previewContent += '
' + - $(this).find('.untitled-question').val() + - '
' - previewContent += '
' - let type = $(this).find('.custom-select').val() - let optionsContainer = $(this).find('.options-container') + $(this).find(".untitled-question").val() + + "
"; + previewContent += "
"; + let type = $(this).find(".custom-select").val(); + let optionsContainer = $(this).find(".options-container"); - if (type === 'multiple-choice') { - optionsContainer.find('.option').each(function () { + if (type === "multiple-choice") { + optionsContainer.find(".option").each(function () { previewContent += `
- +
- ` - }) - } else if (type === 'checkboxes') { - optionsContainer.find('.option').each(function () { + `; + }); + } else if (type === "checkboxes") { + optionsContainer.find(".option").each(function () { previewContent += `
- +
- ` - }) - } else if (type === 'short-answer') { + `; + }); + } else if (type === "short-answer") { previewContent += - '' - } else if (type === 'paragraph') { + ''; + } else if (type === "paragraph") { previewContent += - '' - } else if (type === 'dropdown') { - let dropdownHtml = '' - previewContent += dropdownHtml + ''; + } else if (type === "dropdown") { + let dropdownHtml = '"; + previewContent += dropdownHtml; } - previewContent += '
' - }) + previewContent += "
"; + }); previewContent += `
- ` - previewWindow.document.write(previewContent) - previewWindow.document.close() - }) + `; + previewWindow.document.write(previewContent); + previewWindow.document.close(); + }); - $(document).on('click', '.form-section', function () { - $('.form-section').removeClass('active') - $(this).addClass('active') - activeSection = $(this) - positionAddSectionButton() - }) + $(document).on("click", ".form-section", function () { + $(".form-section").removeClass("active"); + $(this).addClass("active"); + activeSection = $(this); + positionAddSectionButton(); + }); - $('#form-container').sortable({ - placeholder: 'ui-state-highlight', + $("#form-container").sortable({ + placeholder: "ui-state-highlight", start: function (event, ui) { - ui.placeholder.height(ui.item.height()) + ui.placeholder.height(ui.item.height()); }, stop: function (event, ui) { - positionAddSectionButton() + positionAddSectionButton(); }, - }) + }); function collectFormData() { var formData = { questions: [], - } + }; - $('.form-section').each(function () { - var questionType = $(this).find('.custom-select').val() + $(".form-section").each(function () { + var questionType = $(this).find(".custom-select").val(); var questionData = { - text: $(this).find('.untitled-question').val(), + text: $(this).find(".untitled-question").val(), type: questionType, - is_required: $(this).find('.required-toggle').is(':checked'), + is_required: $(this).find(".required-toggle").is(":checked"), options: [], - } + }; // Only add options if the question type supports them if ( - questionType === 'multiple-choice' || - questionType === 'checkboxes' || - questionType === 'dropdown' + questionType === "multiple-choice" || + questionType === "checkboxes" || + questionType === "dropdown" ) { $(this) - .find('.option-label') + .find(".option-label") .each(function () { - questionData.options.push($(this).val()) - }) + questionData.options.push($(this).val()); + }); } - formData.questions.push(questionData) - }) + formData.questions.push(questionData); + }); - console.log(formData) - return formData + console.log(formData); + return formData; } function validateFormData(formData) { for (let question of formData.questions) { if (!question.text.trim()) { - return { isValid: false, message: 'All questions must have text.' } + return { isValid: false, message: "All questions must have text." }; } if ( - (question.type === 'multiple-choice' || - question.type === 'checkboxes' || - question.type === 'dropdown') && + (question.type === "multiple-choice" || + question.type === "checkboxes" || + question.type === "dropdown") && question.options.length === 0 ) { return { isValid: false, - message: 'All options-based questions must have at least one option.', - } + message: "All options-based questions must have at least one option.", + }; } for (let option of question.options) { if (!option.trim()) { - return { isValid: false, message: 'All options must have text.' } + return { isValid: false, message: "All options must have text." }; } } } - return { isValid: true } + return { isValid: true }; } - $('#submit-btn').on('click', function () { - let formData = collectFormData() - console.log(formData) + $("#submit-btn").on("click", function () { + let formData = collectFormData(); + console.log(formData); - let validation = validateFormData(formData) + let validation = validateFormData(formData); if (!validation.isValid) { - alert(validation.message) - return + alert(validation.message); + return; } $.ajax({ - url: base_url + 'New_form_controller/submit_form', - type: 'POST', + url: base_url + "New_form_controller/submit_form", + type: "POST", data: { formData: formData }, - dataType: 'JSON', + dataType: "JSON", success: function (response) { - if (response.status === 'success') { + if (response.status === "success") { Swal.fire({ - title: 'Success!', - text: 'Form submitted successfully!', - icon: 'success', - confirmButtonText: 'OK', + title: "Success!", + text: "Form submitted successfully!", + icon: "success", + confirmButtonText: "OK", }).then((result) => { - window.location.href = base_url - }) + window.location.href = base_url; + }); } else { Swal.fire({ - title: 'Error!', + title: "Error!", text: response.message, - icon: 'error', - confirmButtonText: 'OK', - }) - console.log(response) + icon: "error", + confirmButtonText: "OK", + }); + console.log(response); } }, error: function (error) { Swal.fire({ - title: 'Error!', - text: 'Error submitting form!', - icon: 'error', - confirmButtonText: 'OK', - width: '400px', - height: '300px', - padding: 'auto', + title: "Error!", + text: "Error submitting form!", + icon: "error", + confirmButtonText: "OK", + width: "400px", + height: "300px", + padding: "auto", }).then((result) => { if (result.isConfirmed) { - window.location.href = home + window.location.href = home; } - }) - console.log(error) + }); + console.log(error); }, - }) - }) + }); + }); - $('#form-container').disableSelection() -}) + $("#form-container").disableSelection(); +}); diff --git a/assets/js/updation.js b/assets/js/updation.js index f6def37..1391917 100644 --- a/assets/js/updation.js +++ b/assets/js/updation.js @@ -1,35 +1,36 @@ $(document).ready(function () { - let index = 1 - let activeSection = null + let index = 1; + let activeSection = null; function addOption(type, container) { - let optionHtml + let optionHtml; - if (type === 'multiple-choice' || type === 'checkboxes') { + if (type === "multiple-choice" || type === "checkboxes") { optionHtml = ` -
- - + +
+ + - × -
- ` - } else if (type === 'dropdown') { + × +
+ `; + } else if (type === "dropdown") { optionHtml = ` -
- - × -
- ` +
+ + × +
+ `; } - container.append(optionHtml) + container.append(optionHtml); } function createFormSection() { let newSection = `
- ${index === 1 ? '
' : ''} + ${index === 1 ? '
' : ""} ' - ) - } else if (type === 'paragraph') { + '', + ); + } else if (type === "paragraph") { container.append( - '' - ) + '', + ); } else { - addOption(type, container) + addOption(type, container); $(this) - .closest('.form-section') + .closest(".form-section") .append( - '' - ) + '', + ); } - }) -}) + }); +}); diff --git a/bootstrap.php b/bootstrap.php new file mode 100644 index 0000000..72329db --- /dev/null +++ b/bootstrap.php @@ -0,0 +1,3 @@ +=5.3.7" - }, +"require": { + "php": ">=7.4" +}, "suggest": { "paragonie/random_compat": "Provides better randomness in PHP 5.x" }, @@ -31,6 +31,19 @@ "require-dev": { "mikey179/vfsstream": "1.6.*", "phpunit/phpunit": "4.* || 5.* || 9.*", - "squizlabs/php_codesniffer": "^3.5" + "squizlabs/php_codesniffer": "^3.10", + "slevomat/coding-standard": "^8.15" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } + , + "autoload": { + "psr-4": { + "CustomSniffs\\": "custom_sniffs/", + "App\\": "application/" + } +} } diff --git a/composer.lock b/composer.lock index a929396..c1a3854 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,87 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e56478c624f38d66a8457b936ab02732", + "content-hash": "3aa20e9993bebd9d273b0335f238881f", "packages": [], "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "time": "2023-01-05T11:28:13+00:00" + }, { "name": "doctrine/instantiator", "version": "1.5.0", @@ -41,7 +119,9 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["MIT"], + "license": [ + "MIT" + ], "authors": [ { "name": "Marco Pivetta", @@ -51,7 +131,10 @@ ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": ["constructor", "instantiate"], + "keywords": [ + "constructor", + "instantiate" + ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", "source": "https://github.com/doctrine/instantiator/tree/1.5.0" @@ -104,7 +187,9 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Frank Kleine", @@ -150,15 +235,25 @@ }, "type": "library", "autoload": { - "files": ["src/DeepCopy/deep_copy.php"], + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", - "license": ["MIT"], + "license": [ + "MIT" + ], "description": "Create deep copies (clones) of your objects", - "keywords": ["clone", "copy", "duplicate", "object", "object graph"], + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" @@ -195,7 +290,9 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^9.0" }, - "bin": ["bin/php-parse"], + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { @@ -208,14 +305,19 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Nikita Popov" } ], "description": "A PHP parser written in PHP", - "keywords": ["parser", "php"], + "keywords": [ + "parser", + "php" + ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" @@ -251,10 +353,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -304,10 +410,14 @@ }, "type": "library", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -332,6 +442,53 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "time": "2024-05-31T08:52:43+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.31", @@ -375,10 +532,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -388,7 +549,11 @@ ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": ["coverage", "testing", "xunit"], + "keywords": [ + "coverage", + "testing", + "xunit" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", @@ -429,10 +594,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -442,7 +611,10 @@ ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": ["filesystem", "iterator"], + "keywords": [ + "filesystem", + "iterator" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" @@ -486,10 +658,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -499,7 +675,9 @@ ], "description": "Invoke callables with a timeout", "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": ["process"], + "keywords": [ + "process" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" @@ -539,10 +717,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -552,7 +734,9 @@ ], "description": "Simple template engine.", "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": ["template"], + "keywords": [ + "template" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" @@ -592,10 +776,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -605,7 +793,9 @@ ], "description": "Utility class for timing", "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": ["timer"], + "keywords": [ + "timer" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" @@ -665,7 +855,9 @@ "ext-soap": "To be able to generate mocks based on WSDL files", "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "bin": ["phpunit"], + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { @@ -673,11 +865,17 @@ } }, "autoload": { - "files": ["src/Framework/Assert/Functions.php"], - "classmap": ["src/"] + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -687,7 +885,11 @@ ], "description": "The PHP Unit Testing framework.", "homepage": "https://phpunit.de/", - "keywords": ["phpunit", "testing", "xunit"], + "keywords": [ + "phpunit", + "testing", + "xunit" + ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", @@ -736,10 +938,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -788,10 +994,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -840,10 +1050,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -893,10 +1107,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -917,7 +1135,11 @@ ], "description": "Provides the functionality to compare PHP values for equality", "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": ["comparator", "compare", "equality"], + "keywords": [ + "comparator", + "compare", + "equality" + ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" @@ -958,10 +1180,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1011,10 +1237,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1027,7 +1257,12 @@ ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": ["diff", "udiff", "unidiff", "unified diff"], + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" @@ -1070,10 +1305,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1082,7 +1321,11 @@ ], "description": "Provides functionality to handle HHVM/PHP environments", "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": ["Xdebug", "environment", "hhvm"], + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" @@ -1124,10 +1367,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1152,7 +1399,10 @@ ], "description": "Provides the functionality to export PHP variables for visualization", "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": ["export", "exporter"], + "keywords": [ + "export", + "exporter" + ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" @@ -1198,10 +1448,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1210,7 +1464,9 @@ ], "description": "Snapshotting of global state", "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": ["global state"], + "keywords": [ + "global state" + ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" @@ -1251,10 +1507,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1305,10 +1565,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1356,10 +1620,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1407,10 +1675,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1466,10 +1738,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1516,10 +1792,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1565,10 +1845,14 @@ } }, "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1590,6 +1874,71 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.15.0", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "7d1d957421618a3803b593ec31ace470177d7817" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", + "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.9.0" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.60", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.16", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2024-03-09T15:20:58+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.10.2", @@ -1613,7 +1962,10 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, - "bin": ["bin/phpcbf", "bin/phpcs"], + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], "type": "library", "extra": { "branch-alias": { @@ -1621,7 +1973,9 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Greg Sherwood", @@ -1638,7 +1992,11 @@ ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": ["phpcs", "standards", "static analysis"], + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], "support": { "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", @@ -1683,10 +2041,14 @@ }, "type": "library", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -1714,7 +2076,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.3.7" + "php": ">=7.4" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/custom_sniffs/Sniffs/NamespaceSniff.php b/custom_sniffs/Sniffs/NamespaceSniff.php new file mode 100644 index 0000000..d5b2a5d --- /dev/null +++ b/custom_sniffs/Sniffs/NamespaceSniff.php @@ -0,0 +1,57 @@ +getTokens(); + $namespace = $this->getNamespace($phpcsFile, $stackPtr); + + // Get the file path relative to the project root + $filePath = $phpcsFile->getFilename(); + $projectRoot = '/var/www/html/google_forms/'; // Adjust this path as necessary + $relativePath = str_replace([$projectRoot, '.php'], '', $filePath); + + // Convert the file path to a namespace-like format + $expectedNamespace = str_replace('/', '\\', $relativePath); + + // Compare the file path with the namespace + if ($namespace !== $expectedNamespace) { + $error = sprintf( + 'Namespace "%s" does not match file path. Expected namespace: "%s"', + $namespace, + $expectedNamespace + ); + $phpcsFile->addError($error, $stackPtr, 'InvalidNamespace'); + } + } + + private function getNamespace(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $namespace = ''; + + for ($i = $stackPtr + 2; $i < $phpcsFile->numTokens; $i++) { + $namespace .= $tokens[$i]['content']; + + if ($tokens[$i]['code'] === T_SEMICOLON) { + break; + } + } + + return trim($namespace); + } +} diff --git a/eslint.config.mjs b/eslint.mjs.txt similarity index 100% rename from eslint.config.mjs rename to eslint.mjs.txt diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 1a16ded..201509b 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -87,6 +87,15 @@ "eslint": "^7.5.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@babel/generator": { "version": "7.25.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", @@ -1745,24 +1754,51 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "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.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.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/globals": { @@ -1781,33 +1817,46 @@ } }, "node_modules/@eslint/js": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.8.0.tgz", - "integrity": "sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", + "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.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==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", "dev": true }, @@ -1868,6 +1917,63 @@ "eslint-scope": "5.1.1" } }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@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/@pkgr/core": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", @@ -1880,10 +1986,234 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/type-utils": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", + "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", + "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", + "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", + "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", + "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1917,15 +2247,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", @@ -1963,18 +2284,15 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "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/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "engines": { "node": ">=8" @@ -2229,12 +2547,29 @@ } } }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2248,9 +2583,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz", + "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==", "dev": true }, "node_modules/emoji-regex": { @@ -2258,40 +2593,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/enquirer/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/enquirer/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", @@ -2325,57 +2626,55 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "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", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "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.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "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-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "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" @@ -2424,58 +2723,40 @@ } }, "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.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.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==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "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" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "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==", + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint/node_modules/ansi-regex": { @@ -2560,18 +2841,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2597,39 +2866,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.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.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" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -2644,15 +2894,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -2665,7 +2906,7 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -2674,15 +2915,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2731,6 +2963,34 @@ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2743,11 +3003,14 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", - "dev": true + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } }, "node_modules/file-entry-cache": { "version": "6.0.1", @@ -2772,6 +3035,22 @@ "node": ">=8" } }, + "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": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -2807,12 +3086,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2866,15 +3139,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": { @@ -2889,6 +3162,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -2931,9 +3230,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.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -3036,6 +3335,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-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3059,13 +3367,12 @@ "dev": true }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "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": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -3147,21 +3454,21 @@ } }, "node_modules/lint-staged": { - "version": "15.2.7", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz", - "integrity": "sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==", + "version": "15.2.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.8.tgz", + "integrity": "sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==", "dev": true, "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.4", + "debug": "~4.3.6", "execa": "~8.0.1", - "lilconfig": "~3.1.1", - "listr2": "~8.2.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", "micromatch": "~4.0.7", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.4.2" + "yaml": "~2.5.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -3189,6 +3496,21 @@ "node": ">=18.0.0" } }, + "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/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -3201,12 +3523,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true - }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -3268,6 +3584,15 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", @@ -3315,9 +3640,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -3396,6 +3721,36 @@ "node": ">= 0.8.0" } }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "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/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3408,6 +3763,15 @@ "node": ">=6" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3431,6 +3795,15 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -3495,15 +3868,6 @@ "node": ">=6.0.0" } }, - "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/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3513,6 +3877,26 @@ "node": ">=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/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -3546,18 +3930,6 @@ "@babel/runtime": "^7.8.4" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/regexpu-core": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", @@ -3596,15 +3968,6 @@ "jsesc": "bin/jsesc" } }, - "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/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -3660,6 +4023,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", @@ -3681,6 +4054,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3720,6 +4116,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", @@ -3735,12 +4140,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -3842,144 +4241,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/table": { - "version": "6.8.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", - "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/table/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/table/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/table/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/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/table/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/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4006,6 +4267,18 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", @@ -4036,6 +4309,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -4115,12 +4402,6 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4173,15 +4454,27 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "bin": { "yaml": "bin.mjs" }, "engines": { "node": ">= 14" } + }, + "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/eslintrc/CHANGELOG.md b/node_modules/@eslint/eslintrc/CHANGELOG.md deleted file mode 100644 index 3250e1e..0000000 --- a/node_modules/@eslint/eslintrc/CHANGELOG.md +++ /dev/null @@ -1,50 +0,0 @@ -v0.4.3 - July 17, 2021 - -* [`ce78027`](https://github.com/eslint/eslintrc/commit/ce78027f6a319a29fdf0b78ac1e7071373acffc4) Fix: ensure config files are files (#42) (Tom Jenkinson) -* [`95b1c9b`](https://github.com/eslint/eslintrc/commit/95b1c9b30267479a75cd07768f8f9e9cfa63c105) Chore: pin fs-teardown@0.1.1 (#45) (Milos Djermanovic) -* [`593fbe3`](https://github.com/eslint/eslintrc/commit/593fbe3c2c1c5f723f71810963ed21a56caed4c1) Chore: fix failing test (#44) (Tom Jenkinson) - -v0.4.2 - June 4, 2021 - -* [`cc79a4d`](https://github.com/eslint/eslintrc/commit/cc79a4db45a2ca0236a846ed8eba28eea07d4db5) Upgrade: update globals to version 13.6 (#32) (Rouven Weßling) - -v0.4.1 - May 7, 2021 - -* [`aa38ef4`](https://github.com/eslint/eslintrc/commit/aa38ef40c3123f8f534c7f9b0b7c306f5f011dce) Fix: Properly export module resolver (#34) (Richie Bendall) -* [`62ea4bd`](https://github.com/eslint/eslintrc/commit/62ea4bd74b78fbeff12ffb21f1f978817601d4d1) Build: add node v16 (#33) (薛定谔的猫) -* [`7c43d77`](https://github.com/eslint/eslintrc/commit/7c43d7784e39cf0b7b102af64f703cade11252bb) Chore: add tests for built-in rules config schema validation (fixes #15) (#31) (Milos Djermanovic) -* [`d8ea601`](https://github.com/eslint/eslintrc/commit/d8ea601ecb4b9f81cdc332b012b6b1bbc984366c) Chore: Test on Node 15.x (#30) (Milos Djermanovic) -* [`0b2f80d`](https://github.com/eslint/eslintrc/commit/0b2f80d6f6b33e4c5e168b08468867653f726754) Chore: lint test files (#18) (Milos Djermanovic) - -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 f9556ee..b607bb3 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 11ff46e..7641c74 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,87 @@ 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 (ESM) 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"; -const compat = new FlatCompat(); +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +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: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## Usage (CommonJS) + +Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file: + +```js +const { FlatCompat } = require("@eslint/eslintrc"); +const js = require("@eslint/js"); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional + allConfig: js.configs.all, // optional +}); + +module.exports = [ + + // mimic ESLintRC-style extends + ...compat.extends("standard", "example"), + + // mimic environments + ...compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + ...compat.plugins("airbnb", "react"), + + // translate an entire 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 712fc42..ada90e1 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 757c9fe..50d1b1d 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,24 @@ module.exports = new Map(Object.entries({ ecmaVersion: 12 } }, + es2022: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 13 + } + }, + es2023: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 14 + } + }, + es2024: { + globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 }, + parserOptions: { + ecmaVersion: 15 + } + }, // 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 859811c..0000000 --- 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 9630091..0000000 --- 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/lib/cascading-config-array-factory.js b/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js index c991c24..597352e 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 406601c..58c1e80 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 }); } @@ -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"); @@ -1003,6 +1053,7 @@ class ConfigArrayFactory { if (plugin) { return new ConfigDependency({ definition: normalizePlugin(plugin), + original: plugin, filePath: "", // It's unknown where the plugin came from. id, importerName: ctx.name, @@ -1014,7 +1065,7 @@ class ConfigArrayFactory { let error; try { - filePath = ModuleResolver.resolve(request, relativeTo); + filePath = resolver.resolve(request, relativeTo); } catch (resolveError) { error = resolveError; /* istanbul ignore else */ @@ -1039,6 +1090,7 @@ class ConfigArrayFactory { return new ConfigDependency({ definition: normalizePlugin(pluginDefinition), + original: pluginDefinition, filePath, id, importerName: ctx.name, @@ -1096,4 +1148,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 42a7362..133f5a2 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 = { +/** + * 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); + + return Array.from(cache.values()); +} + + +export { 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 - */ - getUsedExtractedConfigs(instance) { - const { cache } = internalSlotsMap.get(instance); - - return Array.from(cache.values()); - } + getUsedExtractedConfigs }; - -module.exports = exportObject; 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 0d5f6f7..080e640 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. @@ -29,6 +28,7 @@ class ConfigDependency { * Initialize this instance. * @param {Object} data The dependency data. * @param {T} [data.definition] The dependency if the loading succeeded. + * @param {T} [data.original] The original, non-normalized 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. @@ -37,6 +37,7 @@ class ConfigDependency { */ constructor({ definition = null, + original = null, error = null, filePath = null, id, @@ -50,6 +51,12 @@ class ConfigDependency { */ this.definition = definition; + /** + * The original dependency as loaded directly from disk if the loading succeeded. + * @type {T|null} + */ + this.original = original; + /** * The error object if the loading failed. * @type {Error|null} @@ -102,7 +109,8 @@ class ConfigDependency { */ [util.inspect.custom]() { const { - definition: _ignore, // eslint-disable-line no-unused-vars + definition: _ignore1, // eslint-disable-line no-unused-vars + original: _ignore2, // eslint-disable-line no-unused-vars ...obj } = this; @@ -113,4 +121,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 b27d6ff..e93b0b6 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 4c16278..3022ba9 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 928d76c..647f02b 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 e7ba120..460aafc 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 c0d0ea2..6c307a9 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") { @@ -144,7 +132,7 @@ function translateESLintRC(eslintrcConfig, { debug(`Translating plugin: ${pluginName}`); debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`); - const { definition: plugin, error } = eslintrcConfig.plugins[pluginName]; + const { original: plugin, error } = eslintrcConfig.plugins[pluginName]; if (error) { throw error; @@ -180,14 +168,20 @@ function translateESLintRC(eslintrcConfig, { if (environments.has(envName)) { // built-in environments should be defined first - configs.unshift(...translateESLintRC(environments.get(envName), { + configs.unshift(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...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), { + configs.push(...translateESLintRC({ + criteria: eslintrcConfig.criteria, + ...pluginEnvironments.get(envName) + }, { resolveConfigRelativeTo, resolvePluginsRelativeTo })); @@ -216,15 +210,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 +284,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 +295,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 +306,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 +315,4 @@ class FlatCompat { } } -exports.FlatCompat = FlatCompat; +export { FlatCompat }; diff --git a/node_modules/@eslint/eslintrc/lib/index.js b/node_modules/@eslint/eslintrc/lib/index.js index de2a95d..9e3d13f 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"); + createContext as createConfigArrayFactoryContext +} from "./config-array-factory.js"; -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"); +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 = { +const Legacy = { + ConfigArray, + createConfigArrayFactoryContext, + CascadingConfigArrayFactory, + ConfigArrayFactory, + ConfigDependency, + ExtractedConfig, + IgnorePattern, + OverrideTester, + getUsedExtractedConfigs, + environments, - Legacy: { - ConfigArray, - createConfigArrayFactoryContext, - CascadingConfigArrayFactory, - ConfigArrayFactory, - ConfigDependency, - ExtractedConfig, - IgnorePattern, - OverrideTester, - getUsedExtractedConfigs, + // shared + ConfigOps, + ConfigValidator, + ModuleResolver, + naming +}; - // 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 3fb0fbd..b79ad36 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 3b4d569..d203be0 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. + */ +function getRuleSeverity(ruleConfig) { + const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; - /** - * 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')`); - } + 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 9086973..32174a5 100644 --- a/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +++ b/node_modules/@eslint/eslintrc/lib/shared/config-validator.js @@ -3,22 +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; @@ -38,7 +37,7 @@ const validated = new WeakSet(); // Exports //----------------------------------------------------------------------------- -module.exports = class ConfigValidator { +export default class ConfigValidator { constructor({ builtInRules = new Map() } = {}) { this.builtInRules = builtInRules; } @@ -323,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 136fc25..91907b1 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 32cff94..93df5fc 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 80335c5..1df0ca8 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; +const createRequire = Module.createRequire; -module.exports = { +/** + * 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) { - /** - * 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) { - - // 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 d4ac14e..a32c35e 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/package.json b/node_modules/@eslint/eslintrc/package.json index 35f5129..aa43e75 100644 --- a/node_modules/@eslint/eslintrc/package.json +++ b/node_modules/@eslint/eslintrc/package.json @@ -1,27 +1,44 @@ { "name": "@eslint/eslintrc", - "version": "0.4.3", + "version": "2.1.4", "description": "The legacy ESLintRC config file format for ESLint", - "main": "lib/index.js", + "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" ], "publishConfig": { "access": "public" }, "scripts": { + "build": "rollup -c", "lint": "eslint . --report-unused-disable-directives", - "fix": "npm run lint -- --fix", - "test": "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" + "lint:fix": "npm run lint -- --fix", + "prepare": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'" }, "repository": "eslint/eslintrc", + "funding": "https://opencollective.com/eslint", "keywords": [ "ESLint", "ESLintRC", @@ -34,30 +51,32 @@ }, "homepage": "https://github.com/eslint/eslintrc#readme", "devDependencies": { - "chai": "^4.2.0", - "eslint": "^7.21.0", + "c8": "^7.7.3", + "chai": "^4.3.4", + "eslint": "^7.31.0", "eslint-config-eslint": "^7.0.0", - "eslint-plugin-jsdoc": "^32.2.0", + "eslint-plugin-jsdoc": "^35.4.1", "eslint-plugin-node": "^11.1.0", - "eslint-release": "^3.1.2", - "fs-teardown": "0.1.1", - "mocha": "^8.1.1", + "eslint-release": "^3.2.0", + "fs-teardown": "^0.1.3", + "mocha": "^9.0.3", + "rollup": "^2.70.1", "shelljs": "^0.8.4", - "sinon": "^9.2.0", + "sinon": "^11.1.2", "temp-dir": "^2.0.0" }, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.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" } } diff --git a/node_modules/@eslint/js/package.json b/node_modules/@eslint/js/package.json index bac2bd6..3120dd3 100644 --- a/node_modules/@eslint/js/package.json +++ b/node_modules/@eslint/js/package.json @@ -1,6 +1,6 @@ { "name": "@eslint/js", - "version": "9.8.0", + "version": "9.9.0", "description": "ESLint JavaScript language implementation", "main": "./src/index.js", "scripts": {}, diff --git a/node_modules/@humanwhocodes/config-array/README.md b/node_modules/@humanwhocodes/config-array/README.md index 9cfe637..d64784c 100644 --- a/node_modules/@humanwhocodes/config-array/README.md +++ b/node_modules/@humanwhocodes/config-array/README.md @@ -74,11 +74,11 @@ const configs = new ConfigArray(rawConfigs, { }); ``` -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 directoy in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, and `name`. +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 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: +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"); @@ -106,14 +106,17 @@ const configs = new ConfigArray(rawConfigs, { // the path to match filenames from basePath: process.cwd(), - // additional items in each config - schema: mySchema + // 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, such as: +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 [ @@ -171,11 +174,44 @@ If the `files` array contains a function, then that function is called with the 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 getting a `settings.js` property set to `false`. +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. 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: +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 [ @@ -210,7 +246,7 @@ export default [ When a config array is normalized, each function is executed and replaced in the config array with the return value. -**Note:** Config functions cannot be async. This will be added in a future version. +**Note:** Config functions can also be async. ### Normalizing Config Arrays @@ -226,6 +262,14 @@ await configs.normalize({ 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 @@ -244,6 +288,46 @@ 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 diff --git a/node_modules/@humanwhocodes/config-array/api.js b/node_modules/@humanwhocodes/config-array/api.js index a9aacf4..eb95429 100644 --- a/node_modules/@humanwhocodes/config-array/api.js +++ b/node_modules/@humanwhocodes/config-array/api.js @@ -1,12 +1,8 @@ '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 path = require('path'); +var minimatch = require('minimatch'); +var createDebug = require('debug'); var objectSchema = require('@humanwhocodes/object-schema'); /** @@ -18,31 +14,13 @@ var objectSchema = require('@humanwhocodes/object-schema'); // 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.'); - } -} +const NOOP_STRATEGY = { + required: false, + merge() { + return undefined; + }, + validate() { } +}; //------------------------------------------------------------------------------ // Exports @@ -64,6 +42,66 @@ const baseSchema = Object.freeze({ } } }, + files: NOOP_STRATEGY, + ignores: NOOP_STRATEGY +}); + +/** + * @fileoverview ConfigSchema + * @author Nicholas C. Zakas + */ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Asserts 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.'); + } +} + +/** + * Asserts 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 and functions.'); + } +} + +/** + * Asserts that a given value is a non-empty array. + * @param {*} value The value to check. + * @returns {void} + * @throws {TypeError} When the value is not an array or an empty array. + */ +function assertIsNonEmptyArray(value) { + if (!Array.isArray(value) || value.length === 0) { + throw new TypeError('Expected value to be a non-empty array.'); + } +} + +//------------------------------------------------------------------------------ +// Exports +//------------------------------------------------------------------------------ + +/** + * The schema for `files` and `ignores` that every ConfigArray uses. + * @type Object + */ +const filesAndIgnoresSchema = Object.freeze({ files: { required: false, merge() { @@ -72,7 +110,7 @@ const baseSchema = Object.freeze({ validate(value) { // first check if it's an array - assertIsArray(value); + assertIsNonEmptyArray(value); // then check each member value.forEach(item => { @@ -99,16 +137,25 @@ const baseSchema = Object.freeze({ * @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 + // matchBase: true, + dot: true }; +const CONFIG_TYPES = new Set(['array', 'function']); + +const FILES_AND_IGNORES_SCHEMA = new objectSchema.ObjectSchema(filesAndIgnoresSchema); + /** * Shorthand for checking if a value is a string. * @param {any} value The value to check. @@ -118,27 +165,143 @@ function isString(value) { return typeof value === 'string'; } +/** + * Asserts that the files and ignores keys of a config object are valid as per base schema. + * @param {object} config The config object to check. + * @returns {void} + * @throws {TypeError} If the files and ignores keys of a config object are not valid. + */ +function assertValidFilesAndIgnores(config) { + if (!config || typeof config !== 'object') { + return; + } + const validateConfig = { }; + if ('files' in config) { + validateConfig.files = config.files; + } + if ('ignores' in config) { + validateConfig.ignores = config.ignores; + } + FILES_AND_IGNORES_SCHEMA.validate(validateConfig); +} + +/** + * 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. - * @returns {Array} A flattened array containing only config objects. + * @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) { +async function normalize(items, context, extraConfigTypes) { - // TODO: Allow async config functions + const allowFunctions = extraConfigTypes.includes('function'); + const allowArrays = extraConfigTypes.includes('array'); - function *flatTraverse(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)) { - yield * flatTraverse(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 { @@ -150,43 +313,111 @@ async function normalize(items, context) { 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 based on + * `ignores` only. + * @param {string} filePath The absolute file path to check. + * @param {string} basePath The base path for the config. + * @param {Object} config The config object to check. + * @returns {boolean} True if the file path is matched by the config, + * false if not. + */ +function pathMatchesIgnores(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); + + return Object.keys(config).length > 1 && + !shouldIgnorePath(config.ignores, filePath, relativeFilePath); +} + + /** * 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 {string} basePath The base path for the config. * @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) { - // a config without a `files` field always matches - if (!config.files) { - return true; - } - - // if files isn't an array, throw an error - if (!Array.isArray(config.files) || config.files.length === 0) { - throw new TypeError('The files key must be a non-empty array.'); - } - + /* + * 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); // match both strings and functions const match = pattern => { + if (isString(pattern)) { - return minimatch(relativeFilePath, pattern, MINIMATCH_OPTIONS); + 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 matches = config.files.some(pattern => { + let filePathMatchesPattern = config.files.some(pattern => { if (Array.isArray(pattern)) { return pattern.every(match); } @@ -198,13 +429,11 @@ function pathMatches(filePath, basePath, config) { * If the file path matches the config.files patterns, then check to see * if there are any files to ignore. */ - if (matches && config.ignores) { - matches = !config.ignores.some(pattern => { - return minimatch(filePath, pattern, MINIMATCH_OPTIONS); - }); + if (filePathMatchesPattern && config.ignores) { + filePathMatchesPattern = !shouldIgnorePath(config.ignores, filePath, relativeFilePath); } - return matches; + return filePathMatchesPattern; } /** @@ -220,6 +449,24 @@ function assertNormalized(configArray) { } } +/** + * 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 //------------------------------------------------------------------------------ @@ -232,6 +479,9 @@ const ConfigArraySymbol = { 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. @@ -247,8 +497,15 @@ class ConfigArray extends Array { * 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 } = {}) { + constructor(configs, { + basePath = '', + normalized = false, + schema: customSchema, + extraConfigTypes = [] + } = {} + ) { super(); /** @@ -265,10 +522,9 @@ class ConfigArray extends Array { * @type ObjectSchema * @private */ - this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema({ - ...customSchema, - ...baseSchema - }); + this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema( + Object.assign({}, customSchema, baseSchema) + ); /** * The path of the config file that this array was loaded from. @@ -278,6 +534,15 @@ class ConfigArray extends Array { */ 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 @@ -286,6 +551,14 @@ class ConfigArray extends Array { */ 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); @@ -308,54 +581,79 @@ class ConfigArray extends Array { /** * Returns the `files` globs from every config object in the array. - * Negated patterns (those beginning with `!`) are not returned. * 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 {string[]} An array of string patterns. + * @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 => { - if (Array.isArray(filePattern)) { - result.push(...filePattern.filter(pattern => { - return isString(pattern) && !pattern.startsWith('!'); - })); - } else if (isString(filePattern) && !filePattern.startsWith('!')) { - result.push(filePattern); - } + result.push(filePattern); }); } } + // store result + cache.files = result; + dataCache.set(this, cache); + return result; } /** - * Returns the file globs that should always be ignored regardless of + * 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 to be ignored. + * @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) { - if (config.ignores && !config.files) { - result.push(...config.ignores.filter(isString)); + + /* + * 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) { + result.push(...config.ignores); } } + // store result + cache.ignores = result; + dataCache.set(this, cache); + return result; } @@ -371,14 +669,37 @@ class ConfigArray extends Array { * Normalizes a config array by flattening embedded arrays and executing * config functions. * @param {ConfigContext} context The context object for config functions. - * @returns {ConfigArray} A new ConfigArray instance that is normalized. + * @returns {Promise} The current ConfigArray instance. */ async normalize(context = {}) { if (!this.isNormalized()) { - const normalizedConfigs = await normalize(this, context); + const normalizedConfigs = await normalize(this, context, this.extraConfigTypes); this.length = 0; - this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig])); + this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig].bind(this))); + this.forEach(assertValidFilesAndIgnores); + 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.forEach(assertValidFilesAndIgnores); this[ConfigArraySymbol.isNormalized] = true; // prevent further changes @@ -411,6 +732,56 @@ class ConfigArray extends Array { 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. @@ -420,37 +791,239 @@ class ConfigArray extends Array { assertNormalized(this); - // first check the cache to avoid duplicate work - let finalConfig = this[ConfigArraySymbol.configCache].get(filePath); + const cache = this[ConfigArraySymbol.configCache]; - if (finalConfig) { + // first check the cache for a filename match to avoid duplicate work + if (cache.has(filePath)) { + return cache.get(filePath); + } + + let 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; } - // No config found in cache, so calculate a new one + // TODO: Maybe move elsewhere? + const relativeFilePath = path.relative(this.basePath, filePath); - const matchingConfigs = []; + if (shouldIgnorePath(this.ignores, filePath, relativeFilePath)) { + debug(`Ignoring ${filePath} based on file pattern`); - for (const config of this) { - if (pathMatches(filePath, this.basePath, config)) { - debug(`Matching config found for ${filePath}`); - matchingConfigs.push(config); - } else { - debug(`No matching config found for ${filePath}`); - } + // cache and return result - finalConfig is undefined at this point + cache.set(filePath, finalConfig); + return finalConfig; } - finalConfig = matchingConfigs.reduce((result, config) => { - return this[ConfigArraySymbol.schema].merge(result, config); + // 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) { + + if (!config.ignores) { + debug(`Anonymous universal config found for ${filePath}`); + matchingConfigIndices.push(index); + return; + } + + if (pathMatchesIgnores(filePath, this.basePath, config)) { + debug(`Matching config found for ${filePath} (based on ignores: ${config.ignores})`); + matchingConfigIndices.push(index); + return; + } + + debug(`Skipped config found for ${filePath} (based on ignores: ${config.ignores})`); + return; + } + + /* + * 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); - this[ConfigArraySymbol.configCache].set(filePath, 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; diff --git a/node_modules/@humanwhocodes/config-array/package.json b/node_modules/@humanwhocodes/config-array/package.json index 4dc3a4e..0c3beb3 100644 --- a/node_modules/@humanwhocodes/config-array/package.json +++ b/node_modules/@humanwhocodes/config-array/package.json @@ -1,6 +1,6 @@ { "name": "@humanwhocodes/config-array", - "version": "0.5.0", + "version": "0.11.14", "description": "Glob-based configuration matching.", "author": "Nicholas C. Zakas", "main": "api.js", @@ -19,6 +19,7 @@ "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" @@ -28,7 +29,6 @@ }, "lint-staged": { "*.js": [ - "nitpik", "eslint --fix --ignore-pattern '!.eslintrc.js'" ] }, @@ -42,20 +42,20 @@ "node": ">=10.10.0" }, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" }, "devDependencies": { - "@nitpik/javascript": "^0.3.3", + "@nitpik/javascript": "0.4.0", "@nitpik/node": "0.0.5", - "chai": "^4.2.0", - "eslint": "^6.7.1", - "esm": "^3.2.25", - "lint-staged": "^10.2.8", - "mocha": "^6.1.4", - "nyc": "^14.1.1", - "rollup": "^1.12.3", - "yorkie": "^2.0.0" + "chai": "4.3.10", + "eslint": "8.52.0", + "esm": "3.2.25", + "lint-staged": "15.0.2", + "mocha": "6.2.3", + "nyc": "15.1.0", + "rollup": "3.28.1", + "yorkie": "2.0.0" } -} \ No newline at end of file +} diff --git a/node_modules/@humanwhocodes/object-schema/.eslintrc.js b/node_modules/@humanwhocodes/object-schema/.eslintrc.js deleted file mode 100644 index 4934076..0000000 --- a/node_modules/@humanwhocodes/object-schema/.eslintrc.js +++ /dev/null @@ -1,29 +0,0 @@ -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 deleted file mode 100644 index 8ea1951..0000000 --- a/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml +++ /dev/null @@ -1,27 +0,0 @@ -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 deleted file mode 100644 index 42f75f7..0000000 --- a/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml +++ /dev/null @@ -1,39 +0,0 @@ -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 index bb63f5f..3b0b6a3 100644 --- a/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +++ b/node_modules/@humanwhocodes/object-schema/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## [2.0.3](https://github.com/humanwhocodes/object-schema/compare/v2.0.2...v2.0.3) (2024-04-01) + + +### Bug Fixes + +* Ensure test files are not including in package ([6eeb32c](https://github.com/humanwhocodes/object-schema/commit/6eeb32cc76a3e37d76b2990bd603d72061c816e0)), closes [#19](https://github.com/humanwhocodes/object-schema/issues/19) + +## [2.0.2](https://github.com/humanwhocodes/object-schema/compare/v2.0.1...v2.0.2) (2024-01-10) + + +### Bug Fixes + +* WrapperError should be an actual error ([2523f01](https://github.com/humanwhocodes/object-schema/commit/2523f014168167e5a40bb63e0cc03231b2c0f1bf)) + +## [2.0.1](https://github.com/humanwhocodes/object-schema/compare/v2.0.0...v2.0.1) (2023-10-20) + + +### Bug Fixes + +* Custom properties should be available on thrown errors ([6ca80b0](https://github.com/humanwhocodes/object-schema/commit/6ca80b001a4ffb678b9b5544fc53322117374376)) + +## [2.0.0](https://github.com/humanwhocodes/object-schema/compare/v1.2.1...v2.0.0) (2023-10-18) + + +### ⚠ BREAKING CHANGES + +* Throw custom errors instead of generics. + +### Features + +* Throw custom errors instead of generics. ([c6c01d7](https://github.com/humanwhocodes/object-schema/commit/c6c01d71eb354bf7b1fb3e883c40f7bd9b61647c)) + ### [1.2.1](https://www.github.com/humanwhocodes/object-schema/compare/v1.2.0...v1.2.1) (2021-11-02) diff --git a/node_modules/@humanwhocodes/object-schema/package.json b/node_modules/@humanwhocodes/object-schema/package.json index 9fc90bf..0098b44 100644 --- a/node_modules/@humanwhocodes/object-schema/package.json +++ b/node_modules/@humanwhocodes/object-schema/package.json @@ -1,8 +1,13 @@ { "name": "@humanwhocodes/object-schema", - "version": "1.2.1", + "version": "2.0.3", "description": "An object schema merger/validator", "main": "src/index.js", + "files": [ + "src", + "LICENSE", + "README.md" + ], "directories": { "test": "tests" }, diff --git a/node_modules/@humanwhocodes/object-schema/src/object-schema.js b/node_modules/@humanwhocodes/object-schema/src/object-schema.js index b663236..62d198e 100644 --- a/node_modules/@humanwhocodes/object-schema/src/object-schema.js +++ b/node_modules/@humanwhocodes/object-schema/src/object-schema.js @@ -62,9 +62,77 @@ function validateDefinition(name, strategy) { } } +//----------------------------------------------------------------------------- +// Errors +//----------------------------------------------------------------------------- + +/** + * Error when an unexpected key is found. + */ +class UnexpectedKeyError extends Error { + + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + */ + constructor(key) { + super(`Unexpected key "${key}" found.`); + } +} + +/** + * Error when a required key is missing. + */ +class MissingKeyError extends Error { + + /** + * Creates a new instance. + * @param {string} key The key that was missing. + */ + constructor(key) { + super(`Missing required key "${key}".`); + } +} + +/** + * Error when a key requires other keys that are missing. + */ +class MissingDependentKeysError extends Error { + + /** + * Creates a new instance. + * @param {string} key The key that was unexpected. + * @param {Array} requiredKeys The keys that are required. + */ + constructor(key, requiredKeys) { + super(`Key "${key}" requires keys "${requiredKeys.join("\", \"")}".`); + } +} + +/** + * Wrapper error for errors occuring during a merge or validate operation. + */ +class WrapperError extends Error { + + /** + * Creates a new instance. + * @param {string} key The object key causing the error. + * @param {Error} source The source error. + */ + constructor(key, source) { + super(`Key "${key}": ${source.message}`, { cause: source }); + + // copy over custom properties that aren't represented + for (const key of Object.keys(source)) { + if (!(key in this)) { + this[key] = source[key]; + } + } + } +} //----------------------------------------------------------------------------- -// Class +// Main //----------------------------------------------------------------------------- /** @@ -159,11 +227,11 @@ class ObjectSchema { // double check arguments if (objects.length < 2) { - throw new Error("merge() requires at least two arguments."); + throw new TypeError("merge() requires at least two arguments."); } if (objects.some(object => (object == null || typeof object !== "object"))) { - throw new Error("All arguments must be objects."); + throw new TypeError("All arguments must be objects."); } return objects.reduce((result, object) => { @@ -179,8 +247,7 @@ class ObjectSchema { } } } catch (ex) { - ex.message = `Key "${key}": ` + ex.message; - throw ex; + throw new WrapperError(key, ex); } } return result; @@ -200,7 +267,7 @@ class ObjectSchema { // check to see if the key is defined if (!this.hasKey(key)) { - throw new Error(`Unexpected key "${key}" found.`); + throw new UnexpectedKeyError(key); } // validate existing keys @@ -209,7 +276,7 @@ class ObjectSchema { // 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("\", \"")}".`); + throw new MissingDependentKeysError(key, strategy.requires); } } @@ -217,15 +284,14 @@ class ObjectSchema { try { strategy.validate.call(strategy, object[key]); } catch (ex) { - ex.message = `Key "${key}": ` + ex.message; - throw ex; + throw new WrapperError(key, ex); } } // ensure required keys aren't missing for (const [key] of this[requiredKeys]) { if (!(key in object)) { - throw new Error(`Missing required key "${key}".`); + throw new MissingKeyError(key); } } diff --git a/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js b/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js deleted file mode 100644 index 84032d7..0000000 --- a/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @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 deleted file mode 100644 index d86ef6e..0000000 --- a/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +++ /dev/null @@ -1,611 +0,0 @@ -/** - * @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 deleted file mode 100644 index 5d3e4a2..0000000 --- a/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @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/acorn/CHANGELOG.md b/node_modules/acorn/CHANGELOG.md index 164fd27..c404a23 100644 --- a/node_modules/acorn/CHANGELOG.md +++ b/node_modules/acorn/CHANGELOG.md @@ -1,3 +1,293 @@ +## 8.12.1 (2024-07-03) + +### Bug fixes + +Fix a regression that caused Acorn to no longer run on Node versions <8.10. + +## 8.12.0 (2024-06-14) + +### New features + +Support ES2025 duplicate capture group names in regular expressions. + +### Bug fixes + +Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error. + +Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name. + +Properly recognize \"use strict\" when preceded by a string with an escaped newline. + +Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors. + +Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled. + +Properly normalize line endings in raw strings of invalid template tokens. + +Properly track line numbers for escaped newlines in strings. + +Fix a bug that broke line number accounting after a template literal with invalid escape sequences. + +## 8.11.3 (2023-12-29) + +### Bug fixes + +Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error. + +Make sure `onToken` get an `import` keyword token when parsing `import.meta`. + +Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes. + +## 8.11.2 (2023-10-27) + +### Bug fixes + +Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances. + +## 8.11.1 (2023-10-26) + +### Bug fixes + +Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens. + +## 8.11.0 (2023-10-26) + +### Bug fixes + +Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state. + +Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression. + +### New features + +Upgrade to Unicode 15.1. + +Use a set of new, much more precise, TypeScript types. + +## 8.10.0 (2023-07-05) + +### New features + +Add a `checkPrivateFields` option that disables strict checking of private property use. + +## 8.9.0 (2023-06-16) + +### Bug fixes + +Forbid dynamic import after `new`, even when part of a member expression. + +### New features + +Add Unicode properties for ES2023. + +Add support for the `v` flag to regular expressions. + +## 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 + +Fix a spurious error in nested destructuring arrays. + +### New features + +Expose `allowAwaitOutsideFunction` in CLI interface. + +Make `allowImportExportAnywhere` also apply to `import.meta`. + +## 8.0.5 (2021-01-25) + +### Bug fixes + +Adjust package.json to work with Node 12.16.0 and 13.0-13.6. + +## 8.0.4 (2020-10-05) + +### Bug fixes + +Make `await x ** y` an error, following the spec. + +Fix potentially exponential regular expression. + +## 8.0.3 (2020-10-02) + +### Bug fixes + +Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`. + +## 8.0.2 (2020-09-30) + +### Bug fixes + +Make the TypeScript types reflect the current allowed values for `ecmaVersion`. + +Fix another regexp/division tokenizer issue. + +## 8.0.1 (2020-08-12) + +### Bug fixes + +Provide the correct value in the `version` export. + +## 8.0.0 (2020-08-12) + +### Bug fixes + +Disallow expressions like `(a = b) = c`. + +Make non-octal escape sequences a syntax error in strict mode. + +### New features + +The package can now be loaded directly as an ECMAScript module in node 13+. + +Update to the set of Unicode properties from ES2021. + +### Breaking changes + +The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release. + +Some changes to method signatures that may be used by plugins. + ## 7.4.0 (2020-08-03) ### New features diff --git a/node_modules/acorn/LICENSE b/node_modules/acorn/LICENSE index cc5272c..9d71cc6 100644 --- a/node_modules/acorn/LICENSE +++ b/node_modules/acorn/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2012-2018 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 52d2e9b..f7ff966 100644 --- a/node_modules/acorn/README.md +++ b/node_modules/acorn/README.md @@ -9,9 +9,7 @@ Acorn is open source software released under an 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). +requests on [github](https://github.com/acornjs/acorn). ## Installation @@ -32,14 +30,14 @@ 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 +`input` parameter is a string, `options` must be 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")); +console.log(acorn.parse("1 + 1", {ecmaVersion: 2020})); ``` When encountering a syntax error, the parser will raise a @@ -48,18 +46,19 @@ 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: +Options are provided by in a second argument, which should be an +object containing any of these fields (only `ecmaVersion` is +required): -- **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. +- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a + number, either in year (`2022`) or plain version number (`6`) form, + 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 can be implemented - through plugins. + implemented by Acorn. Other proposed new features must 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 @@ -89,16 +88,27 @@ an object containing any of these fields: - **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. + option to `true` allows them anywhere where a statement is allowed, + and also allows `import.meta` expressions to appear in scripts + (when `sourceType` is not `"module"`). -- **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. +- **allowAwaitOutsideFunction**: If `false`, `await` expressions can + only appear inside `async` functions. Defaults to `true` in modules + 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. + +- **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. + +- **checkPrivateFields**: By default, the parser will verify that + private properties are only used in places where they are valid and + have been declared. Set this to false to turn such checks off. - **locations**: When `true`, each node has a `loc` object attached with `start` and `end` subobjects, each of which contains the @@ -191,6 +201,13 @@ 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. +Note that tokenizing JavaScript without parsing it is, in modern +versions of the language, not really possible due to the way syntax is +overloaded in ways that can only be disambiguated by the parse +context. This package applies a bunch of heuristics to try and do a +reasonable job, but you are advised to use `parse` with the `onToken` +option instead of this. + In ES6 environment, returned result can be used as any other protocol-compliant iterable: @@ -224,7 +241,7 @@ you can use its static `extend` method. var acorn = require("acorn"); var jsx = require("acorn-jsx"); var JSXParser = acorn.Parser.extend(jsx()); -JSXParser.parse("foo()"); +JSXParser.parse("foo()", {ecmaVersion: 2020}); ``` The `extend` method takes any number of plugin values, and returns a @@ -249,6 +266,9 @@ options: - `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. +- `--allow-await-outside-function`: Allows top-level `await` expressions. + See the `allowAwaitOutsideFunction` option for more information. + - `--compact`: No whitespace is used in the AST output. - `--silent`: Do not output the AST, just return the exit status. @@ -260,10 +280,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 cf7df46..3ef3c12 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 bda5f80..cd204b1 100644 --- a/node_modules/acorn/dist/acorn.d.ts +++ b/node_modules/acorn/dist/acorn.d.ts @@ -1,209 +1,856 @@ -export as namespace acorn -export = acorn +export interface Node { + start: number + end: number + type: string + range?: [number, number] + loc?: SourceLocation | null +} -declare namespace acorn { - function parse(input: string, options?: Options): Node +export interface SourceLocation { + source?: string | null + start: Position + end: Position +} - function parseExpressionAt(input: string, pos?: number, options?: Options): Node +export interface Position { + /** 1-based */ + line: number + /** 0-based */ + column: number +} - function tokenizer(input: string, options?: Options): { +export interface Identifier extends Node { + type: "Identifier" + name: string +} + +export interface Literal extends Node { + type: "Literal" + value?: string | boolean | null | number | RegExp | bigint + raw?: string + regex?: { + pattern: string + flags: string + } + bigint?: string +} + +export interface Program extends Node { + type: "Program" + body: Array + sourceType: "script" | "module" +} + +export interface Function extends Node { + id?: Identifier | null + params: Array + body: BlockStatement | Expression + generator: boolean + expression: boolean + async: boolean +} + +export interface ExpressionStatement extends Node { + type: "ExpressionStatement" + expression: Expression | Literal + directive?: string +} + +export interface BlockStatement extends Node { + type: "BlockStatement" + body: Array +} + +export interface EmptyStatement extends Node { + type: "EmptyStatement" +} + +export interface DebuggerStatement extends Node { + type: "DebuggerStatement" +} + +export interface WithStatement extends Node { + type: "WithStatement" + object: Expression + body: Statement +} + +export interface ReturnStatement extends Node { + type: "ReturnStatement" + argument?: Expression | null +} + +export interface LabeledStatement extends Node { + type: "LabeledStatement" + label: Identifier + body: Statement +} + +export interface BreakStatement extends Node { + type: "BreakStatement" + label?: Identifier | null +} + +export interface ContinueStatement extends Node { + type: "ContinueStatement" + label?: Identifier | null +} + +export interface IfStatement extends Node { + type: "IfStatement" + test: Expression + consequent: Statement + alternate?: Statement | null +} + +export interface SwitchStatement extends Node { + type: "SwitchStatement" + discriminant: Expression + cases: Array +} + +export interface SwitchCase extends Node { + type: "SwitchCase" + test?: Expression | null + consequent: Array +} + +export interface ThrowStatement extends Node { + type: "ThrowStatement" + argument: Expression +} + +export interface TryStatement extends Node { + type: "TryStatement" + block: BlockStatement + handler?: CatchClause | null + finalizer?: BlockStatement | null +} + +export interface CatchClause extends Node { + type: "CatchClause" + param?: Pattern | null + body: BlockStatement +} + +export interface WhileStatement extends Node { + type: "WhileStatement" + test: Expression + body: Statement +} + +export interface DoWhileStatement extends Node { + type: "DoWhileStatement" + body: Statement + test: Expression +} + +export interface ForStatement extends Node { + type: "ForStatement" + init?: VariableDeclaration | Expression | null + test?: Expression | null + update?: Expression | null + body: Statement +} + +export interface ForInStatement extends Node { + type: "ForInStatement" + left: VariableDeclaration | Pattern + right: Expression + body: Statement +} + +export interface FunctionDeclaration extends Function { + type: "FunctionDeclaration" + id: Identifier + body: BlockStatement +} + +export interface VariableDeclaration extends Node { + type: "VariableDeclaration" + declarations: Array + kind: "var" | "let" | "const" +} + +export interface VariableDeclarator extends Node { + type: "VariableDeclarator" + id: Pattern + init?: Expression | null +} + +export interface ThisExpression extends Node { + type: "ThisExpression" +} + +export interface ArrayExpression extends Node { + type: "ArrayExpression" + elements: Array +} + +export interface ObjectExpression extends Node { + type: "ObjectExpression" + properties: Array +} + +export interface Property extends Node { + type: "Property" + key: Expression + value: Expression + kind: "init" | "get" | "set" + method: boolean + shorthand: boolean + computed: boolean +} + +export interface FunctionExpression extends Function { + type: "FunctionExpression" + body: BlockStatement +} + +export interface UnaryExpression extends Node { + type: "UnaryExpression" + operator: UnaryOperator + prefix: boolean + argument: Expression +} + +export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete" + +export interface UpdateExpression extends Node { + type: "UpdateExpression" + operator: UpdateOperator + argument: Expression + prefix: boolean +} + +export type UpdateOperator = "++" | "--" + +export interface BinaryExpression extends Node { + type: "BinaryExpression" + operator: BinaryOperator + left: Expression | PrivateIdentifier + right: Expression +} + +export type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in" | "instanceof" | "**" + +export interface AssignmentExpression extends Node { + type: "AssignmentExpression" + operator: AssignmentOperator + left: Pattern + right: Expression +} + +export type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??=" + +export interface LogicalExpression extends Node { + type: "LogicalExpression" + operator: LogicalOperator + left: Expression + right: Expression +} + +export type LogicalOperator = "||" | "&&" | "??" + +export interface MemberExpression extends Node { + type: "MemberExpression" + object: Expression | Super + property: Expression | PrivateIdentifier + computed: boolean + optional: boolean +} + +export interface ConditionalExpression extends Node { + type: "ConditionalExpression" + test: Expression + alternate: Expression + consequent: Expression +} + +export interface CallExpression extends Node { + type: "CallExpression" + callee: Expression | Super + arguments: Array + optional: boolean +} + +export interface NewExpression extends Node { + type: "NewExpression" + callee: Expression + arguments: Array +} + +export interface SequenceExpression extends Node { + type: "SequenceExpression" + expressions: Array +} + +export interface ForOfStatement extends Node { + type: "ForOfStatement" + left: VariableDeclaration | Pattern + right: Expression + body: Statement + await: boolean +} + +export interface Super extends Node { + type: "Super" +} + +export interface SpreadElement extends Node { + type: "SpreadElement" + argument: Expression +} + +export interface ArrowFunctionExpression extends Function { + type: "ArrowFunctionExpression" +} + +export interface YieldExpression extends Node { + type: "YieldExpression" + argument?: Expression | null + delegate: boolean +} + +export interface TemplateLiteral extends Node { + type: "TemplateLiteral" + quasis: Array + expressions: Array +} + +export interface TaggedTemplateExpression extends Node { + type: "TaggedTemplateExpression" + tag: Expression + quasi: TemplateLiteral +} + +export interface TemplateElement extends Node { + type: "TemplateElement" + tail: boolean + value: { + cooked?: string | null + raw: string + } +} + +export interface AssignmentProperty extends Node { + type: "Property" + key: Expression + value: Pattern + kind: "init" + method: false + shorthand: boolean + computed: boolean +} + +export interface ObjectPattern extends Node { + type: "ObjectPattern" + properties: Array +} + +export interface ArrayPattern extends Node { + type: "ArrayPattern" + elements: Array +} + +export interface RestElement extends Node { + type: "RestElement" + argument: Pattern +} + +export interface AssignmentPattern extends Node { + type: "AssignmentPattern" + left: Pattern + right: Expression +} + +export interface Class extends Node { + id?: Identifier | null + superClass?: Expression | null + body: ClassBody +} + +export interface ClassBody extends Node { + type: "ClassBody" + body: Array +} + +export interface MethodDefinition extends Node { + type: "MethodDefinition" + key: Expression | PrivateIdentifier + value: FunctionExpression + kind: "constructor" | "method" | "get" | "set" + computed: boolean + static: boolean +} + +export interface ClassDeclaration extends Class { + type: "ClassDeclaration" + id: Identifier +} + +export interface ClassExpression extends Class { + type: "ClassExpression" +} + +export interface MetaProperty extends Node { + type: "MetaProperty" + meta: Identifier + property: Identifier +} + +export interface ImportDeclaration extends Node { + type: "ImportDeclaration" + specifiers: Array + source: Literal +} + +export interface ImportSpecifier extends Node { + type: "ImportSpecifier" + imported: Identifier | Literal + local: Identifier +} + +export interface ImportDefaultSpecifier extends Node { + type: "ImportDefaultSpecifier" + local: Identifier +} + +export interface ImportNamespaceSpecifier extends Node { + type: "ImportNamespaceSpecifier" + local: Identifier +} + +export interface ExportNamedDeclaration extends Node { + type: "ExportNamedDeclaration" + declaration?: Declaration | null + specifiers: Array + source?: Literal | null +} + +export interface ExportSpecifier extends Node { + type: "ExportSpecifier" + exported: Identifier | Literal + local: Identifier | Literal +} + +export interface AnonymousFunctionDeclaration extends Function { + type: "FunctionDeclaration" + id: null + body: BlockStatement +} + +export interface AnonymousClassDeclaration extends Class { + type: "ClassDeclaration" + id: null +} + +export interface ExportDefaultDeclaration extends Node { + type: "ExportDefaultDeclaration" + declaration: AnonymousFunctionDeclaration | FunctionDeclaration | AnonymousClassDeclaration | ClassDeclaration | Expression +} + +export interface ExportAllDeclaration extends Node { + type: "ExportAllDeclaration" + source: Literal + exported?: Identifier | Literal | null +} + +export interface AwaitExpression extends Node { + type: "AwaitExpression" + argument: Expression +} + +export interface ChainExpression extends Node { + type: "ChainExpression" + expression: MemberExpression | CallExpression +} + +export interface ImportExpression extends Node { + type: "ImportExpression" + source: Expression +} + +export interface ParenthesizedExpression extends Node { + type: "ParenthesizedExpression" + expression: Expression +} + +export interface PropertyDefinition extends Node { + type: "PropertyDefinition" + key: Expression | PrivateIdentifier + value?: Expression | null + computed: boolean + static: boolean +} + +export interface PrivateIdentifier extends Node { + type: "PrivateIdentifier" + name: string +} + +export interface StaticBlock extends Node { + type: "StaticBlock" + body: Array +} + +export type Statement = +| ExpressionStatement +| BlockStatement +| EmptyStatement +| DebuggerStatement +| WithStatement +| ReturnStatement +| LabeledStatement +| BreakStatement +| ContinueStatement +| IfStatement +| SwitchStatement +| ThrowStatement +| TryStatement +| WhileStatement +| DoWhileStatement +| ForStatement +| ForInStatement +| ForOfStatement +| Declaration + +export type Declaration = +| FunctionDeclaration +| VariableDeclaration +| ClassDeclaration + +export type Expression = +| Identifier +| Literal +| ThisExpression +| ArrayExpression +| ObjectExpression +| FunctionExpression +| UnaryExpression +| UpdateExpression +| BinaryExpression +| AssignmentExpression +| LogicalExpression +| MemberExpression +| ConditionalExpression +| CallExpression +| NewExpression +| SequenceExpression +| ArrowFunctionExpression +| YieldExpression +| TemplateLiteral +| TaggedTemplateExpression +| ClassExpression +| MetaProperty +| AwaitExpression +| ChainExpression +| ImportExpression +| ParenthesizedExpression + +export type Pattern = +| Identifier +| MemberExpression +| ObjectPattern +| ArrayPattern +| RestElement +| AssignmentPattern + +export type ModuleDeclaration = +| ImportDeclaration +| ExportNamedDeclaration +| ExportDefaultDeclaration +| ExportAllDeclaration + +export type AnyNode = Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator + +export function parse(input: string, options: Options): Program + +export function parseExpressionAt(input: string, pos: number, options: Options): Expression + +export function tokenizer(input: string, options: Options): { + getToken(): Token + [Symbol.iterator](): Iterator +} + +export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | "latest" + +export interface Options { + /** + * `ecmaVersion` indicates the ECMAScript version to parse. Can be a + * number, either in year (`2022`) or plain version number (`6`) form, + * or `"latest"` (the latest the library supports). This influences + * support for strict mode, the set of reserved words, and support for + * new syntax features. + */ + ecmaVersion: ecmaVersion + + /** + * `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" | "module" + + /** + * a callback that will be called when a semicolon is automatically inserted. + * @param lastTokEnd the position of the comma as an offset + * @param lastTokEndLoc location if {@link locations} is enabled + */ + onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + + /** + * similar to `onInsertedSemicolon`, but for trailing commas + * @param lastTokEnd the position of the comma as an offset + * @param lastTokEndLoc location if `locations` is enabled + */ + onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void + + /** + * 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?: boolean | "never" + + /** + * When enabled, a return at the top level is not considered an error. + */ + allowReturnOutsideFunction?: boolean + + /** + * When enabled, import/export statements are not constrained to + * appearing at the top of the program, and an import.meta expression + * in a script isn't considered an error. + */ + allowImportExportEverywhere?: boolean + + /** + * By default, `await` identifiers are allowed to appear at the top-level scope only if {@link 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?: boolean + + /** + * When enabled, super identifiers are not constrained to + * appearing in methods and do not raise an error when they appear elsewhere. + */ + allowSuperOutsideMethod?: boolean + + /** + * When enabled, hashbang directive in the beginning of file is + * allowed and treated as a line comment. Enabled by default when + * {@link ecmaVersion} >= 2023. + */ + allowHashBang?: boolean + + /** + * By default, the parser will verify that private properties are + * only used in places where they are valid and have been declared. + * Set this to false to turn such checks off. + */ + checkPrivateFields?: boolean + + /** + * When `locations` is on, `loc` properties holding objects with + * `start` and `end` properties as {@link Position} objects will be attached to the + * nodes. + */ + locations?: boolean + + /** + * a callback that will cause Acorn to call that export 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?: ((token: Token) => void) | Token[] + + + /** + * This takes a export function or an array. + * + * When a export function is passed, Acorn will call that export 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 {@link locations} option is on, two more parameters are + * passed, the full locations of {@link Position} export type of the start and + * end of the comments. + * + * When a array is passed, each found comment of {@link Comment} export type is pushed to the array. + * + * Note that you are not allowed to call the + * parser from the callback—that will corrupt its internal state. + */ + onComment?: (( + isBlock: boolean, text: string, start: number, end: number, startLoc?: Position, + endLoc?: Position + ) => void) | Comment[] + + /** + * 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`. + */ + ranges?: boolean + + /** + * 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?: Node + + /** + * When {@link locations} is on, you can pass this to record the source + * file in every node's `loc` object. + */ + sourceFile?: string + + /** + * This value, if given, is stored in every node, whether {@link locations} is on or off. + */ + directSourceFile?: string + + /** + * When enabled, parenthesized expressions are represented by + * (non-standard) ParenthesizedExpression nodes + */ + preserveParens?: boolean +} + +export class Parser { + options: Options + input: string + + protected constructor(options: Options, input: string, startPos?: number) + parse(): Program + + static parse(input: string, options: Options): Program + static parseExpressionAt(input: string, pos: number, options: Options): Expression + static 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 + static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser } + +export const defaultOptions: Options + +export function getLineInfo(input: string, offset: number): Position + +export class TokenType { + label: string + keyword: string | undefined +} + +export const tokTypes: { + num: TokenType + regexp: TokenType + string: TokenType + name: TokenType + privateId: 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 + questionDot: TokenType + arrow: TokenType + template: TokenType + invalidTemplate: 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 + coalesce: 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 +} + +export interface Comment { + type: "Line" | "Block" + value: string + start: number + end: number + loc?: SourceLocation + range?: [number, number] +} + +export class Token { + type: TokenType + start: number + end: number + loc?: SourceLocation + range?: [number, number] +} + +export const version: string diff --git a/node_modules/acorn/dist/acorn.js b/node_modules/acorn/dist/acorn.js index 0523f0e..68bf2a7 100644 --- a/node_modules/acorn/dist/acorn.js +++ b/node_modules/acorn/dist/acorn.js @@ -1,8 +1,25 @@ (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, 16, 621, 2467, 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\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\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\uff65"; + + // 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 + // >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. // Reserved word lists for various dialects of the language @@ -18,7 +35,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 +45,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 +59,7 @@ pos += set[i + 1]; if (pos >= code) { return true } } + return false } // Test whether a given character code starts an identifier. @@ -137,21 +133,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 +248,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,20 +271,29 @@ 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]" ); }); + var regexpCache = Object.create(null); + function wordsRegexp(words) { - return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") + return regexpCache[words] || (regexpCache[words] = 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,36 +320,33 @@ 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; } } - // A second optional argument can be given to further configure - // the parser process. These options are recognized: + // A second argument must be given to configure the parser process. + // These options are recognized (only `ecmaVersion` is required): 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, + // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 + // (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 // 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` can be a callback that will be called when + // a semicolon is automatically inserted. It will be passed the + // position of the inserted semicolon 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. @@ -346,14 +360,24 @@ // error. allowReturnOutsideFunction: false, // When enabled, import/export statements are not constrained to - // appearing at the top of the program. + // 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, + // By default, the parser will verify that private properties are + // only used in places where they are valid and have been declared. + // Set this to false to turn such checks off. + checkPrivateFields: true, // 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 @@ -375,6 +399,8 @@ // 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. + // When this option has an array as value, objects representing the + // comments are pushed to it. onComment: null, // Nodes have their start and end characters offsets recorded in // `start` and `end` properties (directly on the node, rather than @@ -404,18 +430,32 @@ // Interpret and default an options object + var warnedAboutEcmaVersion = false; + function getOptions(opts) { 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 >= 2015) - { options.ecmaVersion -= 2009; } + if (options.ecmaVersion === "latest") { + options.ecmaVersion = 1e8; + } else if (options.ecmaVersion == null) { + if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) { + warnedAboutEcmaVersion = true; + console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future."); + } + options.ecmaVersion = 11; + } else if (options.ecmaVersion >= 2015) { + options.ecmaVersion -= 2009; + } 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); }; @@ -446,19 +486,20 @@ 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) } - // Used in checkLVal and declareName to determine the type of a binding + // 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 @@ -470,11 +511,10 @@ 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) { - for (var v = options.ecmaVersion;; v--) - { if (reserved = reservedWords[v]) { break } } + reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3]; if (options.sourceType === "module") { reserved += " await"; } } this.reservedWords = wordsRegexp(reserved); @@ -502,7 +542,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 @@ -527,13 +567,14 @@ // 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; // Labels in scope. this.labels = []; // Thus-far undefined exports. - this.undefinedExports = {}; + this.undefinedExports = Object.create(null); // If enabled, skip leading hashbang line. if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") @@ -545,9 +586,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 } }; + 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(); @@ -556,14 +602,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()) }; - // Switch to a getter for 7.0.0. - Parser.prototype.inNonArrowFunction = function inNonArrowFunction () { 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; @@ -590,12 +663,13 @@ Object.defineProperties( Parser.prototype, prototypeAccessors ); - var pp = Parser.prototype; + var pp$9 = Parser.prototype; // ## Parser utilities - var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; - pp.strictDirective = function(start) { + var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/; + pp$9.strictDirective = function(start) { + if (this.options.ecmaVersion < 5) { return false } for (;;) { // Try to find string literal. skipWhiteSpace.lastIndex = start; @@ -623,7 +697,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 @@ -634,13 +708,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 @@ -648,19 +722,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); } @@ -671,11 +745,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); } @@ -688,34 +762,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; @@ -726,20 +800,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 @@ -748,10 +822,10 @@ // `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 = {}; + 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); } @@ -770,7 +844,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); @@ -779,13 +853,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 } } @@ -795,16 +870,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. @@ -814,11 +890,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"; } @@ -827,35 +903,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); @@ -869,7 +945,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 @@ -884,17 +960,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(); @@ -914,21 +990,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") @@ -942,25 +1018,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; } } @@ -969,16 +1045,24 @@ if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } + var startsWithLet = this.isContextual("let"), isForOf = false; + var containsEsc = this.containsEsc; 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; } + var initPos = this.start; + var init = awaitAt > -1 + ? this.parseExprSubscripts(refDestructuringErrors, "await") + : this.parseExpression(true, refDestructuringErrors); + if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt) + if (this.type === types$1._in) { this.unexpected(awaitAt); } + node.await = true; + } else if (isForOf && this.options.ecmaVersion >= 8) { + if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); } + else if (this.options.ecmaVersion >= 9) { node.await = false; } } + 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.checkLVal(init); + this.checkLValPattern(init); return this.parseForIn(node, init) } else { this.checkExpressionErrors(refDestructuringErrors, true); @@ -987,21 +1071,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(); @@ -1010,16 +1094,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); @@ -1028,9 +1112,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 = []; @@ -1042,7 +1126,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)); @@ -1055,7 +1139,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"); } @@ -1066,21 +1150,27 @@ // Reused empty array added for node fields that are always empty. - var empty = []; + var empty$1 = []; - pp$1.parseTryStatement = function(node) { + pp$8.parseCatchClauseParam = function() { + var param = this.parseBindingAtom(); + var simple = param.type === "Identifier"; + this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); + this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); + this.expect(types$1.parenR); + + return param + }; + + 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)) { - 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); + if (this.eat(types$1.parenL)) { + clause.param = this.parseCatchClauseParam(); } else { if (this.options.ecmaVersion < 10) { this.unexpected(); } clause.param = null; @@ -1090,20 +1180,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, allowMissingInitializer) { this.next(); - this.parseVar(node, false, kind); + this.parseVar(node, false, kind, allowMissingInitializer); 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); @@ -1112,7 +1202,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(); @@ -1120,12 +1210,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]; @@ -1133,7 +1223,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) { @@ -1149,7 +1239,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") @@ -1159,14 +1249,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); } @@ -1180,13 +1270,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(); @@ -1196,8 +1286,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 ( @@ -1215,12 +1305,10 @@ 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); + this.expect(types$1.parenR); node.body = this.parseStatement("for"); this.exitScope(); this.labels.pop(); @@ -1229,30 +1317,30 @@ // Parse a list of variable declarations. - pp$1.parseVar = function(node, isFor, kind) { + pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) { 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 (!allowMissingInitializer && 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 (!allowMissingInitializer && 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.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); + this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); }; var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4; @@ -1261,24 +1349,24 @@ // `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 // 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); } + { this.checkLValSimple(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; @@ -1288,10 +1376,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; @@ -1299,16 +1387,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 @@ -1318,93 +1406,193 @@ 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"); } + if (hadConstructor) { this.raiseRecoverable(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 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 ecmaVersion = this.options.ecmaVersion; + var node = this.startNode(); + var keyName = ""; + var isGenerator = false; 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"; + 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"; } } - 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"); + 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"; + } } - 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 + 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; + } + } + } + + // 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); + } + + // 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); + } + + return node }; - pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { - method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper); + 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); + } + }; + + pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { + // Check key and flags + var key = method.key; + 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"); } + } else if (method.static && checkKeyName(method, "prototype")) { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + + // 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.checkLVal(node.id, BIND_LEXICAL, false); } + { this.checkLValSimple(node.id, BIND_LEXICAL, false); } } else { if (isStatement === true) { this.unexpected(); } @@ -1412,61 +1600,113 @@ } }; - 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; + if (!this.options.checkPrivateFields) { return } + 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.parseExportAllDeclaration = function(node, exports) { + if (this.options.ecmaVersion >= 11) { + if (this.eatContextual("as")) { + node.exported = this.parseModuleExportName(); + this.checkExport(exports, node.exported, this.lastTokStart); + } else { + node.exported = null; + } + } + this.expectContextual("from"); + if (this.type !== types$1.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration") + }; + + pp$8.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$1.star)) { + return this.parseExportAllDeclaration(node, exports) } - 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())) { - 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(); - } + node.declaration = this.parseExportDefaultDeclaration(); return this.finishNode(node, "ExportDefaultDeclaration") } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(null); + node.declaration = this.parseExportDeclaration(node); 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) { @@ -1476,6 +1716,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; @@ -1485,17 +1729,40 @@ return this.finishNode(node, "ExportNamedDeclaration") }; - pp$1.checkExport = function(exports, name, pos) { + pp$8.parseExportDeclaration = function(node) { + return this.parseStatement(null) + }; + + pp$8.parseExportDefaultDeclaration = function() { + var isAsync; + if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync) + } else if (this.type === types$1._class) { + var cNode = this.startNode(); + return this.parseClass(cNode, "nullableID") + } else { + var declaration = this.parseMaybeAssign(); + this.semicolon(); + return declaration + } + }; + + 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) { @@ -1515,11 +1782,9 @@ { 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) { + pp$8.checkVariableExport = function(exports, decls) { if (!exports) { return } for (var i = 0, list = decls; i < list.length; i += 1) { @@ -1529,7 +1794,7 @@ } }; - pp$1.shouldParseExportStatement = function() { + pp$8.shouldParseExportStatement = function() { return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || @@ -1540,37 +1805,48 @@ // Parses a comma-separated list of module exports. - pp$1.parseExportSpecifiers = function(exports) { + pp$8.parseExportSpecifier = function(exports) { + var node = this.startNode(); + node.local = this.parseModuleExportName(); + + node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local; + this.checkExport( + exports, + node.exported, + node.exported.start + ); + + return this.finishNode(node, "ExportSpecifier") + }; + + 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); - nodes.push(this.finishNode(node, "ExportSpecifier")); + nodes.push(this.parseExportSpecifier(exports)); } return nodes }; // 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") @@ -1578,54 +1854,80 @@ // 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(); + pp$8.parseImportSpecifier = function() { + var node = this.startNode(); + node.imported = this.parseModuleExportName(); + + if (this.eatContextual("as")) { node.local = this.parseIdent(); - this.checkLVal(node.local, BIND_LEXICAL); - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(types.comma)) { return nodes } + } else { + this.checkUnreserved(node.imported); + node.local = node.imported; } - 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")); + this.checkLValSimple(node.local, BIND_LEXICAL); + + return this.finishNode(node, "ImportSpecifier") + }; + + pp$8.parseImportDefaultSpecifier = function() { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + return this.finishNode(node, "ImportDefaultSpecifier") + }; + + pp$8.parseImportNamespaceSpecifier = function() { + var node = this.startNode(); + this.next(); + this.expectContextual("as"); + node.local = this.parseIdent(); + this.checkLValSimple(node.local, BIND_LEXICAL); + return this.finishNode(node, "ImportNamespaceSpecifier") + }; + + pp$8.parseImportSpecifiers = function() { + var nodes = [], first = true; + if (this.type === types$1.name) { + nodes.push(this.parseImportDefaultSpecifier()); + if (!this.eat(types$1.comma)) { return nodes } + } + if (this.type === types$1.star) { + nodes.push(this.parseImportNamespaceSpecifier()); 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); - 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")); + nodes.push(this.parseImportSpecifier()); } 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" && @@ -1634,12 +1936,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": @@ -1649,6 +1951,7 @@ case "ObjectPattern": case "ArrayPattern": + case "AssignmentPattern": case "RestElement": break @@ -1697,9 +2000,6 @@ node.type = "AssignmentPattern"; delete node.operator; this.toAssignable(node.left, isBinding); - // falls through to AssignmentPattern - - case "AssignmentPattern": break case "ParenthesizedExpression": @@ -1722,7 +2022,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]; @@ -1738,19 +2038,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(); @@ -1760,84 +2060,149 @@ // 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, allowModifiers) { 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.raiseRecoverable(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); + elts.push(this.parseAssignableListItem(allowModifiers)); } } return elts }; - pp$2.parseBindingListItem = function(param) { + pp$7.parseAssignableListItem = function(allowModifiers) { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + return elem + }; + + 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(); 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 + // The following three functions all verify that a node is an lvalue — + // something that can be bound, or assigned to. In order to do so, they perform + // a variety of checks: + // + // - Check that none of the bound/assigned-to identifiers are reserved words. + // - Record name declarations for bindings in the appropriate scope. + // - Check duplicate argument names, if checkClashes is set. + // + // If a complex binding pattern is encountered (e.g., object and array + // destructuring), the entire pattern is recursively checked. + // + // There are three versions of checkLVal*() appropriate for different + // circumstances: + // + // - checkLValSimple() shall be used if the syntactic construct supports + // nothing other than identifiers and member expressions. Parenthesized + // expressions are also correctly handled. This is generally appropriate for + // constructs for which the spec says + // + // > It is a Syntax Error if AssignmentTargetType of [the production] is not + // > simple. + // + // It is also appropriate for checking if an identifier is valid and not + // defined elsewhere, like import declarations or function/class identifiers. + // + // Examples where this is used include: + // a += …; + // import a from '…'; + // where a is the node to be checked. + // + // - checkLValPattern() shall be used if the syntactic construct supports + // anything checkLValSimple() supports, as well as object and array + // destructuring patterns. This is generally appropriate for constructs for + // which the spec says + // + // > It is a Syntax Error if [the production] is neither an ObjectLiteral nor + // > an ArrayLiteral and AssignmentTargetType of [the production] is not + // > simple. + // + // Examples where this is used include: + // (a = …); + // const a = …; + // try { … } catch (a) { … } + // where a is the node to be checked. + // + // - checkLValInnerPattern() shall be used if the syntactic construct supports + // anything checkLValPattern() supports, as well as default assignment + // patterns, rest elements, and other constructs that may appear within an + // object or array destructuring pattern. + // + // As a special case, function parameters also use checkLValInnerPattern(), + // as they also support defaults and rest constructs. + // + // These functions deliberately support both assignment and binding constructs, + // as the logic for both is exceedingly similar. If the node is the target of + // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it + // should be set to the appropriate BIND_* constant, like BIND_VAR or + // BIND_LEXICAL. + // + // If the function is called with a non-BIND_NONE bindingType, then + // additionally a checkClashes object may be specified to allow checking for + // duplicate argument names. checkClashes is ignored if the provided construct + // is an assignment (i.e., bindingType is BIND_NONE). - pp$2.checkLVal = function(expr, bindingType, checkClashes) { + pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { if ( bindingType === void 0 ) bindingType = BIND_NONE; + var isBind = 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; + { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } + if (isBind) { + if (bindingType === BIND_LEXICAL && expr.name === "let") + { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); } + if (checkClashes) { + if (hasOwn(checkClashes, expr.name)) + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } } - if (bindingType !== BIND_NONE && bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); } break case "ChainExpression": @@ -1845,58 +2210,255 @@ break case "MemberExpression": - if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } + if (isBind) { 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]; + case "ParenthesizedExpression": + if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); } + return this.checkLValSimple(expr.expression, bindingType, checkClashes) - this.checkLVal(prop, bindingType, checkClashes); + default: + this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue"); } - break + }; - case "Property": - // AssignmentProperty has type === "Property" - this.checkLVal(expr.value, bindingType, checkClashes); + pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; + + switch (expr.type) { + case "ObjectPattern": + for (var i = 0, list = expr.properties; i < list.length; i += 1) { + var prop = list[i]; + + this.checkLValInnerPattern(prop, 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); } + if (elem) { this.checkLValInnerPattern(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"); + this.checkLValSimple(expr, bindingType, checkClashes); } }; - // A recursive descent parser operates by defining functions for all + pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { + if ( bindingType === void 0 ) bindingType = BIND_NONE; - var pp$3 = Parser.prototype; + switch (expr.type) { + case "Property": + // AssignmentProperty has type === "Property" + this.checkLValInnerPattern(expr.value, bindingType, checkClashes); + break + + case "AssignmentPattern": + this.checkLValPattern(expr.left, bindingType, checkClashes); + break + + case "RestElement": + this.checkLValPattern(expr.argument, bindingType, checkClashes); + break + + default: + this.checkLValPattern(expr, bindingType, checkClashes); + } + }; + + // The algorithm used to determine whether a regexp can appear at a + // given point in the program is loosely based on sweet.js' approach. + // See https://github.com/mozilla/sweet.js/wiki/design + + + 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 edge 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.colon.updateContext = function() { + if (this.curContext().token === "function") { this.context.pop(); } + this.exprAllowed = true; + }; + + 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 + // syntactic elements, and recursively calling those, each function + // advancing the input stream and returning an AST node. Precedence + // of constructs (for example, the fact that `!x[1]` means `!(x[1])` + // instead of `(!x)[1]` is handled by the fact that the parser + // function that parses unary prefix operators is called first, and + // in turn calls the function that parses `[]` subscripts — that + // way, it'll receive the node for `x[1]` already parsed, and wraps + // *that* in the unary operator node. + // + // Acorn uses an [operator precedence parser][opp] to handle binary + // operator precedence, because it is much more compact than using + // the technique outlined above, which uses different, nesting + // functions to specify precedence, for all of the ten binary + // precedence levels that JavaScript defines. + // + // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser + + + var 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)) @@ -1913,10 +2475,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; } @@ -1958,13 +2522,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 @@ -1973,18 +2537,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; @@ -1992,22 +2557,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; - node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (this.type === types$1.eq) + { left = this.toAssignable(left, false, refDestructuringErrors); } if (!ownDestructuringErrors) { refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; } - if (refDestructuringErrors.shorthandAssign >= node.left.start) + if (refDestructuringErrors.shorthandAssign >= left.start) { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly - this.checkLVal(left); + 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); } @@ -2019,16 +2592,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 @@ -2036,11 +2609,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 @@ -2049,32 +2622,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; @@ -2084,67 +2658,93 @@ // 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.checkLVal(node.argument); } - else if (this.strict && node.operator === "delete" && - node.argument.type === "Identifier") + if (update) { this.checkLValSimple(node.argument); } + else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument)) { 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.options.checkPrivateFields) { 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); node$1.operator = this.value; node$1.prefix = false; node$1.argument = expr; - this.checkLVal(expr); + this.checkLValSimple(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 } + 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 isLocalVariableAccess(node) { + return ( + node.type === "Identifier" || + node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression) + ) + } + + function isPrivateFieldAccess(node) { + return ( + node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" || + node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) || + node.type === "ParenthesizedExpression" && 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; } + if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; } } 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") { @@ -2160,29 +2760,43 @@ } }; - pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) { + pp$5.shouldParseAsyncArrow = function() { + return !this.canInsertSemicolon() && this.eat(types$1.arrow) + }; + + pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit) + }; + + 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.shouldParseAsyncArrow()) { this.checkPatternErrors(refDestructuringErrors, false); this.checkYieldAwaitInDefaultParams(); if (this.awaitIdentPos > 0) @@ -2190,7 +2804,7 @@ this.yieldPos = oldYieldPos; this.awaitPos = oldAwaitPos; this.awaitIdentPos = oldAwaitIdentPos; - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true) + return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit) } this.checkExpressionErrors(refDestructuringErrors, true); this.yieldPos = oldYieldPos || this.yieldPos; @@ -2203,7 +2817,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"); } @@ -2220,19 +2834,19 @@ // `new`, or an expression wrapped in punctuation like `()`, `[]`, // or `{}`. - pp$3.parseExprAtom = function(refDestructuringErrors) { + pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) { // 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: @@ -2240,50 +2854,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; } @@ -2292,70 +2909,76 @@ } 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() + return this.parseExprImport(forNew) } else { return this.unexpected() } default: - this.unexpected(); + return this.parseExprAtomDefault() } }; - pp$3.parseExprImport = function() { + pp$5.parseExprAtomDefault = function() { + this.unexpected(); + }; + + pp$5.parseExprImport = function(forNew) { 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); + this.next(); - switch (this.type) { - case types.parenL: + if (this.type === types$1.parenL && !forNew) { return this.parseDynamicImport(node) - case types.dot: - node.meta = meta; + } else if (this.type === types$1.dot) { + var meta = this.startNodeAt(node.start, node.loc && node.loc.start); + meta.name = "import"; + node.meta = this.finishNode(meta, "Identifier"); return this.parseImportMeta(node) - default: + } else { this.unexpected(); } }; - 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); @@ -2365,7 +2988,7 @@ return this.finishNode(node, "ImportExpression") }; - pp$3.parseImportMeta = function(node) { + pp$5.parseImportMeta = function(node) { this.next(); // skip `.` var containsEsc = this.containsEsc; @@ -2375,13 +2998,13 @@ { 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") + if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere) { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); } 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); @@ -2390,14 +3013,18 @@ 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.shouldParseArrow = function(exprList) { + return !this.canInsertSemicolon() + }; + + 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(); @@ -2408,29 +3035,34 @@ 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.raiseRecoverable( + 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.shouldParseArrow(exprList) && 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); } @@ -2459,12 +3091,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 @@ -2473,46 +3105,46 @@ // 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)) { - node.meta = meta; + this.next(); + if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) { + var meta = this.startNodeAt(node.start, node.loc && node.loc.start); + meta.name = "new"; + node.meta = this.finishNode(meta, "Identifier"); + this.next(); 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"); } + 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); - 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; } + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false); + 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"); } elem.value = { - raw: this.value, + raw: this.value.replace(/\r\n?/g, "\n"), cooked: null }; } else { @@ -2522,11 +3154,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; @@ -2536,32 +3168,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); @@ -2571,29 +3203,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) { - this.raise(this.start, "Comma is not permitted after the rest element"); + if (this.type === types$1.comma) { + this.raiseRecoverable(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 @@ -2607,14 +3230,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; } @@ -2622,14 +3245,31 @@ 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.parseGetterSetter = function(prop) { + 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"); } + } + }; + + 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; @@ -2637,22 +3277,9 @@ } 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); - 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"); } - } + this.parseGetterSetter(prop); } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { if (isGenerator || isAsync) { this.unexpected(); } this.checkUnreserved(prop.key); @@ -2660,35 +3287,35 @@ { this.awaitIdentPos = startPos; } prop.kind = "init"; if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else if (this.type === types.eq && refDestructuringErrors) { + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); + } else if (this.type === types$1.eq && refDestructuringErrors) { if (refDestructuringErrors.shorthandAssign < 0) { refDestructuringErrors.shorthandAssign = this.start; } - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); } else { - prop.value = prop.key; + prop.value = this.copyNode(prop.key); } prop.shorthand = true; } 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; } @@ -2696,7 +3323,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); @@ -2710,10 +3337,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; @@ -2723,7 +3350,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); @@ -2735,7 +3362,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; @@ -2745,12 +3372,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 { @@ -2773,7 +3400,7 @@ // 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); } + if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); } node.body = this.parseBlock(false, undefined, useStrict && !oldStrict); node.expression = false; this.adaptDirectivePrologue(node.body.body); @@ -2782,7 +3409,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]; @@ -2795,13 +3422,13 @@ // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. - pp$3.checkParams = function(node, allowDuplicates) { - var nameHash = {}; + pp$5.checkParams = function(node, allowDuplicates) { + var nameHash = Object.create(null); for (var i = 0, list = node.params; i < list.length; i += 1) { var param = list[i]; - this.checkLVal(param, BIND_VAR, allowDuplicates ? null : nameHash); + this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash); } }; @@ -2811,20 +3438,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); @@ -2834,7 +3461,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; @@ -2843,6 +3470,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 && @@ -2859,24 +3490,8 @@ // 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(); - } + pp$5.parseIdent = function(liberal) { + var node = this.parseIdentNode(); this.next(!!liberal); this.finishNode(node, "Identifier"); if (!liberal) { @@ -2887,29 +3502,73 @@ return node }; + pp$5.parseIdentNode = function() { + var node = this.startNode(); + if (this.type === types$1.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(); + } + this.type = types$1.name; + } else { + this.unexpected(); + } + 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.options.checkPrivateFields) { + 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, false); + node.argument = this.parseMaybeUnary(null, true, false, forInit); return this.finishNode(node, "AwaitExpression") }; @@ -2937,7 +3596,7 @@ } }; - var pp$5 = Parser.prototype; + var pp$3 = Parser.prototype; var Scope = function Scope(flags) { this.flags = flags; @@ -2947,26 +3606,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(); @@ -3001,7 +3662,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) { @@ -3009,11 +3670,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 } @@ -3021,7 +3682,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 } @@ -3042,13 +3703,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) }; @@ -3064,189 +3725,80 @@ 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) }; - // 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; + 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 }; - 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: + // 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 ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict"; + var ecma13BinaryProperties = ecma12BinaryProperties; + var ecma14BinaryProperties = ecma13BinaryProperties; + var unicodeBinaryProperties = { 9: ecma9BinaryProperties, 10: ecma10BinaryProperties, - 11: ecma11BinaryProperties + 11: ecma11BinaryProperties, + 12: ecma12BinaryProperties, + 13: ecma13BinaryProperties, + 14: ecma14BinaryProperties + }; + + // #table-binary-unicode-properties-of-strings + var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"; + + var unicodeBinaryPropertiesOfStrings = { + 9: "", + 10: "", + 11: "", + 12: "", + 13: "", + 14: ecma14BinaryPropertiesOfStrings }; // #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 + " Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz"; + var unicodeScriptValues = { 9: ecma9ScriptValues, 10: ecma10ScriptValues, - 11: ecma11ScriptValues + 11: ecma11ScriptValues, + 12: ecma12ScriptValues, + 13: ecma13ScriptValues, + 14: ecma14ScriptValues }; var data = {}; function buildUnicodeData(ecmaVersion) { var d = data[ecmaVersion] = { binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues), + binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]), nonBinary: { General_Category: wordsRegexp(unicodeGeneralCategoryValues), Script: wordsRegexp(unicodeScriptValues[ecmaVersion]) @@ -3258,20 +3810,48 @@ d.nonBinary.sc = d.nonBinary.Script; d.nonBinary.scx = d.nonBinary.Script_Extensions; } - buildUnicodeData(9); - buildUnicodeData(10); - buildUnicodeData(11); - 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; + + // Track disjunction structure to determine whether a duplicate + // capture group name is allowed because it is in a separate branch. + var BranchID = function BranchID(parent, base) { + // Parent disjunction branch + this.parent = parent; + // Identifies this set of sibling branches + this.base = base || this; + }; + + BranchID.prototype.separatedFrom = function separatedFrom (alt) { + // A branch is separate from another branch if they or any of + // their parents are siblings in a given disjunction + for (var self = this; self; self = self.parent) { + for (var other = alt; other; other = other.parent) { + if (self.base === other.base && self !== other) { return true } + } + } + return false + }; + + BranchID.prototype.sibling = function sibling () { + return new BranchID(this.parent, this.base) + }; 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.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : ""); + this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion]; this.source = ""; this.flags = ""; this.start = 0; this.switchU = false; + this.switchV = false; this.switchN = false; this.pos = 0; this.lastIntValue = 0; @@ -3279,17 +3859,26 @@ this.lastAssertionIsQuantifiable = false; this.numCapturingParens = 0; this.maxBackReference = 0; - this.groupNames = []; + this.groupNames = Object.create(null); this.backReferenceNames = []; + this.branchID = null; }; RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicodeSets = flags.indexOf("v") !== -1; 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; + if (unicodeSets && this.parser.options.ecmaVersion >= 15) { + this.switchU = true; + this.switchV = true; + this.switchN = true; + } else { + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchV = false; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; + } }; RegExpValidationState.prototype.raise = function raise (message) { @@ -3358,11 +3947,22 @@ return false }; - function codePointToString(ch) { - if (ch <= 0xFFFF) { return String.fromCharCode(ch) } - ch -= 0x10000; - return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) - } + RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) { + if ( forceU === void 0 ) forceU = false; + + var pos = this.pos; + for (var i = 0, list = chs; i < list.length; i += 1) { + var ch = list[i]; + + var current = this.at(pos, forceU); + if (current === -1 || current !== ch) { + return false + } + pos = this.nextIndex(pos, forceU); + } + this.pos = pos; + return true + }; /** * Validate the flags part of a given RegExpLiteral. @@ -3370,10 +3970,13 @@ * @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; + var u = false; + var v = false; + for (var i = 0; i < flags.length; i++) { var flag = flags.charAt(i); if (validFlags.indexOf(flag) === -1) { @@ -3382,16 +3985,26 @@ if (flags.indexOf(flag, i + 1) > -1) { this.raise(state.start, "Duplicate regular expression flag"); } + if (flag === "u") { u = true; } + if (flag === "v") { v = true; } + } + if (this.options.ecmaVersion >= 15 && u && v) { + this.raise(state.start, "Invalid regular expression flag"); } }; + function hasProp(obj) { + for (var _ in obj) { return true } + return false + } + /** * Validate the pattern part of a given RegExpLiteral. * * @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 @@ -3399,22 +4012,23 @@ // |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) { + if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) { state.switchN = true; this.regexp_pattern(state); } }; // 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 = ""; state.lastAssertionIsQuantifiable = false; state.numCapturingParens = 0; state.maxBackReference = 0; - state.groupNames.length = 0; + state.groupNames = Object.create(null); state.backReferenceNames.length = 0; + state.branchID = null; this.regexp_disjunction(state); @@ -3433,18 +4047,22 @@ for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { var name = list[i]; - if (state.groupNames.indexOf(name) === -1) { + if (!state.groupNames[name]) { state.raise("Invalid named capture referenced"); } } }; // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction - pp$8.regexp_disjunction = function(state) { + pp$1.regexp_disjunction = function(state) { + var trackDisjunction = this.options.ecmaVersion >= 16; + if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); } this.regexp_alternative(state); while (state.eat(0x7C /* | */)) { + if (trackDisjunction) { state.branchID = state.branchID.sibling(); } this.regexp_alternative(state); } + if (trackDisjunction) { state.branchID = state.branchID.parent; } // Make the same message as V8. if (this.regexp_eatQuantifier(state, true)) { @@ -3456,13 +4074,12 @@ }; // 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)) - { } + 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 @@ -3485,7 +4102,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; @@ -3523,7 +4140,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)) { @@ -3534,7 +4151,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 /* + */) || @@ -3542,7 +4159,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; @@ -3568,7 +4185,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 /* . */) || @@ -3578,7 +4195,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)) { @@ -3588,7 +4205,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 /* : */)) { @@ -3602,7 +4219,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); @@ -3620,7 +4237,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) || @@ -3633,7 +4250,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"); } @@ -3641,7 +4258,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; @@ -3663,7 +4280,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)) { @@ -3673,7 +4290,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 && @@ -3694,23 +4311,35 @@ // 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) { + if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); } + var trackDisjunction = this.options.ecmaVersion >= 16; + var known = state.groupNames[state.lastStringValue]; + if (known) { + if (trackDisjunction) { + for (var i = 0, list = known; i < list.length; i += 1) { + var altID = list[i]; + + if (!altID.separatedFrom(state.branchID)) + { state.raise("Duplicate capture group name"); } + } + } else { state.raise("Duplicate capture group name"); } - state.groupNames.push(state.lastStringValue); - return } - state.raise("Invalid group"); + if (trackDisjunction) { + (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID); + } else { + state.groupNames[state.lastStringValue] = true; + } } }; // 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 /* > */)) { @@ -3725,7 +4354,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); @@ -3742,7 +4371,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); @@ -3770,7 +4399,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); @@ -3792,7 +4421,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) || @@ -3810,7 +4439,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; @@ -3828,7 +4457,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); @@ -3840,7 +4469,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) || @@ -3851,7 +4480,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)) { @@ -3861,7 +4490,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(); @@ -3871,7 +4500,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 */ @@ -3902,7 +4531,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; @@ -3919,7 +4548,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; @@ -3964,7 +4593,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 @@ -3987,7 +4616,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 */) { @@ -4000,35 +4629,45 @@ return false }; + // Return values used by character set parsing methods, needed to + // forbid negation of sets that can match strings. + var CharSetNone = 0; // Nothing parsed + var CharSetOk = 1; // Construct parsed, cannot contain strings + var CharSetString = 2; // Construct parsed, can contain strings + // 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)) { state.lastIntValue = -1; state.advance(); - return true + return CharSetOk } + var negate = false; if ( state.switchU && this.options.ecmaVersion >= 9 && - (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */) ) { state.lastIntValue = -1; state.advance(); + var result; if ( state.eat(0x7B /* { */) && - this.regexp_eatUnicodePropertyValueExpression(state) && + (result = this.regexp_eatUnicodePropertyValueExpression(state)) && state.eat(0x7D /* } */) ) { - return true + if (negate && result === CharSetString) { state.raise("Invalid property name"); } + return result } state.raise("Invalid property name"); } - return false + return CharSetNone }; + function isCharacterClassEscape(ch) { return ( ch === 0x64 /* d */ || @@ -4043,7 +4682,7 @@ // UnicodePropertyValueExpression :: // UnicodePropertyName `=` UnicodePropertyValue // LoneUnicodePropertyNameOrValue - pp$8.regexp_eatUnicodePropertyValueExpression = function(state) { + pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { var start = state.pos; // UnicodePropertyName `=` UnicodePropertyValue @@ -4052,7 +4691,7 @@ if (this.regexp_eatUnicodePropertyValue(state)) { var value = state.lastStringValue; this.regexp_validateUnicodePropertyNameAndValue(state, name, value); - return true + return CharSetOk } } state.pos = start; @@ -4060,25 +4699,27 @@ // LoneUnicodePropertyNameOrValue if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { var nameOrValue = state.lastStringValue; - this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); - return true + return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue) } - return false + return CharSetNone }; - 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) { - if (!state.unicodeProperties.binary.test(nameOrValue)) - { state.raise("Invalid property name"); } + + pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk } + if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString } + 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())) { @@ -4087,13 +4728,14 @@ } return state.lastStringValue !== "" }; + function isUnicodePropertyNameCharacter(ch) { return isControlLetter(ch) || ch === 0x5F /* _ */ } // UnicodePropertyValue :: // UnicodePropertyValueCharacters - pp$8.regexp_eatUnicodePropertyValue = function(state) { + pp$1.regexp_eatUnicodePropertyValue = function(state) { var ch = 0; state.lastStringValue = ""; while (isUnicodePropertyValueCharacter(ch = state.current())) { @@ -4108,28 +4750,36 @@ // 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); - if (state.eat(0x5D /* ] */)) { - return true - } - // Unreachable since it threw "unterminated regular expression" error before. - state.raise("Unterminated character class"); + var negate = state.eat(0x5E /* ^ */); + var result = this.regexp_classContents(state); + if (!state.eat(0x5D /* ] */)) + { state.raise("Unterminated character class"); } + if (negate && result === CharSetString) + { state.raise("Negated character class may contain strings"); } + return true } return false }; + // https://tc39.es/ecma262/#prod-ClassContents // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges + pp$1.regexp_classContents = function(state) { + if (state.current() === 0x5D /* ] */) { return CharSetOk } + if (state.switchV) { return this.regexp_classSetExpression(state) } + this.regexp_nonEmptyClassRanges(state); + return CharSetOk + }; + // 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_nonEmptyClassRanges = function(state) { while (this.regexp_eatClassAtom(state)) { var left = state.lastIntValue; if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) { @@ -4146,7 +4796,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 /* \ */)) { @@ -4175,7 +4825,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 */)) { @@ -4201,8 +4851,207 @@ ) }; + // https://tc39.es/ecma262/#prod-ClassSetExpression + // https://tc39.es/ecma262/#prod-ClassUnion + // https://tc39.es/ecma262/#prod-ClassIntersection + // https://tc39.es/ecma262/#prod-ClassSubtraction + pp$1.regexp_classSetExpression = function(state) { + var result = CharSetOk, subResult; + if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) { + if (subResult === CharSetString) { result = CharSetString; } + // https://tc39.es/ecma262/#prod-ClassIntersection + var start = state.pos; + while (state.eatChars([0x26, 0x26] /* && */)) { + if ( + state.current() !== 0x26 /* & */ && + (subResult = this.regexp_eatClassSetOperand(state)) + ) { + if (subResult !== CharSetString) { result = CharSetOk; } + continue + } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { return result } + // https://tc39.es/ecma262/#prod-ClassSubtraction + while (state.eatChars([0x2D, 0x2D] /* -- */)) { + if (this.regexp_eatClassSetOperand(state)) { continue } + state.raise("Invalid character in character class"); + } + if (start !== state.pos) { return result } + } else { + state.raise("Invalid character in character class"); + } + // https://tc39.es/ecma262/#prod-ClassUnion + for (;;) { + if (this.regexp_eatClassSetRange(state)) { continue } + subResult = this.regexp_eatClassSetOperand(state); + if (!subResult) { return result } + if (subResult === CharSetString) { result = CharSetString; } + } + }; + + // https://tc39.es/ecma262/#prod-ClassSetRange + pp$1.regexp_eatClassSetRange = function(state) { + var start = state.pos; + if (this.regexp_eatClassSetCharacter(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) { + var right = state.lastIntValue; + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + return true + } + state.pos = start; + } + return false + }; + + // https://tc39.es/ecma262/#prod-ClassSetOperand + pp$1.regexp_eatClassSetOperand = function(state) { + if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk } + return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state) + }; + + // https://tc39.es/ecma262/#prod-NestedClass + pp$1.regexp_eatNestedClass = function(state) { + var start = state.pos; + if (state.eat(0x5B /* [ */)) { + var negate = state.eat(0x5E /* ^ */); + var result = this.regexp_classContents(state); + if (state.eat(0x5D /* ] */)) { + if (negate && result === CharSetString) { + state.raise("Negated character class may contain strings"); + } + return result + } + state.pos = start; + } + if (state.eat(0x5C /* \ */)) { + var result$1 = this.regexp_eatCharacterClassEscape(state); + if (result$1) { + return result$1 + } + state.pos = start; + } + return null + }; + + // https://tc39.es/ecma262/#prod-ClassStringDisjunction + pp$1.regexp_eatClassStringDisjunction = function(state) { + var start = state.pos; + if (state.eatChars([0x5C, 0x71] /* \q */)) { + if (state.eat(0x7B /* { */)) { + var result = this.regexp_classStringDisjunctionContents(state); + if (state.eat(0x7D /* } */)) { + return result + } + } else { + // Make the same message as V8. + state.raise("Invalid escape"); + } + state.pos = start; + } + return null + }; + + // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents + pp$1.regexp_classStringDisjunctionContents = function(state) { + var result = this.regexp_classString(state); + while (state.eat(0x7C /* | */)) { + if (this.regexp_classString(state) === CharSetString) { result = CharSetString; } + } + return result + }; + + // https://tc39.es/ecma262/#prod-ClassString + // https://tc39.es/ecma262/#prod-NonEmptyClassString + pp$1.regexp_classString = function(state) { + var count = 0; + while (this.regexp_eatClassSetCharacter(state)) { count++; } + return count === 1 ? CharSetOk : CharSetString + }; + + // https://tc39.es/ecma262/#prod-ClassSetCharacter + pp$1.regexp_eatClassSetCharacter = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if ( + this.regexp_eatCharacterEscape(state) || + this.regexp_eatClassSetReservedPunctuator(state) + ) { + return true + } + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* */ + return true + } + state.pos = start; + return false + } + var ch = state.current(); + if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false } + if (isClassSetSyntaxCharacter(ch)) { return false } + state.advance(); + state.lastIntValue = ch; + return true + }; + + // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator + function isClassSetReservedDoublePunctuatorCharacter(ch) { + return ( + ch === 0x21 /* ! */ || + ch >= 0x23 /* # */ && ch <= 0x26 /* & */ || + ch >= 0x2A /* * */ && ch <= 0x2C /* , */ || + ch === 0x2E /* . */ || + ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ || + ch === 0x5E /* ^ */ || + ch === 0x60 /* ` */ || + ch === 0x7E /* ~ */ + ) + } + + // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter + function isClassSetSyntaxCharacter(ch) { + return ( + ch === 0x28 /* ( */ || + ch === 0x29 /* ) */ || + ch === 0x2D /* - */ || + ch === 0x2F /* / */ || + ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) + } + + // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator + pp$1.regexp_eatClassSetReservedPunctuator = function(state) { + var ch = state.current(); + if (isClassSetReservedPunctuator(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false + }; + + // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator + function isClassSetReservedPunctuator(ch) { + return ( + ch === 0x21 /* ! */ || + ch === 0x23 /* # */ || + ch === 0x25 /* % */ || + ch === 0x26 /* & */ || + ch === 0x2C /* , */ || + ch === 0x2D /* - */ || + ch >= 0x3A /* : */ && ch <= 0x3E /* > */ || + ch === 0x40 /* @ */ || + ch === 0x60 /* ` */ || + ch === 0x7E /* ~ */ + ) + } + // 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; @@ -4213,7 +5062,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)) { @@ -4228,7 +5077,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; @@ -4243,7 +5092,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; @@ -4272,7 +5121,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)) { @@ -4291,7 +5140,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 */ @@ -4308,7 +5157,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) { @@ -4340,11 +5189,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) @@ -4357,21 +5206,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 } } @@ -4381,26 +5230,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 /* '\' */) @@ -4409,24 +5254,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) @@ -4434,7 +5277,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); @@ -4449,7 +5292,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) { @@ -4494,7 +5337,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; @@ -4513,62 +5356,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 && @@ -4578,19 +5421,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) { @@ -4600,39 +5443,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.question, 1) + return this.finishOp(types$1.question, 1) }; - pp$9.getTokenFromCode = function(code) { + 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()) + } + } + + this.raise(this.pos, "Unexpected character '" + codePointToString(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. @@ -4640,20 +5497,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); @@ -4676,7 +5533,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() @@ -4702,19 +5558,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"); } @@ -4749,14 +5608,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; @@ -4810,7 +5669,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); @@ -4819,12 +5678,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; @@ -4834,7 +5693,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) { // '.' @@ -4850,12 +5709,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) { // '{' @@ -4870,14 +5729,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"); } @@ -4887,20 +5739,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(); @@ -4915,7 +5774,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 { @@ -4923,23 +5782,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); @@ -4970,7 +5829,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 "\\": @@ -4978,15 +5837,18 @@ break case "$": - if (this.input[this.pos + 1] !== "{") { - break - } - // falls through - + if (this.input[this.pos + 1] !== "{") { break } + // fall 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 + case "\r": + if (this.input[this.pos + 1] === "\n") { ++this.pos; } + // fall through + case "\n": case "\u2028": case "\u2029": + ++this.curLine; + this.lineStart = this.pos + 1; + break } } this.raise(this.start, "Unterminated template"); @@ -4994,14 +5856,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' @@ -5012,6 +5874,12 @@ return "" case 56: case 57: + if (this.strict) { + this.invalidStringToken( + this.pos - 1, + "Invalid escape sequence" + ); + } if (inTemplate) { var codePos = this.pos - 1; @@ -5019,8 +5887,6 @@ codePos, "Invalid escape sequence in template string" ); - - return null } default: if (ch >= 48 && ch <= 55) { @@ -5045,6 +5911,7 @@ if (isNewLine(ch)) { // Unicode new line characters after \ get removed from output in both // template literals and strings + if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; } return "" } return String.fromCharCode(ch) @@ -5053,7 +5920,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"); } @@ -5066,7 +5933,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; @@ -5084,7 +5951,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 @@ -5097,18 +5964,33 @@ // 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. + // + // Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and + // various contributors and released under an MIT license. + // + // Git repositories for Acorn are available at + // + // http://marijnhaverbeke.nl/git/acorn + // https://github.com/acornjs/acorn.git + // + // Please use the [github bug tracker][ghbt] to report issues. + // + // [ghbt]: https://github.com/acornjs/acorn/issues + // + // [walk]: util/walk.js - var version = "7.4.1"; + + var version = "8.12.1"; Parser.acorn = { Parser: Parser, @@ -5119,10 +6001,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, @@ -5133,11 +6015,10 @@ }; // The main exported interface (under `self.acorn` when in the - // browser) is a `parse` function that takes a code string and - // returns an abstract syntax tree as specified by [Mozilla parser - // API][api]. + // browser) is a `parse` function that takes a code string and returns + // an abstract syntax tree as specified by the [ESTree spec][estree]. // - // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API + // [estree]: https://github.com/estree/estree function parse(input, options) { return Parser.parse(input, options) @@ -5170,17 +6051,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 }); - -}))); +})); diff --git a/node_modules/acorn/dist/acorn.js.map b/node_modules/acorn/dist/acorn.js.map deleted file mode 100644 index 7781620..0000000 --- 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.\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 = {}\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 = {}\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 }\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\")\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 = {}\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** | -| --- | --- | -| 312 | [jonschlinkert](https://github.com/jonschlinkert) | -| 86 | [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 | [hongaar](https://github.com/hongaar) | -| 3 | [Ovyerus](https://github.com/Ovyerus) | -| 3 | [swyxio](https://github.com/swyxio) | -| 2 | [GabeL7r](https://github.com/GabeL7r) | -| 2 | [Andarist](https://github.com/Andarist) | -| 1 | [ahmadawais](https://github.com/ahmadawais) | -| 1 | [AlCalzone](https://github.com/AlCalzone) | -| 1 | [hipstersmoothie](https://github.com/hipstersmoothie) | -| 1 | [TrySound](https://github.com/TrySound) | -| 1 | [brentjanderson](https://github.com/brentjanderson) | -| 1 | [camilaibs](https://github.com/camilaibs) | -| 1 | [AgentEnder](https://github.com/AgentEnder) | -| 1 | [danieldelcore](https://github.com/danieldelcore) | -| 1 | [deve-sh](https://github.com/deve-sh) | -| 1 | [shortercode](https://github.com/shortercode) | -| 1 | [ImgBotApp](https://github.com/ImgBotApp) | -| 1 | [shumkov](https://github.com/shumkov) | -| 1 | [jsonkao](https://github.com/jsonkao) | -| 1 | [JounQin](https://github.com/JounQin) | -| 1 | [knpwrs](https://github.com/knpwrs) | -| 1 | [yeskunall](https://github.com/yeskunall) | -| 1 | [mischah](https://github.com/mischah) | -| 1 | [starpit](https://github.com/starpit) | -| 1 | [remcohaszing](https://github.com/remcohaszing) | -| 1 | [renarsvilnis](https://github.com/renarsvilnis) | -| 1 | [rstagi](https://github.com/rstagi) | -| 1 | [sbugert](https://github.com/sbugert) | -| 1 | [skellock](https://github.com/skellock) | -| 1 | [tinesoft](https://github.com/tinesoft) | -| 1 | [busticated](https://github.com/busticated) | -| 1 | [cha147](https://github.com/cha147) | -| 1 | [jmlee2k](https://github.com/jmlee2k) | -| 1 | [lef237](https://github.com/lef237) | -| 1 | [peterroe](https://github.com/peterroe) | -| 1 | [spwoodall](https://github.com/spwoodall) | -| 1 | [whxaxes](https://github.com/whxaxes) | -| 1 | [holynewbie](https://github.com/holynewbie) | -| 1 | [xulingling0](https://github.com/xulingling0) | - -#### 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). - -[issue]: https://github.com/enquirer/enquirer/issues/new -[pulls]: https://github.com/enquirer/enquirer/pulls -[jon]: https://github.com/jonschlinkert -[brian]: https://github.com/doowb diff --git a/node_modules/enquirer/index.d.ts b/node_modules/enquirer/index.d.ts deleted file mode 100644 index 8150fa4..0000000 --- a/node_modules/enquirer/index.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { EventEmitter } from "events"; - -interface BasePromptOptions { - name: string | (() => string) - type: string | (() => string) - message: string | (() => string) | (() => Promise) - prefix?: string - initial?: any - required?: boolean - enabled?: boolean | string - disabled?: boolean | string - format?(value: string): string | Promise - result?(value: string): string | Promise - skip?: ((state: object) => boolean | Promise) | boolean - validate?(value: string): boolean | 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?: unknown - hint?: string - role?: string - enabled?: boolean - disabled?: boolean | string -} - -interface ArrayPromptOptions extends BasePromptOptions { - type: - | 'autocomplete' - | 'editable' - | 'form' - | 'multiselect' - | 'select' - | 'survey' - | 'list' - | 'scale' - choices: (string | Choice)[] - maxChoices?: number - multiple?: 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 deaf94b..0000000 --- a/node_modules/enquirer/index.js +++ /dev/null @@ -1,254 +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'); - const 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]; - if (type === 'number') type = 'numeral'; - - 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 define = name => { - utils.defineExport(Enquirer, name, () => Enquirer.types[name]); -}; - -define('ArrayPrompt'); -define('AuthPrompt'); -define('BooleanPrompt'); -define('NumberPrompt'); -define('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 2f2d05e..0000000 --- a/node_modules/enquirer/lib/ansi.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -const isTerm = process.env.TERM_PROGRAM === 'Apple_Terminal'; -const stripAnsi = require('strip-ansi'); -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; - }, - strLen(str) { - // to suport chinese - var realLength = 0, len = str.length, charCode = -1; - for (var i = 0; i < len; i++) { - charCode = str.charCodeAt(i); - if (charCode >= 0 && charCode <= 128) realLength += 1; - else realLength += 2; - } - return realLength; - }, - 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(this.strLen(prompt)); - let diff = input.length - cursor; - if (diff > 0) { - codes += ansi.cursor.left(diff); - } - return codes; - } - - if (value || after) { - let pos = (!input && !!initial) ? - this.strLen(initial) : -this.strLen(input) + cursor; - if (after) pos -= this.strLen(after); - if (input === '' && initial && !prompt.includes(initial)) { - pos += this.strLen(initial); - } - 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 => [...stripAnsi(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 5b9d86c..0000000 --- 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 4a50af0..0000000 --- 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 9c4f42a..0000000 --- a/node_modules/enquirer/lib/interpolate.js +++ /dev/null @@ -1,266 +0,0 @@ -'use strict'; - -const stripAnsi = require('strip-ansi'); -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 (hasOwnProperty.call(defaults, 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 += stripAnsi(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(stripAnsi(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 5ef967f..0000000 --- a/node_modules/enquirer/lib/keypress.js +++ /dev/null @@ -1,245 +0,0 @@ -'use strict'; - -const readline = require('readline'); -const combos = require('./combos'); -const Queue = require('./queue'); - -/* 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); - - const queue = new Queue((buf, key) => onKeypress(buf, keypress(buf, key), rl)); - let isRaw = stdin.isRaw; - - if (stdin.isTTY) stdin.setRawMode(true); - stdin.on('keypress', queue.enqueue); - rl.resume(); - - let off = () => { - if (stdin.isTTY) stdin.setRawMode(isRaw); - stdin.removeListener('keypress', queue.enqueue); - queue.destroy(); - 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 ae2af1c..0000000 --- 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 51e117d..0000000 --- a/node_modules/enquirer/lib/prompt.js +++ /dev/null @@ -1,497 +0,0 @@ -'use strict'; - -const Events = require('events'); -const stripAnsi = require('strip-ansi'); -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()); - - const 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()); - const releaseOnExit = utils.onExit(() => this.cursorShow()); - this.on('close', () => { - this.cursorShow(); - releaseOnExit(); - }); - } - - 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 = stripAnsi(prompt); - let buf = stripAnsi(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); - this.emit('start', this); - } - } - - 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 c3b8b10..0000000 --- a/node_modules/enquirer/lib/prompts/autocomplete.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -const Select = require('./select'); - -const highlight = (input, color) => { - const regex = input ? new RegExp(input, 'ig') : /$^/; - - return str => { - return input ? str.replace(regex, match => color(match)) : 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(); - const hl = this.options.highlight || this.styles.complement; - - const style = (input, color) => { - if (!input) return input; - if (hl.stack) return hl(input); - return hl.call(this, input); - }; - - const color = highlight(this.input, style); - const 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 54c5ea7..0000000 --- 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 61eae7a..0000000 --- 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 042e4c9..0000000 --- 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 f6c2aa3..0000000 --- a/node_modules/enquirer/lib/prompts/form.js +++ /dev/null @@ -1,195 +0,0 @@ -'use strict'; - -const stripAnsi = require('strip-ansi'); -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, input = '' } = choice; - let { muted, submitted, primary, danger } = styles; - - 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 ].filter(Boolean).join(' '); - - if (state.submitted) { - msg = stripAnsi(msg); - input = submitted(input); - - 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 a82fbfb..0000000 --- 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 80ba193..0000000 --- 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 5481062..0000000 --- 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 7657c7f..0000000 --- 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 f64fcd5..0000000 --- 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 2a81fdd..0000000 --- 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 46df22d..0000000 --- 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 2be4551..0000000 --- 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 e321b55..0000000 --- a/node_modules/enquirer/lib/prompts/scale.js +++ /dev/null @@ -1,237 +0,0 @@ -'use strict'; - -const stripAnsi = require('strip-ansi'); -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 = stripAnsi(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 5d3ad37..0000000 --- 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 529d2a7..0000000 --- a/node_modules/enquirer/lib/prompts/snippet.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -const stripAnsi = require('strip-ansi'); -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 = stripAnsi(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 b779b9b..0000000 --- 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 5d39f6b..0000000 --- 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 556e1db..0000000 --- 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 13b7766..0000000 --- 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.resolve(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/queue.js b/node_modules/enquirer/lib/queue.js deleted file mode 100644 index 04ebb3c..0000000 --- a/node_modules/enquirer/lib/queue.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -module.exports = class Queue { - _queue = []; - _executing = false; - _jobRunner = null; - - constructor(jobRunner) { - this._jobRunner = jobRunner; - } - - enqueue = (...args) => { - this._queue.push(args); - this._dequeue(); - }; - - destroy() { - this._queue.length = 0; - this._jobRunner = null; - } - - _dequeue() { - if (this._executing || !this._queue.length) return; - this._executing = true; - - this._jobRunner(...this._queue.shift()); - - setTimeout(() => { - this._executing = false; - this._dequeue(); - }); - } -}; diff --git a/node_modules/enquirer/lib/render.js b/node_modules/enquirer/lib/render.js deleted file mode 100644 index 6a6df4a..0000000 --- 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 1d663d2..0000000 --- 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 501890b..0000000 --- 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 27538d5..0000000 --- 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 (!hasOwnProperty.call(result, key)) { - Reflect.defineProperty(result, key, { get: () => colors[key] }); - } - } - - for (let key of Object.keys(colors.styles)) { - if (!hasOwnProperty.call(result, 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 16adb86..0000000 --- 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 f9c642a..0000000 --- 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 564998b..0000000 --- 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 31091e9..0000000 --- a/node_modules/enquirer/lib/types/array.js +++ /dev/null @@ -1,664 +0,0 @@ -'use strict'; - -const stripAnsi = require('strip-ansi'); -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, stripAnsi(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(); - if (!this.focused) return; - 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() { - if (!this.choices.some(ch => !!ch.parent)) return this.a(); - const focused = this.focused; - this.toggle((focused.parent && !focused.choices) ? focused.parent : focused); - 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() && !this.allChoicesAreDisabled()) { - 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() && !this.allChoicesAreDisabled()) { - 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); - } - - allChoicesAreDisabled(choices = this.choices) { - return choices.every(choice => this.isDisabled(choice)); - } - - 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 c2c66fa..0000000 --- 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 d3e7f34..0000000 --- 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 b3a2300..0000000 --- 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 199a7c9..0000000 --- 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 f4b2ed3..0000000 --- a/node_modules/enquirer/lib/types/string.js +++ /dev/null @@ -1,209 +0,0 @@ -'use strict'; - -const Prompt = require('../prompt'); -const keypress = require('../keypress'); -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 = []; - this.keypressTimeout = - this.options.keypressTimeout !== undefined - ? this.options.keypressTimeout - : null; - } - - async keypress(input, key = input ? keypress(input, {}) : {}) { - const now = Date.now(); - const elapsed = now - this.lastKeypress; - this.lastKeypress = now; - - const isEnterKey = key.name === 'return' || key.name === 'enter'; - let prev = this.state.prevKeypress; - let append; - this.state.prevKeypress = key; - - if (this.keypressTimeout != null && isEnterKey) { - if (elapsed < this.keypressTimeout) { - return this.submit(); - } - - this.state.multilineBuffer = this.state.multilineBuffer || ''; - this.state.multilineBuffer += input; - append = true; - prev = null; - } - - if (append || (this.options.multiline && isEnterKey)) { - 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 7f6ad26..0000000 --- a/node_modules/enquirer/lib/utils.js +++ /dev/null @@ -1,279 +0,0 @@ -'use strict'; - -const toString = Object.prototype.toString; -const colors = require('ansi-colors'); -let onExitCalled = false; -let onExitCallbacks = new Set(); - -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 (hasOwnProperty.call(desc, 'value')) { - if (hasOwnProperty.call(target, key) && isObject(desc.value)) { - let existing = Object.getOwnPropertyDescriptor(target, key); - if (isObject(existing.value) && existing.value !== desc.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); - } - } -}; - -const onExit = (quit, code) => { - if (onExitCalled) return; - - onExitCalled = true; - onExitCallbacks.forEach(fn => fn()); - - if (quit === true) { - process.exit(128 + code); - } -}; -const onSigTerm = onExit.bind(null, true, 15); -const onSigInt = onExit.bind(null, true, 2); - -exports.onExit = callback => { - if (onExitCallbacks.size === 0) { - process.once('SIGTERM', onSigTerm); - process.once('SIGINT', onSigInt); - process.once('exit', onExit); - } - - onExitCallbacks.add(callback); - - return () => { - onExitCallbacks.delete(callback); - if (onExitCallbacks.size === 0) { - process.off('SIGTERM', onSigTerm); - process.off('SIGINT', onSigInt); - process.off('exit', onExit); - } - } -}; - -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/node_modules/ansi-regex/index.d.ts b/node_modules/enquirer/node_modules/ansi-regex/index.d.ts deleted file mode 100644 index 2dbf6af..0000000 --- a/node_modules/enquirer/node_modules/ansi-regex/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace ansiRegex { - interface Options { - /** - Match only the first ANSI escape. - - @default false - */ - onlyFirst: boolean; - } -} - -/** -Regular expression for matching ANSI escape codes. - -@example -``` -import ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` -*/ -declare function ansiRegex(options?: ansiRegex.Options): RegExp; - -export = ansiRegex; diff --git a/node_modules/enquirer/node_modules/ansi-regex/index.js b/node_modules/enquirer/node_modules/ansi-regex/index.js deleted file mode 100644 index 616ff83..0000000 --- a/node_modules/enquirer/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = ({onlyFirst = false} = {}) => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -}; diff --git a/node_modules/enquirer/node_modules/ansi-regex/license b/node_modules/enquirer/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/enquirer/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/enquirer/node_modules/ansi-regex/package.json b/node_modules/enquirer/node_modules/ansi-regex/package.json deleted file mode 100644 index 017f531..0000000 --- a/node_modules/enquirer/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "ansi-regex", - "version": "5.0.1", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": "chalk/ansi-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/enquirer/node_modules/ansi-regex/readme.md b/node_modules/enquirer/node_modules/ansi-regex/readme.md deleted file mode 100644 index 4d848bc..0000000 --- a/node_modules/enquirer/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# ansi-regex - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex(options?) - -Returns a regex for matching ANSI escape codes. - -#### options - -Type: `object` - -##### onlyFirst - -Type: `boolean`
-Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## 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/enquirer/node_modules/strip-ansi/index.d.ts b/node_modules/enquirer/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 907fccc..0000000 --- a/node_modules/enquirer/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -declare function stripAnsi(string: string): string; - -export = stripAnsi; diff --git a/node_modules/enquirer/node_modules/strip-ansi/index.js b/node_modules/enquirer/node_modules/strip-ansi/index.js deleted file mode 100644 index 9a593df..0000000 --- a/node_modules/enquirer/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/enquirer/node_modules/strip-ansi/license b/node_modules/enquirer/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/enquirer/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/enquirer/node_modules/strip-ansi/package.json b/node_modules/enquirer/node_modules/strip-ansi/package.json deleted file mode 100644 index 1a41108..0000000 --- a/node_modules/enquirer/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,54 +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/enquirer/node_modules/strip-ansi/readme.md b/node_modules/enquirer/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7c4b56d..0000000 --- a/node_modules/enquirer/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## strip-ansi for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of strip-ansi 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-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - diff --git a/node_modules/enquirer/package.json b/node_modules/enquirer/package.json deleted file mode 100644 index aae0fc7..0000000 --- a/node_modules/enquirer/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "name": "enquirer", - "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.", - "version": "2.4.1", - "homepage": "https://github.com/enquirer/enquirer", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "enquirer/enquirer", - "bugs": { - "url": "https://github.com/enquirer/enquirer/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "index.d.ts", - "lib" - ], - "main": "index.js", - "engines": { - "node": ">=8.6" - }, - "scripts": { - "test": "mocha && tsc -p ./test/types", - "cover": "nyc --reporter=text --reporter=html mocha" - }, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "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" - }, - "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" - ], - "lintDeps": { - "devDependencies": { - "files": { - "patterns": [ - "examples/**/*.js", - "perf/*.js", - "recipes/*.js" - ] - } - } - }, - "verb": { - "toc": false, - "layout": false, - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "helpers": [ - "./docs/helpers.js" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "inquirer", - "prompt-skeleton" - ] - } -} diff --git a/node_modules/eslint-scope/CHANGELOG.md b/node_modules/eslint-scope/CHANGELOG.md deleted file mode 100644 index cc07de0..0000000 --- a/node_modules/eslint-scope/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -v5.1.1 - September 12, 2020 - -* [`9b528d7`](https://github.com/eslint/eslint-scope/commit/9b528d778c381718c12dabfb7f1c0e0dc6b36e49) Upgrade: esrecurse version to ^4.3.0 (#64) (Timofey Kachalov) -* [`f758bbc`](https://github.com/eslint/eslint-scope/commit/f758bbc3d49b9b9ea2289a5d6a6bba8dcf2c4903) Chore: fix definiton -> definition typo in comments (#63) (Kevin Kirsche) -* [`7513734`](https://github.com/eslint/eslint-scope/commit/751373473375b3f2edc4eaf1c8d2763d8435bb72) Chore: move to GitHub Actions (#62) (Kai Cataldo) - -v5.1.0 - June 4, 2020 - -* [`d4a3764`](https://github.com/eslint/eslint-scope/commit/d4a376434b16289c1a428d7e304576e997520873) Update: support new export syntax (#56) (Toru Nagashima) - -v5.0.0 - July 20, 2019 - -* [`e9fa22e`](https://github.com/eslint/eslint-scope/commit/e9fa22ea412c26cf2761fa98af7e715644bdb464) Upgrade: update dependencies after dropping support for Node <8 (#53) (Kai Cataldo) -* [`ee9f7c1`](https://github.com/eslint/eslint-scope/commit/ee9f7c12721aa195ba7e0e69551f49bfdb479951) Breaking: drop support for Node v6 (#54) (Kai Cataldo) - -v4.0.3 - March 15, 2019 - -* [`299df64`](https://github.com/eslint/eslint-scope/commit/299df64bdafb30b4d9372e4b7af0cf51a3818c4a) Fix: arrow function scope strictness (take 2) (#52) (futpib) - -v4.0.2 - March 1, 2019 - -* [`c925600`](https://github.com/eslint/eslint-scope/commit/c925600a684ae0f71b96f85339437a43b4d50d99) Revert "Fix: Arrow function scope strictness (fixes #49) (#50)" (#51) (Teddy Katz) - -v4.0.1 - March 1, 2019 - -* [`2533966`](https://github.com/eslint/eslint-scope/commit/2533966faf317df5a3847fab937ba462c16808b8) Fix: Arrow function scope strictness (fixes #49) (#50) (futpib) -* [`0cbeea5`](https://github.com/eslint/eslint-scope/commit/0cbeea51dfb66ab88ea34b0e3b4ad5e6cc210f2f) Chore: add supported Node.js versions to CI (#47) (Kai Cataldo) -* [`b423057`](https://github.com/eslint/eslint-scope/commit/b42305760638b8edf4667acf1445e450869bd983) Upgrade: eslint-release@1.0.0 (#46) (Teddy Katz) - -v4.0.0 - June 21, 2018 - - - -v4.0.0-rc.0 - June 9, 2018 - -* 3b919b8 Build: Adding rc release script to package.json (#38) (Kevin Partington) -* 137732a Chore: avoid creating package-lock.json files (#37) (Teddy Katz) - -v4.0.0-alpha.0 - April 27, 2018 - -* 7cc3769 Upgrade: eslint-release ^0.11.1 (#36) (Teddy Katz) -* c9f6967 Breaking: remove TDZScope (refs eslint/eslint#10245) (#35) (Toru Nagashima) -* 982a71f Fix: wrong resolution about default parameters (#33) (Toru Nagashima) -* 57889f1 Docs: Remove extra header line from LICENSE (#32) (Gyandeep Singh) - -v3.7.1 - April 12, 2017 - -* ced6262 Fix: restore previous Scope API exports from escope (#31) (Vitor Balocco) -* 5c3d966 Fix: Remove and Modify tests that contain invalid ES6 syntax (#29) (Reyad Attiyat) - -v3.7.0 - March 17, 2017 - -* 9e27835 Chore: Add files section to package.json (#24) (Ilya Volodin) -* 3e4d123 Upgrade: eslint-config-eslint to 4.0.0 (#21) (Teddy Katz) -* 38c50fb Chore: Rename src to lib and test to tests (#20) (Corbin Uselton) -* f4cd920 Chore: Remove esprima (#19) (Corbin Uselton) -* f81fad5 Revert "Chore: Remove esprima" (#18) (James Henry) -* 31b0085 Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (#13) (Corbin Uselton) -* 12a1ca1 Add Makefile.js and eslint (#15) (Reyad Attiyat) -* 7d23f8e Chore: Remove es6-map and es6-weakmap as they are included in node4 (#10) (Corbin Uselton) -* 019441e Chore: Convert to ES6 that is supported on Node 4, commonjs modules and remove Babel (#14) (Corbin Uselton) -* c647f65 Update: Add check for node.body in referencer (#2) (Corbin Uselton) -* eb5c9db Remove browserify and jsdoc (#12) (Corbin Uselton) -* cf38df0 Chore: Update README.md (#3) (James Henry) -* 8a142ca Chore: Add eslint-release scripts (#6) (James Henry) -* e60d8cb Chore: Remove unused bower.json (#5) (James Henry) -* 049c545 Chore: Fix tests for eslint-scope (#4) (James Henry) -* f026aab Chore: Update package.json for eslint fork (#1) (James Henry) -* a94d281 Chore: Update license with JSF copyright (Nicholas C. Zakas) - diff --git a/node_modules/eslint-scope/README.md b/node_modules/eslint-scope/README.md index 7e7ce0d..110baaf 100644 --- a/node_modules/eslint-scope/README.md +++ b/node_modules/eslint-scope/README.md @@ -1,36 +1,52 @@ +[![npm version](https://img.shields.io/npm/v/eslint-scope.svg)](https://www.npmjs.com/package/eslint-scope) +[![Downloads](https://img.shields.io/npm/dm/eslint-scope.svg)](https://www.npmjs.com/package/eslint-scope) +[![Build Status](https://github.com/eslint/eslint-scope/workflows/CI/badge.svg)](https://github.com/eslint/eslint-scope/actions) + # ESLint Scope ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope). -## Usage - -Install: +## 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/lib/definition.js b/node_modules/eslint-scope/lib/definition.js index 172bfe2..9744ef4 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 0f16fa4..cd0678d 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"; -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 ScopeManager from "./scope-manager.js"; +import Referencer from "./referencer.js"; +import Reference from "./reference.js"; +import Variable from "./variable.js"; + +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 afa6291..a9ff48e 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 9529827..e657d62 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 63d1935..6a5da52 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) { @@ -411,7 +409,7 @@ class Referencer extends esrecurse.Visitor { Program(node) { this.scopeManager.__nestGlobalScope(node); - if (this.scopeManager.__isNodejsScope()) { + if (this.scopeManager.isGlobalReturn()) { // Force strictness of GlobalScope to false when using node.js scope. this.currentScope().isStrict = false; @@ -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 c192799..d2270f1 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) { @@ -64,8 +65,8 @@ class ScopeManager { return this.__options.ignoreEval; } - __isNodejsScope() { - return this.__options.nodejsScope; + isGlobalReturn() { + 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 bdb5f63..0619b90 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 702c478..286202f 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/package.json b/node_modules/eslint-scope/package.json index b700b92..0aae36d 100644 --- a/node_modules/eslint-scope/package.json +++ b/node_modules/eslint-scope/package.json @@ -2,19 +2,31 @@ "name": "eslint-scope", "description": "ECMAScript scope analyzer for ESLint", "homepage": "http://github.com/eslint/eslint-scope", - "main": "lib/index.js", - "version": "5.1.1", + "main": "./dist/eslint-scope.cjs", + "type": "module", + "exports": { + ".": { + "import": "./lib/index.js", + "require": "./dist/eslint-scope.cjs" + }, + "./package.json": "./package.json" + }, + "version": "7.2.2", "engines": { - "node": ">=8.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "repository": "eslint/eslint-scope", + "funding": "https://opencollective.com/eslint", "bugs": { "url": "https://github.com/eslint/eslint-scope/issues" }, "license": "BSD-2-Clause", "scripts": { - "test": "node Makefile.js test", - "lint": "node Makefile.js lint", + "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", @@ -24,25 +36,28 @@ "files": [ "LICENSE", "README.md", - "lib" + "lib", + "dist/eslint-scope.cjs" ], "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "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", + "@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", - "shelljs": "^0.8.3", - "typescript": "^3.5.2" + "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 0b91759..0000000 --- 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 b/node_modules/eslint-utils/index.js deleted file mode 100644 index 3d55509..0000000 --- a/node_modules/eslint-utils/index.js +++ /dev/null @@ -1,1880 +0,0 @@ -/*! @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')); - -/** - * Get the innermost scope which contains a given location. - * @param {Scope} initialScope The initial scope to search. - * @param {Node} node The location to search. - * @returns {Scope} The innermost scope. - */ -function getInnermostScope(initialScope, node) { - const location = node.range[0]; - - let scope = initialScope; - let found = false; - do { - found = false; - for (const childScope of scope.childScopes) { - const range = childScope.block.range; - - if (range[0] <= location && location < range[1]) { - scope = childScope; - found = true; - break - } - } - } while (found) - - return scope -} - -/** - * Find the variable of a given name. - * @param {Scope} initialScope The scope to start finding. - * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. - * @returns {Variable|null} The found variable or null. - */ -function findVariable(initialScope, nameOrNode) { - let name = ""; - let scope = initialScope; - - if (typeof nameOrNode === "string") { - name = nameOrNode; - } else { - name = nameOrNode.name; - scope = getInnermostScope(scope, nameOrNode); - } - - while (scope != null) { - const variable = scope.set.get(name); - if (variable != null) { - return variable - } - scope = scope.upper; - } - - return null -} - -/** - * Negate the result of `this` calling. - * @param {Token} token The token to check. - * @returns {boolean} `true` if the result of `this(token)` is `false`. - */ -function negate0(token) { - return !this(token) //eslint-disable-line no-invalid-this -} - -/** - * Creates the negate function of the given function. - * @param {function(Token):boolean} f - The function to negate. - * @returns {function(Token):boolean} Negated function. - */ -function negate(f) { - return negate0.bind(f) -} - -/** - * 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" -} - -/** - * Checks if the given token is a comma token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a comma token. - */ -function isCommaToken(token) { - return token.value === "," && token.type === "Punctuator" -} - -/** - * Checks if the given token is a semicolon token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a semicolon token. - */ -function isSemicolonToken(token) { - return token.value === ";" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a colon token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a colon token. - */ -function isColonToken(token) { - return token.value === ":" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening parenthesis token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening parenthesis token. - */ -function isOpeningParenToken(token) { - return token.value === "(" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing parenthesis token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing parenthesis token. - */ -function isClosingParenToken(token) { - return token.value === ")" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening square bracket token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening square bracket token. - */ -function isOpeningBracketToken(token) { - return token.value === "[" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing square bracket token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing square bracket token. - */ -function isClosingBracketToken(token) { - return token.value === "]" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening brace token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening brace token. - */ -function isOpeningBraceToken(token) { - return token.value === "{" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing brace token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing brace token. - */ -function isClosingBraceToken(token) { - return token.value === "}" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a comment token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a comment token. - */ -function isCommentToken(token) { - return ( - token.type === "Line" || - token.type === "Block" || - token.type === "Shebang" - ) -} - -const isNotArrowToken = negate(isArrowToken); -const isNotCommaToken = negate(isCommaToken); -const isNotSemicolonToken = negate(isSemicolonToken); -const isNotColonToken = negate(isColonToken); -const isNotOpeningParenToken = negate(isOpeningParenToken); -const isNotClosingParenToken = negate(isClosingParenToken); -const isNotOpeningBracketToken = negate(isOpeningBracketToken); -const isNotClosingBracketToken = negate(isClosingBracketToken); -const isNotOpeningBraceToken = negate(isOpeningBraceToken); -const isNotClosingBraceToken = negate(isClosingBraceToken); -const isNotCommentToken = negate(isCommentToken); - -/** - * Get the `(` token of the given function node. - * @param {Node} node - The function node to get. - * @param {SourceCode} sourceCode - The source code object to get tokens. - * @returns {Token} `(` token. - */ -function getOpeningParenOfParams(node, sourceCode) { - return node.id - ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) - : sourceCode.getFirstToken(node, isOpeningParenToken) -} - -/** - * Get the location of the given function node for reporting. - * @param {Node} 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. - */ -function getFunctionHeadLocation(node, sourceCode) { - const parent = node.parent; - let start = null; - let end = null; - - 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; - } - - return { - start: Object.assign({}, start), - end: Object.assign({}, end), - } -} - -/* globals BigInt, globalThis, global, self, window */ - -const globalObject = - typeof globalThis !== "undefined" - ? globalThis - : typeof self !== "undefined" - ? self - : typeof window !== "undefined" - ? window - : typeof global !== "undefined" - ? global - : {}; - -const builtinNames = Object.freeze( - new Set([ - "Array", - "ArrayBuffer", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "Boolean", - "DataView", - "Date", - "decodeURI", - "decodeURIComponent", - "encodeURI", - "encodeURIComponent", - "escape", - "Float32Array", - "Float64Array", - "Function", - "Infinity", - "Int16Array", - "Int32Array", - "Int8Array", - "isFinite", - "isNaN", - "isPrototypeOf", - "JSON", - "Map", - "Math", - "NaN", - "Number", - "Object", - "parseFloat", - "parseInt", - "Promise", - "Proxy", - "Reflect", - "RegExp", - "Set", - "String", - "Symbol", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "undefined", - "unescape", - "WeakMap", - "WeakSet", - ]) -); -const callAllowed = new Set( - [ - Array.isArray, - typeof BigInt === "function" ? BigInt : undefined, - Boolean, - Date, - Date.parse, - decodeURI, - decodeURIComponent, - encodeURI, - encodeURIComponent, - escape, - isFinite, - isNaN, - isPrototypeOf, - ...Object.getOwnPropertyNames(Math) - .map(k => Math[k]) - .filter(f => typeof f === "function"), - Number, - Number.isFinite, - Number.isNaN, - Number.parseFloat, - Number.parseInt, - Object, - Object.entries, - Object.is, - Object.isExtensible, - Object.isFrozen, - Object.isSealed, - Object.keys, - Object.values, - parseFloat, - parseInt, - RegExp, - String, - String.fromCharCode, - String.fromCodePoint, - String.raw, - Symbol, - Symbol.for, - Symbol.keyFor, - unescape, - ].filter(f => typeof f === "function") -); -const callPassThrough = new Set([ - Object.freeze, - Object.preventExtensions, - Object.seal, -]); - -/** - * Get the property descriptor. - * @param {object} object The object to get. - * @param {string|number|symbol} name The property name to get. - */ -function getPropertyDescriptor(object, name) { - let x = object; - while ((typeof x === "object" || typeof x === "function") && x !== null) { - const d = Object.getOwnPropertyDescriptor(x, name); - if (d) { - return d - } - x = Object.getPrototypeOf(x); - } - return null -} - -/** - * Check if a property is getter or not. - * @param {object} object The object to check. - * @param {string|number|symbol} name The property name to check. - */ -function isGetter(object, name) { - const d = getPropertyDescriptor(object, name); - return d != null && d.get != null -} - -/** - * Get the element values of a given node list. - * @param {Node[]} nodeList The node list to get values. - * @param {Scope|undefined} initialScope The initial scope to find variables. - * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. - */ -function getElementValues(nodeList, initialScope) { - const valueList = []; - - for (let i = 0; i < nodeList.length; ++i) { - const elementNode = nodeList[i]; - - if (elementNode == null) { - valueList.length = i + 1; - } else if (elementNode.type === "SpreadElement") { - const argument = getStaticValueR(elementNode.argument, initialScope); - if (argument == null) { - return null - } - valueList.push(...argument.value); - } else { - const element = getStaticValueR(elementNode, initialScope); - if (element == null) { - return null - } - valueList.push(element.value); - } - } - - return valueList -} - -const operations = Object.freeze({ - ArrayExpression(node, initialScope) { - const elements = getElementValues(node.elements, initialScope); - return elements != null ? { value: elements } : null - }, - - AssignmentExpression(node, initialScope) { - if (node.operator === "=") { - return getStaticValueR(node.right, initialScope) - } - return null - }, - - //eslint-disable-next-line complexity - BinaryExpression(node, initialScope) { - if (node.operator === "in" || node.operator === "instanceof") { - // Not supported. - return null - } - - const left = getStaticValueR(node.left, initialScope); - const right = getStaticValueR(node.right, initialScope); - if (left != null && right != null) { - switch (node.operator) { - case "==": - return { value: left.value == right.value } //eslint-disable-line eqeqeq - case "!=": - return { value: left.value != right.value } //eslint-disable-line eqeqeq - case "===": - return { value: left.value === right.value } - case "!==": - return { value: left.value !== right.value } - case "<": - return { value: left.value < right.value } - case "<=": - return { value: left.value <= right.value } - case ">": - return { value: left.value > right.value } - case ">=": - return { value: left.value >= right.value } - case "<<": - return { value: left.value << right.value } - case ">>": - return { value: left.value >> right.value } - case ">>>": - return { value: left.value >>> right.value } - case "+": - return { value: left.value + right.value } - case "-": - return { value: left.value - right.value } - case "*": - return { value: left.value * right.value } - case "/": - return { value: left.value / right.value } - case "%": - return { value: left.value % right.value } - case "**": - return { value: Math.pow(left.value, right.value) } - case "|": - return { value: left.value | right.value } - case "^": - return { value: left.value ^ right.value } - case "&": - return { value: left.value & right.value } - - // no default - } - } - - return null - }, - - CallExpression(node, initialScope) { - const calleeNode = node.callee; - const args = getElementValues(node.arguments, initialScope); - - if (args != null) { - if (calleeNode.type === "MemberExpression") { - const object = getStaticValueR(calleeNode.object, initialScope); - if (object != null) { - if ( - object.value == null && - (object.optional || node.optional) - ) { - return { value: undefined, optional: true } - } - const property = calleeNode.computed - ? getStaticValueR(calleeNode.property, initialScope) - : { value: calleeNode.property.name }; - - if (property != null) { - const receiver = object.value; - const methodName = property.value; - if (callAllowed.has(receiver[methodName])) { - return { value: receiver[methodName](...args) } - } - if (callPassThrough.has(receiver[methodName])) { - return { value: args[0] } - } - } - } - } else { - const callee = getStaticValueR(calleeNode, initialScope); - if (callee != null) { - if (callee.value == null && node.optional) { - return { value: undefined, optional: true } - } - const func = callee.value; - if (callAllowed.has(func)) { - return { value: func(...args) } - } - if (callPassThrough.has(func)) { - return { value: args[0] } - } - } - } - } - - return null - }, - - ConditionalExpression(node, initialScope) { - const test = getStaticValueR(node.test, initialScope); - if (test != null) { - return test.value - ? getStaticValueR(node.consequent, initialScope) - : getStaticValueR(node.alternate, initialScope) - } - return null - }, - - ExpressionStatement(node, initialScope) { - return getStaticValueR(node.expression, initialScope) - }, - - Identifier(node, initialScope) { - if (initialScope != null) { - const variable = findVariable(initialScope, node); - - // Built-in globals. - if ( - variable != null && - variable.defs.length === 0 && - builtinNames.has(variable.name) && - variable.name in globalObject - ) { - return { value: globalObject[variable.name] } - } - - // Constants. - if (variable != null && variable.defs.length === 1) { - const def = variable.defs[0]; - if ( - def.parent && - def.parent.kind === "const" && - // TODO(mysticatea): don't support destructuring here. - def.node.id.type === "Identifier" - ) { - return getStaticValueR(def.node.init, initialScope) - } - } - } - return null - }, - - Literal(node) { - //istanbul ignore if : this is implementation-specific behavior. - if ((node.regex != null || node.bigint != null) && node.value == null) { - // It was a RegExp/BigInt literal, but Node.js didn't support it. - return null - } - return { value: node.value } - }, - - LogicalExpression(node, initialScope) { - const left = getStaticValueR(node.left, initialScope); - if (left != null) { - if ( - (node.operator === "||" && Boolean(left.value) === true) || - (node.operator === "&&" && Boolean(left.value) === false) || - (node.operator === "??" && left.value != null) - ) { - return left - } - - const right = getStaticValueR(node.right, initialScope); - if (right != null) { - return right - } - } - - return null - }, - - MemberExpression(node, initialScope) { - 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 }; - - if (property != null && !isGetter(object.value, property.value)) { - return { value: object.value[property.value] } - } - } - return null - }, - - ChainExpression(node, initialScope) { - const expression = getStaticValueR(node.expression, initialScope); - if (expression != null) { - return { value: expression.value } - } - return null - }, - - NewExpression(node, initialScope) { - const callee = getStaticValueR(node.callee, initialScope); - const args = getElementValues(node.arguments, initialScope); - - if (callee != null && args != null) { - const Func = callee.value; - if (callAllowed.has(Func)) { - return { value: new Func(...args) } - } - } - - return null - }, - - ObjectExpression(node, initialScope) { - const object = {}; - - for (const propertyNode of node.properties) { - if (propertyNode.type === "Property") { - if (propertyNode.kind !== "init") { - return null - } - const key = propertyNode.computed - ? getStaticValueR(propertyNode.key, initialScope) - : { value: propertyNode.key.name }; - const value = getStaticValueR(propertyNode.value, initialScope); - if (key == null || value == null) { - return null - } - object[key.value] = value.value; - } else if ( - propertyNode.type === "SpreadElement" || - propertyNode.type === "ExperimentalSpreadProperty" - ) { - const argument = getStaticValueR( - propertyNode.argument, - initialScope - ); - if (argument == null) { - return null - } - Object.assign(object, argument.value); - } else { - return null - } - } - - return { value: object } - }, - - SequenceExpression(node, initialScope) { - const last = node.expressions[node.expressions.length - 1]; - return getStaticValueR(last, initialScope) - }, - - TaggedTemplateExpression(node, initialScope) { - const tag = getStaticValueR(node.tag, initialScope); - const expressions = getElementValues( - node.quasi.expressions, - 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); - - if (func === String.raw) { - return { value: func(strings, ...expressions) } - } - } - - return null - }, - - TemplateLiteral(node, initialScope) { - const expressions = getElementValues(node.expressions, initialScope); - if (expressions != null) { - let value = node.quasis[0].value.cooked; - for (let i = 0; i < expressions.length; ++i) { - value += expressions[i]; - value += node.quasis[i + 1].value.cooked; - } - return { value } - } - return null - }, - - UnaryExpression(node, initialScope) { - if (node.operator === "delete") { - // Not supported. - return null - } - if (node.operator === "void") { - return { value: undefined } - } - - const arg = getStaticValueR(node.argument, initialScope); - if (arg != null) { - switch (node.operator) { - case "-": - return { value: -arg.value } - case "+": - return { value: +arg.value } //eslint-disable-line no-implicit-coercion - case "!": - return { value: !arg.value } - case "~": - return { value: ~arg.value } - case "typeof": - return { value: typeof arg.value } - - // no default - } - } - - return null - }, -}); - -/** - * Get the value of a given node if it's a static value. - * @param {Node} node The node to get. - * @param {Scope|undefined} initialScope The scope to start finding variable. - * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. - */ -function getStaticValueR(node, initialScope) { - if (node != null && Object.hasOwnProperty.call(operations, node.type)) { - return operations[node.type](node, initialScope) - } - return null -} - -/** - * Get the value of a given node if it's a static value. - * @param {Node} node The node to get. - * @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. - * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. - */ -function getStaticValue(node, initialScope = null) { - try { - return getStaticValueR(node, initialScope) - } catch (_error) { - return null - } -} - -/** - * Get the value of a given node if it's a literal or a template literal. - * @param {Node} node The node to get. - * @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. - * @returns {string|null} The value of the node, or `null`. - */ -function getStringIfConstant(node, initialScope = null) { - // Handle the literals that the platform doesn't support natively. - if (node && node.type === "Literal" && node.value === null) { - if (node.regex) { - return `/${node.regex.pattern}/${node.regex.flags}` - } - if (node.bigint) { - return node.bigint - } - } - - const evaluated = getStaticValue(node, initialScope); - return evaluated && String(evaluated.value) -} - -/** - * Get the 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 {string|null} The property name of the node. - */ -function getPropertyName(node, initialScope) { - switch (node.type) { - case "MemberExpression": - if (node.computed) { - return getStringIfConstant(node.property, initialScope) - } - return node.property.name - - case "Property": - case "MethodDefinition": - if (node.computed) { - return getStringIfConstant(node.key, initialScope) - } - if (node.key.type === "Literal") { - return String(node.key.value) - } - return node.key.name - - // no default - } - - return null -} - -/** - * Get the name and kind of the given function node. - * @param {ASTNode} node - The function node to get. - * @returns {string} The name and kind of the function node. - */ -function getFunctionNameWithKind(node) { - const parent = node.parent; - const tokens = []; - - if (parent.type === "MethodDefinition" && parent.static) { - tokens.push("static"); - } - if (node.async) { - tokens.push("async"); - } - if (node.generator) { - tokens.push("generator"); - } - - if (node.type === "ArrowFunctionExpression") { - tokens.push("arrow", "function"); - } else if ( - parent.type === "Property" || - parent.type === "MethodDefinition" - ) { - if (parent.kind === "constructor") { - return "constructor" - } - if (parent.kind === "get") { - tokens.push("getter"); - } else if (parent.kind === "set") { - tokens.push("setter"); - } else { - 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") { - 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}'`); - } - } - - return tokens.join(" ") -} - -const typeConversionBinaryOps = Object.freeze( - new Set([ - "==", - "!=", - "<", - "<=", - ">", - ">=", - "<<", - ">>", - ">>>", - "+", - "-", - "*", - "/", - "%", - "|", - "^", - "&", - "in", - ]) -); -const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); - -/** - * Check whether the given value is an ASTNode or not. - * @param {any} x The value to check. - * @returns {boolean} `true` if the value is an ASTNode. - */ -function isNode(x) { - return x !== null && typeof x === "object" && typeof x.type === "string" -} - -const visitor = Object.freeze( - Object.assign(Object.create(null), { - $visit(node, options, visitorKeys) { - const { type } = node; - - if (typeof this[type] === "function") { - return this[type](node, options, visitorKeys) - } - - return this.$visitChildren(node, options, visitorKeys) - }, - - $visitChildren(node, options, visitorKeys) { - const { type } = node; - - for (const key of visitorKeys[type] || evk.getKeys(node)) { - const value = node[key]; - - if (Array.isArray(value)) { - for (const element of value) { - if ( - isNode(element) && - this.$visit(element, options, visitorKeys) - ) { - return true - } - } - } else if ( - isNode(value) && - this.$visit(value, options, visitorKeys) - ) { - return true - } - } - - return false - }, - - ArrowFunctionExpression() { - return false - }, - AssignmentExpression() { - return true - }, - AwaitExpression() { - return true - }, - BinaryExpression(node, options, visitorKeys) { - if ( - options.considerImplicitTypeConversion && - typeConversionBinaryOps.has(node.operator) && - (node.left.type !== "Literal" || node.right.type !== "Literal") - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - CallExpression() { - return true - }, - FunctionExpression() { - return false - }, - ImportExpression() { - return true - }, - MemberExpression(node, options, visitorKeys) { - if (options.considerGetters) { - return true - } - if ( - options.considerImplicitTypeConversion && - node.computed && - node.property.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - MethodDefinition(node, options, visitorKeys) { - if ( - options.considerImplicitTypeConversion && - node.computed && - node.key.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - NewExpression() { - return true - }, - Property(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 - } - if ( - options.considerImplicitTypeConversion && - typeConversionUnaryOps.has(node.operator) && - node.argument.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - UpdateExpression() { - return true - }, - YieldExpression() { - return true - }, - }) -); - -/** - * Check whether a given node has any side effect or not. - * @param {Node} node The node to get. - * @param {SourceCode} sourceCode The source code object. - * @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`. - * @returns {boolean} `true` if the node has a certain side effect. - */ -function hasSideEffect( - node, - sourceCode, - { considerGetters = false, considerImplicitTypeConversion = false } = {} -) { - return visitor.$visit( - node, - { considerGetters, considerImplicitTypeConversion }, - sourceCode.visitorKeys || evk.KEYS - ) -} - -/** - * Get the left parenthesis of the parent node syntax if it exists. - * E.g., `if (a) {}` then the `(`. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {Token|null} The left parenthesis of the parent node syntax - */ -function getParentSyntaxParen(node, sourceCode) { - const parent = node.parent; - - switch (parent.type) { - case "CallExpression": - case "NewExpression": - if (parent.arguments.length === 1 && parent.arguments[0] === node) { - return sourceCode.getTokenAfter( - parent.callee, - isOpeningParenToken - ) - } - return null - - case "DoWhileStatement": - if (parent.test === node) { - return sourceCode.getTokenAfter( - parent.body, - isOpeningParenToken - ) - } - return null - - case "IfStatement": - case "WhileStatement": - if (parent.test === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "ImportExpression": - if (parent.source === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "SwitchStatement": - if (parent.discriminant === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "WithStatement": - if (parent.object === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - default: - return null - } -} - -/** - * Check whether a given node is parenthesized or not. - * @param {number} times The number of parantheses. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is parenthesized the given times. - */ -/** - * Check whether a given node is parenthesized or not. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is parenthesized. - */ -function isParenthesized( - timesOrNode, - nodeOrSourceCode, - optionalSourceCode -) { - let times, node, sourceCode, maybeLeftParen, maybeRightParen; - if (typeof timesOrNode === "number") { - times = timesOrNode | 0; - node = nodeOrSourceCode; - sourceCode = optionalSourceCode; - if (!(times >= 1)) { - throw new TypeError("'times' should be a positive integer.") - } - } else { - times = 1; - node = timesOrNode; - sourceCode = nodeOrSourceCode; - } - - if (node == null) { - return false - } - - maybeLeftParen = maybeRightParen = node; - do { - maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); - maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); - } while ( - maybeLeftParen != null && - maybeRightParen != null && - isOpeningParenToken(maybeLeftParen) && - isClosingParenToken(maybeRightParen) && - // Avoid false positive such as `if (a) {}` - maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && - --times > 0 - ) - - return times === 0 -} - -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ - -const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; - -/** @type {WeakMap} */ -const internal = new WeakMap(); - -/** - * Check whether a given character is escaped or not. - * @param {string} str The string to check. - * @param {number} index The location of the character to check. - * @returns {boolean} `true` if the character is escaped. - */ -function isEscaped(str, index) { - let escaped = false; - for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { - escaped = !escaped; - } - return escaped -} - -/** - * Replace a given string by a given matcher. - * @param {PatternMatcher} matcher The pattern matcher. - * @param {string} str The string to be replaced. - * @param {string} replacement The new substring to replace each matched part. - * @returns {string} The replaced string. - */ -function replaceS(matcher, str, replacement) { - const chunks = []; - let index = 0; - - /** @type {RegExpExecArray} */ - let match = null; - - /** - * @param {string} key The placeholder. - * @returns {string} The replaced string. - */ - function replacer(key) { - switch (key) { - case "$$": - return "$" - case "$&": - return match[0] - case "$`": - return str.slice(0, match.index) - case "$'": - return str.slice(match.index + match[0].length) - default: { - const i = key.slice(1); - if (i in match) { - return match[i] - } - return key - } - } - } - - for (match of matcher.execAll(str)) { - chunks.push(str.slice(index, match.index)); - chunks.push(replacement.replace(placeholder, replacer)); - index = match.index + match[0].length; - } - chunks.push(str.slice(index)); - - return chunks.join("") -} - -/** - * Replace a given string by a given matcher. - * @param {PatternMatcher} matcher The pattern matcher. - * @param {string} str The string to be replaced. - * @param {(...strs[])=>string} replace The function to replace each matched part. - * @returns {string} The replaced string. - */ -function replaceF(matcher, str, replace) { - const chunks = []; - let index = 0; - - for (const match of matcher.execAll(str)) { - chunks.push(str.slice(index, match.index)); - chunks.push(String(replace(...match, match.index, match.input))); - index = match.index + match[0].length; - } - chunks.push(str.slice(index)); - - return chunks.join("") -} - -/** - * The class to find patterns as considering escape sequences. - */ -class PatternMatcher { - /** - * Initialize this matcher. - * @param {RegExp} pattern The pattern to match. - * @param {{escaped:boolean}} options The options. - */ - constructor(pattern, { escaped = false } = {}) { - if (!(pattern instanceof RegExp)) { - throw new TypeError("'pattern' should be a RegExp instance.") - } - if (!pattern.flags.includes("g")) { - throw new Error("'pattern' should contains 'g' flag.") - } - - internal.set(this, { - pattern: new RegExp(pattern.source, pattern.flags), - escaped: Boolean(escaped), - }); - } - - /** - * Find the pattern in a given string. - * @param {string} str The string to find. - * @returns {IterableIterator} The iterator which iterate the matched information. - */ - *execAll(str) { - const { pattern, escaped } = internal.get(this); - let match = null; - let lastIndex = 0; - - pattern.lastIndex = 0; - while ((match = pattern.exec(str)) != null) { - if (escaped || !isEscaped(str, match.index)) { - lastIndex = pattern.lastIndex; - yield match; - pattern.lastIndex = lastIndex; - } - } - } - - /** - * Check whether the pattern is found in a given string. - * @param {string} str The string to check. - * @returns {boolean} `true` if the pattern was found in the string. - */ - test(str) { - const it = this.execAll(str); - const ret = it.next(); - return !ret.done - } - - /** - * Replace a given string. - * @param {string} str The string to be replaced. - * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. - * @returns {string} The replaced string. - */ - [Symbol.replace](str, replacer) { - return typeof replacer === "function" - ? replaceF(this, String(str), replacer) - : replaceS(this, String(str), String(replacer)) - } -} - -const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; -const has = Function.call.bind(Object.hasOwnProperty); - -const READ = Symbol("read"); -const CALL = Symbol("call"); -const CONSTRUCT = Symbol("construct"); -const ESM = Symbol("esm"); - -const requireCall = { require: { [CALL]: true } }; - -/** - * Check whether a given variable is modified or not. - * @param {Variable} variable The variable to check. - * @returns {boolean} `true` if the variable is modified. - */ -function isModifiedGlobal(variable) { - return ( - variable == null || - variable.defs.length !== 0 || - variable.references.some(r => r.isWrite()) - ) -} - -/** - * Check if the value of a given node is passed through to the parent syntax as-is. - * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. - * @param {Node} node A node to check. - * @returns {boolean} `true` if the node is passed through. - */ -function isPassThrough(node) { - const parent = node.parent; - - switch (parent && parent.type) { - case "ConditionalExpression": - return parent.consequent === node || parent.alternate === node - case "LogicalExpression": - return true - case "SequenceExpression": - return parent.expressions[parent.expressions.length - 1] === node - case "ChainExpression": - return true - - default: - return false - } -} - -/** - * The reference tracker. - */ -class ReferenceTracker { - /** - * Initialize this tracker. - * @param {Scope} globalScope The global scope. - * @param {object} [options] The options. - * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. - * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. - */ - constructor( - globalScope, - { - mode = "strict", - globalObjectNames = ["global", "globalThis", "self", "window"], - } = {} - ) { - this.variableStack = []; - this.globalScope = globalScope; - this.mode = mode; - this.globalObjectNames = globalObjectNames.slice(0); - } - - /** - * Iterate the references of global variables. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateGlobalReferences(traceMap) { - for (const key of Object.keys(traceMap)) { - const nextTraceMap = traceMap[key]; - const path = [key]; - const variable = this.globalScope.set.get(key); - - if (isModifiedGlobal(variable)) { - continue - } - - yield* this._iterateVariableReferences( - variable, - path, - nextTraceMap, - true - ); - } - - for (const key of this.globalObjectNames) { - const path = []; - const variable = this.globalScope.set.get(key); - - if (isModifiedGlobal(variable)) { - continue - } - - yield* this._iterateVariableReferences( - variable, - path, - traceMap, - false - ); - } - } - - /** - * Iterate the references of CommonJS modules. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateCjsReferences(traceMap) { - for (const { node } of this.iterateGlobalReferences(requireCall)) { - const key = getStringIfConstant(node.arguments[0]); - if (key == null || !has(traceMap, key)) { - continue - } - - const nextTraceMap = traceMap[key]; - const path = [key]; - - if (nextTraceMap[READ]) { - yield { - node, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iteratePropertyReferences(node, path, nextTraceMap); - } - } - - /** - * Iterate the references of ES modules. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateEsmReferences(traceMap) { - const programNode = this.globalScope.block; - - for (const node of programNode.body) { - if (!IMPORT_TYPE.test(node.type) || node.source == null) { - continue - } - const moduleId = node.source.value; - - if (!has(traceMap, moduleId)) { - continue - } - const nextTraceMap = traceMap[moduleId]; - const path = [moduleId]; - - if (nextTraceMap[READ]) { - yield { node, path, type: READ, info: nextTraceMap[READ] }; - } - - if (node.type === "ExportAllDeclaration") { - for (const key of Object.keys(nextTraceMap)) { - const exportTraceMap = nextTraceMap[key]; - if (exportTraceMap[READ]) { - yield { - node, - path: path.concat(key), - type: READ, - info: exportTraceMap[READ], - }; - } - } - } else { - for (const specifier of node.specifiers) { - const esm = has(nextTraceMap, ESM); - const it = this._iterateImportReferences( - specifier, - path, - esm - ? nextTraceMap - : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } - ); - - if (esm) { - yield* it; - } else { - for (const report of it) { - report.path = report.path.filter(exceptDefault); - if ( - report.path.length >= 2 || - report.type !== READ - ) { - yield report; - } - } - } - } - } - } - } - - /** - * Iterate the references for a given variable. - * @param {Variable} variable The variable to iterate that references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @param {boolean} shouldReport = The flag to report those references. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateVariableReferences(variable, path, traceMap, shouldReport) { - if (this.variableStack.includes(variable)) { - return - } - this.variableStack.push(variable); - try { - for (const reference of variable.references) { - if (!reference.isRead()) { - continue - } - const node = reference.identifier; - - if (shouldReport && traceMap[READ]) { - yield { node, path, type: READ, info: traceMap[READ] }; - } - yield* this._iteratePropertyReferences(node, path, traceMap); - } - } finally { - this.variableStack.pop(); - } - } - - /** - * Iterate the references for a given AST node. - * @param rootNode The AST node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - //eslint-disable-next-line complexity - *_iteratePropertyReferences(rootNode, path, traceMap) { - let node = rootNode; - while (isPassThrough(node)) { - node = node.parent; - } - - const parent = node.parent; - if (parent.type === "MemberExpression") { - if (parent.object === node) { - const key = getPropertyName(parent); - if (key == null || !has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: parent, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iteratePropertyReferences( - parent, - path, - nextTraceMap - ); - } - return - } - if (parent.type === "CallExpression") { - if (parent.callee === node && traceMap[CALL]) { - yield { node: parent, path, type: CALL, info: traceMap[CALL] }; - } - return - } - if (parent.type === "NewExpression") { - if (parent.callee === node && traceMap[CONSTRUCT]) { - yield { - node: parent, - path, - type: CONSTRUCT, - info: traceMap[CONSTRUCT], - }; - } - return - } - if (parent.type === "AssignmentExpression") { - if (parent.right === node) { - yield* this._iterateLhsReferences(parent.left, path, traceMap); - yield* this._iteratePropertyReferences(parent, path, traceMap); - } - return - } - if (parent.type === "AssignmentPattern") { - if (parent.right === node) { - yield* this._iterateLhsReferences(parent.left, path, traceMap); - } - return - } - if (parent.type === "VariableDeclarator") { - if (parent.init === node) { - yield* this._iterateLhsReferences(parent.id, path, traceMap); - } - } - } - - /** - * Iterate the references for a given Pattern node. - * @param {Node} patternNode The Pattern node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateLhsReferences(patternNode, path, traceMap) { - if (patternNode.type === "Identifier") { - const variable = findVariable(this.globalScope, patternNode); - if (variable != null) { - yield* this._iterateVariableReferences( - variable, - path, - traceMap, - false - ); - } - return - } - if (patternNode.type === "ObjectPattern") { - for (const property of patternNode.properties) { - const key = getPropertyName(property); - - if (key == null || !has(traceMap, key)) { - continue - } - - const nextPath = path.concat(key); - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: property, - path: nextPath, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iterateLhsReferences( - property.value, - nextPath, - nextTraceMap - ); - } - return - } - if (patternNode.type === "AssignmentPattern") { - yield* this._iterateLhsReferences(patternNode.left, path, traceMap); - } - } - - /** - * Iterate the references for a given ModuleSpecifier node. - * @param {Node} specifierNode The ModuleSpecifier node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateImportReferences(specifierNode, path, traceMap) { - const type = specifierNode.type; - - if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { - const key = - type === "ImportDefaultSpecifier" - ? "default" - : specifierNode.imported.name; - if (!has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: specifierNode, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iterateVariableReferences( - findVariable(this.globalScope, specifierNode.local), - path, - nextTraceMap, - false - ); - - return - } - - if (type === "ImportNamespaceSpecifier") { - yield* this._iterateVariableReferences( - findVariable(this.globalScope, specifierNode.local), - path, - traceMap, - false - ); - return - } - - if (type === "ExportSpecifier") { - const key = specifierNode.local.name; - if (!has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: specifierNode, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - } - } -} - -ReferenceTracker.READ = READ; -ReferenceTracker.CALL = CALL; -ReferenceTracker.CONSTRUCT = CONSTRUCT; -ReferenceTracker.ESM = ESM; - -/** - * This is a predicate function for Array#filter. - * @param {string} name A name part. - * @param {number} index The index of the name. - * @returns {boolean} `false` if it's default. - */ -function exceptDefault(name, index) { - return !(index === 1 && name === "default") -} - -var index = { - CALL, - CONSTRUCT, - ESM, - 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, - PatternMatcher, - READ, - ReferenceTracker, -}; - -exports.CALL = CALL; -exports.CONSTRUCT = CONSTRUCT; -exports.ESM = ESM; -exports.PatternMatcher = PatternMatcher; -exports.READ = READ; -exports.ReferenceTracker = ReferenceTracker; -exports.default = index; -exports.findVariable = findVariable; -exports.getFunctionHeadLocation = getFunctionHeadLocation; -exports.getFunctionNameWithKind = getFunctionNameWithKind; -exports.getInnermostScope = getInnermostScope; -exports.getPropertyName = getPropertyName; -exports.getStaticValue = getStaticValue; -exports.getStringIfConstant = getStringIfConstant; -exports.hasSideEffect = hasSideEffect; -exports.isArrowToken = isArrowToken; -exports.isClosingBraceToken = isClosingBraceToken; -exports.isClosingBracketToken = isClosingBracketToken; -exports.isClosingParenToken = isClosingParenToken; -exports.isColonToken = isColonToken; -exports.isCommaToken = isCommaToken; -exports.isCommentToken = isCommentToken; -exports.isNotArrowToken = isNotArrowToken; -exports.isNotClosingBraceToken = isNotClosingBraceToken; -exports.isNotClosingBracketToken = isNotClosingBracketToken; -exports.isNotClosingParenToken = isNotClosingParenToken; -exports.isNotColonToken = isNotColonToken; -exports.isNotCommaToken = isNotCommaToken; -exports.isNotCommentToken = isNotCommentToken; -exports.isNotOpeningBraceToken = isNotOpeningBraceToken; -exports.isNotOpeningBracketToken = isNotOpeningBracketToken; -exports.isNotOpeningParenToken = isNotOpeningParenToken; -exports.isNotSemicolonToken = isNotSemicolonToken; -exports.isOpeningBraceToken = isOpeningBraceToken; -exports.isOpeningBracketToken = isOpeningBracketToken; -exports.isOpeningParenToken = isOpeningParenToken; -exports.isParenthesized = isParenthesized; -exports.isSemicolonToken = isSemicolonToken; -//# sourceMappingURL=index.js.map diff --git a/node_modules/eslint-utils/index.js.map b/node_modules/eslint-utils/index.js.map deleted file mode 100644 index 5fab2d4..0000000 --- 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,GAA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EAAE,KAAK,EAAE;AACpC,IAAI,OAAO,EAAE,KAAK,KAAK,CAAC,IAAI,IAAI,KAAK,SAAS,CAAC;AAC/C,CAAC;;AC1ZD,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,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/eslint-utils/index.mjs b/node_modules/eslint-utils/index.mjs deleted file mode 100644 index 6940337..0000000 --- a/node_modules/eslint-utils/index.mjs +++ /dev/null @@ -1,1838 +0,0 @@ -/*! @author Toru Nagashima */ -import evk from 'eslint-visitor-keys'; - -/** - * Get the innermost scope which contains a given location. - * @param {Scope} initialScope The initial scope to search. - * @param {Node} node The location to search. - * @returns {Scope} The innermost scope. - */ -function getInnermostScope(initialScope, node) { - const location = node.range[0]; - - let scope = initialScope; - let found = false; - do { - found = false; - for (const childScope of scope.childScopes) { - const range = childScope.block.range; - - if (range[0] <= location && location < range[1]) { - scope = childScope; - found = true; - break - } - } - } while (found) - - return scope -} - -/** - * Find the variable of a given name. - * @param {Scope} initialScope The scope to start finding. - * @param {string|Node} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node. - * @returns {Variable|null} The found variable or null. - */ -function findVariable(initialScope, nameOrNode) { - let name = ""; - let scope = initialScope; - - if (typeof nameOrNode === "string") { - name = nameOrNode; - } else { - name = nameOrNode.name; - scope = getInnermostScope(scope, nameOrNode); - } - - while (scope != null) { - const variable = scope.set.get(name); - if (variable != null) { - return variable - } - scope = scope.upper; - } - - return null -} - -/** - * Negate the result of `this` calling. - * @param {Token} token The token to check. - * @returns {boolean} `true` if the result of `this(token)` is `false`. - */ -function negate0(token) { - return !this(token) //eslint-disable-line no-invalid-this -} - -/** - * Creates the negate function of the given function. - * @param {function(Token):boolean} f - The function to negate. - * @returns {function(Token):boolean} Negated function. - */ -function negate(f) { - return negate0.bind(f) -} - -/** - * 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" -} - -/** - * Checks if the given token is a comma token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a comma token. - */ -function isCommaToken(token) { - return token.value === "," && token.type === "Punctuator" -} - -/** - * Checks if the given token is a semicolon token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a semicolon token. - */ -function isSemicolonToken(token) { - return token.value === ";" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a colon token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a colon token. - */ -function isColonToken(token) { - return token.value === ":" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening parenthesis token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening parenthesis token. - */ -function isOpeningParenToken(token) { - return token.value === "(" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing parenthesis token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing parenthesis token. - */ -function isClosingParenToken(token) { - return token.value === ")" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening square bracket token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening square bracket token. - */ -function isOpeningBracketToken(token) { - return token.value === "[" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing square bracket token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing square bracket token. - */ -function isClosingBracketToken(token) { - return token.value === "]" && token.type === "Punctuator" -} - -/** - * Checks if the given token is an opening brace token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is an opening brace token. - */ -function isOpeningBraceToken(token) { - return token.value === "{" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a closing brace token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a closing brace token. - */ -function isClosingBraceToken(token) { - return token.value === "}" && token.type === "Punctuator" -} - -/** - * Checks if the given token is a comment token or not. - * @param {Token} token - The token to check. - * @returns {boolean} `true` if the token is a comment token. - */ -function isCommentToken(token) { - return ( - token.type === "Line" || - token.type === "Block" || - token.type === "Shebang" - ) -} - -const isNotArrowToken = negate(isArrowToken); -const isNotCommaToken = negate(isCommaToken); -const isNotSemicolonToken = negate(isSemicolonToken); -const isNotColonToken = negate(isColonToken); -const isNotOpeningParenToken = negate(isOpeningParenToken); -const isNotClosingParenToken = negate(isClosingParenToken); -const isNotOpeningBracketToken = negate(isOpeningBracketToken); -const isNotClosingBracketToken = negate(isClosingBracketToken); -const isNotOpeningBraceToken = negate(isOpeningBraceToken); -const isNotClosingBraceToken = negate(isClosingBraceToken); -const isNotCommentToken = negate(isCommentToken); - -/** - * Get the `(` token of the given function node. - * @param {Node} node - The function node to get. - * @param {SourceCode} sourceCode - The source code object to get tokens. - * @returns {Token} `(` token. - */ -function getOpeningParenOfParams(node, sourceCode) { - return node.id - ? sourceCode.getTokenAfter(node.id, isOpeningParenToken) - : sourceCode.getFirstToken(node, isOpeningParenToken) -} - -/** - * Get the location of the given function node for reporting. - * @param {Node} 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. - */ -function getFunctionHeadLocation(node, sourceCode) { - const parent = node.parent; - let start = null; - let end = null; - - 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; - } - - return { - start: Object.assign({}, start), - end: Object.assign({}, end), - } -} - -/* globals BigInt, globalThis, global, self, window */ - -const globalObject = - typeof globalThis !== "undefined" - ? globalThis - : typeof self !== "undefined" - ? self - : typeof window !== "undefined" - ? window - : typeof global !== "undefined" - ? global - : {}; - -const builtinNames = Object.freeze( - new Set([ - "Array", - "ArrayBuffer", - "BigInt", - "BigInt64Array", - "BigUint64Array", - "Boolean", - "DataView", - "Date", - "decodeURI", - "decodeURIComponent", - "encodeURI", - "encodeURIComponent", - "escape", - "Float32Array", - "Float64Array", - "Function", - "Infinity", - "Int16Array", - "Int32Array", - "Int8Array", - "isFinite", - "isNaN", - "isPrototypeOf", - "JSON", - "Map", - "Math", - "NaN", - "Number", - "Object", - "parseFloat", - "parseInt", - "Promise", - "Proxy", - "Reflect", - "RegExp", - "Set", - "String", - "Symbol", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray", - "undefined", - "unescape", - "WeakMap", - "WeakSet", - ]) -); -const callAllowed = new Set( - [ - Array.isArray, - typeof BigInt === "function" ? BigInt : undefined, - Boolean, - Date, - Date.parse, - decodeURI, - decodeURIComponent, - encodeURI, - encodeURIComponent, - escape, - isFinite, - isNaN, - isPrototypeOf, - ...Object.getOwnPropertyNames(Math) - .map(k => Math[k]) - .filter(f => typeof f === "function"), - Number, - Number.isFinite, - Number.isNaN, - Number.parseFloat, - Number.parseInt, - Object, - Object.entries, - Object.is, - Object.isExtensible, - Object.isFrozen, - Object.isSealed, - Object.keys, - Object.values, - parseFloat, - parseInt, - RegExp, - String, - String.fromCharCode, - String.fromCodePoint, - String.raw, - Symbol, - Symbol.for, - Symbol.keyFor, - unescape, - ].filter(f => typeof f === "function") -); -const callPassThrough = new Set([ - Object.freeze, - Object.preventExtensions, - Object.seal, -]); - -/** - * Get the property descriptor. - * @param {object} object The object to get. - * @param {string|number|symbol} name The property name to get. - */ -function getPropertyDescriptor(object, name) { - let x = object; - while ((typeof x === "object" || typeof x === "function") && x !== null) { - const d = Object.getOwnPropertyDescriptor(x, name); - if (d) { - return d - } - x = Object.getPrototypeOf(x); - } - return null -} - -/** - * Check if a property is getter or not. - * @param {object} object The object to check. - * @param {string|number|symbol} name The property name to check. - */ -function isGetter(object, name) { - const d = getPropertyDescriptor(object, name); - return d != null && d.get != null -} - -/** - * Get the element values of a given node list. - * @param {Node[]} nodeList The node list to get values. - * @param {Scope|undefined} initialScope The initial scope to find variables. - * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null. - */ -function getElementValues(nodeList, initialScope) { - const valueList = []; - - for (let i = 0; i < nodeList.length; ++i) { - const elementNode = nodeList[i]; - - if (elementNode == null) { - valueList.length = i + 1; - } else if (elementNode.type === "SpreadElement") { - const argument = getStaticValueR(elementNode.argument, initialScope); - if (argument == null) { - return null - } - valueList.push(...argument.value); - } else { - const element = getStaticValueR(elementNode, initialScope); - if (element == null) { - return null - } - valueList.push(element.value); - } - } - - return valueList -} - -const operations = Object.freeze({ - ArrayExpression(node, initialScope) { - const elements = getElementValues(node.elements, initialScope); - return elements != null ? { value: elements } : null - }, - - AssignmentExpression(node, initialScope) { - if (node.operator === "=") { - return getStaticValueR(node.right, initialScope) - } - return null - }, - - //eslint-disable-next-line complexity - BinaryExpression(node, initialScope) { - if (node.operator === "in" || node.operator === "instanceof") { - // Not supported. - return null - } - - const left = getStaticValueR(node.left, initialScope); - const right = getStaticValueR(node.right, initialScope); - if (left != null && right != null) { - switch (node.operator) { - case "==": - return { value: left.value == right.value } //eslint-disable-line eqeqeq - case "!=": - return { value: left.value != right.value } //eslint-disable-line eqeqeq - case "===": - return { value: left.value === right.value } - case "!==": - return { value: left.value !== right.value } - case "<": - return { value: left.value < right.value } - case "<=": - return { value: left.value <= right.value } - case ">": - return { value: left.value > right.value } - case ">=": - return { value: left.value >= right.value } - case "<<": - return { value: left.value << right.value } - case ">>": - return { value: left.value >> right.value } - case ">>>": - return { value: left.value >>> right.value } - case "+": - return { value: left.value + right.value } - case "-": - return { value: left.value - right.value } - case "*": - return { value: left.value * right.value } - case "/": - return { value: left.value / right.value } - case "%": - return { value: left.value % right.value } - case "**": - return { value: Math.pow(left.value, right.value) } - case "|": - return { value: left.value | right.value } - case "^": - return { value: left.value ^ right.value } - case "&": - return { value: left.value & right.value } - - // no default - } - } - - return null - }, - - CallExpression(node, initialScope) { - const calleeNode = node.callee; - const args = getElementValues(node.arguments, initialScope); - - if (args != null) { - if (calleeNode.type === "MemberExpression") { - const object = getStaticValueR(calleeNode.object, initialScope); - if (object != null) { - if ( - object.value == null && - (object.optional || node.optional) - ) { - return { value: undefined, optional: true } - } - const property = calleeNode.computed - ? getStaticValueR(calleeNode.property, initialScope) - : { value: calleeNode.property.name }; - - if (property != null) { - const receiver = object.value; - const methodName = property.value; - if (callAllowed.has(receiver[methodName])) { - return { value: receiver[methodName](...args) } - } - if (callPassThrough.has(receiver[methodName])) { - return { value: args[0] } - } - } - } - } else { - const callee = getStaticValueR(calleeNode, initialScope); - if (callee != null) { - if (callee.value == null && node.optional) { - return { value: undefined, optional: true } - } - const func = callee.value; - if (callAllowed.has(func)) { - return { value: func(...args) } - } - if (callPassThrough.has(func)) { - return { value: args[0] } - } - } - } - } - - return null - }, - - ConditionalExpression(node, initialScope) { - const test = getStaticValueR(node.test, initialScope); - if (test != null) { - return test.value - ? getStaticValueR(node.consequent, initialScope) - : getStaticValueR(node.alternate, initialScope) - } - return null - }, - - ExpressionStatement(node, initialScope) { - return getStaticValueR(node.expression, initialScope) - }, - - Identifier(node, initialScope) { - if (initialScope != null) { - const variable = findVariable(initialScope, node); - - // Built-in globals. - if ( - variable != null && - variable.defs.length === 0 && - builtinNames.has(variable.name) && - variable.name in globalObject - ) { - return { value: globalObject[variable.name] } - } - - // Constants. - if (variable != null && variable.defs.length === 1) { - const def = variable.defs[0]; - if ( - def.parent && - def.parent.kind === "const" && - // TODO(mysticatea): don't support destructuring here. - def.node.id.type === "Identifier" - ) { - return getStaticValueR(def.node.init, initialScope) - } - } - } - return null - }, - - Literal(node) { - //istanbul ignore if : this is implementation-specific behavior. - if ((node.regex != null || node.bigint != null) && node.value == null) { - // It was a RegExp/BigInt literal, but Node.js didn't support it. - return null - } - return { value: node.value } - }, - - LogicalExpression(node, initialScope) { - const left = getStaticValueR(node.left, initialScope); - if (left != null) { - if ( - (node.operator === "||" && Boolean(left.value) === true) || - (node.operator === "&&" && Boolean(left.value) === false) || - (node.operator === "??" && left.value != null) - ) { - return left - } - - const right = getStaticValueR(node.right, initialScope); - if (right != null) { - return right - } - } - - return null - }, - - MemberExpression(node, initialScope) { - 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 }; - - if (property != null && !isGetter(object.value, property.value)) { - return { value: object.value[property.value] } - } - } - return null - }, - - ChainExpression(node, initialScope) { - const expression = getStaticValueR(node.expression, initialScope); - if (expression != null) { - return { value: expression.value } - } - return null - }, - - NewExpression(node, initialScope) { - const callee = getStaticValueR(node.callee, initialScope); - const args = getElementValues(node.arguments, initialScope); - - if (callee != null && args != null) { - const Func = callee.value; - if (callAllowed.has(Func)) { - return { value: new Func(...args) } - } - } - - return null - }, - - ObjectExpression(node, initialScope) { - const object = {}; - - for (const propertyNode of node.properties) { - if (propertyNode.type === "Property") { - if (propertyNode.kind !== "init") { - return null - } - const key = propertyNode.computed - ? getStaticValueR(propertyNode.key, initialScope) - : { value: propertyNode.key.name }; - const value = getStaticValueR(propertyNode.value, initialScope); - if (key == null || value == null) { - return null - } - object[key.value] = value.value; - } else if ( - propertyNode.type === "SpreadElement" || - propertyNode.type === "ExperimentalSpreadProperty" - ) { - const argument = getStaticValueR( - propertyNode.argument, - initialScope - ); - if (argument == null) { - return null - } - Object.assign(object, argument.value); - } else { - return null - } - } - - return { value: object } - }, - - SequenceExpression(node, initialScope) { - const last = node.expressions[node.expressions.length - 1]; - return getStaticValueR(last, initialScope) - }, - - TaggedTemplateExpression(node, initialScope) { - const tag = getStaticValueR(node.tag, initialScope); - const expressions = getElementValues( - node.quasi.expressions, - 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); - - if (func === String.raw) { - return { value: func(strings, ...expressions) } - } - } - - return null - }, - - TemplateLiteral(node, initialScope) { - const expressions = getElementValues(node.expressions, initialScope); - if (expressions != null) { - let value = node.quasis[0].value.cooked; - for (let i = 0; i < expressions.length; ++i) { - value += expressions[i]; - value += node.quasis[i + 1].value.cooked; - } - return { value } - } - return null - }, - - UnaryExpression(node, initialScope) { - if (node.operator === "delete") { - // Not supported. - return null - } - if (node.operator === "void") { - return { value: undefined } - } - - const arg = getStaticValueR(node.argument, initialScope); - if (arg != null) { - switch (node.operator) { - case "-": - return { value: -arg.value } - case "+": - return { value: +arg.value } //eslint-disable-line no-implicit-coercion - case "!": - return { value: !arg.value } - case "~": - return { value: ~arg.value } - case "typeof": - return { value: typeof arg.value } - - // no default - } - } - - return null - }, -}); - -/** - * Get the value of a given node if it's a static value. - * @param {Node} node The node to get. - * @param {Scope|undefined} initialScope The scope to start finding variable. - * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. - */ -function getStaticValueR(node, initialScope) { - if (node != null && Object.hasOwnProperty.call(operations, node.type)) { - return operations[node.type](node, initialScope) - } - return null -} - -/** - * Get the value of a given node if it's a static value. - * @param {Node} node The node to get. - * @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. - * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the node, or `null`. - */ -function getStaticValue(node, initialScope = null) { - try { - return getStaticValueR(node, initialScope) - } catch (_error) { - return null - } -} - -/** - * Get the value of a given node if it's a literal or a template literal. - * @param {Node} node The node to get. - * @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. - * @returns {string|null} The value of the node, or `null`. - */ -function getStringIfConstant(node, initialScope = null) { - // Handle the literals that the platform doesn't support natively. - if (node && node.type === "Literal" && node.value === null) { - if (node.regex) { - return `/${node.regex.pattern}/${node.regex.flags}` - } - if (node.bigint) { - return node.bigint - } - } - - const evaluated = getStaticValue(node, initialScope); - return evaluated && String(evaluated.value) -} - -/** - * Get the 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 {string|null} The property name of the node. - */ -function getPropertyName(node, initialScope) { - switch (node.type) { - case "MemberExpression": - if (node.computed) { - return getStringIfConstant(node.property, initialScope) - } - return node.property.name - - case "Property": - case "MethodDefinition": - if (node.computed) { - return getStringIfConstant(node.key, initialScope) - } - if (node.key.type === "Literal") { - return String(node.key.value) - } - return node.key.name - - // no default - } - - return null -} - -/** - * Get the name and kind of the given function node. - * @param {ASTNode} node - The function node to get. - * @returns {string} The name and kind of the function node. - */ -function getFunctionNameWithKind(node) { - const parent = node.parent; - const tokens = []; - - if (parent.type === "MethodDefinition" && parent.static) { - tokens.push("static"); - } - if (node.async) { - tokens.push("async"); - } - if (node.generator) { - tokens.push("generator"); - } - - if (node.type === "ArrowFunctionExpression") { - tokens.push("arrow", "function"); - } else if ( - parent.type === "Property" || - parent.type === "MethodDefinition" - ) { - if (parent.kind === "constructor") { - return "constructor" - } - if (parent.kind === "get") { - tokens.push("getter"); - } else if (parent.kind === "set") { - tokens.push("setter"); - } else { - 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") { - 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}'`); - } - } - - return tokens.join(" ") -} - -const typeConversionBinaryOps = Object.freeze( - new Set([ - "==", - "!=", - "<", - "<=", - ">", - ">=", - "<<", - ">>", - ">>>", - "+", - "-", - "*", - "/", - "%", - "|", - "^", - "&", - "in", - ]) -); -const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"])); - -/** - * Check whether the given value is an ASTNode or not. - * @param {any} x The value to check. - * @returns {boolean} `true` if the value is an ASTNode. - */ -function isNode(x) { - return x !== null && typeof x === "object" && typeof x.type === "string" -} - -const visitor = Object.freeze( - Object.assign(Object.create(null), { - $visit(node, options, visitorKeys) { - const { type } = node; - - if (typeof this[type] === "function") { - return this[type](node, options, visitorKeys) - } - - return this.$visitChildren(node, options, visitorKeys) - }, - - $visitChildren(node, options, visitorKeys) { - const { type } = node; - - for (const key of visitorKeys[type] || evk.getKeys(node)) { - const value = node[key]; - - if (Array.isArray(value)) { - for (const element of value) { - if ( - isNode(element) && - this.$visit(element, options, visitorKeys) - ) { - return true - } - } - } else if ( - isNode(value) && - this.$visit(value, options, visitorKeys) - ) { - return true - } - } - - return false - }, - - ArrowFunctionExpression() { - return false - }, - AssignmentExpression() { - return true - }, - AwaitExpression() { - return true - }, - BinaryExpression(node, options, visitorKeys) { - if ( - options.considerImplicitTypeConversion && - typeConversionBinaryOps.has(node.operator) && - (node.left.type !== "Literal" || node.right.type !== "Literal") - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - CallExpression() { - return true - }, - FunctionExpression() { - return false - }, - ImportExpression() { - return true - }, - MemberExpression(node, options, visitorKeys) { - if (options.considerGetters) { - return true - } - if ( - options.considerImplicitTypeConversion && - node.computed && - node.property.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - MethodDefinition(node, options, visitorKeys) { - if ( - options.considerImplicitTypeConversion && - node.computed && - node.key.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - NewExpression() { - return true - }, - Property(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 - } - if ( - options.considerImplicitTypeConversion && - typeConversionUnaryOps.has(node.operator) && - node.argument.type !== "Literal" - ) { - return true - } - return this.$visitChildren(node, options, visitorKeys) - }, - UpdateExpression() { - return true - }, - YieldExpression() { - return true - }, - }) -); - -/** - * Check whether a given node has any side effect or not. - * @param {Node} node The node to get. - * @param {SourceCode} sourceCode The source code object. - * @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`. - * @returns {boolean} `true` if the node has a certain side effect. - */ -function hasSideEffect( - node, - sourceCode, - { considerGetters = false, considerImplicitTypeConversion = false } = {} -) { - return visitor.$visit( - node, - { considerGetters, considerImplicitTypeConversion }, - sourceCode.visitorKeys || evk.KEYS - ) -} - -/** - * Get the left parenthesis of the parent node syntax if it exists. - * E.g., `if (a) {}` then the `(`. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {Token|null} The left parenthesis of the parent node syntax - */ -function getParentSyntaxParen(node, sourceCode) { - const parent = node.parent; - - switch (parent.type) { - case "CallExpression": - case "NewExpression": - if (parent.arguments.length === 1 && parent.arguments[0] === node) { - return sourceCode.getTokenAfter( - parent.callee, - isOpeningParenToken - ) - } - return null - - case "DoWhileStatement": - if (parent.test === node) { - return sourceCode.getTokenAfter( - parent.body, - isOpeningParenToken - ) - } - return null - - case "IfStatement": - case "WhileStatement": - if (parent.test === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "ImportExpression": - if (parent.source === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "SwitchStatement": - if (parent.discriminant === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - case "WithStatement": - if (parent.object === node) { - return sourceCode.getFirstToken(parent, 1) - } - return null - - default: - return null - } -} - -/** - * Check whether a given node is parenthesized or not. - * @param {number} times The number of parantheses. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is parenthesized the given times. - */ -/** - * Check whether a given node is parenthesized or not. - * @param {Node} node The AST node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is parenthesized. - */ -function isParenthesized( - timesOrNode, - nodeOrSourceCode, - optionalSourceCode -) { - let times, node, sourceCode, maybeLeftParen, maybeRightParen; - if (typeof timesOrNode === "number") { - times = timesOrNode | 0; - node = nodeOrSourceCode; - sourceCode = optionalSourceCode; - if (!(times >= 1)) { - throw new TypeError("'times' should be a positive integer.") - } - } else { - times = 1; - node = timesOrNode; - sourceCode = nodeOrSourceCode; - } - - if (node == null) { - return false - } - - maybeLeftParen = maybeRightParen = node; - do { - maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen); - maybeRightParen = sourceCode.getTokenAfter(maybeRightParen); - } while ( - maybeLeftParen != null && - maybeRightParen != null && - isOpeningParenToken(maybeLeftParen) && - isClosingParenToken(maybeRightParen) && - // Avoid false positive such as `if (a) {}` - maybeLeftParen !== getParentSyntaxParen(node, sourceCode) && - --times > 0 - ) - - return times === 0 -} - -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ - -const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu; - -/** @type {WeakMap} */ -const internal = new WeakMap(); - -/** - * Check whether a given character is escaped or not. - * @param {string} str The string to check. - * @param {number} index The location of the character to check. - * @returns {boolean} `true` if the character is escaped. - */ -function isEscaped(str, index) { - let escaped = false; - for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) { - escaped = !escaped; - } - return escaped -} - -/** - * Replace a given string by a given matcher. - * @param {PatternMatcher} matcher The pattern matcher. - * @param {string} str The string to be replaced. - * @param {string} replacement The new substring to replace each matched part. - * @returns {string} The replaced string. - */ -function replaceS(matcher, str, replacement) { - const chunks = []; - let index = 0; - - /** @type {RegExpExecArray} */ - let match = null; - - /** - * @param {string} key The placeholder. - * @returns {string} The replaced string. - */ - function replacer(key) { - switch (key) { - case "$$": - return "$" - case "$&": - return match[0] - case "$`": - return str.slice(0, match.index) - case "$'": - return str.slice(match.index + match[0].length) - default: { - const i = key.slice(1); - if (i in match) { - return match[i] - } - return key - } - } - } - - for (match of matcher.execAll(str)) { - chunks.push(str.slice(index, match.index)); - chunks.push(replacement.replace(placeholder, replacer)); - index = match.index + match[0].length; - } - chunks.push(str.slice(index)); - - return chunks.join("") -} - -/** - * Replace a given string by a given matcher. - * @param {PatternMatcher} matcher The pattern matcher. - * @param {string} str The string to be replaced. - * @param {(...strs[])=>string} replace The function to replace each matched part. - * @returns {string} The replaced string. - */ -function replaceF(matcher, str, replace) { - const chunks = []; - let index = 0; - - for (const match of matcher.execAll(str)) { - chunks.push(str.slice(index, match.index)); - chunks.push(String(replace(...match, match.index, match.input))); - index = match.index + match[0].length; - } - chunks.push(str.slice(index)); - - return chunks.join("") -} - -/** - * The class to find patterns as considering escape sequences. - */ -class PatternMatcher { - /** - * Initialize this matcher. - * @param {RegExp} pattern The pattern to match. - * @param {{escaped:boolean}} options The options. - */ - constructor(pattern, { escaped = false } = {}) { - if (!(pattern instanceof RegExp)) { - throw new TypeError("'pattern' should be a RegExp instance.") - } - if (!pattern.flags.includes("g")) { - throw new Error("'pattern' should contains 'g' flag.") - } - - internal.set(this, { - pattern: new RegExp(pattern.source, pattern.flags), - escaped: Boolean(escaped), - }); - } - - /** - * Find the pattern in a given string. - * @param {string} str The string to find. - * @returns {IterableIterator} The iterator which iterate the matched information. - */ - *execAll(str) { - const { pattern, escaped } = internal.get(this); - let match = null; - let lastIndex = 0; - - pattern.lastIndex = 0; - while ((match = pattern.exec(str)) != null) { - if (escaped || !isEscaped(str, match.index)) { - lastIndex = pattern.lastIndex; - yield match; - pattern.lastIndex = lastIndex; - } - } - } - - /** - * Check whether the pattern is found in a given string. - * @param {string} str The string to check. - * @returns {boolean} `true` if the pattern was found in the string. - */ - test(str) { - const it = this.execAll(str); - const ret = it.next(); - return !ret.done - } - - /** - * Replace a given string. - * @param {string} str The string to be replaced. - * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`. - * @returns {string} The replaced string. - */ - [Symbol.replace](str, replacer) { - return typeof replacer === "function" - ? replaceF(this, String(str), replacer) - : replaceS(this, String(str), String(replacer)) - } -} - -const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u; -const has = Function.call.bind(Object.hasOwnProperty); - -const READ = Symbol("read"); -const CALL = Symbol("call"); -const CONSTRUCT = Symbol("construct"); -const ESM = Symbol("esm"); - -const requireCall = { require: { [CALL]: true } }; - -/** - * Check whether a given variable is modified or not. - * @param {Variable} variable The variable to check. - * @returns {boolean} `true` if the variable is modified. - */ -function isModifiedGlobal(variable) { - return ( - variable == null || - variable.defs.length !== 0 || - variable.references.some(r => r.isWrite()) - ) -} - -/** - * Check if the value of a given node is passed through to the parent syntax as-is. - * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through. - * @param {Node} node A node to check. - * @returns {boolean} `true` if the node is passed through. - */ -function isPassThrough(node) { - const parent = node.parent; - - switch (parent && parent.type) { - case "ConditionalExpression": - return parent.consequent === node || parent.alternate === node - case "LogicalExpression": - return true - case "SequenceExpression": - return parent.expressions[parent.expressions.length - 1] === node - case "ChainExpression": - return true - - default: - return false - } -} - -/** - * The reference tracker. - */ -class ReferenceTracker { - /** - * Initialize this tracker. - * @param {Scope} globalScope The global scope. - * @param {object} [options] The options. - * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules. - * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object. - */ - constructor( - globalScope, - { - mode = "strict", - globalObjectNames = ["global", "globalThis", "self", "window"], - } = {} - ) { - this.variableStack = []; - this.globalScope = globalScope; - this.mode = mode; - this.globalObjectNames = globalObjectNames.slice(0); - } - - /** - * Iterate the references of global variables. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateGlobalReferences(traceMap) { - for (const key of Object.keys(traceMap)) { - const nextTraceMap = traceMap[key]; - const path = [key]; - const variable = this.globalScope.set.get(key); - - if (isModifiedGlobal(variable)) { - continue - } - - yield* this._iterateVariableReferences( - variable, - path, - nextTraceMap, - true - ); - } - - for (const key of this.globalObjectNames) { - const path = []; - const variable = this.globalScope.set.get(key); - - if (isModifiedGlobal(variable)) { - continue - } - - yield* this._iterateVariableReferences( - variable, - path, - traceMap, - false - ); - } - } - - /** - * Iterate the references of CommonJS modules. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateCjsReferences(traceMap) { - for (const { node } of this.iterateGlobalReferences(requireCall)) { - const key = getStringIfConstant(node.arguments[0]); - if (key == null || !has(traceMap, key)) { - continue - } - - const nextTraceMap = traceMap[key]; - const path = [key]; - - if (nextTraceMap[READ]) { - yield { - node, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iteratePropertyReferences(node, path, nextTraceMap); - } - } - - /** - * Iterate the references of ES modules. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *iterateEsmReferences(traceMap) { - const programNode = this.globalScope.block; - - for (const node of programNode.body) { - if (!IMPORT_TYPE.test(node.type) || node.source == null) { - continue - } - const moduleId = node.source.value; - - if (!has(traceMap, moduleId)) { - continue - } - const nextTraceMap = traceMap[moduleId]; - const path = [moduleId]; - - if (nextTraceMap[READ]) { - yield { node, path, type: READ, info: nextTraceMap[READ] }; - } - - if (node.type === "ExportAllDeclaration") { - for (const key of Object.keys(nextTraceMap)) { - const exportTraceMap = nextTraceMap[key]; - if (exportTraceMap[READ]) { - yield { - node, - path: path.concat(key), - type: READ, - info: exportTraceMap[READ], - }; - } - } - } else { - for (const specifier of node.specifiers) { - const esm = has(nextTraceMap, ESM); - const it = this._iterateImportReferences( - specifier, - path, - esm - ? nextTraceMap - : this.mode === "legacy" - ? Object.assign( - { default: nextTraceMap }, - nextTraceMap - ) - : { default: nextTraceMap } - ); - - if (esm) { - yield* it; - } else { - for (const report of it) { - report.path = report.path.filter(exceptDefault); - if ( - report.path.length >= 2 || - report.type !== READ - ) { - yield report; - } - } - } - } - } - } - } - - /** - * Iterate the references for a given variable. - * @param {Variable} variable The variable to iterate that references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @param {boolean} shouldReport = The flag to report those references. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateVariableReferences(variable, path, traceMap, shouldReport) { - if (this.variableStack.includes(variable)) { - return - } - this.variableStack.push(variable); - try { - for (const reference of variable.references) { - if (!reference.isRead()) { - continue - } - const node = reference.identifier; - - if (shouldReport && traceMap[READ]) { - yield { node, path, type: READ, info: traceMap[READ] }; - } - yield* this._iteratePropertyReferences(node, path, traceMap); - } - } finally { - this.variableStack.pop(); - } - } - - /** - * Iterate the references for a given AST node. - * @param rootNode The AST node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - //eslint-disable-next-line complexity - *_iteratePropertyReferences(rootNode, path, traceMap) { - let node = rootNode; - while (isPassThrough(node)) { - node = node.parent; - } - - const parent = node.parent; - if (parent.type === "MemberExpression") { - if (parent.object === node) { - const key = getPropertyName(parent); - if (key == null || !has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: parent, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iteratePropertyReferences( - parent, - path, - nextTraceMap - ); - } - return - } - if (parent.type === "CallExpression") { - if (parent.callee === node && traceMap[CALL]) { - yield { node: parent, path, type: CALL, info: traceMap[CALL] }; - } - return - } - if (parent.type === "NewExpression") { - if (parent.callee === node && traceMap[CONSTRUCT]) { - yield { - node: parent, - path, - type: CONSTRUCT, - info: traceMap[CONSTRUCT], - }; - } - return - } - if (parent.type === "AssignmentExpression") { - if (parent.right === node) { - yield* this._iterateLhsReferences(parent.left, path, traceMap); - yield* this._iteratePropertyReferences(parent, path, traceMap); - } - return - } - if (parent.type === "AssignmentPattern") { - if (parent.right === node) { - yield* this._iterateLhsReferences(parent.left, path, traceMap); - } - return - } - if (parent.type === "VariableDeclarator") { - if (parent.init === node) { - yield* this._iterateLhsReferences(parent.id, path, traceMap); - } - } - } - - /** - * Iterate the references for a given Pattern node. - * @param {Node} patternNode The Pattern node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateLhsReferences(patternNode, path, traceMap) { - if (patternNode.type === "Identifier") { - const variable = findVariable(this.globalScope, patternNode); - if (variable != null) { - yield* this._iterateVariableReferences( - variable, - path, - traceMap, - false - ); - } - return - } - if (patternNode.type === "ObjectPattern") { - for (const property of patternNode.properties) { - const key = getPropertyName(property); - - if (key == null || !has(traceMap, key)) { - continue - } - - const nextPath = path.concat(key); - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: property, - path: nextPath, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iterateLhsReferences( - property.value, - nextPath, - nextTraceMap - ); - } - return - } - if (patternNode.type === "AssignmentPattern") { - yield* this._iterateLhsReferences(patternNode.left, path, traceMap); - } - } - - /** - * Iterate the references for a given ModuleSpecifier node. - * @param {Node} specifierNode The ModuleSpecifier node to iterate references. - * @param {string[]} path The current path. - * @param {object} traceMap The trace map. - * @returns {IterableIterator<{node:Node,path:string[],type:symbol,info:any}>} The iterator to iterate references. - */ - *_iterateImportReferences(specifierNode, path, traceMap) { - const type = specifierNode.type; - - if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") { - const key = - type === "ImportDefaultSpecifier" - ? "default" - : specifierNode.imported.name; - if (!has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: specifierNode, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - yield* this._iterateVariableReferences( - findVariable(this.globalScope, specifierNode.local), - path, - nextTraceMap, - false - ); - - return - } - - if (type === "ImportNamespaceSpecifier") { - yield* this._iterateVariableReferences( - findVariable(this.globalScope, specifierNode.local), - path, - traceMap, - false - ); - return - } - - if (type === "ExportSpecifier") { - const key = specifierNode.local.name; - if (!has(traceMap, key)) { - return - } - - path = path.concat(key); //eslint-disable-line no-param-reassign - const nextTraceMap = traceMap[key]; - if (nextTraceMap[READ]) { - yield { - node: specifierNode, - path, - type: READ, - info: nextTraceMap[READ], - }; - } - } - } -} - -ReferenceTracker.READ = READ; -ReferenceTracker.CALL = CALL; -ReferenceTracker.CONSTRUCT = CONSTRUCT; -ReferenceTracker.ESM = ESM; - -/** - * This is a predicate function for Array#filter. - * @param {string} name A name part. - * @param {number} index The index of the name. - * @returns {boolean} `false` if it's default. - */ -function exceptDefault(name, index) { - return !(index === 1 && name === "default") -} - -var index = { - CALL, - CONSTRUCT, - ESM, - 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, - PatternMatcher, - READ, - 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 }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/eslint-utils/index.mjs.map b/node_modules/eslint-utils/index.mjs.map deleted file mode 100644 index 0af1519..0000000 --- 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,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,U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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,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 dc1d4b5..0000000 --- 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/LICENSE b/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE deleted file mode 100644 index 17a2553..0000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/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 250f5fa..0000000 --- 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 cd8a326..0000000 --- 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 a33bbc6..0000000 --- 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 63267be..0000000 --- a/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "eslint-visitor-keys", - "version": "1.3.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">=4" - }, - "dependencies": {}, - "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" - }, - "scripts": { - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "test": "nyc mocha tests/lib", - "coverage": "nyc 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", - "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" - }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} diff --git a/node_modules/eslint-utils/package.json b/node_modules/eslint-utils/package.json deleted file mode 100644 index 661a97f..0000000 --- a/node_modules/eslint-utils/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "eslint-utils", - "version": "2.1.0", - "description": "Utilities for ESLint plugins.", - "engines": { - "node": ">=6" - }, - "sideEffects": false, - "main": "index", - "module": "index.mjs", - "files": [ - "index.*" - ], - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "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" - }, - "scripts": { - "prebuild": "npm run -s clean", - "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", - "test": "run-s lint build test:mocha", - "test:mocha": "nyc mocha --reporter dot \"test/*.js\"", - "preversion": "npm test && npm run -s build", - "postversion": "git push && git push --tags", - "prewatch": "npm run -s clean", - "watch": "warun \"{src,test}/**/*.js\" -- npm run -s test:mocha" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/eslint-utils.git" - }, - "keywords": [ - "eslint" - ], - "author": "Toru Nagashima", - "license": "MIT", - "bugs": { - "url": "https://github.com/mysticatea/eslint-utils/issues" - }, - "homepage": "https://github.com/mysticatea/eslint-utils#readme", - "funding": "https://github.com/sponsors/mysticatea" -} diff --git a/node_modules/eslint-visitor-keys/CHANGELOG.md b/node_modules/eslint-visitor-keys/CHANGELOG.md deleted file mode 100644 index f430297..0000000 --- a/node_modules/eslint-visitor-keys/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -v2.1.0 - May 3, 2021 - -* [`908fdf8`](https://github.com/eslint/eslint-visitor-keys/commit/908fdf8c0d9a352c696c8c1f4901280d1a0795f7) Update: add PrivateIdentifier and PropertyDefinition (#20) (Toru Nagashima) -* [`2d7be11`](https://github.com/eslint/eslint-visitor-keys/commit/2d7be11e4d13ac702c9fe3c529cadbd75b370146) Chore: No longer test in Node.js 13 (#17) (Michaël De Boey) -* [`b41b509`](https://github.com/eslint/eslint-visitor-keys/commit/b41b509b153ecd8d47af46a421122f64e93d4c67) Docs: Update required Node.js version (#15) (Michaël De Boey) - -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 d7dbe65..cab8103 100644 --- a/node_modules/eslint-visitor-keys/README.md +++ b/node_modules/eslint-visitor-keys/README.md @@ -2,8 +2,7 @@ [![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) +[![Build Status](https://github.com/eslint/eslint-visitor-keys/workflows/CI/badge.svg)](https://github.com/eslint/eslint-visitor-keys/actions) Constants and utilities about visitor keys to traverse AST. @@ -17,10 +16,19 @@ $ npm install eslint-visitor-keys ### Requirements -- [Node.js] 10.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 +59,7 @@ This will be used to traverse unknown nodes. For example: -``` +```js const node = { type: "AssignmentExpression", left: { type: "Identifier", name: "foo" }, @@ -71,7 +79,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"], ... } @@ -89,10 +97,9 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer- - `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 run test:open-coverage` opens the code coverage report of the previous test with your default browser. [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/lib/index.js b/node_modules/eslint-visitor-keys/lib/index.js index cd8a326..3622816 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 {import('./visitor-keys.js').VisitorKeys} 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 -//------------------------------------------------------------------------------ +/** + * 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); +} -module.exports = Object.freeze({ +// 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)); - /** - * Visitor keys. - * @type {{ [type: string]: string[] | undefined }} - */ - KEYS, + for (const type of Object.keys(additionalKeys)) { + if (Object.prototype.hasOwnProperty.call(retv, type)) { + const keys = new Set(additionalKeys[type]); - /** - * 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])); + 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/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/eslint-visitor-keys/lib/visitor-keys.json deleted file mode 100644 index e648ee1..0000000 --- a/node_modules/eslint-visitor-keys/lib/visitor-keys.json +++ /dev/null @@ -1,289 +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" - ], - "PrivateIdentifier": [], - "Program": [ - "body" - ], - "Property": [ - "key", - "value" - ], - "PropertyDefinition": [ - "key", - "value" - ], - "RestElement": [ - "argument" - ], - "ReturnStatement": [ - "argument" - ], - "SequenceExpression": [ - "expressions" - ], - "SpreadElement": [ - "argument" - ], - "Super": [], - "SwitchStatement": [ - "discriminant", - "cases" - ], - "SwitchCase": [ - "test", - "consequent" - ], - "TaggedTemplateExpression": [ - "tag", - "quasi" - ], - "TemplateElement": [], - "TemplateLiteral": [ - "quasis", - "expressions" - ], - "ThisExpression": [], - "ThrowStatement": [ - "argument" - ], - "TryStatement": [ - "block", - "handler", - "finalizer" - ], - "UnaryExpression": [ - "argument" - ], - "UpdateExpression": [ - "argument" - ], - "VariableDeclaration": [ - "declarations" - ], - "VariableDeclarator": [ - "id", - "init" - ], - "WhileStatement": [ - "test", - "body" - ], - "WithStatement": [ - "object", - "body" - ], - "YieldExpression": [ - "argument" - ] -} diff --git a/node_modules/eslint-visitor-keys/package.json b/node_modules/eslint-visitor-keys/package.json index 775706b..b9d51ce 100644 --- a/node_modules/eslint-visitor-keys/package.json +++ b/node_modules/eslint-visitor-keys/package.json @@ -1,34 +1,69 @@ { "name": "eslint-visitor-keys", - "version": "2.1.0", + "version": "3.4.3", "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", + "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", + "dist/eslint-visitor-keys.d.cts", "lib" ], "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "dependencies": {}, "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" + "@types/estree": "^0.0.51", + "@types/estree-jsx": "^0.0.1", + "@typescript-eslint/parser": "^5.14.0", + "c8": "^7.11.0", + "chai": "^4.3.6", + "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", + "esquery": "^1.4.0", + "json-diff": "^0.7.3", + "mocha": "^9.2.1", + "opener": "^1.5.2", + "rollup": "^2.70.0", + "rollup-plugin-dts": "^4.2.3", + "tsd": "^0.19.1", + "typescript": "^4.6.2" }, "scripts": { - "lint": "eslint lib tests/lib", - "test": "nyc mocha tests/lib", - "coverage": "nyc 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", - "publish-release": "eslint-publish-release" + "build": "npm run build:cjs && npm run build:types", + "build:cjs": "rollup -c", + "build:debug": "npm run build:cjs -- -m && npm run build:types", + "build:keys": "node tools/build-keys-from-ts", + "build:types": "tsc", + "lint": "eslint .", + "prepare": "npm run build", + "release:generate:latest": "eslint-generate-release", + "release:generate:alpha": "eslint-generate-prerelease alpha", + "release:generate:beta": "eslint-generate-prerelease beta", + "release:generate:rc": "eslint-generate-prerelease rc", + "release:publish": "eslint-publish-release", + "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run test:types", + "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", + "test:types": "tsd" }, "repository": "eslint/eslint-visitor-keys", + "funding": "https://opencollective.com/eslint", "keywords": [], "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "Apache-2.0", diff --git a/node_modules/eslint/CHANGELOG.md b/node_modules/eslint/CHANGELOG.md deleted file mode 100644 index a631808..0000000 --- a/node_modules/eslint/CHANGELOG.md +++ /dev/null @@ -1,6553 +0,0 @@ -v7.32.0 - July 30, 2021 - -* [`3c78a7b`](https://github.com/eslint/eslint/commit/3c78a7bff6044fd196ae3b737983e6744c6eb7c8) Chore: Adopt `eslint-plugin/prefer-message-ids` rule internally (#14841) (Bryan Mishkin) -* [`faecf56`](https://github.com/eslint/eslint/commit/faecf56cdb4146b28bfa4f1980adb41b4d3614b1) Update: change reporting location for `curly` rule (refs #12334) (#14766) (Nitin Kumar) -* [`d7dc07a`](https://github.com/eslint/eslint/commit/d7dc07a15e256cee9232183165e2f6102f2c0873) Fix: ignore lines with empty elements (fixes #12756) (#14837) (Soufiane Boutahlil) -* [`1bfbefd`](https://github.com/eslint/eslint/commit/1bfbefdaaf19ef32df42b89a3f5d32cff1e5b831) New: Exit on fatal error (fixes #13711) (#14730) (Antonios Katopodis) -* [`ed007c8`](https://github.com/eslint/eslint/commit/ed007c82ee9d2170c87500d98303554b5f90b915) Chore: Simplify internal `no-invalid-meta` rule (#14842) (Bryan Mishkin) -* [`d53d906`](https://github.com/eslint/eslint/commit/d53d9064b9dd0dd6a8ea39e07b16310c8364db69) Docs: Prepare data for website to indicate rules with suggestions (#14830) (Bryan Mishkin) -* [`d28f2ff`](https://github.com/eslint/eslint/commit/d28f2ffb986e49d6da5c1d91215580591f4cfd35) Docs: Reference eslint-config-eslint to avoid potential for staleness (#14805) (Brett Zamir) -* [`8be8a36`](https://github.com/eslint/eslint/commit/8be8a36010145dfcd31cbdd4f781a91989e3b1bd) Chore: Adopt `eslint-plugin/require-meta-docs-url` rule internally (#14823) (Bryan Mishkin) -* [`f9c164f`](https://github.com/eslint/eslint/commit/f9c164f7b74ca73384c8c80eed5bdbe359b44f6c) Docs: New syntax issue template (#14826) (Nicholas C. Zakas) -* [`eba0c45`](https://github.com/eslint/eslint/commit/eba0c4595c126a91f700d5f2e8723ec3f820a830) Chore: assertions on reporting loc in `unicode-bom` (refs #12334) (#14809) (Nitin Kumar) -* [`ed945bd`](https://github.com/eslint/eslint/commit/ed945bd662714b1917e9de71d5b322a28be9161b) Docs: fix multiple broken links (#14833) (Sam Chen) -* [`60df44c`](https://github.com/eslint/eslint/commit/60df44c79b0f74406119c0c040a360ca84e721fc) Chore: use `actions/setup-node@v2` (#14816) (Nitin Kumar) -* [`6641d88`](https://github.com/eslint/eslint/commit/6641d88e17d952a8e51df5e0d3882a842d4c3f35) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.31.0 - July 17, 2021 - -* [`efdbb12`](https://github.com/eslint/eslint/commit/efdbb1227019427ec2d968a8d6e9151dd8a77c35) Upgrade: @eslint/eslintrc to v0.4.3 (#14808) (Brandon Mills) -* [`a96b05f`](https://github.com/eslint/eslint/commit/a96b05f6c5649cfee112d605c91d95aa191e2f78) Update: add end location to report in `consistent-return` (refs #12334) (#14798) (Nitin Kumar) -* [`e0e8e30`](https://github.com/eslint/eslint/commit/e0e8e308929c9c66612505f2da89043f8592eea7) Docs: update BUG_REPORT template (#14787) (Nitin Kumar) -* [`39115c8`](https://github.com/eslint/eslint/commit/39115c8b71d2629161359f6456f47fdbd552fddd) Docs: provide more context to no-eq-null (#14801) (gfyoung) -* [`9a3c73c`](https://github.com/eslint/eslint/commit/9a3c73c130d437a65f4edba0dcb63390e68cac41) Docs: fix a broken link (#14790) (Sam Chen) -* [`ddffa8a`](https://github.com/eslint/eslint/commit/ddffa8ad58b4b124b08061e9045fdb5370cbdbe3) Update: Indicating the operator in question (#14764) (Paul Smith) -* [`bba714c`](https://github.com/eslint/eslint/commit/bba714c2ed813821ed288fbc07722cdde6e534fe) Update: Clarifying what changes need to be made in no-mixed-operators (#14765) (Paul Smith) -* [`b0d22e3`](https://github.com/eslint/eslint/commit/b0d22e3eff18ea7f08189134c07cddceaec69a09) Docs: Mention benefit of providing `meta.docs.url` (#14774) (Bryan Mishkin) -* [`000cc79`](https://github.com/eslint/eslint/commit/000cc796fd487e7b9ba8bcc5857dd691044479cc) Sponsors: Sync README with website (ESLint Jenkins) -* [`a6a7438`](https://github.com/eslint/eslint/commit/a6a7438502abc6a1e29ec35cfbe2058ffc0803b1) Chore: pin fs-teardown@0.1.1 (#14771) (Milos Djermanovic) - -v7.30.0 - July 2, 2021 - -* [`5f74642`](https://github.com/eslint/eslint/commit/5f746420700d457b92dd86659de588d272937b79) Chore: don't check Program.start in SourceCode#getComments (refs #14744) (#14748) (Milos Djermanovic) -* [`19a871a`](https://github.com/eslint/eslint/commit/19a871a35ae9997ce352624b1081c96c54b73a9f) Docs: Suggest linting plugins for ESLint plugin developers (#14754) (Bryan Mishkin) -* [`aa87329`](https://github.com/eslint/eslint/commit/aa87329d919f569404ca573b439934552006572f) Docs: fix broken links (#14756) (Sam Chen) -* [`278813a`](https://github.com/eslint/eslint/commit/278813a6e759f6b5512ac64c7530c9c51732e692) Docs: fix and add more examples for new-cap rule (fixes #12874) (#14725) (Nitin Kumar) -* [`ed1da5d`](https://github.com/eslint/eslint/commit/ed1da5d96af2587b7211854e45cf8657ef808710) Update: ecmaVersion allows "latest" (#14720) (薛定谔的猫) -* [`104c0b5`](https://github.com/eslint/eslint/commit/104c0b592f203d315a108d311c58375357e40b24) Update: improve use-isnan rule to detect `Number.NaN` (fixes #14715) (#14718) (Nitin Kumar) -* [`b08170b`](https://github.com/eslint/eslint/commit/b08170b92beb22db6ec612ebdfff930f9e0582ab) Update: Implement FlatConfigArray (refs #13481) (#14321) (Nicholas C. Zakas) -* [`f113cdd`](https://github.com/eslint/eslint/commit/f113cdd872257d72bbd66d95e4eaf13623323b24) Chore: upgrade eslint-plugin-eslint-plugin (#14738) (薛定谔的猫) -* [`1b8997a`](https://github.com/eslint/eslint/commit/1b8997ab63781f4ebf87e3269400b2ef4c7d2973) Docs: Fix getRulesMetaForResults link syntax (#14723) (Brandon Mills) -* [`aada733`](https://github.com/eslint/eslint/commit/aada733d2aee830aa32cccb9828cd72db4ccd6bd) Docs: fix two broken links (#14726) (Sam Chen) -* [`8972529`](https://github.com/eslint/eslint/commit/8972529f82d13bd04059ee8852b4ebb9b5350962) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.29.0 - June 18, 2021 - -* [`bfbfe5c`](https://github.com/eslint/eslint/commit/bfbfe5c1fd4c39a06d5e159dbe48479ca4305fc0) New: Add only to RuleTester (refs eslint/rfcs#73) (#14677) (Brandon Mills) -* [`c2cd7b4`](https://github.com/eslint/eslint/commit/c2cd7b4a18057ca6067bdfc16de771dc5d90c0ea) New: Add ESLint#getRulesMetaForResults() (refs #13654) (#14716) (Nicholas C. Zakas) -* [`eea7e0d`](https://github.com/eslint/eslint/commit/eea7e0d09d6ef43d6663cbe424e7974764a5f7fe) Chore: remove duplicate code (#14719) (Nitin Kumar) -* [`6a1c7a0`](https://github.com/eslint/eslint/commit/6a1c7a0dac050ea5876972c50563a7eb867b38d3) Fix: allow fallthrough comment inside block (fixes #14701) (#14702) (Kevin Gibbons) -* [`a47e5e3`](https://github.com/eslint/eslint/commit/a47e5e30b0da364593b6881f6826c595da8696f5) Docs: Add Mega-Linter to the list of integrations (#14707) (Nicolas Vuillamy) -* [`353ddf9`](https://github.com/eslint/eslint/commit/353ddf965078030794419b089994373e27ffc86e) Chore: enable reportUnusedDisableDirectives in eslint-config-eslint (#14699) (薛定谔的猫) -* [`757c495`](https://github.com/eslint/eslint/commit/757c49584a5852c468c1b4a0b74ad3aa39d954e5) Chore: add some rules to eslint-config-eslint (#14692) (薛定谔的猫) -* [`c93a222`](https://github.com/eslint/eslint/commit/c93a222563177a9b5bc7a59aa106bc0a6d31e063) Docs: fix a broken link (#14697) (Sam Chen) -* [`655c118`](https://github.com/eslint/eslint/commit/655c1187fc845bac61ae8d06c556f1a59ee2071b) Sponsors: Sync README with website (ESLint Jenkins) -* [`e2bed2e`](https://github.com/eslint/eslint/commit/e2bed2ead22b575d55ccaeed94eecd3a979dd871) Sponsors: Sync README with website (ESLint Jenkins) -* [`8490fb4`](https://github.com/eslint/eslint/commit/8490fb42e559ef0b3c34ac60be4e05e0d879a9cb) Sponsors: Sync README with website (ESLint Jenkins) -* [`ddbe877`](https://github.com/eslint/eslint/commit/ddbe877c95224e127215d35562a175c6f2b7ba22) Sponsors: Sync README with website (ESLint Jenkins) - -v7.28.0 - June 4, 2021 - -* [`1237705`](https://github.com/eslint/eslint/commit/1237705dd08c209c5e3136045ec51a4ba87a3abe) Upgrade: @eslint/eslintrc to 0.4.2 (#14672) (Milos Djermanovic) -* [`123fb86`](https://github.com/eslint/eslint/commit/123fb8648731c2c23313c544ffa1872d3024fe68) Docs: Add Feedback Needed triage description (#14670) (Nicholas C. Zakas) -* [`c545163`](https://github.com/eslint/eslint/commit/c5451635b4e89827cfc8d8d77083647c74506e42) Update: support multiline /*eslint-env*/ directives (fixes #14652) (#14660) (薛定谔的猫) -* [`8d1e75a`](https://github.com/eslint/eslint/commit/8d1e75a31b3e3d67130709a219bdd07ce6f3cf74) Upgrade: glob-parent version in package.json (#14658) (Hamza Najeeb) -* [`1f048cb`](https://github.com/eslint/eslint/commit/1f048cb0eec660d2052f1758f4b2ad7b1cb424e1) Fix: no-implicit-coercion false positive with `String()` (fixes #14623) (#14641) (Milos Djermanovic) -* [`d709abf`](https://github.com/eslint/eslint/commit/d709abfdde087325d4578b6709dc61040b8ca9d8) Chore: fix comment location in no-unused-vars (#14648) (Milos Djermanovic) -* [`e44ce0a`](https://github.com/eslint/eslint/commit/e44ce0a8acfaad513c385150c25e76e82a1b8f12) Fix: no-duplicate-imports allow unmergeable (fixes #12758, fixes #12760) (#14238) (Soufiane Boutahlil) -* [`bb66a3d`](https://github.com/eslint/eslint/commit/bb66a3d91af426dac9a7ffdbe47bdbbc0ffd4dd7) New: add `getPhysicalFilename()` method to rule context (fixes #11989) (#14616) (Nitin Kumar) -* [`2e43dac`](https://github.com/eslint/eslint/commit/2e43dacd24337a82d4184fac9b44d497675f46ef) Docs: fix `no-sequences` example (#14643) (Nitin Kumar) -* [`958ff4e`](https://github.com/eslint/eslint/commit/958ff4e8a5102f204f1484d09985e28a79790996) Docs: add note for arrow functions in no-seq rule (#14578) (Nitin Kumar) -* [`e4f111b`](https://github.com/eslint/eslint/commit/e4f111b67d114adbf76a9c9dbb18fa4f49bc91b6) Fix: arrow-body-style crash with object pattern (fixes #14633) (#14635) (Milos Djermanovic) -* [`ec28b5a`](https://github.com/eslint/eslint/commit/ec28b5a2bdc69f34ce29d670f5e84d2446774a00) Chore: upgrade eslint-plugin-eslint-plugin (#14590) (薛定谔的猫) -* [`85a2725`](https://github.com/eslint/eslint/commit/85a2725b1fade5538e727102d9701ccb503e54d4) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.27.0 - May 21, 2021 - -* [`2c0868c`](https://github.com/eslint/eslint/commit/2c0868cbeadc9f42716fa1178ebdc6b4cee6d31e) Chore: merge all html formatter files into `html.js` (#14612) (Milos Djermanovic) -* [`9e9b5e0`](https://github.com/eslint/eslint/commit/9e9b5e07475564813b62cd1d7562a93c5fb4bc74) Update: no-unused-vars false negative with comma operator (fixes #14325) (#14354) (Nitin Kumar) -* [`afe9569`](https://github.com/eslint/eslint/commit/afe95693e1e4316a1c6f01d39345061d4c5921c7) Chore: use includes instead of indexOf (#14607) (Mikhail Bodrov) -* [`c0f418e`](https://github.com/eslint/eslint/commit/c0f418e2476df98519bc156b81d20431984e8704) Chore: Remove lodash (#14287) (Stephen Wade) -* [`52655dd`](https://github.com/eslint/eslint/commit/52655dd54925ee02af2ba3a0ebc09de959ae3101) Update: no-restricted-imports custom message for patterns (fixes #11843) (#14580) (Alex Holden) -* [`967b1c4`](https://github.com/eslint/eslint/commit/967b1c4ceca8f5248378477da94ff118dafaa647) Chore: Fix typo in large.js (#14589) (Ikko Ashimine) -* [`2466a05`](https://github.com/eslint/eslint/commit/2466a05160de60958457d984b79fd445c12ebc98) Sponsors: Sync README with website (ESLint Jenkins) -* [`fe29f18`](https://github.com/eslint/eslint/commit/fe29f18227fd02fd7c3da033417d621275b00d0a) Sponsors: Sync README with website (ESLint Jenkins) -* [`086c1d6`](https://github.com/eslint/eslint/commit/086c1d6e8593cf8e7851daa8f2a890c213cf6999) Chore: add more test cases for `no-sequences` (#14579) (Nitin Kumar) -* [`6a2ced8`](https://github.com/eslint/eslint/commit/6a2ced892c0dc43fa4942293b9f1c4b9151c3741) Docs: Update README team and sponsors (ESLint Jenkins) - -v7.26.0 - May 7, 2021 - -* [`aaf65e6`](https://github.com/eslint/eslint/commit/aaf65e629adb74401092c3ccc9cb4e4bd1c8609b) Upgrade: eslintrc for ModuleResolver fix (#14577) (Brandon Mills) -* [`ae6dbd1`](https://github.com/eslint/eslint/commit/ae6dbd148aaca83e4bd04b9351b54029c50fac8a) Fix: track variables, not names in require-atomic-updates (fixes #14208) (#14282) (Patrick Ahmetovic) -* [`6a86e50`](https://github.com/eslint/eslint/commit/6a86e5018a3733049c09261bcabae422fbea893d) Chore: remove loose-parser tests (fixes #14315) (#14569) (Milos Djermanovic) -* [`ee3a3ea`](https://github.com/eslint/eslint/commit/ee3a3ead893d185cc4b1ae9041940cb0968767e1) Fix: create `.eslintrc.cjs` for `module` type (#14304) (Nitin Kumar) -* [`6791dec`](https://github.com/eslint/eslint/commit/6791decfc58b7b09cfd0aabd15a3d14148aae073) Docs: fix example for require-atomic-updates (#14562) (Milos Djermanovic) -* [`388eb7e`](https://github.com/eslint/eslint/commit/388eb7e14039b8951462b311d6121002ca5232cb) Sponsors: Sync README with website (ESLint Jenkins) -* [`f071d1e`](https://github.com/eslint/eslint/commit/f071d1ef91286bf2e3fb63d9b679ff7702819a1e) Update: Add automated suggestion to `radix` rule for parsing decimals (#14291) (Bryan Mishkin) -* [`0b6a3f3`](https://github.com/eslint/eslint/commit/0b6a3f31e6e78825114f82d4e0aed9cd72f784ac) New: Include XO style guide in `eslint --init` (#14193) (Federico Brigante) - -v7.25.0 - April 23, 2021 - -* [`5df5e4a`](https://github.com/eslint/eslint/commit/5df5e4a9976964fcf4dc67e241d4e22ec1370fe0) Update: highlight last write reference for no-unused-vars (fixes #14324) (#14335) (Nitin Kumar) -* [`0023872`](https://github.com/eslint/eslint/commit/00238729329b86b4f8af89ebfe278da3095a6075) Docs: Add deprecated note to `working-with-rules-deprecated` page (#14344) (Michael Novotny) -* [`36fca70`](https://github.com/eslint/eslint/commit/36fca70fa29ab65080076810de98e09133254b8a) Chore: Upgrade eslump to 3.0.0 (#14350) (Stephen Wade) -* [`59b689a`](https://github.com/eslint/eslint/commit/59b689a0b3fa658b8380431007cc1facb4617a3b) Chore: add node v16 (#14355) (薛定谔的猫) -* [`35a1f5e`](https://github.com/eslint/eslint/commit/35a1f5e967e4e87360d3e70d3fca0f7adeeaa1d7) Sponsors: Sync README with website (ESLint Jenkins) -* [`fb0a92b`](https://github.com/eslint/eslint/commit/fb0a92b3d2fed4a17bc39b7f02c540cd1175ec7d) Chore: rename misspelled identifier in test (#14346) (Tobias Nießen) -* [`f2babb1`](https://github.com/eslint/eslint/commit/f2babb1069194166e0ac1afd1269bbd06ac299b6) Docs: update pull request template (#14336) (Nitin Kumar) -* [`02dde29`](https://github.com/eslint/eslint/commit/02dde29eeb523ca24bc4ae7797d38627c3ba9fe9) Docs: Fix anchor in 'docs/developer-guide/working-with-rules.md' (#14332) (Nate-Wilkins) -* [`07d14c3`](https://github.com/eslint/eslint/commit/07d14c304c358fbc9c3d318e1377d2b2bda9179f) Chore: remove extraneous command from lint-staged config (#14314) (James George) -* [`41b3570`](https://github.com/eslint/eslint/commit/41b3570b6c014c534bb3208ed00050fd99842101) Update: lint code block with same extension but different content (#14227) (JounQin) -* [`eb29996`](https://github.com/eslint/eslint/commit/eb299966bdc3920dd2c6f9774d95103d242fc409) Docs: add more examples with arrow functions for no-sequences rule (#14313) (Nitin Kumar) - -v7.24.0 - April 9, 2021 - -* [`0c346c8`](https://github.com/eslint/eslint/commit/0c346c87fa83c6d1184fdafb9c0748c2e15a423d) Chore: ignore `pnpm-lock.yaml` (#14303) (Nitin Kumar) -* [`f06ecdf`](https://github.com/eslint/eslint/commit/f06ecdf78b6d6f366434d73a6acfe7041d575223) Update: Add disallowTemplateShorthand option in no-implicit-coercion (#13579) (Remco Haszing) -* [`71a80e3`](https://github.com/eslint/eslint/commit/71a80e38aab2dada01b808ed43d9b0e806d863c4) Docs: fix broken links in Node.js API docs toc (#14296) (u-sho (Shouhei Uechi)) -* [`bd46dc4`](https://github.com/eslint/eslint/commit/bd46dc4647faa4c3bbb5f60d4c00616a64081398) Docs: Fix incorrect reference to "braces" in arrow-parens (#14300) (emclain) -* [`0d6235e`](https://github.com/eslint/eslint/commit/0d6235ea201b8b90761ee69bb4d46ae18899c28d) Docs: update header in max-lines (#14273) (Shinigami) -* [`70c9216`](https://github.com/eslint/eslint/commit/70c92164017238e329e3a2d1654a0227b8f953f7) Docs: Update issue triage to include blocked column (#14275) (Nicholas C. Zakas) -* [`abca186`](https://github.com/eslint/eslint/commit/abca186a845200fd7728c4e5f220973e640054f9) Docs: Fix typo in suggestions section (#14293) (Kevin Partington) -* [`c4d8b0d`](https://github.com/eslint/eslint/commit/c4d8b0db62b859e721105d4bc0f4044ce346995e) Fix: no-unused-vars ignoreRestSiblings check assignments (fixes #14163) (#14264) (YeonJuan) -* [`b51d077`](https://github.com/eslint/eslint/commit/b51d0778d76c2aa27578caca3ea82c867dced3e4) Update: add ignoreNonDeclaration to no-multi-assign rule (fixes #12545) (#14185) (t-mangoe) -* [`c981fb1`](https://github.com/eslint/eslint/commit/c981fb1994cd04914042ced1980aa86b68ba7be9) Chore: Upgrade mocha to 8.3.2 (#14278) (Stephen Wade) -* [`147fc04`](https://github.com/eslint/eslint/commit/147fc045e699811fab33dddf77498324ddf7e9d6) Docs: Fix `repro:needed` label in bug report template (#14285) (Milos Djermanovic) -* [`e1cfde9`](https://github.com/eslint/eslint/commit/e1cfde93eec71a15c2df1ad660a7a6171204ba80) Docs: Update bug report template (#14276) (Nicholas C. Zakas) -* [`c85c2f1`](https://github.com/eslint/eslint/commit/c85c2f1138a9e952655f19ee780ab0c8e35431a8) Docs: Add fatal to Node.js API LintMessage type (#14251) (Brandon Mills) - -v7.23.0 - March 26, 2021 - -* [`687ccae`](https://github.com/eslint/eslint/commit/687ccae517b8b815cf21e948f80d22e2bf118a99) Update: add option "allowInParentheses" to no-sequences (fixes #14197) (#14199) (Daniel Rentz) -* [`dbf2529`](https://github.com/eslint/eslint/commit/dbf252964d9a2b8957cfe0aed5c87a6d4a5cce24) Sponsors: Sync README with website (ESLint Jenkins) -* [`4bdf2c1`](https://github.com/eslint/eslint/commit/4bdf2c1dade27625b601080687ce95b8c229e491) Sponsors: Sync README with website (ESLint Jenkins) -* [`49d1697`](https://github.com/eslint/eslint/commit/49d16977d969070e5240074e76036f56631a90d3) Chore: Upgrade eslint-plugin-jsdoc to v25 and remove --legacy-peer-deps (#14244) (Brandon Mills) -* [`43f1685`](https://github.com/eslint/eslint/commit/43f1685356b9840e09631843ad9ccf0440a498b0) Update: `--quiet` should not supress `--max-warnings` (fixes #14202) (#14242) (Milos Djermanovic) -* [`909c727`](https://github.com/eslint/eslint/commit/909c7271b8d294bd884827ad5df02615b6ec5e82) Docs: Add valid example that shows vars in a block scope (#14230) (Ed S) -* [`28583eb`](https://github.com/eslint/eslint/commit/28583eb8ada20f32579841bec3fbd60a018d5931) Fix: no-mixed-operators false positives with `? :` (fixes #14223) (#14226) (Milos Djermanovic) -* [`a99eb2d`](https://github.com/eslint/eslint/commit/a99eb2dc2a297d16e40a9feef3956668716c4eb5) Fix: Clarify line breaks in object-curly-newline (fixes #14024) (#14063) (armin yahya) -* [`8984c91`](https://github.com/eslint/eslint/commit/8984c91372e64d1e8dd2ce21b87b80977d57bff9) Update: eslint --env-info output os info (#14059) (薛定谔的猫) -* [`2a79306`](https://github.com/eslint/eslint/commit/2a79306f71c4c80f1e3e73be2a140d07cf55c63d) Sponsors: Sync README with website (ESLint Jenkins) -* [`ebd7026`](https://github.com/eslint/eslint/commit/ebd70263f6e6fe597613d90f4b8de84710c2f3d6) Docs: Fix typo (#14225) (Greg Finley) -* [`a2013fc`](https://github.com/eslint/eslint/commit/a2013fcf996c8651bc760df21d900442828a6884) Sponsors: Sync README with website (ESLint Jenkins) - -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 7fe552a..b607bb3 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 804310d..227d40c 100644
--- a/node_modules/eslint/README.md
+++ b/node_modules/eslint/README.md
@@ -10,14 +10,14 @@
 # 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) |
+[Mastodon](https://fosstodon.org/@eslint)
 
 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 +31,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 +41,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,34 +76,34 @@ 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.
 
 ### Does Prettier replace ESLint?
 
-No, ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use ESLint for everything, or you can combine both using Prettier to format your code and ESLint to catch possible errors.
+No, ESLint and Prettier have diffent jobs: ESLint is a linter (looking for problematic patterns) and Prettier is a code formatter. Using both tools is common, refer to [Prettier's documentation](https://prettier.io/docs/en/install#eslint-and-other-linters) to learn how to configure them to work well with each other.
 
 ### Why can't ESLint find my plugins?
 
@@ -119,23 +113,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, 2022, and 2023. 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 +141,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 +182,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 +191,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)
@@ -214,94 +209,95 @@ The people who manage releases, review feature requests, and meet regularly to e
 
 
-
+Nicholas C. Zakas's Avatar
Nicholas C. Zakas
- -
-Brandon Mills -
-
-
+Milos Djermanovic's Avatar
Milos Djermanovic
- ### Reviewers The people who review and implement new features.
- -
-Toru Nagashima +
+唯然's Avatar
+唯然
- -
-薛定谔的猫 +
+Nitin Kumar's Avatar
+Nitin Kumar
- - - ### Committers The people who review and fix bugs and help triage issues.
- -
-Brett Zamir -
-
-
+Bryan Mishkin's Avatar
Bryan Mishkin
- -
-Pig Fang +
+Francesco Trotta's Avatar
+Francesco Trotta
- -
-Anix +
+Yosuke Ota's Avatar
+Yosuke Ota
- -
-YeonJuan -
-
- -
-Nitin Kumar +
+Tanuj Kanti's Avatar
+Tanuj Kanti
+### Website Team + +Team members who focus specifically on eslint.org + +
+ +Amaresh  S M's Avatar
+Amaresh S M +
+
+ +Strek's Avatar
+Strek +
+
+ +Percy Ma's Avatar
+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 Salesforce Airbnb Coinbase Substack

Silver Sponsors

-

Retool Liftoff

Bronze Sponsors

-

Anagram Solver Bugsnag Stability Monitoring Mixpanel VPS Server Icons8: free icons, photos, illustrations, and music Discord ThemeIsle Fire Stick Tricks Practice Ignition

+

Chrome Frameworks Fund Automattic

Gold Sponsors

+

Salesforce Airbnb

Silver Sponsors

+

Liftoff American Express Workleap

Bronze Sponsors

+

ThemeIsle Anagram Solver Icons8 Discord Transloadit Ignition Nx HeroCoders

-## 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 5fa5766..eeb4647 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:*"); @@ -69,7 +66,7 @@ function getErrorMessage(error) { // Lazy loading because this is used only if an error happened. const util = require("util"); - // Foolproof -- thirdparty module might throw non-object. + // Foolproof -- third-party module might throw non-object. if (typeof error !== "object" || error === null) { return String(error); } @@ -95,6 +92,19 @@ function getErrorMessage(error) { return util.format("%o", error); } +/** + * Tracks error messages that are shown to the user so we only ever show the + * same message once. + * @type {Set} + */ +const displayedErrors = new Set(); + +/** + * Tracks whether an unexpected error was caught + * @type {boolean} + */ +let hadFatalError = false; + /** * Catch and report unexpected error. * @param {any} error The thrown error object. @@ -102,16 +112,20 @@ function getErrorMessage(error) { */ function onFatalError(error) { process.exitCode = 2; + hadFatalError = true; const { version } = require("../package.json"); - const message = getErrorMessage(error); - - console.error(` + const message = ` Oops! Something went wrong! :( ESLint: ${version} -${message}`); +${getErrorMessage(error)}`; + + if (!displayedErrors.has(message)) { + console.error(message); + displayedErrors.add(message); + } } //------------------------------------------------------------------------------ @@ -124,13 +138,36 @@ ${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( + const exitCode = await require("../lib/cli").execute( process.argv, - process.argv.includes("--stdin") ? await readStdin() : null + process.argv.includes("--stdin") ? await readStdin() : null, + true ); + + /* + * If an uncaught exception or unhandled rejection was detected in the meantime, + * keep the fatal exit code 2 that is already assigned to `process.exitCode`. + * Without this condition, exit code 2 (unsuccessful execution) could be overwritten with + * 1 (successful execution, lint problems found) or even 0 (successful execution, no lint problems found). + * This ensures that unexpected errors that seemingly don't affect the success + * of the execution will still cause a non-zero exit code, as it's a common + * practice and the default behavior of Node.js to exit with non-zero + * in case of an uncaught exception or unhandled rejection. + * + * Otherwise, assign the exit code returned from CLI. + */ + if (!hadFatalError) { + process.exitCode = exitCode; + } }()).catch(onFatalError); diff --git a/node_modules/eslint/conf/category-list.json b/node_modules/eslint/conf/category-list.json deleted file mode 100644 index cd3b816..0000000 --- a/node_modules/eslint/conf/category-list.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "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:" } - ], - "deprecated": { - "name": "Deprecated", - "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:", - "rules": [ - { "removed": "generator-star", "replacedBy": ["generator-star-spacing"] }, - { "removed": "global-strict", "replacedBy": ["strict"] }, - { "removed": "no-arrow-condition", "replacedBy": ["no-confusing-arrow", "no-constant-condition"] }, - { "removed": "no-comma-dangle", "replacedBy": ["comma-dangle"] }, - { "removed": "no-empty-class", "replacedBy": ["no-empty-character-class"] }, - { "removed": "no-empty-label", "replacedBy": ["no-labels"] }, - { "removed": "no-extra-strict", "replacedBy": ["strict"] }, - { "removed": "no-reserved-keys", "replacedBy": ["quote-props"] }, - { "removed": "no-space-before-semi", "replacedBy": ["semi-spacing"] }, - { "removed": "no-wrap-func", "replacedBy": ["no-extra-parens"] }, - { "removed": "space-after-function-name", "replacedBy": ["space-before-function-paren"] }, - { "removed": "space-after-keywords", "replacedBy": ["keyword-spacing"] }, - { "removed": "space-before-function-parentheses", "replacedBy": ["space-before-function-paren"] }, - { "removed": "space-before-keywords", "replacedBy": ["keyword-spacing"] }, - { "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] }, - { "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] }, - { "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] }, - { "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] } - ] - } -} diff --git a/node_modules/eslint/conf/eslint-all.js b/node_modules/eslint/conf/eslint-all.js deleted file mode 100644 index 10c5304..0000000 --- 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/eslint-recommended.js b/node_modules/eslint/conf/eslint-recommended.js deleted file mode 100644 index 2137685..0000000 --- a/node_modules/eslint/conf/eslint-recommended.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @fileoverview Configuration applied when a user configuration extends from - * eslint:recommended. - * @author Nicholas C. Zakas - */ - -"use strict"; - -/* eslint sort-keys: ["error", "asc"] */ - -/** @type {import("../lib/shared/types").ConfigData} */ -module.exports = { - rules: { - "constructor-super": "error", - "for-direction": "error", - "getter-return": "error", - "no-async-promise-executor": "error", - "no-case-declarations": "error", - "no-class-assign": "error", - "no-compare-neg-zero": "error", - "no-cond-assign": "error", - "no-const-assign": "error", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-delete-var": "error", - "no-dupe-args": "error", - "no-dupe-class-members": "error", - "no-dupe-else-if": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-empty": "error", - "no-empty-character-class": "error", - "no-empty-pattern": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "error", - "no-extra-semi": "error", - "no-fallthrough": "error", - "no-func-assign": "error", - "no-global-assign": "error", - "no-import-assign": "error", - "no-inner-declarations": "error", - "no-invalid-regexp": "error", - "no-irregular-whitespace": "error", - "no-misleading-character-class": "error", - "no-mixed-spaces-and-tabs": "error", - "no-new-symbol": "error", - "no-obj-calls": "error", - "no-octal": "error", - "no-prototype-builtins": "error", - "no-redeclare": "error", - "no-regex-spaces": "error", - "no-self-assign": "error", - "no-setter-return": "error", - "no-shadow-restricted-names": "error", - "no-sparse-arrays": "error", - "no-this-before-super": "error", - "no-undef": "error", - "no-unexpected-multiline": "error", - "no-unreachable": "error", - "no-unsafe-finally": "error", - "no-unsafe-negation": "error", - "no-unused-labels": "error", - "no-unused-vars": "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/lib/api.js b/node_modules/eslint/lib/api.js index e4b6643..cbaac8f 100644 --- a/node_modules/eslint/lib/api.js +++ b/node_modules/eslint/lib/api.js @@ -5,30 +5,50 @@ "use strict"; -const { CLIEngine } = require("./cli-engine"); -const { ESLint } = require("./eslint"); +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +const { ESLint, FlatESLint } = require("./eslint"); +const { shouldUseFlatConfig } = require("./eslint/flat-eslint"); const { Linter } = require("./linter"); const { RuleTester } = require("./rule-tester"); const { SourceCode } = require("./source-code"); +//----------------------------------------------------------------------------- +// Functions +//----------------------------------------------------------------------------- + +/** + * Loads the correct ESLint constructor given the options. + * @param {Object} [options] The options object + * @param {boolean} [options.useFlatConfig] Whether or not to use a flat config + * @param {string} [options.cwd] The current working directory + * @returns {Promise} The ESLint constructor + */ +async function loadESLint({ useFlatConfig, cwd = process.cwd() } = {}) { + + /* + * Note: The v9.x version of this function doesn't have a cwd option + * because it's not used. It's only used in the v8.x version of this + * function. + */ + + const shouldESLintUseFlatConfig = typeof useFlatConfig === "boolean" + ? useFlatConfig + : await shouldUseFlatConfig({ cwd }); + + return shouldESLintUseFlatConfig ? FlatESLint : ESLint; +} + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + module.exports = { Linter, - CLIEngine, + loadESLint, 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 24f6a10..49c8902 100644 --- a/node_modules/eslint/lib/cli-engine/cli-engine.js +++ b/node_modules/eslint/lib/cli-engine/cli-engine.js @@ -41,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 @@ -51,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. @@ -81,7 +83,7 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]); * @property {string[]} [plugins] An array of plugins to load. * @property {Record} [rules] An object of rules to use. * @property {string[]} [rulePaths] An array of directories to load custom rules from. - * @property {boolean} [reportUnusedDisableDirectives] `true` adds reports for unused eslint-disable directives + * @property {boolean|string} [reportUnusedDisableDirectives] `true`, `"error"` or '"warn"' adds reports for unused eslint-disable directives * @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 {string} [resolvePluginsRelativeTo] The folder where plugins should be resolved from, defaulting to the CWD */ @@ -91,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. @@ -104,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. @@ -153,7 +158,17 @@ function validateFixTypes(fixTypes) { * @private */ function calculateStatsPerFile(messages) { - return messages.reduce((stat, message) => { + const stat = { + errorCount: 0, + fatalErrorCount: 0, + warningCount: 0, + fixableErrorCount: 0, + fixableWarningCount: 0 + }; + + for (let i = 0; i < messages.length; i++) { + const message = messages[i]; + if (message.fatal || message.severity === 2) { stat.errorCount++; if (message.fatal) { @@ -168,14 +183,8 @@ function calculateStatsPerFile(messages) { stat.fixableWarningCount++; } } - return stat; - }, { - errorCount: 0, - fatalErrorCount: 0, - warningCount: 0, - fixableErrorCount: 0, - fixableWarningCount: 0 - }); + } + return stat; } /** @@ -185,20 +194,25 @@ function calculateStatsPerFile(messages) { * @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; - }, { + const stat = { errorCount: 0, fatalErrorCount: 0, warningCount: 0, fixableErrorCount: 0, fixableWarningCount: 0 - }); + }; + + for (let i = 0; i < results.length; i++) { + const result = results[i]; + + stat.errorCount += result.errorCount; + stat.fatalErrorCount += result.fatalErrorCount; + stat.warningCount += result.warningCount; + stat.fixableErrorCount += result.fixableErrorCount; + stat.fixableWarningCount += result.fixableWarningCount; + } + + return stat; } /** @@ -210,7 +224,7 @@ function calculateStatsPerRun(results) { * @param {ConfigArray} config.config 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 {boolean|string} config.reportUnusedDisableDirectives If `true`, `"error"` or '"warn"', then it reports unused `eslint-disable` comments. * @param {FileEnumerator} config.fileEnumerator The file enumerator to check if a path is a target or not. * @param {Linter} config.linter The linter instance to verify. * @returns {LintResult} The result of linting. @@ -261,6 +275,7 @@ function verifyText({ const result = { filePath, messages, + suppressedMessages: linter.getSuppressedMessages(), ...calculateStatsPerFile(messages) }; @@ -280,7 +295,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 */ @@ -302,12 +317,16 @@ function createIgnoreResult(filePath, baseDir) { filePath: path.resolve(filePath), messages: [ { + ruleId: null, fatal: false, severity: 1, - message + message, + nodeType: null } ], + suppressedMessages: [], errorCount: 0, + fatalErrorCount: 0, warningCount: 1, fixableErrorCount: 0, fixableWarningCount: 0 @@ -331,6 +350,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. @@ -341,9 +377,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) { @@ -391,7 +425,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 @@ -463,6 +497,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) { @@ -526,6 +561,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) { @@ -543,13 +579,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, @@ -562,6 +603,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 @@ -578,8 +626,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, @@ -623,12 +671,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); } } @@ -654,11 +697,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, @@ -681,26 +726,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. @@ -730,6 +755,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) { @@ -936,6 +962,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) { @@ -984,7 +1011,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) { @@ -1004,7 +1032,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 { @@ -1019,7 +1047,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 ade2851..5dff8d0 100644 --- a/node_modules/eslint/lib/cli-engine/file-enumerator.js +++ b/node_modules/eslint/lib/cli-engine/file-enumerator.js @@ -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 41e3ab7..0000000 --- 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/html.js b/node_modules/eslint/lib/cli-engine/formatters/html.js index baddb63..1aa66fc 100644 --- a/node_modules/eslint/lib/cli-engine/formatters/html.js +++ b/node_modules/eslint/lib/cli-engine/formatters/html.js @@ -39,87 +39,114 @@ function pageTemplate(it) { ESLint Report + + @@ -149,7 +176,7 @@ function pageTemplate(it) { -`.trimLeft(); +`.trimStart(); } /** @@ -212,7 +239,7 @@ function messageTemplate(it) { } = it; return ` - + ${lineNumber}:${columnNumber} ${severityName} ${encodeHTML(message)} @@ -220,7 +247,7 @@ function messageTemplate(it) { ${ruleId ? ruleId : ""} -`.trimLeft(); +`.trimStart(); } /** @@ -278,11 +305,11 @@ function resultTemplate(it) { ${encodeHTML(summary)} -`.trimLeft(); +`.trimStart(); } -// eslint-disable-next-line jsdoc/require-description /** + * 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. 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 a74cce0..0000000 --- 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 354872a..e4148a3 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 6d7ef8b..8e46773 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 3304d42..97d2ee4 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) ); } @@ -128,16 +128,28 @@ class LintResultCache { return null; } - // If source is present but null, need to reread the file from the filesystem. - if ( - fileDescriptor.meta.results && - fileDescriptor.meta.results.source === null - ) { - debug(`Rereading cached result source from filesystem: ${filePath}`); - fileDescriptor.meta.results.source = fs.readFileSync(filePath, "utf-8"); + const cachedResults = fileDescriptor.meta.results; + + // Just in case, not sure if this can ever happen. + if (!cachedResults) { + return cachedResults; } - return fileDescriptor.meta.results; + /* + * Shallow clone the object to ensure that any properties added or modified afterwards + * will not be accidentally stored in the cache file when `reconcile()` is called. + * https://github.com/eslint/eslint/issues/13507 + * All intentional changes to the cache file must be done through `setCachedLintResults()`. + */ + const results = { ...cachedResults }; + + // If source is present but null, need to reread the file from the filesystem. + if (results.source === null) { + debug(`Rereading cached result source from filesystem: ${filePath}`); + results.source = fs.readFileSync(filePath, "utf-8"); + } + + return results; } /** diff --git a/node_modules/eslint/lib/cli-engine/xml-escape.js b/node_modules/eslint/lib/cli-engine/xml-escape.js index 175c2c0..2e52dba 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 477310d..1d909ec 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, shouldUseFlatConfig } = require("./eslint/flat-eslint"), + createCLIOptions = require("./options"), log = require("./shared/logging"), - RuntimeInfo = require("./shared/runtime-info"); + RuntimeInfo = require("./shared/runtime-info"), + { normalizeSeverityToString } = require("./shared/severity"); +const { Legacy: { naming } } = require("@eslint/eslintrc"); +const { ModuleImporter } = require("@humanwhocodes/module-importer"); const debug = require("debug")("eslint:cli"); @@ -33,6 +37,7 @@ const debug = require("debug")("eslint:cli"); /** @typedef {import("./eslint/eslint").LintMessage} LintMessage */ /** @typedef {import("./eslint/eslint").LintResult} LintResult */ /** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */ +/** @typedef {import("./shared/types").ResultsMeta} ResultsMeta */ //------------------------------------------------------------------------------ // Helpers @@ -54,17 +59,20 @@ function quietFixPredicate(message) { } /** - * Translates the CLI options into the options expected by the CLIEngine. + * Translates the CLI options into the options expected by the ESLint constructor. * @param {ParsedCLIOptions} cliOptions The CLI options to translate. - * @returns {ESLintOptions} The options object for the CLIEngine. + * @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, @@ -82,22 +90,73 @@ function translateOptions({ plugin, quiet, reportUnusedDisableDirectives, + reportUnusedDisableDirectivesSeverity, 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: { + rulesdir, + warnIgnored +}, 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 (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) { + overrideConfig[0].linterOptions = { + reportUnusedDisableDirectives: reportUnusedDisableDirectives + ? "error" + : normalizeSeverityToString(reportUnusedDisableDirectivesSeverity) + }; + } + + 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; @@ -115,19 +174,45 @@ 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 }; + + if (configType === "flat") { + options.ignorePatterns = ignorePattern; + options.warnIgnored = warnIgnored; + } else { + options.resolvePluginsRelativeTo = resolvePluginsRelativeTo; + options.rulePaths = rulesdir; + options.useEslintrc = eslintrc; + options.extensions = ext; + options.ignorePath = ignorePath; + if (reportUnusedDisableDirectives || reportUnusedDisableDirectivesSeverity !== void 0) { + options.reportUnusedDisableDirectives = reportUnusedDisableDirectives + ? "error" + : normalizeSeverityToString(reportUnusedDisableDirectivesSeverity); + } + } + + 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; @@ -165,10 +250,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 { @@ -178,7 +264,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) { @@ -218,20 +304,42 @@ 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 = allowFlatConfig && await shouldUseFlatConfig(); + + debug("Using flat config?", usingFlatConfig); + + const CLIOptions = createCLIOptions(usingFlatConfig); + /** @type {ParsedCLIOptions} */ let options; try { options = CLIOptions.parse(args); } catch (error) { - log.error(error.message); + debug("Error parsing CLI options:", error.message); + + let errorMessage = error.message; + + if (usingFlatConfig) { + errorMessage += "\nYou're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details."; + } + + log.error(errorMessage); return 2; } @@ -251,6 +359,7 @@ const cli = { log.info(RuntimeInfo.environment()); return 0; } catch (err) { + debug("Error retrieving environment info"); log.error(err.message); return 2; } @@ -266,7 +375,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); @@ -289,13 +400,22 @@ const cli = { return 2; } - const engine = new ESLint(translateOptions(options)); + if (options.reportUnusedDisableDirectives && options.reportUnusedDisableDirectivesSeverity !== void 0) { + log.error("The --report-unused-disable-directives option and the --report-unused-disable-directives-severity option cannot be used together."); + return 2; + } + + const ActiveESLint = usingFlatConfig ? FlatESLint : ESLint; + + const engine = new ActiveESLint(await translateOptions(options, usingFlatConfig ? "flat" : "eslintrc")); let results; if (useStdin) { results = await engine.lintText(text, { filePath: options.stdinFilename, - warnIgnored: true + + // flatConfig respects CLI flag and constructor warnIgnored, eslintrc forces true for backwards compatibility + warnIgnored: usingFlatConfig ? void 0 : true }); } else { results = await engine.lintFiles(files); @@ -303,27 +423,34 @@ 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"); - resultsToPrint = ESLint.getErrorResults(resultsToPrint); + resultsToPrint = ActiveESLint.getErrorResults(resultsToPrint); } - if (await printResults(engine, resultsToPrint, options.format, options.outputFile)) { + 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)) { // Errors and warnings from the original unfiltered results should determine the exit code - const { errorCount, fatalErrorCount, warningCount } = countErrors(results); - - const tooManyWarnings = - options.maxWarnings >= 0 && warningCount > options.maxWarnings; const shouldExitForFatalErrors = - options.exitOnFatalError && fatalErrorCount > 0; + options.exitOnFatalError && resultCounts.fatalErrorCount > 0; - if (!errorCount && tooManyWarnings) { + if (!resultCounts.errorCount && tooManyWarnings) { log.error( "ESLint found too many warnings (maximum: %s).", options.maxWarnings @@ -334,7 +461,7 @@ const cli = { return 2; } - return (errorCount || tooManyWarnings) ? 1 : 0; + 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 index cb6f403..8a6ff82 100644 --- a/node_modules/eslint/lib/config/default-config.js +++ b/node_modules/eslint/lib/config/default-config.js @@ -15,18 +15,14 @@ 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 + * 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. */ @@ -41,12 +37,31 @@ exports.defaultConfig = [ }) } }, - ignores: [ - "**/node_modules/**", - ".git/**" - ], languageOptions: { - parser: "@/espree" + sourceType: "module", + ecmaVersion: "latest", + parser: require("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 index ecf396a..689dc42 100644 --- a/node_modules/eslint/lib/config/flat-config-array.js +++ b/node_modules/eslint/lib/config/flat-config-array.js @@ -13,8 +13,7 @@ const { ConfigArray, ConfigArraySymbol } = require("@humanwhocodes/config-array" const { flatConfigSchema } = require("./flat-config-schema"); const { RuleValidator } = require("./rule-validator"); const { defaultConfig } = require("./default-config"); -const recommendedConfig = require("../../conf/eslint-recommended"); -const allConfig = require("../../conf/eslint-all"); +const jsPlugin = require("@eslint/js"); //----------------------------------------------------------------------------- // Helpers @@ -37,6 +36,47 @@ function splitPluginIdentifier(identifier) { }; } +/** + * 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 //----------------------------------------------------------------------------- @@ -49,19 +89,43 @@ class FlatConfigArray extends ConfigArray { /** * Creates a new instance. * @param {*[]} configs An array of configuration information. - * @param {{basePath: string, baseConfig: FlatConfig}} options The options + * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options * to use for the config array instance. */ - constructor(configs, { basePath, baseConfig = defaultConfig }) { + constructor(configs, { + basePath, + shouldIgnore = true, + baseConfig = defaultConfig + } = {}) { super(configs, { basePath, schema: flatConfigSchema }); - this.unshift(baseConfig); + 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 */ + /* 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 @@ -71,11 +135,40 @@ class FlatConfigArray extends ConfigArray { */ [ConfigArraySymbol.preprocessConfig](config) { if (config === "eslint:recommended") { - return recommendedConfig; + + // 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") { - return allConfig; + + // 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; @@ -91,34 +184,90 @@ class FlatConfigArray extends ConfigArray { [ConfigArraySymbol.finalizeConfig](config) { const { plugins, languageOptions, processor } = config; + let parserName, processorName; + let invalidParser = false, + invalidProcessor = false; // Check parser value - if (languageOptions && languageOptions.parser && typeof languageOptions.parser === "string") { - const { pluginName, objectName: parserName } = splitPluginIdentifier(languageOptions.parser); + if (languageOptions && languageOptions.parser) { + const { parser } = languageOptions; - if (!plugins || !plugins[pluginName] || !plugins[pluginName].parsers || !plugins[pluginName].parsers[parserName]) { - throw new TypeError(`Key "parser": Could not find "${parserName}" in plugin "${pluginName}".`); + if (typeof parser === "object") { + parserName = getObjectId(parser); + + if (!parserName) { + invalidParser = true; + } + + } else { + invalidParser = true; } - - languageOptions.parser = plugins[pluginName].parsers[parserName]; } // Check processor value - if (processor && typeof processor === "string") { - const { pluginName, objectName: processorName } = splitPluginIdentifier(processor); + if (processor) { + if (typeof processor === "string") { + const { pluginName, objectName: localProcessorName } = splitPluginIdentifier(processor); - if (!plugins || !plugins[pluginName] || !plugins[pluginName].processors || !plugins[pluginName].processors[processorName]) { - throw new TypeError(`Key "processor": Could not find "${processorName}" in plugin "${pluginName}".`); + 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; } - - config.processor = plugins[pluginName].processors[processorName]; } 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.entries(plugins).map(([namespace, plugin]) => { + + const pluginId = getObjectId(plugin); + + if (!pluginId) { + return namespace; + } + + return `${namespace}:${pluginId}`; + }), + languageOptions: { + ...languageOptions, + parser: parserName + }, + processor: processorName + }; + } + }); + /* eslint-enable object-shorthand -- ok to enable now */ + return config; } - /* eslint-enable class-methods-use-this */ + /* eslint-enable class-methods-use-this -- Desired as instance method */ } diff --git a/node_modules/eslint/lib/config/flat-config-schema.js b/node_modules/eslint/lib/config/flat-config-schema.js index 8078547..6b64319 100644 --- a/node_modules/eslint/lib/config/flat-config-schema.js +++ b/node_modules/eslint/lib/config/flat-config-schema.js @@ -5,6 +5,17 @@ "use strict"; +//----------------------------------------------------------------------------- +// Requirements +//----------------------------------------------------------------------------- + +/* + * Note: This can be removed in ESLint v9 because structuredClone is available globally + * starting in Node.js v17. + */ +const structuredClone = require("@ungap/structured-clone").default; +const { normalizeSeverityToNumber } = require("../shared/severity"); + //----------------------------------------------------------------------------- // Type Definitions //----------------------------------------------------------------------------- @@ -42,6 +53,15 @@ function isNonNullObject(value) { return typeof value === "object" && value !== null; } +/** + * Check if a value is a non-null non-array object. + * @param {any} value The value to check. + * @returns {boolean} `true` if the value is a non-null non-array object. + */ +function isNonArrayObject(value) { + return isNonNullObject(value) && !Array.isArray(value); +} + /** * Check if a value is undefined. * @param {any} value The value to check. @@ -52,19 +72,27 @@ function isUndefined(value) { } /** - * Deeply merges two objects. + * Deeply merges two non-array objects. * @param {Object} first The base object. * @param {Object} second The overrides object. + * @param {Map>} [mergeMap] Maps the combination of first and second arguments to a merged result. * @returns {Object} An object with properties from both first and second. */ -function deepMerge(first = {}, second = {}) { +function deepMerge(first, second, mergeMap = new Map()) { - /* - * 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; + let secondMergeMap = mergeMap.get(first); + + if (secondMergeMap) { + const result = secondMergeMap.get(second); + + if (result) { + + // If this combination of first and second arguments has been already visited, return the previously created result. + return result; + } + } else { + secondMergeMap = new Map(); + mergeMap.set(first, secondMergeMap); } /* @@ -78,27 +106,25 @@ function deepMerge(first = {}, second = {}) { ...second }; + delete result.__proto__; // eslint-disable-line no-proto -- don't merge own property "__proto__" + + // Store the pending result for this combination of first and second arguments. + secondMergeMap.set(second, result); + for (const key of Object.keys(second)) { // avoid hairy edge case - if (key === "__proto__") { + if (key === "__proto__" || !Object.prototype.propertyIsEnumerable.call(first, key)) { 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; - } + if (isNonArrayObject(firstValue) && isNonArrayObject(secondValue)) { + result[key] = deepMerge(firstValue, secondValue, mergeMap); + } else if (isUndefined(secondValue)) { + result[key] = firstValue; } } @@ -119,39 +145,70 @@ function normalizeRuleOptions(ruleOptions) { : [ruleOptions]; finalOptions[0] = ruleSeverities.get(finalOptions[0]); - return finalOptions; + return structuredClone(finalOptions); } //----------------------------------------------------------------------------- // Assertions //----------------------------------------------------------------------------- +/** + * The error type when a rule's options are configured with an invalid type. + */ +class InvalidRuleOptionsError extends Error { + + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-options"; + this.messageData = { ruleId, value }; + } +} + /** * Validates that a value is a valid rule options entry. + * @param {string} ruleId Rule name being configured. * @param {any} value The value to check. * @returns {void} - * @throws {TypeError} If the value isn't a valid rule options. + * @throws {InvalidRuleOptionsError} If the value isn't a valid rule options. */ -function assertIsRuleOptions(value) { - +function assertIsRuleOptions(ruleId, value) { if (typeof value !== "string" && typeof value !== "number" && !Array.isArray(value)) { - throw new TypeError("Expected a string, number, or array."); + throw new InvalidRuleOptionsError(ruleId, value); + } +} + +/** + * The error type when a rule's severity is invalid. + */ +class InvalidRuleSeverityError extends Error { + + /** + * @param {string} ruleId Rule name being configured. + * @param {any} value The invalid value. + */ + constructor(ruleId, value) { + super(`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`); + this.messageTemplate = "invalid-rule-severity"; + this.messageData = { ruleId, value }; } } /** * Validates that a value is valid rule severity. + * @param {string} ruleId Rule name being configured. * @param {any} value The value to check. * @returns {void} - * @throws {TypeError} If the value isn't a valid rule severity. + * @throws {InvalidRuleSeverityError} If the value isn't a valid rule severity. */ -function assertIsRuleSeverity(value) { - const severity = typeof value === "string" - ? ruleSeverities.get(value.toLowerCase()) - : ruleSeverities.get(value); +function assertIsRuleSeverity(ruleId, value) { + const severity = ruleSeverities.get(value); if (typeof severity === "undefined") { - throw new TypeError("Expected severity of \"off\", 0, \"warn\", 1, \"error\", or 2."); + throw new InvalidRuleSeverityError(ruleId, value); } } @@ -180,34 +237,67 @@ function assertIsObject(value) { } /** - * 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. + * The error type when there's an eslintrc-style options in a flat config. */ -function assertIsObjectOrString(value) { - if ((!value || typeof value !== "object") && typeof value !== "string") { - throw new TypeError("Expected an object or string."); +class IncompatibleKeyError extends Error { + + /** + * @param {string} key The invalid key. + */ + constructor(key) { + super("This appears to be in eslintrc format rather than flat config format."); + this.messageTemplate = "eslintrc-incompat"; + this.messageData = { key }; } } +/** + * The error type when there's an eslintrc-style plugins array found. + */ +class IncompatiblePluginsError extends Error { + + /** + * Creates a new instance. + * @param {Array} plugins The plugins array. + */ + constructor(plugins) { + super("This appears to be in eslintrc format (array of strings) rather than flat config format (object)."); + this.messageTemplate = "eslintrc-plugins"; + this.messageData = { plugins }; + } +} + + //----------------------------------------------------------------------------- // Low-Level Schemas //----------------------------------------------------------------------------- - -/** @type {ObjectPropertySchema} */ -const numberSchema = { - merge: "replace", - validate: "number" -}; - /** @type {ObjectPropertySchema} */ const booleanSchema = { merge: "replace", validate: "boolean" }; +const ALLOWED_SEVERITIES = new Set(["error", "warn", "off", 2, 1, 0]); + +/** @type {ObjectPropertySchema} */ +const disableDirectiveSeveritySchema = { + merge(first, second) { + const value = second === void 0 ? first : second; + + if (typeof value === "boolean") { + return value ? "warn" : "off"; + } + + return normalizeSeverityToNumber(value); + }, + validate(value) { + if (!(ALLOWED_SEVERITIES.has(value) || typeof value === "boolean")) { + throw new TypeError("Expected one of: \"error\", \"warn\", \"off\", 0, 1, 2, or a boolean."); + } + } +}; + /** @type {ObjectPropertySchema} */ const deepObjectAssignSchema = { merge(first = {}, second = {}) { @@ -249,15 +339,13 @@ const globalsSchema = { 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 (!value || typeof value !== "object" || + (typeof value.parse !== "function" && typeof value.parseForESLint !== "function") + ) { + throw new TypeError("Expected object with parse() or parseForESLint() method."); } - if (typeof value === "string") { - assertIsPluginMemberName(value); - } } }; @@ -291,6 +379,11 @@ const pluginsSchema = { throw new TypeError("Expected an object."); } + // make sure it's not an array, which would mean eslintrc-style is used + if (Array.isArray(value)) { + throw new IncompatiblePluginsError(value); + } + // second check the keys to make sure they are objects for (const key of Object.keys(value)) { @@ -331,90 +424,100 @@ const rulesSchema = { ...second }; + for (const ruleId of Object.keys(result)) { - // avoid hairy edge case - if (ruleId === "__proto__") { + try { - /* eslint-disable-next-line no-proto */ - delete result.__proto__; - continue; + // 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. + */ + } catch (ex) { + throw new Error(`Key "${ruleId}": ${ex.message}`, { cause: ex }); } - 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; + /* + * 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)) { - // 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); - } + // avoid hairy edge case + if (ruleId === "__proto__") { + continue; + } + + const ruleOptions = value[ruleId]; + + assertIsRuleOptions(ruleId, ruleOptions); + + if (Array.isArray(ruleOptions)) { + assertIsRuleSeverity(ruleId, ruleOptions[0]); + } else { + assertIsRuleSeverity(ruleId, 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", @@ -425,21 +528,54 @@ const sourceTypeSchema = { } }; +/** + * Creates a schema that always throws an error. Useful for warning + * about eslintrc-style keys. + * @param {string} key The eslintrc key to create a schema for. + * @returns {ObjectPropertySchema} The schema. + */ +function createEslintrcErrorSchema(key) { + return { + merge: "replace", + validate() { + throw new IncompatibleKeyError(key); + } + }; +} + +const eslintrcKeys = [ + "env", + "extends", + "globals", + "ignorePatterns", + "noInlineConfig", + "overrides", + "parser", + "parserOptions", + "reportUnusedDisableDirectives", + "root" +]; + //----------------------------------------------------------------------------- // Full schema //----------------------------------------------------------------------------- -exports.flatConfigSchema = { +const flatConfigSchema = { + + // eslintrc-style keys that should always error + ...Object.fromEntries(eslintrcKeys.map(key => [key, createEslintrcErrorSchema(key)])), + + // flat config keys settings: deepObjectAssignSchema, linterOptions: { schema: { noInlineConfig: booleanSchema, - reportUnusedDisableDirectives: booleanSchema + reportUnusedDisableDirectives: disableDirectiveSeveritySchema } }, languageOptions: { schema: { - ecmaVersion: numberSchema, + ecmaVersion: ecmaVersionSchema, sourceType: sourceTypeSchema, globals: globalsSchema, parser: parserSchema, @@ -450,3 +586,13 @@ exports.flatConfigSchema = { plugins: pluginsSchema, rules: rulesSchema }; + +//----------------------------------------------------------------------------- +// Exports +//----------------------------------------------------------------------------- + +module.exports = { + flatConfigSchema, + assertIsRuleSeverity, + assertIsRuleOptions +}; diff --git a/node_modules/eslint/lib/config/rule-validator.js b/node_modules/eslint/lib/config/rule-validator.js index f162dd8..eee5b40 100644 --- a/node_modules/eslint/lib/config/rule-validator.js +++ b/node_modules/eslint/lib/config/rule-validator.js @@ -9,75 +9,61 @@ // Requirements //----------------------------------------------------------------------------- -const ajv = require("../shared/ajv")(); +const ajvImport = require("../shared/ajv"); +const ajv = ajvImport(); +const { + parseRuleId, + getRuleFromConfig, + getRuleOptionsSchema +} = require("./flat-config-helpers"); +const ruleReplacements = require("../../conf/replacements.json"); //----------------------------------------------------------------------------- // Helpers //----------------------------------------------------------------------------- /** - * Finds a rule with the given ID in the given config. - * @param {string} ruleId The ID of the rule to find. + * 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. - * @returns {{create: Function, schema: (Array|null)}} THe rule object. + * @throws {TypeError} For missing plugin or rule. + * @returns {void} */ -function findRuleDefinition(ruleId, config) { - const ruleIdParts = ruleId.split("/"); - let pluginName, ruleName; +function throwRuleNotFoundError({ pluginName, ruleName }, config) { - // built-in rule - if (ruleIdParts.length === 1) { - pluginName = "@"; - ruleName = ruleIdParts[0]; - } else { - ruleName = ruleIdParts.pop(); - pluginName = ruleIdParts.join("/"); - } + const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`; - if (!config.plugins || !config.plugins[pluginName]) { - throw new TypeError(`Key "rules": Key "${ruleId}": Could not find plugin "${pluginName}".`); - } + const errorMessageHeader = `Key "rules": Key "${ruleId}"`; + let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}".`; - if (!config.plugins[pluginName].rules || !config.plugins[pluginName].rules[ruleName]) { - throw new TypeError(`Key "rules": Key "${ruleId}": Could not find "${ruleName}" in 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]; - return config.plugins[pluginName].rules[ruleName]; + if (pluginName === "@" && replacementRuleName) { -} + errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`; -/** - * 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) { + } else { - if (!rule) { - return null; - } + errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`; - const schema = rule.schema || rule.meta && rule.meta.schema; + // 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; + } + } - if (Array.isArray(schema)) { - if (schema.length) { - return { - type: "array", - items: schema, - minItems: 0, - maxItems: schema.length - }; } - return { - type: "array", - minItems: 0, - maxItems: 0 - }; + // falls through to throw error } - // Given a full schema, leave it alone - return schema || null; + throw new TypeError(errorMessage); } //----------------------------------------------------------------------------- @@ -98,7 +84,6 @@ class RuleValidator { * A collection of compiled validators for rules that have already * been validated. * @type {WeakMap} - * @property validators */ this.validators = new WeakMap(); } @@ -137,7 +122,11 @@ class RuleValidator { continue; } - const rule = findRuleDefinition(ruleId, config); + const rule = getRuleFromConfig(ruleId, config); + + if (!rule) { + throwRuleNotFoundError(parseRuleId(ruleId), config); + } // Precompile and cache validator the first time if (!this.validators.has(rule)) { diff --git a/node_modules/eslint/lib/eslint/eslint.js b/node_modules/eslint/lib/eslint/eslint.js index 056e04b..7085d5a 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."); @@ -294,7 +289,7 @@ function processOptions({ cacheLocation, cacheStrategy, configFile: overrideConfigFile, - cwd, + cwd: path.normalize(cwd), errorOnUnmatchedPattern, extensions, fix, @@ -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 @@ -529,6 +514,9 @@ class ESLint { 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 @@ -612,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. */ @@ -626,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") { @@ -637,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()); @@ -689,6 +682,13 @@ class ESLint { } } +/** + * The type of configuration used by this class. + * @type {string} + * @static + */ +ESLint.configType = "eslintrc"; + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ diff --git a/node_modules/eslint/lib/eslint/index.js b/node_modules/eslint/lib/eslint/index.js index c9185ee..017b768 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 054c538..0000000 --- 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 equal = require("fast-deep-equal"), - 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 (equal(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 4c648ac..0000000 --- a/node_modules/eslint/lib/init/config-file.js +++ /dev/null @@ -1,144 +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": - case ".cjs": - 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 3c7f2ba..0000000 --- a/node_modules/eslint/lib/init/config-initializer.js +++ /dev/null @@ -1,704 +0,0 @@ -/** - * @fileoverview Config initialization wizard. - * @author Ilya Volodin - */ - - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const util = require("util"), - path = require("path"), - fs = require("fs"), - 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"; - } else if (format === "JavaScript") { - const pkgJSONPath = npmUtils.findPackageJson(); - - if (pkgJSONPath) { - const pkgJSONContents = JSON.parse(fs.readFileSync(pkgJSONPath, "utf8")); - - if (pkgJSONContents.type === "module") { - extname = ".cjs"; - } - } - } - - 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" }, - { message: "XO: https://github.com/xojs/eslint-config-xo", name: "xo" } - ], - 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, - writeFile, - /* 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 7aec89c..0000000 --- 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 b91a824..0000000 --- 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, - findPackageJson, - 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 dca6541..0000000 --- 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 0ba69ca..c5e3c9d 100644 --- a/node_modules/eslint/lib/linter/apply-disable-directives.js +++ b/node_modules/eslint/lib/linter/apply-disable-directives.js @@ -5,6 +5,18 @@ "use strict"; +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").LintMessage} LintMessage */ + +//------------------------------------------------------------------------------ +// Module Definition +//------------------------------------------------------------------------------ + +const escapeRegExp = require("escape-string-regexp"); + /** * Compares the locations of two objects in a source file * @param {{line: number, column: number}} itemA The first object @@ -16,6 +28,266 @@ 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 {Iterable} 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)}\k(?:\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 {Iterable} allDirectives Unused directives to be removed. + * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems. + */ +function processUnusedDirectives(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)]; + } + ); +} + +/** + * Collect eslint-enable comments that are removing suppressions by eslint-disable comments. + * @param {Directive[]} directives The directives to check. + * @returns {Set} The used eslint-enable comments + */ +function collectUsedEnableDirectives(directives) { + + /** + * A Map of `eslint-enable` keyed by ruleIds that may be marked as used. + * If `eslint-enable` does not have a ruleId, the key will be `null`. + * @type {Map} + */ + const enabledRules = new Map(); + + /** + * A Set of `eslint-enable` marked as used. + * It is also the return value of `collectUsedEnableDirectives` function. + * @type {Set} + */ + const usedEnableDirectives = new Set(); + + /* + * Checks the directives backwards to see if the encountered `eslint-enable` is used by the previous `eslint-disable`, + * and if so, stores the `eslint-enable` in `usedEnableDirectives`. + */ + for (let index = directives.length - 1; index >= 0; index--) { + const directive = directives[index]; + + if (directive.type === "disable") { + if (enabledRules.size === 0) { + continue; + } + if (directive.ruleId === null) { + + // If encounter `eslint-disable` without ruleId, + // mark all `eslint-enable` currently held in enabledRules as used. + // e.g. + // /* eslint-disable */ <- current directive + // /* eslint-enable rule-id1 */ <- used + // /* eslint-enable rule-id2 */ <- used + // /* eslint-enable */ <- used + for (const enableDirective of enabledRules.values()) { + usedEnableDirectives.add(enableDirective); + } + enabledRules.clear(); + } else { + const enableDirective = enabledRules.get(directive.ruleId); + + if (enableDirective) { + + // If encounter `eslint-disable` with ruleId, and there is an `eslint-enable` with the same ruleId in enabledRules, + // mark `eslint-enable` with ruleId as used. + // e.g. + // /* eslint-disable rule-id */ <- current directive + // /* eslint-enable rule-id */ <- used + usedEnableDirectives.add(enableDirective); + } else { + const enabledDirectiveWithoutRuleId = enabledRules.get(null); + + if (enabledDirectiveWithoutRuleId) { + + // If encounter `eslint-disable` with ruleId, and there is no `eslint-enable` with the same ruleId in enabledRules, + // mark `eslint-enable` without ruleId as used. + // e.g. + // /* eslint-disable rule-id */ <- current directive + // /* eslint-enable */ <- used + usedEnableDirectives.add(enabledDirectiveWithoutRuleId); + } + } + } + } else if (directive.type === "enable") { + if (directive.ruleId === null) { + + // If encounter `eslint-enable` without ruleId, the `eslint-enable` that follows it are unused. + // So clear enabledRules. + // e.g. + // /* eslint-enable */ <- current directive + // /* eslint-enable rule-id *// <- unused + // /* eslint-enable */ <- unused + enabledRules.clear(); + enabledRules.set(null, directive); + } else { + enabledRules.set(directive.ruleId, directive); + } + } + } + return usedEnableDirectives; +} + /** * 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 @@ -23,120 +295,132 @@ function compareLocations(itemA, itemB) { * @param {Object} options options for applying directives. This is the same as the options * 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 + * @returns {{problems: LintMessage[], unusedDirectives: LintMessage[]}} An object with a list + * 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; + if (directive.ruleId === null || directive.ruleId === problem.ruleId) { + switch (directive.type) { + case "disable": + disableDirectivesForProblem.push(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; + case "enable": + disableDirectivesForProblem = []; + break; - // no default + // 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 unusedDisableDirectivesToReport = options.directives + .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive)); + + + const unusedEnableDirectivesToReport = new Set( + options.directives.filter(directive => directive.unprocessedDirective.type === "enable") + ); + + /* + * If directives has the eslint-enable directive, + * check whether the eslint-enable comment is used. + */ + if (unusedEnableDirectivesToReport.size > 0) { + for (const directive of collectUsedEnableDirectives(options.directives)) { + unusedEnableDirectivesToReport.delete(directive); } } - 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 processed = processUnusedDirectives(unusedDisableDirectivesToReport) + .concat(processUnusedDirectives(unusedEnableDirectivesToReport)); - return { problems, unusedDisableDirectives }; + const unusedDirectives = processed + .map(({ description, fix, unprocessedDirective }) => { + const { parentComment, type, line, column } = unprocessedDirective; + + let message; + + if (type === "enable") { + message = description + ? `Unused eslint-enable directive (no matching eslint-disable directives were found for ${description}).` + : "Unused eslint-enable directive (no matching eslint-disable directives were found)."; + } else { + message = description + ? `Unused eslint-disable directive (no problems were reported from ${description}).` + : "Unused eslint-disable directive (no problems were reported)."; + } + return { + ruleId: null, + message, + 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, unusedDirectives }; } /** * 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); - /** - * Returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. - * TODO(stephenwade): Replace this with array.flatMap when we drop support for Node v10 - * @param {any[]} array The array to process - * @param {Function} fn The function to use - * @returns {any[]} The result array - */ - function flatMap(array, fn) { - const mapped = array.map(fn); - const flattened = [].concat(...mapped); - - return flattened; - } - - const lineDirectives = flatMap(directives, directive => { + const lineDirectives = directives.flatMap(directive => { switch (directive.type) { case "disable": case "enable": @@ -162,18 +446,20 @@ module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off" const blockDirectivesResult = applyDirectives({ problems, directives: blockDirectives, + disableFixes, reportUnusedDisableDirectives }); const lineDirectivesResult = applyDirectives({ problems: blockDirectivesResult.problems, directives: lineDirectives, + disableFixes, reportUnusedDisableDirectives }); return reportUnusedDisableDirectives !== "off" ? lineDirectivesResult.problems - .concat(blockDirectivesResult.unusedDisableDirectives) - .concat(lineDirectivesResult.unusedDisableDirectives) + .concat(blockDirectivesResult.unusedDirectives) + .concat(lineDirectivesResult.unusedDirectives) .sort(compareLocations) : lineDirectivesResult.problems; }; 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 47427c1..b60e55c 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 || @@ -179,15 +192,18 @@ function forwardCurrentToHead(analyzer, node) { headSegment = headSegments[i]; if (currentSegment !== headSegment && currentSegment) { - debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); - if (currentSegment.reachable) { - analyzer.emitter.emit( - "onCodePathSegmentEnd", - currentSegment, - node - ); - } + const eventName = currentSegment.reachable + ? "onCodePathSegmentEnd" + : "onUnreachableCodePathSegmentEnd"; + + debug.dump(`${eventName} ${currentSegment.id}`); + + analyzer.emitter.emit( + eventName, + currentSegment, + node + ); } } @@ -200,16 +216,19 @@ function forwardCurrentToHead(analyzer, node) { headSegment = headSegments[i]; if (currentSegment !== headSegment && headSegment) { - debug.dump(`onCodePathSegmentStart ${headSegment.id}`); + + const eventName = headSegment.reachable + ? "onCodePathSegmentStart" + : "onUnreachableCodePathSegmentStart"; + + debug.dump(`${eventName} ${headSegment.id}`); CodePathSegment.markUsed(headSegment); - if (headSegment.reachable) { - analyzer.emitter.emit( - "onCodePathSegmentStart", - headSegment, - node - ); - } + analyzer.emitter.emit( + eventName, + headSegment, + node + ); } } @@ -228,15 +247,17 @@ function leaveFromCurrentSegment(analyzer, node) { for (let i = 0; i < currentSegments.length; ++i) { const currentSegment = currentSegments[i]; + const eventName = currentSegment.reachable + ? "onCodePathSegmentEnd" + : "onUnreachableCodePathSegmentEnd"; - debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`); - if (currentSegment.reachable) { - analyzer.emitter.emit( - "onCodePathSegmentEnd", - currentSegment, - node - ); - } + debug.dump(`${eventName} ${currentSegment.id}`); + + analyzer.emitter.emit( + eventName, + currentSegment, + node + ); } state.currentSegments = []; @@ -388,29 +409,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) { + startCodePath("function"); + break; - // 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); - - // 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 +563,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 +688,39 @@ function processCodePathToExit(analyzer, node) { * @returns {void} */ function postprocess(analyzer, node) { + + /** + * 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 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); + } + + } + 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(); - - // 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); - - codePath = analyzer.codePath = analyzer.codePath.upper; - if (codePath) { - debug.dumpState(node, CodePath.getState(codePath), true); - } + case "ArrowFunctionExpression": + case "StaticBlock": { + endCodePath(); break; } @@ -662,6 +734,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 +767,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 ca96ad3..3b8dbb4 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 @@ -1,5 +1,5 @@ /** - * @fileoverview A class of the code path segment. + * @fileoverview The CodePathSegment class. * @author Toru Nagashima */ @@ -30,11 +30,22 @@ function isReachable(segment) { /** * A code path segment. + * + * Each segment is arranged in a series of linked lists (implemented by arrays) + * that keep track of the previous and next segments in a code path. In this way, + * you can navigate between all segments in any code path so long as you have a + * reference to any segment in that code path. + * + * When first created, the segment is in a detached state, meaning that it knows the + * segments that came before it but those segments don't know that this new segment + * follows it. Only when `CodePathSegment#markUsed()` is called on a segment does it + * officially become part of the code path by updating the previous segments to know + * that this new segment follows. */ class CodePathSegment { - // eslint-disable-next-line jsdoc/require-description /** + * Creates a new instance. * @param {string} id An identifier. * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * This array includes unreachable segments. @@ -50,27 +61,25 @@ class CodePathSegment { this.id = id; /** - * An array of the next segments. + * An array of the next reachable segments. * @type {CodePathSegment[]} */ this.nextSegments = []; /** - * An array of the previous segments. + * An array of the previous reachable segments. * @type {CodePathSegment[]} */ this.prevSegments = allPrevSegments.filter(isReachable); /** - * An array of the next segments. - * This array includes unreachable segments. + * An array of all next segments including reachable and unreachable. * @type {CodePathSegment[]} */ this.allNextSegments = []; /** - * An array of the previous segments. - * This array includes unreachable segments. + * An array of all previous segments including reachable and unreachable. * @type {CodePathSegment[]} */ this.allPrevSegments = allPrevSegments; @@ -84,15 +93,19 @@ class CodePathSegment { // Internal data. Object.defineProperty(this, "internal", { value: { + + // determines if the segment has been attached to the code path used: false, + + // array of previous segments coming from the end of a loop loopedPrevSegments: [] } }); - /* istanbul ignore if */ + /* c8 ignore start */ if (debug.enabled) { this.internal.nodes = []; - } + }/* c8 ignore stop */ } /** @@ -101,7 +114,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); } /** @@ -114,9 +127,10 @@ class CodePathSegment { } /** - * Creates a segment that follows given segments. + * Creates a new segment and appends it after the given segments. * @param {string} id An identifier. - * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. + * @param {CodePathSegment[]} allPrevSegments An array of the previous segments + * to append to. * @returns {CodePathSegment} The created segment. */ static newNext(id, allPrevSegments) { @@ -128,7 +142,7 @@ class CodePathSegment { } /** - * Creates an unreachable segment that follows given segments. + * Creates an unreachable segment and appends it after the given segments. * @param {string} id An identifier. * @param {CodePathSegment[]} allPrevSegments An array of the previous segments. * @returns {CodePathSegment} The created segment. @@ -138,7 +152,7 @@ class CodePathSegment { /* * In `if (a) return a; foo();` case, the unreachable segment preceded by - * the return statement is not used but must not be remove. + * the return statement is not used but must not be removed. */ CodePathSegment.markUsed(segment); @@ -158,7 +172,7 @@ class CodePathSegment { } /** - * Makes a given segment being used. + * Marks a given segment as used. * * And this function registers the segment into the previous segments as a next. * @param {CodePathSegment} segment A segment to mark. @@ -173,6 +187,13 @@ class CodePathSegment { let i; if (segment.reachable) { + + /* + * If the segment is reachable, then it's officially part of the + * code path. This loops through all previous segments to update + * their list of next segments. Because the segment is reachable, + * it's added to both `nextSegments` and `allNextSegments`. + */ for (i = 0; i < segment.allPrevSegments.length; ++i) { const prevSegment = segment.allPrevSegments[i]; @@ -180,6 +201,13 @@ class CodePathSegment { prevSegment.nextSegments.push(segment); } } else { + + /* + * If the segment is not reachable, then it's not officially part of the + * code path. This loops through all previous segments to update + * their list of next segments. Because the segment is not reachable, + * it's added only to `allNextSegments`. + */ for (i = 0; i < segment.allPrevSegments.length; ++i) { segment.allPrevSegments[i].allNextSegments.push(segment); } @@ -197,19 +225,20 @@ class CodePathSegment { } /** - * Replaces unused segments with the previous segments of each unused segment. - * @param {CodePathSegment[]} segments An array of segments to replace. - * @returns {CodePathSegment[]} The replaced array. + * Creates a new array based on an array of segments. If any segment in the + * array is unused, then it is replaced by all of its previous segments. + * All used segments are returned as-is without replacement. + * @param {CodePathSegment[]} segments The array of segments to flatten. + * @returns {CodePathSegment[]} The flattened array. */ static flattenUnusedSegments(segments) { - const done = Object.create(null); - const retv = []; + const done = new Set(); for (let i = 0; i < segments.length; ++i) { const segment = segments[i]; // Ignores duplicated. - if (done[segment.id]) { + if (done.has(segment)) { continue; } @@ -218,18 +247,16 @@ class CodePathSegment { for (let j = 0; j < segment.allPrevSegments.length; ++j) { const prevSegment = segment.allPrevSegments[j]; - if (!done[prevSegment.id]) { - done[prevSegment.id] = true; - retv.push(prevSegment); + if (!done.has(prevSegment)) { + done.add(prevSegment); } } } else { - done[segment.id] = true; - retv.push(segment); + done.add(segment); } } - return retv; + return [...done]; } } 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 f75e60e..2b0dc2b 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 @@ -12,13 +12,622 @@ const CodePathSegment = require("./code-path-segment"), ForkContext = require("./fork-context"); +//----------------------------------------------------------------------------- +// Contexts +//----------------------------------------------------------------------------- + +/** + * Represents the context in which a `break` statement can be used. + * + * A `break` statement without a label is only valid in a few places in + * JavaScript: any type of loop or a `switch` statement. Otherwise, `break` + * without a label causes a syntax error. For these contexts, `breakable` is + * set to `true` to indicate that a `break` without a label is valid. + * + * However, a `break` statement with a label is also valid inside of a labeled + * statement. For example, this is valid: + * + * a : { + * break a; + * } + * + * The `breakable` property is set false for labeled statements to indicate + * that `break` without a label is invalid. + */ +class BreakContext { + + /** + * Creates a new instance. + * @param {BreakContext} upperContext The previous `BreakContext`. + * @param {boolean} breakable Indicates if we are inside a statement where + * `break` without a label will exit the statement. + * @param {string|null} label The label for the statement. + * @param {ForkContext} forkContext The current fork context. + */ + constructor(upperContext, breakable, label, forkContext) { + + /** + * The previous `BreakContext` + * @type {BreakContext} + */ + this.upper = upperContext; + + /** + * Indicates if we are inside a statement where `break` without a label + * will exit the statement. + * @type {boolean} + */ + this.breakable = breakable; + + /** + * The label associated with the statement. + * @type {string|null} + */ + this.label = label; + + /** + * The fork context for the `break`. + * @type {ForkContext} + */ + this.brokenForkContext = ForkContext.newEmpty(forkContext); + } +} + +/** + * Represents the context for `ChainExpression` nodes. + */ +class ChainContext { + + /** + * Creates a new instance. + * @param {ChainContext} upperContext The previous `ChainContext`. + */ + constructor(upperContext) { + + /** + * The previous `ChainContext` + * @type {ChainContext} + */ + this.upper = upperContext; + + /** + * The number of choice contexts inside of the `ChainContext`. + * @type {number} + */ + this.choiceContextCount = 0; + + } +} + +/** + * Represents a choice in the code path. + * + * Choices are created by logical operators such as `&&`, loops, conditionals, + * and `if` statements. This is the point at which the code path has a choice of + * which direction to go. + * + * The result of a choice might be in the left (test) expression of another choice, + * and in that case, may create a new fork. For example, `a || b` is a choice + * but does not create a new fork because the result of the expression is + * not used as the test expression in another expression. In this case, + * `isForkingAsResult` is false. In the expression `a || b || c`, the `a || b` + * expression appears as the test expression for `|| c`, so the + * result of `a || b` creates a fork because execution may or may not + * continue to `|| c`. `isForkingAsResult` for `a || b` in this case is true + * while `isForkingAsResult` for `|| c` is false. (`isForkingAsResult` is always + * false for `if` statements, conditional expressions, and loops.) + * + * All of the choices except one (`??`) operate on a true/false fork, meaning if + * true go one way and if false go the other (tracked by `trueForkContext` and + * `falseForkContext`). The `??` operator doesn't operate on true/false because + * the left expression is evaluated to be nullish or not, so only if nullish do + * we fork to the right expression (tracked by `nullishForkContext`). + */ +class ChoiceContext { + + /** + * Creates a new instance. + * @param {ChoiceContext} upperContext The previous `ChoiceContext`. + * @param {string} kind The kind of choice. If it's a logical or assignment expression, this + * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or + * conditional expression, this is `"test"`; otherwise, this is `"loop"`. + * @param {boolean} isForkingAsResult Indicates if the result of the choice + * creates a fork. + * @param {ForkContext} forkContext The containing `ForkContext`. + */ + constructor(upperContext, kind, isForkingAsResult, forkContext) { + + /** + * The previous `ChoiceContext` + * @type {ChoiceContext} + */ + this.upper = upperContext; + + /** + * The kind of choice. If it's a logical or assignment expression, this + * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or + * conditional expression, this is `"test"`; otherwise, this is `"loop"`. + * @type {string} + */ + this.kind = kind; + + /** + * Indicates if the result of the choice forks the code path. + * @type {boolean} + */ + this.isForkingAsResult = isForkingAsResult; + + /** + * The fork context for the `true` path of the choice. + * @type {ForkContext} + */ + this.trueForkContext = ForkContext.newEmpty(forkContext); + + /** + * The fork context for the `false` path of the choice. + * @type {ForkContext} + */ + this.falseForkContext = ForkContext.newEmpty(forkContext); + + /** + * The fork context for when the choice result is `null` or `undefined`. + * @type {ForkContext} + */ + this.nullishForkContext = ForkContext.newEmpty(forkContext); + + /** + * Indicates if any of `trueForkContext`, `falseForkContext`, or + * `nullishForkContext` have been updated with segments from a child context. + * @type {boolean} + */ + this.processed = false; + } + +} + +/** + * Base class for all loop contexts. + */ +class LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string} type The AST node's `type` for the loop. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, type, label, breakContext) { + + /** + * The previous `LoopContext`. + * @type {LoopContext} + */ + this.upper = upperContext; + + /** + * The AST node's `type` for the loop. + * @type {string} + */ + this.type = type; + + /** + * The label for the loop from an enclosing `LabeledStatement`. + * @type {string|null} + */ + this.label = label; + + /** + * The fork context for when `break` is encountered. + * @type {ForkContext} + */ + this.brokenForkContext = breakContext.brokenForkContext; + } +} + +/** + * Represents the context for a `while` loop. + */ +class WhileLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "WhileStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The segments representing the test condition where `continue` will + * jump to. The test condition will typically have just one segment but + * it's possible for there to be more than one. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `do-while` loop. + */ +class DoWhileLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + * @param {ForkContext} forkContext The enclosing fork context. + */ + constructor(upperContext, label, breakContext, forkContext) { + super(upperContext, "DoWhileStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The segments at the start of the loop body. This is the only loop + * where the test comes at the end, so the first iteration always + * happens and we need a reference to the first statements. + * @type {Array|null} + */ + this.entrySegments = null; + + /** + * The fork context to follow when a `continue` is found. + * @type {ForkContext} + */ + this.continueForkContext = ForkContext.newEmpty(forkContext); + } +} + +/** + * Represents the context for a `for` loop. + */ +class ForLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForStatement", label, breakContext); + + /** + * The hardcoded literal boolean test condition for + * the loop. Used to catch infinite or skipped loops. + * @type {boolean|undefined} + */ + this.test = void 0; + + /** + * The end of the init expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an init expression. + * @type {Array|null} + */ + this.endOfInitSegments = null; + + /** + * The start of the test expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * a test expression. + * @type {Array|null} + */ + this.testSegments = null; + + /** + * The end of the test expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * a test expression. + * @type {Array|null} + */ + this.endOfTestSegments = null; + + /** + * The start of the update expression. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an update expression. + * @type {Array|null} + */ + this.updateSegments = null; + + /** + * The end of the update expresion. This may change during the lifetime + * of the instance as we traverse the loop because some loops don't have + * an update expression. + * @type {Array|null} + */ + this.endOfUpdateSegments = null; + + /** + * The segments representing the test condition where `continue` will + * jump to. The test condition will typically have just one segment but + * it's possible for there to be more than one. This may change during the + * lifetime of the instance as we traverse the loop because some loops + * don't have an update expression. When there is an update expression, this + * will end up pointing to that expression; otherwise it will end up pointing + * to the test expression. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `for-in` loop. + * + * Terminology: + * - "left" means the part of the loop to the left of the `in` keyword. For + * example, in `for (var x in y)`, the left is `var x`. + * - "right" means the part of the loop to the right of the `in` keyword. For + * example, in `for (var x in y)`, the right is `y`. + */ +class ForInLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForInStatement", label, breakContext); + + /** + * The segments that came immediately before the start of the loop. + * This allows you to traverse backwards out of the loop into the + * surrounding code. This is necessary to evaluate the right expression + * correctly, as it must be evaluated in the same way as the left + * expression, but the pointer to these segments would otherwise be + * lost if not stored on the instance. Once the right expression has + * been evaluated, this property is no longer used. + * @type {Array|null} + */ + this.prevSegments = null; + + /** + * Segments representing the start of everything to the left of the + * `in` keyword. This can be used to move forward towards + * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are + * effectively the head and tail of a doubly-linked list. + * @type {Array|null} + */ + this.leftSegments = null; + + /** + * Segments representing the end of everything to the left of the + * `in` keyword. This can be used to move backward towards `leftSegments`. + * `leftSegments` and `endOfLeftSegments` are effectively the head + * and tail of a doubly-linked list. + * @type {Array|null} + */ + this.endOfLeftSegments = null; + + /** + * The segments representing the left expression where `continue` will + * jump to. In `for-in` loops, `continue` must always re-execute the + * left expression each time through the loop. This contains the same + * segments as `leftSegments`, but is duplicated here so each loop + * context has the same property pointing to where `continue` should + * end up. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for a `for-of` loop. + */ +class ForOfLoopContext extends LoopContextBase { + + /** + * Creates a new instance. + * @param {LoopContext|null} upperContext The previous `LoopContext`. + * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`. + * @param {BreakContext} breakContext The context for breaking the loop. + */ + constructor(upperContext, label, breakContext) { + super(upperContext, "ForOfStatement", label, breakContext); + + /** + * The segments that came immediately before the start of the loop. + * This allows you to traverse backwards out of the loop into the + * surrounding code. This is necessary to evaluate the right expression + * correctly, as it must be evaluated in the same way as the left + * expression, but the pointer to these segments would otherwise be + * lost if not stored on the instance. Once the right expression has + * been evaluated, this property is no longer used. + * @type {Array|null} + */ + this.prevSegments = null; + + /** + * Segments representing the start of everything to the left of the + * `of` keyword. This can be used to move forward towards + * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are + * effectively the head and tail of a doubly-linked list. + * @type {Array|null} + */ + this.leftSegments = null; + + /** + * Segments representing the end of everything to the left of the + * `of` keyword. This can be used to move backward towards `leftSegments`. + * `leftSegments` and `endOfLeftSegments` are effectively the head + * and tail of a doubly-linked list. + * @type {Array|null} + */ + this.endOfLeftSegments = null; + + /** + * The segments representing the left expression where `continue` will + * jump to. In `for-in` loops, `continue` must always re-execute the + * left expression each time through the loop. This contains the same + * segments as `leftSegments`, but is duplicated here so each loop + * context has the same property pointing to where `continue` should + * end up. + * @type {Array|null} + */ + this.continueDestSegments = null; + } +} + +/** + * Represents the context for any loop. + * @typedef {WhileLoopContext|DoWhileLoopContext|ForLoopContext|ForInLoopContext|ForOfLoopContext} LoopContext + */ + +/** + * Represents the context for a `switch` statement. + */ +class SwitchContext { + + /** + * Creates a new instance. + * @param {SwitchContext} upperContext The previous context. + * @param {boolean} hasCase Indicates if there is at least one `case` statement. + * `default` doesn't count. + */ + constructor(upperContext, hasCase) { + + /** + * The previous context. + * @type {SwitchContext} + */ + this.upper = upperContext; + + /** + * Indicates if there is at least one `case` statement. `default` doesn't count. + * @type {boolean} + */ + this.hasCase = hasCase; + + /** + * The `default` keyword. + * @type {Array|null} + */ + this.defaultSegments = null; + + /** + * The default case body starting segments. + * @type {Array|null} + */ + this.defaultBodySegments = null; + + /** + * Indicates if a `default` case and is empty exists. + * @type {boolean} + */ + this.foundEmptyDefault = false; + + /** + * Indicates that a `default` exists and is the last case. + * @type {boolean} + */ + this.lastIsDefault = false; + + /** + * The number of fork contexts created. This is equivalent to the + * number of `case` statements plus a `default` statement (if present). + * @type {number} + */ + this.forkCount = 0; + } +} + +/** + * Represents the context for a `try` statement. + */ +class TryContext { + + /** + * Creates a new instance. + * @param {TryContext} upperContext The previous context. + * @param {boolean} hasFinalizer Indicates if the `try` statement has a + * `finally` block. + * @param {ForkContext} forkContext The enclosing fork context. + */ + constructor(upperContext, hasFinalizer, forkContext) { + + /** + * The previous context. + * @type {TryContext} + */ + this.upper = upperContext; + + /** + * Indicates if the `try` statement has a `finally` block. + * @type {boolean} + */ + this.hasFinalizer = hasFinalizer; + + /** + * Tracks the traversal position inside of the `try` statement. This is + * used to help determine the context necessary to create paths because + * a `try` statement may or may not have `catch` or `finally` blocks, + * and code paths behave differently in those blocks. + * @type {"try"|"catch"|"finally"} + */ + this.position = "try"; + + /** + * If the `try` statement has a `finally` block, this affects how a + * `return` statement behaves in the `try` block. Without `finally`, + * `return` behaves as usual and doesn't require a fork; with `finally`, + * `return` forks into the `finally` block, so we need a fork context + * to track it. + * @type {ForkContext|null} + */ + this.returnedForkContext = hasFinalizer + ? ForkContext.newEmpty(forkContext) + : null; + + /** + * When a `throw` occurs inside of a `try` block, the code path forks + * into the `catch` or `finally` blocks, and this fork context tracks + * that path. + * @type {ForkContext} + */ + this.thrownForkContext = ForkContext.newEmpty(forkContext); + + /** + * Indicates if the last segment in the `try` block is reachable. + * @type {boolean} + */ + this.lastOfTryIsReachable = false; + + /** + * Indicates if the last segment in the `catch` block is reachable. + * @type {boolean} + */ + this.lastOfCatchIsReachable = false; + } +} + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ /** * Adds given segments into the `dest` array. - * If the `others` array does not includes the given segments, adds to the `all` + * If the `others` array does not include the given segments, adds to the `all` * array as well. * * This adds only reachable and used segments. @@ -33,16 +642,16 @@ 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); } } } /** - * Gets a loop-context for a `continue` statement. - * @param {CodePathState} state A state to get. - * @param {string} label The label of a `continue` statement. + * Gets a loop context for a `continue` statement based on a given label. + * @param {CodePathState} state The state to search within. + * @param {string|null} label The label of a `continue` statement. * @returns {LoopContext} A loop-context for a `continue` statement. */ function getContinueContext(state, label) { @@ -59,15 +668,15 @@ function getContinueContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } /** * Gets a context for a `break` statement. - * @param {CodePathState} state A state to get. - * @param {string} label The label of a `break` statement. - * @returns {LoopContext|SwitchContext} A context for a `break` statement. + * @param {CodePathState} state The state to search within. + * @param {string|null} label The label of a `break` statement. + * @returns {BreakContext} A context for a `break` statement. */ function getBreakContext(state, label) { let context = state.breakContext; @@ -79,13 +688,15 @@ function getBreakContext(state, label) { context = context.upper; } - /* istanbul ignore next: foolproof (syntax error) */ + /* c8 ignore next */ return null; } /** - * Gets a context for a `return` statement. - * @param {CodePathState} state A state to get. + * Gets a context for a `return` statement. There is just one special case: + * if there is a `try` statement with a `finally` block, because that alters + * how `return` behaves; otherwise, this just passes through the given state. + * @param {CodePathState} state The state to search within * @returns {TryContext|CodePathState} A context for a `return` statement. */ function getReturnContext(state) { @@ -102,8 +713,11 @@ function getReturnContext(state) { } /** - * Gets a context for a `throw` statement. - * @param {CodePathState} state A state to get. + * Gets a context for a `throw` statement. There is just one special case: + * if there is a `try` statement with a `finally` block and we are inside of + * a `catch` because that changes how `throw` behaves; otherwise, this just + * passes through the given state. + * @param {CodePathState} state The state to search within. * @returns {TryContext|CodePathState} A context for a `throw` statement. */ function getThrowContext(state) { @@ -122,13 +736,13 @@ function getThrowContext(state) { } /** - * Removes a given element from a given array. - * @param {any[]} xs An array to remove the specific element. - * @param {any} x An element to be removed. + * Removes a given value from a given array. + * @param {any[]} elements An array to remove the specific element. + * @param {any} value The value to be removed. * @returns {void} */ -function remove(xs, x) { - xs.splice(xs.indexOf(x), 1); +function removeFromArray(elements, value) { + elements.splice(elements.indexOf(value), 1); } /** @@ -141,48 +755,77 @@ function remove(xs, x) { * @param {CodePathSegment[]} nextSegments Backward segments to disconnect. * @returns {void} */ -function removeConnection(prevSegments, nextSegments) { +function disconnectSegments(prevSegments, nextSegments) { for (let i = 0; i < prevSegments.length; ++i) { const prevSegment = prevSegments[i]; const nextSegment = nextSegments[i]; - remove(prevSegment.nextSegments, nextSegment); - remove(prevSegment.allNextSegments, nextSegment); - remove(nextSegment.prevSegments, prevSegment); - remove(nextSegment.allPrevSegments, prevSegment); + removeFromArray(prevSegment.nextSegments, nextSegment); + removeFromArray(prevSegment.allNextSegments, nextSegment); + removeFromArray(nextSegment.prevSegments, prevSegment); + removeFromArray(nextSegment.allPrevSegments, prevSegment); } } /** - * Creates looping path. - * @param {CodePathState} state The instance. + * Creates looping path between two arrays of segments, ensuring that there are + * paths going between matching segments in the arrays. + * @param {CodePathState} state The state to operate on. * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source. * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination. * @returns {void} */ function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { + const fromSegments = CodePathSegment.flattenUnusedSegments(unflattenedFromSegments); const toSegments = CodePathSegment.flattenUnusedSegments(unflattenedToSegments); - const end = Math.min(fromSegments.length, toSegments.length); + /* + * This loop effectively updates a doubly-linked list between two collections + * of segments making sure that segments in the same array indices are + * combined to create a path. + */ for (let i = 0; i < end; ++i) { + + // get the segments in matching array indices const fromSegment = fromSegments[i]; const toSegment = toSegments[i]; + /* + * If the destination segment is reachable, then create a path from the + * source segment to the destination segment. + */ if (toSegment.reachable) { fromSegment.nextSegments.push(toSegment); } + + /* + * If the source segment is reachable, then create a path from the + * destination segment back to the source segment. + */ if (fromSegment.reachable) { toSegment.prevSegments.push(fromSegment); } + + /* + * Also update the arrays that don't care if the segments are reachable + * or not. This should always happen regardless of anything else. + */ fromSegment.allNextSegments.push(toSegment); toSegment.allPrevSegments.push(fromSegment); + /* + * If the destination segment has at least two previous segments in its + * path then that means there was one previous segment before this iteration + * of the loop was executed. So, we need to mark the source segment as + * looped. + */ if (toSegment.allPrevSegments.length >= 2) { CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment); } + // let the code path analyzer know that there's been a loop created state.notifyLooped(fromSegment, toSegment); } } @@ -198,15 +841,27 @@ function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) { * @returns {void} */ function finalizeTestSegmentsOfFor(context, choiceContext, head) { + + /* + * If this choice context doesn't already contain paths from a + * child context, then add the current head to each potential path. + */ if (!choiceContext.processed) { choiceContext.trueForkContext.add(head); choiceContext.falseForkContext.add(head); - choiceContext.qqForkContext.add(head); + choiceContext.nullishForkContext.add(head); } + /* + * If the test condition isn't a hardcoded truthy value, then `break` + * must follow the same path as if the test condition is false. To represent + * that, we append the path for when the loop test is false (represented by + * `falseForkContext`) to the `brokenForkContext`. + */ if (context.test !== true) { context.brokenForkContext.addAll(choiceContext.falseForkContext); } + context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1); } @@ -219,37 +874,125 @@ function finalizeTestSegmentsOfFor(context, choiceContext, head) { */ class CodePathState { - // eslint-disable-next-line jsdoc/require-description /** + * Creates a new instance. * @param {IdGenerator} idGenerator An id generator to generate id for code * path segments. * @param {Function} onLooped A callback function to notify looping. */ constructor(idGenerator, onLooped) { + + /** + * The ID generator to use when creating new segments. + * @type {IdGenerator} + */ this.idGenerator = idGenerator; + + /** + * A callback function to call when there is a loop. + * @type {Function} + */ this.notifyLooped = onLooped; + + /** + * The root fork context for this state. + * @type {ForkContext} + */ this.forkContext = ForkContext.newRoot(idGenerator); + + /** + * Context for logical expressions, conditional expressions, `if` statements, + * and loops. + * @type {ChoiceContext} + */ this.choiceContext = null; + + /** + * Context for `switch` statements. + * @type {SwitchContext} + */ this.switchContext = null; + + /** + * Context for `try` statements. + * @type {TryContext} + */ this.tryContext = null; + + /** + * Context for loop statements. + * @type {LoopContext} + */ this.loopContext = null; + + /** + * Context for `break` statements. + * @type {BreakContext} + */ this.breakContext = null; + + /** + * Context for `ChainExpression` nodes. + * @type {ChainContext} + */ this.chainContext = null; + /** + * An array that tracks the current segments in the state. The array + * starts empty and segments are added with each `onCodePathSegmentStart` + * event and removed with each `onCodePathSegmentEnd` event. Effectively, + * this is tracking the code path segment traversal as the state is + * modified. + * @type {Array} + */ this.currentSegments = []; + + /** + * Tracks the starting segment for this path. This value never changes. + * @type {CodePathSegment} + */ this.initialSegment = this.forkContext.head[0]; - // returnedSegments and thrownSegments push elements into finalSegments also. - const final = this.finalSegments = []; - const returned = this.returnedForkContext = []; - const thrown = this.thrownForkContext = []; + /** + * The final segments of the code path which are either `return` or `throw`. + * This is a union of the segments in `returnedForkContext` and `thrownForkContext`. + * @type {Array} + */ + this.finalSegments = []; + + /** + * The final segments of the code path which are `return`. These + * segments are also contained in `finalSegments`. + * @type {Array} + */ + this.returnedForkContext = []; + + /** + * The final segments of the code path which are `throw`. These + * segments are also contained in `finalSegments`. + * @type {Array} + */ + this.thrownForkContext = []; + + /* + * We add an `add` method so that these look more like fork contexts and + * can be used interchangeably when a fork context is needed to add more + * segments to a path. + * + * Ultimately, we want anything added to `returned` or `thrown` to also + * be added to `final`. We only add reachable and used segments to these + * arrays. + */ + const final = this.finalSegments; + const returned = this.returnedForkContext; + const thrown = this.thrownForkContext; returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final); thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final); } /** - * The head segments. + * A passthrough property exposing the current pointer as part of the API. * @type {CodePathSegment[]} */ get headSegments() { @@ -342,76 +1085,72 @@ class CodePathState { * If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`. * If it's IfStatement's or ConditionalExpression's, this is `"test"`. * Otherwise, this is `"loop"`. - * @param {boolean} isForkingAsResult A flag that shows that goes different - * paths between `true` and `false`. + * @param {boolean} isForkingAsResult Indicates if the result of the choice + * creates a fork. * @returns {void} */ pushChoiceContext(kind, isForkingAsResult) { - this.choiceContext = { - upper: this.choiceContext, - kind, - isForkingAsResult, - trueForkContext: ForkContext.newEmpty(this.forkContext), - falseForkContext: ForkContext.newEmpty(this.forkContext), - qqForkContext: ForkContext.newEmpty(this.forkContext), - processed: false - }; + this.choiceContext = new ChoiceContext(this.choiceContext, kind, isForkingAsResult, this.forkContext); } /** * Pops the last choice context and finalizes it. + * This is called upon leaving a node that represents a choice. + * @throws {Error} (Unreachable.) * @returns {ChoiceContext} The popped context. */ popChoiceContext() { - const context = this.choiceContext; - - this.choiceContext = context.upper; - + const poppedChoiceContext = this.choiceContext; const forkContext = this.forkContext; - const headSegments = forkContext.head; + const head = forkContext.head; - switch (context.kind) { + this.choiceContext = poppedChoiceContext.upper; + + switch (poppedChoiceContext.kind) { case "&&": case "||": case "??": /* - * If any result were not transferred from child contexts, - * this sets the head segments to both cases. - * The head segments are the path of the right-hand operand. + * The `head` are the path of the right-hand operand. + * If we haven't previously added segments from child contexts, + * then we add these segments to all possible forks. */ - if (!context.processed) { - context.trueForkContext.add(headSegments); - context.falseForkContext.add(headSegments); - context.qqForkContext.add(headSegments); + if (!poppedChoiceContext.processed) { + poppedChoiceContext.trueForkContext.add(head); + poppedChoiceContext.falseForkContext.add(head); + poppedChoiceContext.nullishForkContext.add(head); } /* - * Transfers results to upper context if this context is in - * test chunk. + * If this context is the left (test) expression for another choice + * context, such as `a || b` in the expression `a || b || c`, + * then we take the segments for this context and move them up + * to the parent context. */ - if (context.isForkingAsResult) { + if (poppedChoiceContext.isForkingAsResult) { const parentContext = this.choiceContext; - parentContext.trueForkContext.addAll(context.trueForkContext); - parentContext.falseForkContext.addAll(context.falseForkContext); - parentContext.qqForkContext.addAll(context.qqForkContext); + parentContext.trueForkContext.addAll(poppedChoiceContext.trueForkContext); + parentContext.falseForkContext.addAll(poppedChoiceContext.falseForkContext); + parentContext.nullishForkContext.addAll(poppedChoiceContext.nullishForkContext); parentContext.processed = true; - return context; + // Exit early so we don't collapse all paths into one. + return poppedChoiceContext; } break; case "test": - if (!context.processed) { + if (!poppedChoiceContext.processed) { /* * The head segments are the path of the `if` block here. * Updates the `true` path with the end of the `if` block. */ - context.trueForkContext.clear(); - context.trueForkContext.add(headSegments); + poppedChoiceContext.trueForkContext.clear(); + poppedChoiceContext.trueForkContext.add(head); } else { /* @@ -419,8 +1158,8 @@ class CodePathState { * Updates the `false` path with the end of the `else` * block. */ - context.falseForkContext.clear(); - context.falseForkContext.add(headSegments); + poppedChoiceContext.falseForkContext.clear(); + poppedChoiceContext.falseForkContext.add(head); } break; @@ -428,81 +1167,129 @@ class CodePathState { case "loop": /* - * Loops are addressed in popLoopContext(). - * This is called from popLoopContext(). + * Loops are addressed in `popLoopContext()` so just return + * the context without modification. */ - return context; + return poppedChoiceContext; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } - // Merges all paths. - const prevForkContext = context.trueForkContext; + /* + * Merge the true path with the false path to create a single path. + */ + const combinedForkContext = poppedChoiceContext.trueForkContext; - prevForkContext.addAll(context.falseForkContext); - forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + combinedForkContext.addAll(poppedChoiceContext.falseForkContext); + forkContext.replaceHead(combinedForkContext.makeNext(0, -1)); - return context; + return poppedChoiceContext; } /** - * Makes a code path segment of the right-hand operand of a logical + * Creates a code path segment to represent right-hand operand of a logical * expression. + * This is called in the preprocessing phase when entering a node. + * @throws {Error} (Unreachable.) * @returns {void} */ makeLogicalRight() { - const context = this.choiceContext; + const currentChoiceContext = this.choiceContext; const forkContext = this.forkContext; - if (context.processed) { + if (currentChoiceContext.processed) { /* - * This got segments already from the child choice context. - * Creates the next path from own true/false fork context. + * This context was already assigned segments from a child + * choice context. In this case, we are concerned only about + * the path that does not short-circuit and so ends up on the + * right-hand operand of the logical expression. */ let prevForkContext; - switch (context.kind) { + switch (currentChoiceContext.kind) { case "&&": // if true then go to the right-hand side. - prevForkContext = context.trueForkContext; + prevForkContext = currentChoiceContext.trueForkContext; break; case "||": // if false then go to the right-hand side. - prevForkContext = context.falseForkContext; + prevForkContext = currentChoiceContext.falseForkContext; break; - case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's qqForkContext. - prevForkContext = context.qqForkContext; + case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's nullishForkContext. + prevForkContext = currentChoiceContext.nullishForkContext; break; default: throw new Error("unreachable"); } + /* + * Create the segment for the right-hand operand of the logical expression + * and adjust the fork context pointer to point there. The right-hand segment + * is added at the end of all segments in `prevForkContext`. + */ forkContext.replaceHead(prevForkContext.makeNext(0, -1)); + + /* + * We no longer need this list of segments. + * + * Reset `processed` because we've removed the segments from the child + * choice context. This allows `popChoiceContext()` to continue adding + * segments later. + */ prevForkContext.clear(); - context.processed = false; + currentChoiceContext.processed = false; + } else { /* - * This did not get segments from the child choice context. - * So addresses the head segments. - * The head segments are the path of the left-hand operand. + * This choice context was not assigned segments from a child + * choice context, which means that it's a terminal logical + * expression. + * + * `head` is the segments for the left-hand operand of the + * logical expression. + * + * Each of the fork contexts below are empty at this point. We choose + * the path(s) that will short-circuit and add the segment for the + * left-hand operand to it. Ultimately, this will be the only segment + * in that path due to the short-circuting, so we are just seeding + * these paths to start. */ - switch (context.kind) { - case "&&": // the false path can short-circuit. - context.falseForkContext.add(forkContext.head); + switch (currentChoiceContext.kind) { + case "&&": + + /* + * In most contexts, when a && expression evaluates to false, + * it short circuits, so we need to account for that by setting + * the `falseForkContext` to the left operand. + * + * When a && expression is the left-hand operand for a ?? + * expression, such as `(a && b) ?? c`, a nullish value will + * also short-circuit in a different way than a false value, + * so we also set the `nullishForkContext` to the left operand. + * This path is only used with a ?? expression and is thrown + * away for any other type of logical expression, so it's safe + * to always add. + */ + currentChoiceContext.falseForkContext.add(forkContext.head); + currentChoiceContext.nullishForkContext.add(forkContext.head); break; case "||": // the true path can short-circuit. - context.trueForkContext.add(forkContext.head); + currentChoiceContext.trueForkContext.add(forkContext.head); break; case "??": // both can short-circuit. - context.trueForkContext.add(forkContext.head); - context.falseForkContext.add(forkContext.head); + currentChoiceContext.trueForkContext.add(forkContext.head); + currentChoiceContext.falseForkContext.add(forkContext.head); break; default: throw new Error("unreachable"); } + /* + * Create the segment for the right-hand operand of the logical expression + * and adjust the fork context pointer to point there. + */ forkContext.replaceHead(forkContext.makeNext(-1, -1)); } } @@ -523,7 +1310,7 @@ class CodePathState { if (!context.processed) { context.trueForkContext.add(forkContext.head); context.falseForkContext.add(forkContext.head); - context.qqForkContext.add(forkContext.head); + context.nullishForkContext.add(forkContext.head); } context.processed = false; @@ -561,22 +1348,20 @@ class CodePathState { //-------------------------------------------------------------------------- /** - * Push a new `ChainExpression` context to the stack. - * This method is called on entering to each `ChainExpression` node. - * This context is used to count forking in the optional chain then merge them on the exiting from the `ChainExpression` node. + * Pushes a new `ChainExpression` context to the stack. This method is + * called when entering a `ChainExpression` node. A chain context is used to + * count forking in the optional chain then merge them on the exiting from the + * `ChainExpression` node. * @returns {void} */ pushChainContext() { - this.chainContext = { - upper: this.chainContext, - countChoiceContexts: 0 - }; + this.chainContext = new ChainContext(this.chainContext); } /** - * Pop a `ChainExpression` context from the stack. - * This method is called on exiting from each `ChainExpression` node. - * This merges all forks of the last optional chaining. + * Pop a `ChainExpression` context from the stack. This method is called on + * exiting from each `ChainExpression` node. This merges all forks of the + * last optional chaining. * @returns {void} */ popChainContext() { @@ -585,7 +1370,7 @@ class CodePathState { this.chainContext = context.upper; // pop all choice contexts of this. - for (let i = context.countChoiceContexts; i > 0; --i) { + for (let i = context.choiceContextCount; i > 0; --i) { this.popChoiceContext(); } } @@ -598,7 +1383,7 @@ class CodePathState { */ makeOptionalNode() { if (this.chainContext) { - this.chainContext.countChoiceContexts += 1; + this.chainContext.choiceContextCount += 1; this.pushChoiceContext("??", false); } } @@ -626,16 +1411,7 @@ class CodePathState { * @returns {void} */ pushSwitchContext(hasCase, label) { - this.switchContext = { - upper: this.switchContext, - hasCase, - defaultSegments: null, - defaultBodySegments: null, - foundDefault: false, - lastIsDefault: false, - countForks: 0 - }; - + this.switchContext = new SwitchContext(this.switchContext, hasCase); this.pushBreakContext(true, label); } @@ -656,7 +1432,7 @@ class CodePathState { const forkContext = this.forkContext; const brokenForkContext = this.popBreakContext().brokenForkContext; - if (context.countForks === 0) { + if (context.forkCount === 0) { /* * When there is only one `default` chunk and there is one or more @@ -683,47 +1459,54 @@ class CodePathState { brokenForkContext.add(lastSegments); /* - * A path which is failed in all case test should be connected to path - * of `default` chunk. + * Any value that doesn't match a `case` test should flow to the default + * case. That happens normally when the default case is last in the `switch`, + * but if it's not, we need to rewire some of the paths to be correct. */ if (!context.lastIsDefault) { if (context.defaultBodySegments) { /* - * Remove a link from `default` label to its chunk. - * It's false route. + * There is a non-empty default case, so remove the path from the `default` + * label to its body for an accurate representation. + */ + disconnectSegments(context.defaultSegments, context.defaultBodySegments); + + /* + * Connect the path from the last non-default case to the body of the + * default case. */ - removeConnection(context.defaultSegments, context.defaultBodySegments); makeLooped(this, lastCaseSegments, context.defaultBodySegments); + } else { /* - * It handles the last case body as broken if `default` chunk - * does not exist. + * There is no default case, so we treat this as if the last case + * had a `break` in it. */ brokenForkContext.add(lastCaseSegments); } } - // Pops the segment context stack until the entry segment. - for (let i = 0; i < context.countForks; ++i) { + // Traverse up to the original fork context for the `switch` statement + for (let i = 0; i < context.forkCount; ++i) { this.forkContext = this.forkContext.upper; } /* - * Creates a path from all brokenForkContext paths. - * This is a path after switch statement. + * Creates a path from all `brokenForkContext` paths. + * This is a path after `switch` statement. */ this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1)); } /** * Makes a code path segment for a `SwitchCase` node. - * @param {boolean} isEmpty `true` if the body is empty. - * @param {boolean} isDefault `true` if the body is the default case. + * @param {boolean} isCaseBodyEmpty `true` if the body is empty. + * @param {boolean} isDefaultCase `true` if the body is the default case. * @returns {void} */ - makeSwitchCaseBody(isEmpty, isDefault) { + makeSwitchCaseBody(isCaseBodyEmpty, isDefaultCase) { const context = this.switchContext; if (!context.hasCase) { @@ -733,7 +1516,7 @@ class CodePathState { /* * Merge forks. * The parent fork context has two segments. - * Those are from the current case and the body of the previous case. + * Those are from the current `case` and the body of the previous case. */ const parentForkContext = this.forkContext; const forkContext = this.pushForkContext(); @@ -741,26 +1524,53 @@ class CodePathState { forkContext.add(parentForkContext.makeNext(0, -1)); /* - * Save `default` chunk info. - * If the `default` label is not at the last, we must make a path from - * the last `case` to the `default` chunk. + * Add information about the default case. + * + * The purpose of this is to identify the starting segments for the + * default case to make sure there is a path there. */ - if (isDefault) { + if (isDefaultCase) { + + /* + * This is the default case in the `switch`. + * + * We first save the current pointer as `defaultSegments` to point + * to the `default` keyword. + */ context.defaultSegments = parentForkContext.head; - if (isEmpty) { - context.foundDefault = true; + + /* + * If the body of the case is empty then we just set + * `foundEmptyDefault` to true; otherwise, we save a reference + * to the current pointer as `defaultBodySegments`. + */ + if (isCaseBodyEmpty) { + context.foundEmptyDefault = true; } else { context.defaultBodySegments = forkContext.head; } + } else { - if (!isEmpty && context.foundDefault) { - context.foundDefault = false; + + /* + * This is not the default case in the `switch`. + * + * If it's not empty and there is already an empty default case found, + * that means the default case actually comes before this case, + * and that it will fall through to this case. So, we can now + * ignore the previous default case (reset `foundEmptyDefault` to false) + * and set `defaultBodySegments` to the current segments because this is + * effectively the new default case. + */ + if (!isCaseBodyEmpty && context.foundEmptyDefault) { + context.foundEmptyDefault = false; context.defaultBodySegments = forkContext.head; } } - context.lastIsDefault = isDefault; - context.countForks += 1; + // keep track if the default case ends up last + context.lastIsDefault = isDefaultCase; + context.forkCount += 1; } //-------------------------------------------------------------------------- @@ -774,19 +1584,7 @@ class CodePathState { * @returns {void} */ pushTryContext(hasFinalizer) { - this.tryContext = { - upper: this.tryContext, - position: "try", - hasFinalizer, - - returnedForkContext: hasFinalizer - ? ForkContext.newEmpty(this.forkContext) - : null, - - thrownForkContext: ForkContext.newEmpty(this.forkContext), - lastOfTryIsReachable: false, - lastOfCatchIsReachable: false - }; + this.tryContext = new TryContext(this.tryContext, hasFinalizer, this.forkContext); } /** @@ -798,25 +1596,35 @@ class CodePathState { this.tryContext = context.upper; + /* + * If we're inside the `catch` block, that means there is no `finally`, + * so we can process the `try` and `catch` blocks the simple way and + * merge their two paths. + */ if (context.position === "catch") { - - // Merges two paths from the `try` block and `catch` block merely. this.popForkContext(); return; } /* - * The following process is executed only when there is the `finally` + * The following process is executed only when there is a `finally` * block. */ - const returned = context.returnedForkContext; - const thrown = context.thrownForkContext; + const originalReturnedForkContext = context.returnedForkContext; + const originalThrownForkContext = context.thrownForkContext; - if (returned.empty && thrown.empty) { + // no `return` or `throw` in `try` or `catch` so there's nothing left to do + if (originalReturnedForkContext.empty && originalThrownForkContext.empty) { return; } + /* + * The following process is executed only when there is a `finally` + * block and there was a `return` or `throw` in the `try` or `catch` + * blocks. + */ + // Separate head to normal paths and leaving paths. const headSegments = this.forkContext.head; @@ -825,10 +1633,10 @@ class CodePathState { const leavingSegments = headSegments.slice(headSegments.length / 2 | 0); // Forwards the leaving path to upper contexts. - if (!returned.empty) { + if (!originalReturnedForkContext.empty) { getReturnContext(this).returnedForkContext.add(leavingSegments); } - if (!thrown.empty) { + if (!originalThrownForkContext.empty) { getThrowContext(this).thrownForkContext.add(leavingSegments); } @@ -851,16 +1659,20 @@ class CodePathState { makeCatchBlock() { const context = this.tryContext; const forkContext = this.forkContext; - const thrown = context.thrownForkContext; + const originalThrownForkContext = context.thrownForkContext; - // Update state. + /* + * We are now in a catch block so we need to update the context + * with that information. This includes creating a new fork + * context in case we encounter any `throw` statements here. + */ context.position = "catch"; context.thrownForkContext = ForkContext.newEmpty(forkContext); context.lastOfTryIsReachable = forkContext.reachable; - // Merge thrown paths. - thrown.add(forkContext.head); - const thrownSegments = thrown.makeNext(0, -1); + // Merge the thrown paths from the `try` and `catch` blocks + originalThrownForkContext.add(forkContext.head); + const thrownSegments = originalThrownForkContext.makeNext(0, -1); // Fork to a bypass and the merged thrown path. this.pushForkContext(); @@ -879,8 +1691,8 @@ class CodePathState { makeFinallyBlock() { const context = this.tryContext; let forkContext = this.forkContext; - const returned = context.returnedForkContext; - const thrown = context.thrownForkContext; + const originalReturnedForkContext = context.returnedForkContext; + const originalThrownForContext = context.thrownForkContext; const headOfLeavingSegments = forkContext.head; // Update state. @@ -894,9 +1706,15 @@ class CodePathState { } else { context.lastOfTryIsReachable = forkContext.reachable; } + + context.position = "finally"; - if (returned.empty && thrown.empty) { + /* + * If there was no `return` or `throw` in either the `try` or `catch` + * blocks, then there's no further code paths to create for `finally`. + */ + if (originalReturnedForkContext.empty && originalThrownForContext.empty) { // This path does not leave. return; @@ -904,18 +1722,18 @@ class CodePathState { /* * Create a parallel segment from merging returned and thrown. - * This segment will leave at the end of this finally block. + * This segment will leave at the end of this `finally` block. */ const segments = forkContext.makeNext(-1, -1); for (let i = 0; i < forkContext.count; ++i) { const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]]; - for (let j = 0; j < returned.segmentsList.length; ++j) { - prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]); + for (let j = 0; j < originalReturnedForkContext.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(originalReturnedForkContext.segmentsList[j][i]); } - for (let j = 0; j < thrown.segmentsList.length; ++j) { - prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]); + for (let j = 0; j < originalThrownForContext.segmentsList.length; ++j) { + prevSegsOfLeavingSegment.push(originalThrownForContext.segmentsList[j][i]); } segments.push( @@ -965,70 +1783,40 @@ 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) { const forkContext = this.forkContext; + + // All loops need a path to account for `break` statements const breakContext = this.pushBreakContext(true, label); switch (type) { case "WhileStatement": this.pushChoiceContext("loop", false); - this.loopContext = { - upper: this.loopContext, - type, - label, - test: void 0, - continueDestSegments: null, - brokenForkContext: breakContext.brokenForkContext - }; + this.loopContext = new WhileLoopContext(this.loopContext, label, breakContext); break; case "DoWhileStatement": this.pushChoiceContext("loop", false); - this.loopContext = { - upper: this.loopContext, - type, - label, - test: void 0, - entrySegments: null, - continueForkContext: ForkContext.newEmpty(forkContext), - brokenForkContext: breakContext.brokenForkContext - }; + this.loopContext = new DoWhileLoopContext(this.loopContext, label, breakContext, forkContext); break; case "ForStatement": this.pushChoiceContext("loop", false); - this.loopContext = { - upper: this.loopContext, - type, - label, - test: void 0, - endOfInitSegments: null, - testSegments: null, - endOfTestSegments: null, - updateSegments: null, - endOfUpdateSegments: null, - continueDestSegments: null, - brokenForkContext: breakContext.brokenForkContext - }; + this.loopContext = new ForLoopContext(this.loopContext, label, breakContext); break; case "ForInStatement": - case "ForOfStatement": - this.loopContext = { - upper: this.loopContext, - type, - label, - prevSegments: null, - leftSegments: null, - endOfLeftSegments: null, - continueDestSegments: null, - brokenForkContext: breakContext.brokenForkContext - }; + this.loopContext = new ForInLoopContext(this.loopContext, label, breakContext); break; - /* istanbul ignore next */ + case "ForOfStatement": + this.loopContext = new ForOfLoopContext(this.loopContext, label, breakContext); + break; + + /* c8 ignore next */ default: throw new Error(`unknown type: "${type}"`); } @@ -1036,6 +1824,7 @@ class CodePathState { /** * Pops the last context of a loop statement and finalizes it. + * @throws {Error} (Unreachable - unknown type.) * @returns {void} */ popLoopContext() { @@ -1051,6 +1840,11 @@ class CodePathState { case "WhileStatement": case "ForStatement": this.popChoiceContext(); + + /* + * Creates the path from the end of the loop body up to the + * location where `continue` would jump to. + */ makeLooped( this, forkContext.head, @@ -1065,11 +1859,21 @@ class CodePathState { choiceContext.trueForkContext.add(forkContext.head); choiceContext.falseForkContext.add(forkContext.head); } + + /* + * If this isn't a hardcoded `true` condition, then `break` + * should continue down the path as if the condition evaluated + * to false. + */ if (context.test !== true) { brokenForkContext.addAll(choiceContext.falseForkContext); } - // `true` paths go to looping. + /* + * When the condition is true, the loop continues back to the top, + * so create a path from each possible true condition back to the + * top of the loop. + */ const segmentsList = choiceContext.trueForkContext.segmentsList; for (let i = 0; i < segmentsList.length; ++i) { @@ -1085,6 +1889,11 @@ class CodePathState { case "ForInStatement": case "ForOfStatement": brokenForkContext.add(forkContext.head); + + /* + * Creates the path from the end of the loop body up to the + * left expression (left of `in` or `of`) of the loop. + */ makeLooped( this, forkContext.head, @@ -1092,12 +1901,19 @@ class CodePathState { ); break; - /* istanbul ignore next */ + /* c8 ignore next */ default: throw new Error("unreachable"); } - // Go next. + /* + * If there wasn't a `break` statement in the loop, then we're at + * the end of the loop's path, so we make an unreachable segment + * to mark that. + * + * If there was a `break` statement, then we continue on into the + * `brokenForkContext`. + */ if (brokenForkContext.empty) { forkContext.replaceHead(forkContext.makeUnreachable(-1, -1)); } else { @@ -1135,7 +1951,11 @@ class CodePathState { choiceContext.falseForkContext.add(forkContext.head); } - // Update state. + /* + * If this isn't a hardcoded `true` condition, then `break` + * should continue down the path as if the condition evaluated + * to false. + */ if (context.test !== true) { context.brokenForkContext.addAll(choiceContext.falseForkContext); } @@ -1167,7 +1987,11 @@ class CodePathState { context.test = test; - // Creates paths of `continue` statements. + /* + * If there is a `continue` statement in the loop then `continueForkContext` + * won't be empty. We wire up the path from `continue` to the loop + * test condition and then continue the traversal in the root fork context. + */ if (!context.continueForkContext.empty) { context.continueForkContext.add(forkContext.head); const testSegments = context.continueForkContext.makeNext(0, -1); @@ -1187,7 +2011,14 @@ class CodePathState { const endOfInitSegments = forkContext.head; const testSegments = forkContext.makeNext(-1, -1); - // Update state. + /* + * Update the state. + * + * The `continueDestSegments` are set to `testSegments` because we + * don't yet know if there is an update expression in this loop. So, + * from what we already know at this point, a `continue` statement + * will jump back to the test expression. + */ context.test = test; context.endOfInitSegments = endOfInitSegments; context.continueDestSegments = context.testSegments = testSegments; @@ -1214,7 +2045,14 @@ class CodePathState { context.endOfInitSegments = forkContext.head; } - // Update state. + /* + * Update the state. + * + * The `continueDestSegments` are now set to `updateSegments` because we + * know there is an update expression in this loop. So, a `continue` statement + * in the loop will jump to the update expression first, and then to any + * test expression the loop might have. + */ const updateSegments = forkContext.makeDisconnected(-1, -1); context.continueDestSegments = context.updateSegments = updateSegments; @@ -1230,11 +2068,30 @@ class CodePathState { const choiceContext = this.choiceContext; const forkContext = this.forkContext; - // Update state. + /* + * Determine what to do based on which part of the `for` loop are present. + * 1. If there is an update expression, then `updateSegments` is not null and + * we need to assign `endOfUpdateSegments`, and if there is a test + * expression, we then need to create the looped path to get back to + * the test condition. + * 2. If there is no update expression but there is a test expression, + * then we only need to update the test segment information. + * 3. If there is no update expression and no test expression, then we + * just save `endOfInitSegments`. + */ if (context.updateSegments) { context.endOfUpdateSegments = forkContext.head; - // `update` -> `test` + /* + * In a `for` loop that has both an update expression and a test + * condition, execution flows from the test expression into the + * loop body, to the update expression, and then back to the test + * expression to determine if the loop should continue. + * + * To account for that, we need to make a path from the end of the + * update expression to the start of the test expression. This is + * effectively what creates the loop in the code path. + */ if (context.testSegments) { makeLooped( this, @@ -1254,12 +2111,18 @@ class CodePathState { let bodySegments = context.endOfTestSegments; + /* + * If there is a test condition, then there `endOfTestSegments` is also + * the start of the loop body. If there isn't a test condition then + * `bodySegments` will be null and we need to look elsewhere to find + * the start of the body. + * + * The body starts at the end of the init expression and ends at the end + * of the update expression, so we use those locations to determine the + * body segments. + */ if (!bodySegments) { - /* - * If there is not the `test` part, the `body` path comes from the - * `init` part and the `update` part. - */ const prevForkContext = ForkContext.newEmpty(forkContext); prevForkContext.add(context.endOfInitSegments); @@ -1269,7 +2132,16 @@ class CodePathState { bodySegments = prevForkContext.makeNext(0, -1); } + + /* + * If there was no test condition and no update expression, then + * `continueDestSegments` will be null. In that case, a + * `continue` should skip directly to the body of the loop. + * Otherwise, we want to keep the current `continueDestSegments`. + */ context.continueDestSegments = context.continueDestSegments || bodySegments; + + // move pointer to the body forkContext.replaceHead(bodySegments); } @@ -1333,19 +2205,15 @@ class CodePathState { //-------------------------------------------------------------------------- /** - * Creates new context for BreakStatement. - * @param {boolean} breakable The flag to indicate it can break by - * an unlabeled BreakStatement. - * @param {string|null} label The label of this context. - * @returns {Object} The new context. + * Creates new context in which a `break` statement can be used. This occurs inside of a loop, + * labeled statement, or switch statement. + * @param {boolean} breakable Indicates if we are inside a statement where + * `break` without a label will exit the statement. + * @param {string|null} label The label associated with the statement. + * @returns {BreakContext} The new context. */ pushBreakContext(breakable, label) { - this.breakContext = { - upper: this.breakContext, - breakable, - label, - brokenForkContext: ForkContext.newEmpty(this.forkContext) - }; + this.breakContext = new BreakContext(this.breakContext, breakable, label, this.forkContext); return this.breakContext; } @@ -1377,7 +2245,7 @@ class CodePathState { * * It registers the head segment to a context of `break`. * It makes new unreachable segment, then it set the head with the segment. - * @param {string} label A label of the break statement. + * @param {string|null} label A label of the break statement. * @returns {void} */ makeBreak(label) { @@ -1389,11 +2257,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)); } @@ -1402,7 +2271,7 @@ class CodePathState { * * It makes a looping path. * It makes new unreachable segment, then it set the head with the segment. - * @param {string} label A label of the continue statement. + * @param {string|null} label A label of the continue statement. * @returns {void} */ makeContinue(label) { @@ -1414,12 +2283,11 @@ class CodePathState { const context = getContinueContext(this, label); - /* istanbul ignore else: foolproof (syntax error) */ if (context) { if (context.continueDestSegments) { makeLooped(this, forkContext.head, context.continueDestSegments); - // If the context is a for-in/of loop, this effects a break also. + // If the context is a for-in/of loop, this affects a break also. if (context.type === "ForInStatement" || context.type === "ForOfStatement" ) { 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 49b37c6..3bf570d 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} @@ -71,7 +80,9 @@ class CodePath { } /** - * The initial code path segment. + * The initial code path segment. This is the segment that is at the head + * of the code path. + * This is a passthrough to the underlying `CodePathState`. * @type {CodePathSegment} */ get initialSegment() { @@ -79,8 +90,10 @@ class CodePath { } /** - * Final code path segments. - * This array is a mix of `returnedSegments` and `thrownSegments`. + * Final code path segments. These are the terminal (tail) segments in the + * code path, which is the combination of `returnedSegments` and `thrownSegments`. + * All segments in this array are reachable. + * This is a passthrough to the underlying `CodePathState`. * @type {CodePathSegment[]} */ get finalSegments() { @@ -88,9 +101,14 @@ class CodePath { } /** - * Final code path segments which is with `return` statements. - * This array contains the last path segment if it's reachable. - * Since the reachable last path returns `undefined`. + * Final code path segments that represent normal completion of the code path. + * For functions, this means both explicit `return` statements and implicit returns, + * such as the last reachable segment in a function that does not have an + * explicit `return` as this implicitly returns `undefined`. For scripts, + * modules, class field initializers, and class static blocks, this means + * all lines of code have been executed. + * These segments are also present in `finalSegments`. + * This is a passthrough to the underlying `CodePathState`. * @type {CodePathSegment[]} */ get returnedSegments() { @@ -98,7 +116,9 @@ class CodePath { } /** - * Final code path segments which is with `throw` statements. + * Final code path segments that represent `throw` statements. + * This is a passthrough to the underlying `CodePathState`. + * These segments are also present in `finalSegments`. * @type {CodePathSegment[]} */ get thrownSegments() { @@ -106,8 +126,14 @@ class CodePath { } /** - * Current code path segments. + * Tracks the traversal of the code path through each segment. This array + * starts empty and segments are added or removed as the code path is + * traversed. This array always ends up empty at the end of a code path + * traversal. The `CodePathState` uses this to track its progress through + * the code path. + * This is a passthrough to the underlying `CodePathState`. * @type {CodePathSegment[]} + * @deprecated */ get currentSegments() { return this.internal.currentSegments; @@ -116,46 +142,70 @@ class CodePath { /** * Traverses all segments in this code path. * - * codePath.traverseSegments(function(segment, controller) { + * codePath.traverseSegments((segment, controller) => { * // do something. * }); * * This method enumerates segments in order from the head. * - * The `controller` object has two methods. + * The `controller` argument has two methods: * - * - `controller.skip()` - Skip the following segments in this branch. - * - `controller.break()` - Skip all following segments. - * @param {Object} [options] Omittable. - * @param {CodePathSegment} [options.first] The first segment to traverse. - * @param {CodePathSegment} [options.last] The last segment to traverse. + * - `skip()` - skips the following segments in this branch + * - `break()` - skips all following segments in the traversal + * + * A note on the parameters: the `options` argument is optional. This means + * the first argument might be an options object or the callback function. + * @param {Object} [optionsOrCallback] Optional first and last segments to traverse. + * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse. + * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse. * @param {Function} callback A callback function. * @returns {void} */ - traverseSegments(options, callback) { + traverseSegments(optionsOrCallback, callback) { + + // normalize the arguments into a callback and options let resolvedOptions; let resolvedCallback; - if (typeof options === "function") { - resolvedCallback = options; + if (typeof optionsOrCallback === "function") { + resolvedCallback = optionsOrCallback; resolvedOptions = {}; } else { - resolvedOptions = options || {}; + resolvedOptions = optionsOrCallback || {}; resolvedCallback = callback; } + // determine where to start traversing from based on the options const startSegment = resolvedOptions.first || this.internal.initialSegment; const lastSegment = resolvedOptions.last; - let item = null; + // set up initial location information + let record = null; let index = 0; let end = 0; let segment = null; - const visited = Object.create(null); + + // segments that have already been visited during traversal + const visited = new Set(); + + // tracks the traversal steps const stack = [[startSegment, 0]]; + + // tracks the last skipped segment during traversal let skippedSegment = null; + + // indicates if we exited early from the traversal let broken = false; + + /** + * Maintains traversal state. + */ const controller = { + + /** + * Skip the following segments in this branch. + * @returns {void} + */ skip() { if (stack.length <= 1) { broken = true; @@ -163,32 +213,52 @@ class CodePath { skippedSegment = stack[stack.length - 2][0]; } }, + + /** + * Stop traversal completely - do not traverse to any + * other segments. + * @returns {void} + */ break() { broken = true; } }; /** - * Checks a given previous segment has been visited. + * Checks if a given previous segment has been visited. * @param {CodePathSegment} prevSegment A previous segment to check. * @returns {boolean} `true` if the segment has been visited. */ function isVisited(prevSegment) { return ( - visited[prevSegment.id] || + visited.has(prevSegment) || segment.isLoopedPrevSegment(prevSegment) ); } + // the traversal while (stack.length > 0) { - item = stack[stack.length - 1]; - segment = item[0]; - index = item[1]; + + /* + * This isn't a pure stack. We use the top record all the time + * but don't always pop it off. The record is popped only if + * one of the following is true: + * + * 1) We have already visited the segment. + * 2) We have not visited *all* of the previous segments. + * 3) We have traversed past the available next segments. + * + * Otherwise, we just read the value and sometimes modify the + * record as we traverse. + */ + record = stack[stack.length - 1]; + segment = record[0]; + index = record[1]; if (index === 0) { // Skip if this segment has been visited already. - if (visited[segment.id]) { + if (visited.has(segment)) { stack.pop(); continue; } @@ -202,18 +272,29 @@ class CodePath { continue; } - // Reset the flag of skipping if all branches have been skipped. - if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) { + // Reset the skipping flag if all branches have been skipped. + if (skippedSegment && segment.prevSegments.includes(skippedSegment)) { skippedSegment = null; } - visited[segment.id] = true; + visited.add(segment); - // Call the callback when the first time. + /* + * If the most recent segment hasn't been skipped, then we call + * the callback, passing in the segment and the controller. + */ if (!skippedSegment) { resolvedCallback.call(this, segment, controller); + + // exit if we're at the last segment if (segment === lastSegment) { controller.skip(); } + + /* + * If the previous statement was executed, or if the callback + * called a method on the controller, we might need to exit the + * loop, so check for that and break accordingly. + */ if (broken) { break; } @@ -223,12 +304,35 @@ class CodePath { // Update the stack. end = segment.nextSegments.length - 1; if (index < end) { - item[1] += 1; + + /* + * If we haven't yet visited all of the next segments, update + * the current top record on the stack to the next index to visit + * and then push a record for the current segment on top. + * + * Setting the current top record's index lets us know how many + * times we've been here and ensures that the segment won't be + * reprocessed (because we only process segments with an index + * of 0). + */ + record[1] += 1; stack.push([segment.nextSegments[index], 0]); } else if (index === end) { - item[0] = segment.nextSegments[index]; - item[1] = 0; + + /* + * If we are at the last next segment, then reset the top record + * in the stack to next segment and set its index to 0 so it will + * be processed next. + */ + record[0] = segment.nextSegments[index]; + record[1] = 0; } else { + + /* + * If index > end, that means we have no more segments that need + * processing. So, we pop that record off of the stack in order to + * continue traversing at the next level up. + */ stack.pop(); } } 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 a4cb99a..c0e01a8 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" + @@ -109,13 +109,13 @@ module.exports = { text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n"; } if (codePath.thrownSegments.length > 0) { - text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n"; + text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize=true];\n"; } 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 2e872b5..3314027 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 @@ -21,8 +21,8 @@ const assert = require("assert"), //------------------------------------------------------------------------------ /** - * Gets whether or not a given segment is reachable. - * @param {CodePathSegment} segment A segment to get. + * Determines whether or not a given segment is reachable. + * @param {CodePathSegment} segment The segment to check. * @returns {boolean} `true` if the segment is reachable. */ function isReachable(segment) { @@ -30,32 +30,64 @@ function isReachable(segment) { } /** - * Creates new segments from the specific range of `context.segmentsList`. + * Creates a new segment for each fork in the given context and appends it + * to the end of the specified range of segments. Ultimately, this ends up calling + * `new CodePathSegment()` for each of the forks using the `create` argument + * as a wrapper around special behavior. + * + * The `startIndex` and `endIndex` arguments specify a range of segments in + * `context` that should become `allPrevSegments` for the newly created + * `CodePathSegment` objects. * * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and - * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`. - * This `h` is from `b`, `d`, and `f`. - * @param {ForkContext} context An instance. - * @param {number} begin The first index of the previous segments. - * @param {number} end The last index of the previous segments. - * @param {Function} create A factory function of new segments. - * @returns {CodePathSegment[]} New segments. + * `end` is `-1`, this creates two new segments, `[g, h]`. This `g` is appended to + * the end of the path from `a`, `c`, and `e`. This `h` is appended to the end of + * `b`, `d`, and `f`. + * @param {ForkContext} context An instance from which the previous segments + * will be obtained. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {Function} create A function that creates new `CodePathSegment` + * instances in a particular way. See the `CodePathSegment.new*` methods. + * @returns {Array} An array of the newly-created segments. */ -function makeSegments(context, begin, end, create) { +function createSegments(context, startIndex, endIndex, create) { + + /** @type {Array>} */ const list = context.segmentsList; - const normalizedBegin = begin >= 0 ? begin : list.length + begin; - const normalizedEnd = end >= 0 ? end : list.length + end; + /* + * Both `startIndex` and `endIndex` work the same way: if the number is zero + * or more, then the number is used as-is. If the number is negative, + * then that number is added to the length of the segments list to + * determine the index to use. That means -1 for either argument + * is the last element, -2 is the second to last, and so on. + * + * So if `startIndex` is 0, `endIndex` is -1, and `list.length` is 3, the + * effective `startIndex` is 0 and the effective `endIndex` is 2, so this function + * will include items at indices 0, 1, and 2. + * + * Therefore, if `startIndex` is -1 and `endIndex` is -1, that means we'll only + * be using the last segment in `list`. + */ + const normalizedBegin = startIndex >= 0 ? startIndex : list.length + startIndex; + const normalizedEnd = endIndex >= 0 ? endIndex : list.length + endIndex; + /** @type {Array} */ const segments = []; for (let i = 0; i < context.count; ++i) { + + // this is passed into `new CodePathSegment` to add to code path. const allPrevSegments = []; for (let j = normalizedBegin; j <= normalizedEnd; ++j) { allPrevSegments.push(list[j][i]); } + // note: `create` is just a wrapper that augments `new CodePathSegment`. segments.push(create(context.idGenerator.next(), allPrevSegments)); } @@ -63,28 +95,57 @@ function makeSegments(context, begin, end, create) { } /** - * `segments` becomes doubly in a `finally` block. Then if a code path exits by a - * control statement (such as `break`, `continue`) from the `finally` block, the - * destination's segments may be half of the source segments. In that case, this - * merges segments. - * @param {ForkContext} context An instance. - * @param {CodePathSegment[]} segments Segments to merge. - * @returns {CodePathSegment[]} The merged segments. + * Inside of a `finally` block we end up with two parallel paths. If the code path + * exits by a control statement (such as `break` or `continue`) from the `finally` + * block, then we need to merge the remaining parallel paths back into one. + * @param {ForkContext} context The fork context to work on. + * @param {Array} segments Segments to merge. + * @returns {Array} The merged segments. */ function mergeExtraSegments(context, segments) { let currentSegments = segments; + /* + * We need to ensure that the array returned from this function contains no more + * than the number of segments that the context allows. `context.count` indicates + * how many items should be in the returned array to ensure that the new segment + * entries will line up with the already existing segment entries. + */ while (currentSegments.length > context.count) { const merged = []; - for (let i = 0, length = currentSegments.length / 2 | 0; i < length; ++i) { + /* + * Because `context.count` is a factor of 2 inside of a `finally` block, + * we can divide the segment count by 2 to merge the paths together. + * This loops through each segment in the list and creates a new `CodePathSegment` + * that has the segment and the segment two slots away as previous segments. + * + * If `currentSegments` is [a,b,c,d], this will create new segments e and f, such + * that: + * + * When `i` is 0: + * a->e + * c->e + * + * When `i` is 1: + * b->f + * d->f + */ + for (let i = 0, length = Math.floor(currentSegments.length / 2); i < length; ++i) { merged.push(CodePathSegment.newNext( context.idGenerator.next(), [currentSegments[i], currentSegments[i + length]] )); } + + /* + * Go through the loop condition one more time to see if we have the + * number of segments for the context. If not, we'll keep merging paths + * of the merged segments until we get there. + */ currentSegments = merged; } + return currentSegments; } @@ -93,26 +154,55 @@ function mergeExtraSegments(context, segments) { //------------------------------------------------------------------------------ /** - * A class to manage forking. + * Manages the forking of code paths. */ class ForkContext { - // eslint-disable-next-line jsdoc/require-description /** + * Creates a new instance. * @param {IdGenerator} idGenerator An identifier generator for segments. - * @param {ForkContext|null} upper An upper fork context. - * @param {number} count A number of parallel segments. + * @param {ForkContext|null} upper The preceding fork context. + * @param {number} count The number of parallel segments in each element + * of `segmentsList`. */ constructor(idGenerator, upper, count) { + + /** + * The ID generator that will generate segment IDs for any new + * segments that are created. + * @type {IdGenerator} + */ this.idGenerator = idGenerator; + + /** + * The preceding fork context. + * @type {ForkContext|null} + */ this.upper = upper; + + /** + * The number of elements in each element of `segmentsList`. In most + * cases, this is 1 but can be 2 when there is a `finally` present, + * which forks the code path outside of normal flow. In the case of nested + * `finally` blocks, this can be a multiple of 2. + * @type {number} + */ this.count = count; + + /** + * The segments within this context. Each element in this array has + * `count` elements that represent one step in each fork. For example, + * when `segmentsList` is `[[a, b], [c, d], [e, f]]`, there is one path + * a->c->e and one path b->d->f, and `count` is 2 because each element + * is an array with two elements. + * @type {Array>} + */ this.segmentsList = []; } /** - * The head segments. - * @type {CodePathSegment[]} + * The segments that begin this fork context. + * @type {Array} */ get head() { const list = this.segmentsList; @@ -121,7 +211,7 @@ class ForkContext { } /** - * A flag which shows empty. + * Indicates if the context contains no segments. * @type {boolean} */ get empty() { @@ -129,7 +219,7 @@ class ForkContext { } /** - * A flag which shows reachable. + * Indicates if there are any segments that are reachable. * @type {boolean} */ get reachable() { @@ -139,75 +229,82 @@ class ForkContext { } /** - * Creates new segments from this context. - * @param {number} begin The first index of previous segments. - * @param {number} end The last index of previous segments. - * @returns {CodePathSegment[]} New segments. + * Creates new segments in this context and appends them to the end of the + * already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @returns {Array} An array of the newly created segments. */ - makeNext(begin, end) { - return makeSegments(this, begin, end, CodePathSegment.newNext); + makeNext(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newNext); } /** - * Creates new segments from this context. - * The new segments is always unreachable. - * @param {number} begin The first index of previous segments. - * @param {number} end The last index of previous segments. - * @returns {CodePathSegment[]} New segments. + * Creates new unreachable segments in this context and appends them to the end of the + * already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. + * @param {number} startIndex The index of the first segment in the context + * that should be specified as previous segments for the newly created segments. + * @param {number} endIndex The index of the last segment in the context + * that should be specified as previous segments for the newly created segments. + * @returns {Array} An array of the newly created segments. */ - makeUnreachable(begin, end) { - return makeSegments(this, begin, end, CodePathSegment.newUnreachable); + makeUnreachable(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newUnreachable); } /** - * Creates new segments from this context. - * The new segments don't have connections for previous segments. - * But these inherit the reachable flag from this context. - * @param {number} begin The first index of previous segments. - * @param {number} end The last index of previous segments. - * @returns {CodePathSegment[]} New segments. + * Creates new segments in this context and does not append them to the end + * of the already existing `CodePathSegment`s specified by `startIndex` and + * `endIndex`. The `startIndex` and `endIndex` are only used to determine if + * the new segments should be reachable. If any of the segments in this range + * are reachable then the new segments are also reachable; otherwise, the new + * segments are unreachable. + * @param {number} startIndex The index of the first segment in the context + * that should be considered for reachability. + * @param {number} endIndex The index of the last segment in the context + * that should be considered for reachability. + * @returns {Array} An array of the newly created segments. */ - makeDisconnected(begin, end) { - return makeSegments(this, begin, end, CodePathSegment.newDisconnected); + makeDisconnected(startIndex, endIndex) { + return createSegments(this, startIndex, endIndex, CodePathSegment.newDisconnected); } /** - * Adds segments into this context. - * The added segments become the head. - * @param {CodePathSegment[]} segments Segments to add. + * Adds segments to the head of this context. + * @param {Array} segments The segments to add. * @returns {void} */ add(segments) { assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); - this.segmentsList.push(mergeExtraSegments(this, segments)); } /** - * Replaces the head segments with given segments. + * Replaces the head segments with the given segments. * The current head segments are removed. - * @param {CodePathSegment[]} segments Segments to add. + * @param {Array} replacementHeadSegments The new head segments. * @returns {void} */ - replaceHead(segments) { - assert(segments.length >= this.count, `${segments.length} >= ${this.count}`); - - this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments)); + replaceHead(replacementHeadSegments) { + assert( + replacementHeadSegments.length >= this.count, + `${replacementHeadSegments.length} >= ${this.count}` + ); + this.segmentsList.splice(-1, 1, mergeExtraSegments(this, replacementHeadSegments)); } /** * Adds all segments of a given fork context into this context. - * @param {ForkContext} context A fork context to add. + * @param {ForkContext} otherForkContext The fork context to add from. * @returns {void} */ - addAll(context) { - assert(context.count === this.count); - - const source = context.segmentsList; - - for (let i = 0; i < source.length; ++i) { - this.segmentsList.push(source[i]); - } + addAll(otherForkContext) { + assert(otherForkContext.count === this.count); + this.segmentsList.push(...otherForkContext.segmentsList); } /** @@ -219,7 +316,8 @@ class ForkContext { } /** - * Creates the root fork context. + * Creates a new root context, meaning that there are no parent + * fork contexts. * @param {IdGenerator} idGenerator An identifier generator for segments. * @returns {ForkContext} New fork context. */ @@ -234,14 +332,16 @@ class ForkContext { /** * Creates an empty fork context preceded by a given context. * @param {ForkContext} parentContext The parent fork context. - * @param {boolean} forkLeavingPath A flag which shows inside of `finally` block. + * @param {boolean} shouldForkLeavingPath Indicates that we are inside of + * a `finally` block and should therefore fork the path that leaves + * `finally`. * @returns {ForkContext} New fork context. */ - static newEmpty(parentContext, forkLeavingPath) { + static newEmpty(parentContext, shouldForkLeavingPath) { return new ForkContext( parentContext.idGenerator, parentContext, - (forkLeavingPath ? 2 : 1) * parentContext.count + (shouldForkLeavingPath ? 2 : 1) * parentContext.count ); } } 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 4cb2e0e..b580104 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 07bbead..9d33c55 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,10 +11,23 @@ //------------------------------------------------------------------------------ const levn = require("levn"), - ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"); + { + Legacy: { + ConfigOps + } + } = require("@eslint/eslintrc/universal"), + { + directivesPattern + } = require("../shared/directives"); const debug = require("debug")("eslint:config-comment-parser"); +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** @typedef {import("../shared/types").LintMessage} LintMessage */ + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -57,7 +70,7 @@ module.exports = class ConfigCommentParser { * Parses a JSON-like config. * @param {string} string The string to parse. * @param {Object} location Start line and column of comments for potential error message. - * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object + * @returns {({success: true, config: Object}|{success: false, error: LintMessage})} Result map object */ parseJsonConfig(string, location) { debug("Parsing JSON config"); @@ -105,7 +118,8 @@ module.exports = class ConfigCommentParser { severity: 2, message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, line: location.start.line, - column: location.start.column + 1 + column: location.start.column + 1, + nodeType: null } }; @@ -127,9 +141,8 @@ module.exports = class ConfigCommentParser { const items = {}; - // Collapse whitespace around commas - string.replace(/\s*,\s*/gu, ",").split(/,+/u).forEach(name => { - const trimmedName = name.trim(); + string.split(",").forEach(name => { + const trimmedName = name.trim().replace(/^(?['"]?)(?.*)\k$/us, "$"); if (trimmedName) { items[trimmedName] = true; @@ -138,4 +151,35 @@ module.exports = class ConfigCommentParser { return items; } + /** + * 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. + */ + 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 a directive comment into directive text and value. + * @param {Comment} comment The comment node with the directive to be parsed. + * @returns {{directiveText: string, directiveValue: string}} The directive text and value. + */ + parseDirective(comment) { + const { directivePart } = this.extractDirectiveComment(comment.value); + const match = directivesPattern.exec(directivePart); + const directiveText = match[1]; + const directiveValue = directivePart.slice(match.index + directiveText.length); + + return { directiveText, directiveValue }; + } }; diff --git a/node_modules/eslint/lib/linter/linter.js b/node_modules/eslint/lib/linter/linter.js index 4e80926..f74d0ec 100644 --- a/node_modules/eslint/lib/linter/linter.js +++ b/node_modules/eslint/lib/linter/linter.js @@ -16,11 +16,18 @@ const evk = require("eslint-visitor-keys"), espree = require("espree"), merge = require("lodash.merge"), - BuiltInEnvironments = require("@eslint/eslintrc/conf/environments"), 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,7 +40,11 @@ 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 { RuleValidator } = require("../config/rule-validator"); +const { assertIsRuleOptions, assertIsRuleSeverity } = require("../config/flat-config-schema"); +const { normalizeSeverityToString } = require("../shared/severity"); const debug = require("debug")("eslint:linter"); const MAX_AUTOFIX_PASSES = 10; const DEFAULT_PARSER_NAME = "espree"; @@ -46,27 +57,32 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser"); // 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 */ /** @@ -74,6 +90,7 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser"); * @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. */ @@ -94,12 +111,12 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser"); * @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. */ @@ -120,6 +137,15 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser"); // 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); +} + /** * Ensures that variables representing built-in properties of the Global Object, * and any globals declared by special block comments, are present in the global @@ -168,6 +194,7 @@ function addDeclaredGlobals(globalScope, configGlobals, { exportedVariables, ena if (variable) { variable.eslintUsed = true; + variable.eslintExported = true; } }); @@ -242,14 +269,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 = { @@ -257,39 +285,49 @@ 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. - */ -function stripDirectiveComment(value) { - return value.split(/\s-{2,}\s/u)[0].trim(); -} - /** * 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 {SourceCode} sourceCode The SourceCode object to get comments from. * @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[]}} + * @returns {{configuredRules: Object, enabledGlobals: {value:string,comment:Token}[], exportedVariables: Object, problems: LintMessage[], 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(sourceCode, ruleMapper, warnInlineConfig) { const configuredRules = {}; const enabledGlobals = Object.create(null); const exportedVariables = {}; @@ -299,9 +337,10 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { builtInRules: Rules }); - 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); + sourceCode.getInlineConfigNodes().filter(token => token.type !== "Shebang").forEach(comment => { + const { directivePart, justificationPart } = commentParser.extractDirectiveComment(comment.value); + + const match = directivesPattern.exec(directivePart); if (!match) { return; @@ -325,7 +364,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({ @@ -336,7 +375,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": @@ -344,7 +383,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); @@ -392,7 +431,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,6 +471,69 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { }; } +/** + * Parses comments in file to extract disable directives. + * @param {SourceCode} sourceCode The SourceCode object to get comments from. + * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules + * @returns {{problems: LintMessage[], disableDirectives: DisableDirective[]}} + * A collection of the directive comments that were found, along with any problems that occurred when parsing + */ +function getDirectiveCommentsForFlatConfig(sourceCode, ruleMapper) { + const problems = []; + const disableDirectives = []; + + sourceCode.getInlineConfigNodes().filter(token => token.type !== "Shebang").forEach(comment => { + const { directivePart, justificationPart } = commentParser.extractDirectiveComment(comment.value); + + const match = directivesPattern.exec(directivePart); + + if (!match) { + return; + } + const directiveText = match[1]; + const lineCommentSupported = /^eslint-disable-(next-)?line$/u.test(directiveText); + + if (comment.type === "Line" && !lineCommentSupported) { + return; + } + + 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({ + ruleId: null, + message, + loc: comment.loc + })); + return; + } + + const directiveValue = directivePart.slice(match.index + directiveText.length); + + switch (directiveText) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = directiveText.slice("eslint-".length); + const options = { commentToken: comment, type: directiveType, value: directiveValue, justification: justificationPart, ruleMapper }; + const { directives, directiveProblems } = createDisableDirectives(options); + + disableDirectives.push(...directives); + problems.push(...directiveProblems); + break; + } + + // no default + } + }); + + return { + problems, + disableDirectives + }; +} + /** * Normalize ECMAScript version from the initial config * @param {Parser} parser The parser which uses this options. @@ -439,7 +541,8 @@ function getDirectiveComments(filename, ast, ruleMapper, warnInlineConfig) { * @returns {number} normalized ECMAScript version */ function normalizeEcmaVersion(parser, ecmaVersion) { - if ((parser[parserSymbol] || parser) === espree) { + + if (isEspree(parser)) { if (ecmaVersion === "latest") { return espree.latestEcmaVersion; } @@ -452,7 +555,39 @@ function normalizeEcmaVersion(parser, ecmaVersion) { return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion; } -const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gsu; +/** + * 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. @@ -465,10 +600,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(commentParser.extractDirectiveComment(match[1]).directivePart) + ); + } } return retv; @@ -478,7 +615,7 @@ function findEslintEnv(text) { * Convert "/path/to/" to "". * `CLIEngine#executeOnText()` method gives "/path/to/" if the filename * was omitted because `configArray.extractConfig()` requires an absolute path. - * But the linter should pass `` to `RuleContext#getFilename()` in that + * But the linter should pass `` to `RuleContext#filename` in that * case. * Also, code blocks can have their virtual filename. If the parent filename was * ``, the virtual filename is `/0_foo.js` or something like (i.e., @@ -501,7 +638,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})` @@ -513,7 +654,11 @@ function normalizeVerifyOptions(providedOptions, config) { reportUnusedDisableDirectives = reportUnusedDisableDirectives ? "error" : "off"; } if (typeof reportUnusedDisableDirectives !== "string") { - reportUnusedDisableDirectives = config.reportUnusedDisableDirectives ? "warn" : "off"; + if (typeof linterOptions.reportUnusedDisableDirectives === "boolean") { + reportUnusedDisableDirectives = linterOptions.reportUnusedDisableDirectives ? "warn" : "off"; + } else { + reportUnusedDisableDirectives = linterOptions.reportUnusedDisableDirectives === void 0 ? "off" : normalizeSeverityToString(linterOptions.reportUnusedDisableDirectives); + } } return { @@ -556,6 +701,30 @@ function resolveParserOptions(parser, providedOptions, enabledEnvironments) { 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 @@ -604,20 +773,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 || DEFAULT_ECMA_VERSION; + 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 }); @@ -628,25 +798,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}} + * @returns {{success: false, error: LintMessage}|{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 @@ -655,13 +829,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, @@ -695,69 +876,18 @@ function parse(text, parser, providedParserOptions, filePath) { severity: 2, message, line: ex.lineNumber, - column: ex.column + column: ex.column, + nodeType: null } }; } } -/** - * Gets the scope for the current node - * @param {ScopeManager} scopeManager The scope manager for this AST - * @param {ASTNode} currentNode The node to get the scope of - * @returns {eslint-scope.Scope} The scope information for this node - */ -function getScope(scopeManager, currentNode) { - - // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. - const inner = currentNode.type !== "Program"; - - for (let node = currentNode; node; node = node.parent) { - const scope = scopeManager.acquire(node, inner); - - if (scope) { - if (scope.type === "function-expression-name") { - return scope.childScopes[0]; - } - return scope; - } - } - - return scopeManager.scopes[0]; -} - -/** - * 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 {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"; - const currentScope = getScope(scopeManager, currentNode); - - // Special Node.js scope means we need to start one level deeper - const initialScope = currentScope.type === "global" && specialScope ? currentScope.childScopes[0] : currentScope; - - for (let scope = initialScope; scope; scope = scope.upper) { - const variable = scope.variables.find(scopeVar => scopeVar.name === name); - - if (variable) { - variable.eslintUsed = true; - return true; - } - } - - return false; -} - /** * 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) { @@ -769,22 +899,6 @@ function createRuleListeners(rule, ruleContext) { } } -/** - * Gets all the ancestors of a given node - * @param {ASTNode} node The node - * @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting - * from the root node and going inwards to the parent node. - */ -function getAncestors(node) { - const ancestorsStartingAtParent = []; - - for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { - ancestorsStartingAtParent.push(ancestor); - } - - return ancestorsStartingAtParent.reverse(); -} - // methods that exist on SourceCode object const DEPRECATED_SOURCECODE_PASSTHROUGHS = { getSource: "getText", @@ -809,12 +923,13 @@ const DEPRECATED_SOURCECODE_PASSTHROUGHS = { getTokensBetween: "getTokensBetween" }; + const BASE_TRAVERSAL_CONTEXT = Object.freeze( Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).reduce( (contextInfo, methodName) => Object.assign(contextInfo, { [methodName](...args) { - return this.getSourceCode()[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args); + return this.sourceCode[DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]](...args); } }), {} @@ -826,16 +941,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 + * @returns {LintMessage[]} An array of reported problems */ -function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parserName, settings, filename, disableFixes, cwd, physicalFilename) { +function runRules(sourceCode, configuredRules, ruleMapper, parserName, languageOptions, settings, filename, disableFixes, cwd, physicalFilename) { const emitter = createEmitter(); const nodeQueue = []; let currentNode = sourceCode.ast; @@ -860,23 +975,29 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser Object.assign( Object.create(BASE_TRAVERSAL_CONTEXT), { - getAncestors: () => getAncestors(currentNode), - getDeclaredVariables: sourceCode.scopeManager.getDeclaredVariables.bind(sourceCode.scopeManager), + getAncestors: () => sourceCode.getAncestors(currentNode), + getDeclaredVariables: node => sourceCode.getDeclaredVariables(node), getCwd: () => cwd, + cwd, getFilename: () => filename, + filename, getPhysicalFilename: () => physicalFilename || filename, - getScope: () => getScope(sourceCode.scopeManager, currentNode), + physicalFilename: physicalFilename || filename, + getScope: () => sourceCode.getScope(currentNode), getSourceCode: () => sourceCode, - markVariableAsUsed: name => markVariableAsUsed(sourceCode.scopeManager, currentNode, parserOptions, name), - parserOptions, + sourceCode, + markVariableAsUsed: name => sourceCode.markVariableAsUsed(name, currentNode), + parserOptions: { + ...languageOptions.parserOptions + }, parserPath: parserName, + languageOptions, parserServices: sourceCode.parserServices, settings } ) ); - const lintingProblems = []; Object.keys(configuredRules).forEach(ruleId => { @@ -889,7 +1010,7 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser const rule = ruleMapper(ruleId); - if (rule === null) { + if (!rule) { lintingProblems.push(createLintingProblem({ ruleId })); return; } @@ -925,8 +1046,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); } @@ -934,15 +1063,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) ); }); }); @@ -1027,7 +1178,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; } @@ -1037,26 +1188,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() }); @@ -1078,7 +1247,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); @@ -1110,7 +1280,8 @@ class Linter { severity: 2, message: `Configured parser '${config.parser}' was not found.`, line: 0, - column: 0 + column: 0, + nodeType: null }]; } parserName = config.parser; @@ -1130,12 +1301,16 @@ class Linter { 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 ); @@ -1156,14 +1331,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, ruleId => getRule(slots, ruleId), options.warnInlineConfig) : { configuredRules: {}, enabledGlobals: {}, exportedVariables: {}, problems: [], disableDirectives: [] }; // augment global scope with declared global variables @@ -1174,7 +1349,6 @@ class Linter { ); const configuredRules = Object.assign({}, config.rules, commentDirectives.configuredRules); - let lintingProblems; try { @@ -1182,8 +1356,8 @@ class Linter { sourceCode, configuredRules, ruleId => getRule(slots, ruleId), - parserOptions, parserName, + languageOptions, settings, options.filename, options.disableFixes, @@ -1203,11 +1377,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), @@ -1226,23 +1406,370 @@ class Linter { */ verify(textOrSourceCode, config, filenameOrOptions) { debug("Verify"); + + const { configType, cwd } = 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, { basePath: cwd }); + 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, + nodeType: null + } + ]; + } + + 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 + ); + + // 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; + + /* + * Make adjustments based on the language options. For JavaScript, + * this is primarily about adding variables into the global scope + * to account for ecmaVersion and configured globals. + */ + sourceCode.applyLanguageOptions(languageOptions); + + const mergedInlineConfig = { + rules: {} + }; + const inlineConfigProblems = []; + + /* + * Inline config can be either enabled or disabled. If disabled, it's possible + * to detect the inline config and emit a warning (though this is not required). + * So we first check to see if inline config is allowed at all, and if so, we + * need to check if it's a warning or not. + */ + if (options.allowInlineConfig) { + + // if inline config should warn then add the warnings + if (options.warnInlineConfig) { + sourceCode.getInlineConfigNodes().forEach(node => { + inlineConfigProblems.push(createLintingProblem({ + ruleId: null, + message: `'${sourceCode.text.slice(node.range[0], node.range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`, + loc: node.loc, + severity: 1 + })); + + }); + } else { + const inlineConfigResult = sourceCode.applyInlineConfig(); + + inlineConfigProblems.push( + ...inlineConfigResult.problems + .map(createLintingProblem) + .map(problem => { + problem.fatal = true; + return problem; + }) + ); + + // next we need to verify information about the specified rules + const ruleValidator = new RuleValidator(); + + for (const { config: inlineConfig, node } of inlineConfigResult.configs) { + + Object.keys(inlineConfig.rules).forEach(ruleId => { + const rule = getRuleFromConfig(ruleId, config); + const ruleValue = inlineConfig.rules[ruleId]; + + if (!rule) { + inlineConfigProblems.push(createLintingProblem({ ruleId, loc: node.loc })); + return; + } + + try { + + const ruleOptions = Array.isArray(ruleValue) ? ruleValue : [ruleValue]; + + assertIsRuleOptions(ruleId, ruleValue); + assertIsRuleSeverity(ruleId, ruleOptions[0]); + + ruleValidator.validate({ + plugins: config.plugins, + rules: { + [ruleId]: ruleOptions + } + }); + mergedInlineConfig.rules[ruleId] = ruleValue; + } catch (err) { + + let baseMessage = err.message.slice( + err.message.startsWith("Key \"rules\":") + ? err.message.indexOf(":", 12) + 1 + : err.message.indexOf(":") + 1 + ).trim(); + + if (err.messageTemplate) { + baseMessage += ` You passed "${ruleValue}".`; + } + + inlineConfigProblems.push(createLintingProblem({ + ruleId, + message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`, + loc: node.loc + })); + } + }); + } + } + } + + const commentDirectives = options.allowInlineConfig && !options.warnInlineConfig + ? getDirectiveCommentsForFlatConfig( + sourceCode, + ruleId => getRuleFromConfig(ruleId, config) + ) + : { problems: [], disableDirectives: [] }; + + const configuredRules = Object.assign({}, config.rules, mergedInlineConfig.rules); + let lintingProblems; + + sourceCode.finalize(); + + 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) + .concat(inlineConfigProblems) + .sort((problemA, problemB) => problemA.line - problemB.line || problemA.column - problemB.column), + reportUnusedDisableDirectives: options.reportUnusedDisableDirectives + }); } /** @@ -1250,7 +1777,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); @@ -1280,13 +1807,67 @@ 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, + nodeType: null + } + ]; + } + + // 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 || ""; @@ -1294,14 +1875,37 @@ class Linter { const physicalFilename = options.physicalFilename || filenameToExpose; const text = ensureText(textOrSourceCode); const preprocess = options.preprocess || (rawText => [rawText]); - - // TODO(stephenwade): Replace this with array.flat() when we drop support for Node v10 - const postprocess = options.postprocess || (array => [].concat(...array)); + 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, + nodeType: null + } + ]; + } + + const messageLists = blocks.map((block, i) => { debug("A code block was found: %o", block.filename || "(unnamed)"); // Keep the legacy behavior. @@ -1339,6 +1943,30 @@ class Linter { 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 {Array} 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. @@ -1347,6 +1975,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 @@ -1354,6 +1990,7 @@ class Linter { * @returns {void} */ defineRule(ruleId, ruleModule) { + assertEslintrcConfig(this); internalSlotsMap.get(this).ruleMap.define(ruleId, ruleModule); } @@ -1363,6 +2000,7 @@ class Linter { * @returns {void} */ defineRules(rulesToDefine) { + assertEslintrcConfig(this); Object.getOwnPropertyNames(rulesToDefine).forEach(ruleId => { this.defineRule(ruleId, rulesToDefine[ruleId]); }); @@ -1373,6 +2011,7 @@ class Linter { * @returns {Map} All loaded rules */ getRules() { + assertEslintrcConfig(this); const { lastConfigArray, ruleMap } = internalSlotsMap.get(this); return new Map(function *() { @@ -1391,6 +2030,7 @@ class Linter { * @returns {void} */ defineParser(parserId, parserModule) { + assertEslintrcConfig(this); internalSlotsMap.get(this).parserMap.set(parserId, parserModule); } @@ -1398,7 +2038,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 8b619fd..d56bef2 100644 --- a/node_modules/eslint/lib/linter/node-event-generator.js +++ b/node_modules/eslint/lib/linter/node-event-generator.js @@ -37,9 +37,7 @@ const esquery = require("esquery"); * @returns {any[]} The union of the input arrays */ function union(...arrays) { - - // TODO(stephenwade): Replace this with arrays.flat() when we drop support for Node v10 - return [...new Set([].concat(...arrays))]; + return [...new Set(arrays.flat())]; } /** @@ -100,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; @@ -239,7 +244,6 @@ function parseSelector(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 75005c1..41a43ea 100644 --- a/node_modules/eslint/lib/linter/report-translator.js +++ b/node_modules/eslint/lib/linter/report-translator.js @@ -17,6 +17,8 @@ const interpolate = require("./interpolate"); // Typedefs //------------------------------------------------------------------------------ +/** @typedef {import("../shared/types").LintMessage} LintMessage */ + /** * An error message description * @typedef {Object} MessageDescriptor @@ -29,23 +31,6 @@ const interpolate = require("./interpolate"); * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes. */ -/** - * 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] - */ - //------------------------------------------------------------------------------ // Module Definition //------------------------------------------------------------------------------ @@ -115,6 +100,22 @@ function normalizeReportLoc(descriptor) { return descriptor.node.loc; } +/** + * Clones the given fix object. + * @param {Fix|null} fix The fix to clone. + * @returns {Fix|null} Deep cloned fix object or `null` if `null` or `undefined` was passed in. + */ +function cloneFix(fix) { + if (!fix) { + return null; + } + + return { + range: [fix.range[0], fix.range[1]], + text: fix.text + }; +} + /** * Check that a fix has a valid range. * @param {Fix|null} fix The fix to validate. @@ -152,7 +153,7 @@ function mergeFixes(fixes, sourceCode) { return null; } if (fixes.length === 1) { - return fixes[0]; + return cloneFix(fixes[0]); } fixes.sort(compareFixesByRange); @@ -198,7 +199,7 @@ function normalizeFixes(descriptor, sourceCode) { } assertValidFix(fix); - return fix; + return cloneFix(fix); } /** @@ -239,7 +240,7 @@ function mapSuggestions(descriptor, sourceCode, messages) { * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location * @param {{text: string, range: (number[]|null)}} options.fix The fix object * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects - * @returns {function(...args): ReportInfo} Function that returns information about the report + * @returns {LintMessage} Information about the report */ function createProblem(options) { const problem = { @@ -314,7 +315,7 @@ function validateSuggestions(suggest, messages) { * problem for the Node.js API. * @param {{ruleId: string, severity: number, sourceCode: SourceCode, messageIds: Object, disableFixes: boolean}} metadata Metadata for the reported problem * @param {SourceCode} sourceCode The `SourceCode` instance for the text being linted - * @returns {function(...args): ReportInfo} Function that returns information about the report + * @returns {function(...args): LintMessage} Function that returns information about the report */ module.exports = function createReportTranslator(metadata) { diff --git a/node_modules/eslint/lib/linter/rules.js b/node_modules/eslint/lib/linter/rules.js index a153266..647bab6 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 ab21223..f4837c1 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 53dc1dc..15386c9 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 5823030..1076ff2 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 e3661ec..089f347 100644 --- a/node_modules/eslint/lib/options.js +++ b/node_modules/eslint/lib/options.js @@ -32,7 +32,7 @@ const optionator = require("optionator"); * @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 {("problem" | "suggestion" | "layout")[]} [fixType] Specify the types of fixes to apply (problem, suggestion, layout) + * @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 @@ -47,14 +47,16 @@ const optionator = require("optionator"); * @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 {boolean | undefined} reportUnusedDisableDirectives Adds reported errors for unused eslint-disable and eslint-enable directives + * @property {string | undefined} reportUnusedDisableDirectivesSeverity A severity string indicating if and how unused disable and enable directives should be tracked and reported. * @property {string} [resolvePluginsRelativeTo] A folder where plugins should be resolved from, CWD by default * @property {Object} [rule] Specify rules - * @property {string[]} [rulesdir] Use additional rules from this directory + * @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 {boolean} warnIgnored Show warnings when the file list includes ignored files * @property {string[]} _ Positional filenames or patterns */ @@ -63,261 +65,334 @@ const optionator = require("optionator"); //------------------------------------------------------------------------------ // 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", + }; + } + + let warnIgnoredFlag; + + if (usingFlatConfig) { + warnIgnoredFlag = { + option: "warn-ignored", type: "Boolean", default: "true", - description: "Disable use of ignore files and patterns" + description: "Suppress warnings when the file list includes ignored files" + }; + } + + return optionator({ + prepend: "eslint [options] file.js [file.js] [dir]", + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true }, - { - 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: "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" - } - ] -}); + options: [ + { + heading: "Basic configuration" + }, + lookupFlag, + { + option: "config", + alias: "c", + type: "path::String", + description: usingFlatConfig + ? "Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs" + : "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 and eslint-enable directives" + }, + { + option: "report-unused-disable-directives-severity", + type: "String", + default: void 0, + description: "Chooses severity level for reporting unused eslint-disable and eslint-enable directives", + enum: ["off", "warn", "error", "0", "1", "2"] + }, + { + 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" + }, + warnIgnoredFlag, + { + 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/rule-tester.js b/node_modules/eslint/lib/rule-tester/rule-tester.js index 2b55249..3bc80ab 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 @@ -48,22 +48,28 @@ const equal = require("fast-deep-equal"), Traverser = require("../../lib/shared/traverser"), { getRuleOptionsSchema, validate } = require("../shared/config-validator"), - { Linter, SourceCodeFixer, interpolate } = require("../linter"); + { Linter, SourceCodeFixer, interpolate } = require("../linter"), + CodePath = require("../linter/code-path-analysis/code-path"); 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 //------------------------------------------------------------------------------ /** @typedef {import("../shared/types").Parser} Parser */ +/** @typedef {import("../shared/types").Rule} Rule */ + /** * 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. @@ -78,6 +84,7 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser"); /** * 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. @@ -120,6 +127,7 @@ let defaultConfig = { rules: {} }; * configuration */ const RuleTesterParameters = [ + "name", "code", "filename", "options", @@ -155,8 +163,43 @@ const suggestionObjectParameters = new Set([ ]); const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`; +const forbiddenMethods = [ + "applyInlineConfig", + "applyLanguageOptions", + "finalize" +]; + const hasOwnProperty = Function.call.bind(Object.hasOwnProperty); +const DEPRECATED_SOURCECODE_PASSTHROUGHS = { + getSource: "getText", + getSourceLines: "getLines", + getAllComments: "getAllComments", + getNodeByRangeIndex: "getNodeByRangeIndex", + + // getComments: "getComments", -- already handled by a separate error + getCommentsBefore: "getCommentsBefore", + getCommentsAfter: "getCommentsAfter", + getCommentsInside: "getCommentsInside", + getJSDocComment: "getJSDocComment", + getFirstToken: "getFirstToken", + getFirstTokens: "getFirstTokens", + getLastToken: "getLastToken", + getLastTokens: "getLastTokens", + getTokenAfter: "getTokenAfter", + getTokenBefore: "getTokenBefore", + getTokenByRangeStart: "getTokenByRangeStart", + getTokens: "getTokens", + getTokensAfter: "getTokensAfter", + getTokensBefore: "getTokensBefore", + getTokensBetween: "getTokensBetween", + + getScope: "getScope", + getAncestors: "getAncestors", + getDeclaredVariables: "getDeclaredVariables", + markVariableAsUsed: "markVariableAsUsed" +}; + /** * Clones a given value deeply. * Note: This ignores `parent` property. @@ -209,8 +252,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")}` ); } @@ -284,6 +330,107 @@ 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." + ); +} + +/** + * Function to replace forbidden `SourceCode` methods. + * @param {string} methodName The name of the method to forbid. + * @returns {Function} The function that throws the error. + */ +function throwForbiddenMethodError(methodName) { + return () => { + throw new Error( + `\`SourceCode#${methodName}()\` cannot be called inside a rule.` + ); + }; +} + +/** + * 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" + ); + } +} + +/** + * Emit a deprecation warning if a rule uses a deprecated `context` method. + * @param {string} ruleName Name of the rule. + * @param {string} methodName The name of the method on `context` that was used. + * @returns {void} + */ +function emitDeprecatedContextMethodWarning(ruleName, methodName) { + if (!emitDeprecatedContextMethodWarning[`warned-${ruleName}-${methodName}`]) { + emitDeprecatedContextMethodWarning[`warned-${ruleName}-${methodName}`] = true; + process.emitWarning( + `"${ruleName}" rule is using \`context.${methodName}()\`, which is deprecated and will be removed in ESLint v9. Please use \`sourceCode.${DEPRECATED_SOURCECODE_PASSTHROUGHS[methodName]}()\` instead.`, + "DeprecationWarning" + ); + } +} + +/** + * Emit a deprecation warning if rule uses CodePath#currentSegments. + * @param {string} ruleName Name of the rule. + * @returns {void} + */ +function emitCodePathCurrentSegmentsWarning(ruleName) { + if (!emitCodePathCurrentSegmentsWarning[`warned-${ruleName}`]) { + emitCodePathCurrentSegmentsWarning[`warned-${ruleName}`] = true; + process.emitWarning( + `"${ruleName}" rule uses CodePath#currentSegments and will stop working in ESLint v9. Please read the documentation for how to update your code: https://eslint.org/docs/latest/extend/code-path-analysis#usage-examples`, + "DeprecationWarning" + ); + } +} + +/** + * Emit a deprecation warning if `context.parserServices` is used. + * @param {string} ruleName Name of the rule. + * @returns {void} + */ +function emitParserServicesWarning(ruleName) { + if (!emitParserServicesWarning[`warned-${ruleName}`]) { + emitParserServicesWarning[`warned-${ruleName}`] = true; + process.emitWarning( + `"${ruleName}" rule is using \`context.parserServices\`, which is deprecated and will be removed in ESLint v9. Please use \`sourceCode.parserServices\` instead.`, + "DeprecationWarning" + ); + } +} + + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -298,6 +445,7 @@ const IT_ONLY = Symbol("itOnly"); * @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) { @@ -322,6 +470,9 @@ function describeDefaultHandler(text, method) { return method.call(this); } +/** + * Mocha test wrapper. + */ class RuleTester { /** @@ -353,10 +504,11 @@ 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) { - if (typeof config !== "object") { + if (typeof config !== "object" || config === null) { throw new TypeError("RuleTester.setDefaultConfig: config must be an object"); } defaultConfig = config; @@ -437,7 +589,7 @@ class RuleTester { 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/developer-guide/nodejs-api#customizing-ruletester for more." + "See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more." ); } if (typeof it === "function") { @@ -453,21 +605,26 @@ class RuleTester { /** * Define a rule for one particular run of tests. * @param {string} name The name of the rule to define. - * @param {Function} rule The rule definition. + * @param {Function | Rule} rule The rule definition. * @returns {void} */ defineRule(name, rule) { + if (typeof rule === "function") { + emitLegacyRuleAPIWarning(name); + } this.rules[name] = rule; } /** * 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 {Function | Rule} 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) { @@ -493,6 +650,9 @@ class RuleTester { ].concat(scenarioErrors).join("\n")); } + if (typeof rule === "function") { + emitLegacyRuleAPIWarning(ruleName); + } linter.defineRule(ruleName, Object.assign({}, rule, { @@ -502,7 +662,38 @@ class RuleTester { freezeDeeply(context.settings); freezeDeeply(context.parserOptions); - return (typeof rule === "function" ? rule : rule.create)(context); + // wrap all deprecated methods + const newContext = Object.create( + context, + Object.fromEntries(Object.keys(DEPRECATED_SOURCECODE_PASSTHROUGHS).map(methodName => [ + methodName, + { + value(...args) { + + // emit deprecation warning + emitDeprecatedContextMethodWarning(ruleName, methodName); + + // call the original method + return context[methodName].call(this, ...args); + }, + enumerable: true + } + ])) + ); + + // emit warning about context.parserServices + const parserServices = context.parserServices; + + Object.defineProperty(newContext, "parserServices", { + get() { + emitParserServicesWarning(ruleName); + return parserServices; + } + }); + + Object.freeze(newContext); + + return (typeof rule === "function" ? rule : rule.create)(newContext); } })); @@ -511,6 +702,7 @@ 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 */ @@ -549,6 +741,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; @@ -561,14 +762,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"); @@ -607,7 +812,32 @@ class RuleTester { validate(config, "rule-tester", id => (id === ruleName ? rule : null)); // Verify the code. - const messages = linter.verify(code, config, filename); + const { getComments, applyLanguageOptions, applyInlineConfig, finalize } = SourceCode.prototype; + const originalCurrentSegments = Object.getOwnPropertyDescriptor(CodePath.prototype, "currentSegments"); + let messages; + + try { + SourceCode.prototype.getComments = getCommentsDeprecation; + Object.defineProperty(CodePath.prototype, "currentSegments", { + get() { + emitCodePathCurrentSegmentsWarning(ruleName); + return originalCurrentSegments.get.call(this); + } + }); + + forbiddenMethods.forEach(methodName => { + SourceCode.prototype[methodName] = throwForbiddenMethodError(methodName); + }); + + messages = linter.verify(code, config, filename); + } finally { + SourceCode.prototype.getComments = getComments; + Object.defineProperty(CodePath.prototype, "currentSegments", originalCurrentSegments); + SourceCode.prototype.applyInlineConfig = applyInlineConfig; + SourceCode.prototype.applyLanguageOptions = applyLanguageOptions; + SourceCode.prototype.finalize = finalize; + } + const fatalErrorMessage = messages.find(m => m.fatal); assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`); @@ -656,6 +886,13 @@ 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; @@ -696,6 +933,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}`); @@ -921,45 +1162,41 @@ 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); } /* * This creates a mocha test suite and pipes all supplied info through * one of the templates above. + * The test suites for valid/invalid are created conditionally as + * test runners (eg. vitest) fail for empty test suites. */ - RuleTester.describe(ruleName, () => { - RuleTester.describe("valid", () => { - test.valid.forEach(valid => { - RuleTester[valid.only ? "itOnly" : "it"]( - sanitize(typeof valid === "object" ? valid.code : valid), - () => { - testValidTemplate(valid); - } - ); + this.constructor.describe(ruleName, () => { + if (test.valid.length > 0) { + 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); + } + ); + }); }); - }); + } - RuleTester.describe("invalid", () => { - test.invalid.forEach(invalid => { - RuleTester[invalid.only ? "itOnly" : "it"]( - sanitize(invalid.code), - () => { - testInvalidTemplate(invalid); - } - ); + if (test.invalid.length > 0) { + this.constructor.describe("invalid", () => { + test.invalid.forEach(invalid => { + this.constructor[invalid.only ? "itOnly" : "it"]( + sanitize(invalid.name || invalid.code), + () => { + testInvalidTemplate(invalid); + } + ); + }); }); - }); + } }); } } diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js index 0e0d07a..f970328 100644 --- a/node_modules/eslint/lib/rules/accessor-pairs.js +++ b/node_modules/eslint/lib/rules/accessor-pairs.js @@ -134,15 +134,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/accessor-pairs" }, schema: [{ @@ -178,7 +178,7 @@ module.exports = { const checkGetWithoutSet = config.getWithoutSet === true; const checkSetWithoutGet = config.setWithoutGet !== false; const enforceForClassMembers = config.enforceForClassMembers !== false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports the given node. @@ -223,43 +223,6 @@ module.exports = { } } - /** - * Creates a new `AccessorData` object for the given getter or setter node. - * @param {ASTNode} node A getter or setter node. - * @returns {AccessorData} New `AccessorData` object that contains the given node. - * @private - */ - function createAccessorData(node) { - const name = astUtils.getStaticPropertyName(node); - const key = (name !== null) ? name : sourceCode.getTokens(node.key); - - return { - key, - getters: node.kind === "get" ? [node] : [], - setters: node.kind === "set" ? [node] : [] - }; - } - - /** - * Merges the given `AccessorData` object into the given accessors list. - * @param {AccessorData[]} accessors The list to merge into. - * @param {AccessorData} accessorData The object to merge. - * @returns {AccessorData[]} The same instance with the merged object. - * @private - */ - function mergeAccessorData(accessors, accessorData) { - const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); - - if (equalKeyElement) { - equalKeyElement.getters.push(...accessorData.getters); - equalKeyElement.setters.push(...accessorData.setters); - } else { - accessors.push(accessorData); - } - - return accessors; - } - /** * Checks accessor pairs in the given list of nodes. * @param {ASTNode[]} nodes The list to check. @@ -267,10 +230,39 @@ module.exports = { * @private */ function checkList(nodes) { - const accessors = nodes - .filter(isAccessorKind) - .map(createAccessorData) - .reduce(mergeAccessorData, []); + const accessors = []; + let found = false; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + + if (isAccessorKind(node)) { + + // Creates a new `AccessorData` object for the given getter or setter node. + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + // Merges the given `AccessorData` object into the given accessors list. + for (let j = 0; j < accessors.length; j++) { + const accessor = accessors[j]; + + if (areEqualKeys(accessor.key, key)) { + accessor.getters.push(...node.kind === "get" ? [node] : []); + accessor.setters.push(...node.kind === "set" ? [node] : []); + found = true; + break; + } + } + if (!found) { + accessors.push({ + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }); + } + found = false; + } + } for (const { getters, setters } of accessors) { if (checkSetWithoutGet && setters.length && !getters.length) { @@ -299,12 +291,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 b4b4dd4..12ef5b6 100644 --- a/node_modules/eslint/lib/rules/array-bracket-newline.js +++ b/node_modules/eslint/lib/rules/array-bracket-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce linebreaks after open and before close array brackets * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/array-bracket-newline" }, fixable: "whitespace", @@ -56,7 +59,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //---------------------------------------------------------------------- diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js index c2b77a6..9dd3ffd 100644 --- a/node_modules/eslint/lib/rules/array-bracket-spacing.js +++ b/node_modules/eslint/lib/rules/array-bracket-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of array brackets. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/array-bracket-spacing" }, fixable: "whitespace", @@ -53,7 +56,7 @@ module.exports = { }, create(context) { const spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; /** * Determines whether an option is set, relative to the spacing option. diff --git a/node_modules/eslint/lib/rules/array-callback-return.js b/node_modules/eslint/lib/rules/array-callback-return.js index 7267347..6d8f258 100644 --- a/node_modules/eslint/lib/rules/array-callback-return.js +++ b/node_modules/eslint/lib/rules/array-callback-return.js @@ -16,16 +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; - -/** - * Checks a given code path segment is reachable. - * @param {CodePathSegment} segment A segment to check. - * @returns {boolean} `true` if the segment is reachable. - */ -function isReachable(segment) { - return segment.reachable; -} +const TARGET_METHODS = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u; /** * Checks a given node is a member access which has the specified name's @@ -38,6 +29,22 @@ function isTargetMethod(node) { return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS); } +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + /** * Returns a human-legible description of an array method * @param {string} arrayMethodName A method name to fully qualify @@ -125,25 +132,98 @@ function getArrayMethodName(node) { } } - /* istanbul ignore next: unreachable */ + /* c8 ignore next */ return null; } +/** + * Checks if the given node is a void expression. + * @param {ASTNode} node The node to check. + * @returns {boolean} - `true` if the node is a void expression + */ +function isExpressionVoid(node) { + return node.type === "UnaryExpression" && node.operator === "void"; +} + +/** + * Fixes the linting error by prepending "void " to the given node + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function voidPrependFixer(sourceCode, node, fixer) { + + const requiresParens = + + // prepending `void ` will fail if the node has a lower precedence than void + astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression", operator: "void" }) && + + // check if there are parentheses around the node to avoid redundant parentheses + !astUtils.isParenthesised(sourceCode, node); + + // avoid parentheses issues + const returnOrArrowToken = sourceCode.getTokenBefore( + node, + node.parent.type === "ArrowFunctionExpression" + ? astUtils.isArrowToken + + // isReturnToken + : token => token.type === "Keyword" && token.value === "return" + ); + + const firstToken = sourceCode.getTokenAfter(returnOrArrowToken); + + const prependSpace = + + // is return token, as => allows void to be adjacent + returnOrArrowToken.value === "return" && + + // If two tokens (return and "(") are adjacent + returnOrArrowToken.range[1] === firstToken.range[0]; + + return [ + fixer.insertTextBefore(firstToken, `${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`), + fixer.insertTextAfter(node, requiresParens ? ")" : "") + ]; +} + +/** + * Fixes the linting error by `wrapping {}` around the given node's body. + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function curlyWrapFixer(sourceCode, node, fixer) { + const arrowToken = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + const firstToken = sourceCode.getTokenAfter(arrowToken); + const lastToken = sourceCode.getLastToken(node); + + return [ + fixer.insertTextBefore(firstToken, "{"), + fixer.insertTextAfter(lastToken, "}") + ]; +} + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/array-callback-return" }, + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- false positive + hasSuggestions: true, + schema: [ { type: "object", @@ -155,6 +235,10 @@ module.exports = { checkForEach: { type: "boolean", default: false + }, + allowVoid: { + type: "boolean", + default: false } }, additionalProperties: false @@ -165,14 +249,16 @@ module.exports = { expectedAtEnd: "{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.", expectedInside: "{{arrayMethodName}}() expects a return value from {{name}}.", expectedReturnValue: "{{arrayMethodName}}() expects a return value from {{name}}.", - expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}." + expectedNoReturnValue: "{{arrayMethodName}}() expects no useless return value from {{name}}.", + wrapBraces: "Wrap the expression in `{}`.", + prependVoid: "Prepend `void` to the expression." } }, create(context) { - const options = context.options[0] || { allowImplicit: false, checkForEach: false }; - const sourceCode = context.getSourceCode(); + const options = context.options[0] || { allowImplicit: false, checkForEach: false, allowVoid: false }; + const sourceCode = context.sourceCode; let funcInfo = { arrayMethodName: null, @@ -198,26 +284,56 @@ module.exports = { return; } - let messageId = null; + const messageAndSuggestions = { messageId: "", suggest: [] }; if (funcInfo.arrayMethodName === "forEach") { if (options.checkForEach && node.type === "ArrowFunctionExpression" && node.expression) { - messageId = "expectedNoReturnValue"; + + if (options.allowVoid) { + if (isExpressionVoid(node.body)) { + return; + } + + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [ + { + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }, + { + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.body, fixer); + } + } + ]; + } else { + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [{ + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }]; + } } } else { - if (node.body.type === "BlockStatement" && funcInfo.codePath.currentSegments.some(isReachable)) { - messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; + if (node.body.type === "BlockStatement" && isAnySegmentReachable(funcInfo.currentSegments)) { + messageAndSuggestions.messageId = funcInfo.hasReturn ? "expectedAtEnd" : "expectedInside"; } } - if (messageId) { + if (messageAndSuggestions.messageId) { const name = astUtils.getFunctionNameWithKind(node); context.report({ node, loc: astUtils.getFunctionHeadLoc(node, sourceCode), - messageId, - data: { name, arrayMethodName: fullMethodName(funcInfo.arrayMethodName) } + messageId: messageAndSuggestions.messageId, + data: { name, arrayMethodName: fullMethodName(funcInfo.arrayMethodName) }, + suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null }); } } @@ -242,7 +358,8 @@ module.exports = { methodName && !node.async && !node.generator, - node + node, + currentSegments: new Set() }; }, @@ -251,6 +368,23 @@ module.exports = { funcInfo = funcInfo.upper; }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + // Checks the return statement is valid. ReturnStatement(node) { @@ -260,30 +394,46 @@ module.exports = { funcInfo.hasReturn = true; - let messageId = null; + const messageAndSuggestions = { messageId: "", suggest: [] }; if (funcInfo.arrayMethodName === "forEach") { // if checkForEach: true, returning a value at any path inside a forEach is not allowed if (options.checkForEach && node.argument) { - messageId = "expectedNoReturnValue"; + + if (options.allowVoid) { + if (isExpressionVoid(node.argument)) { + return; + } + + messageAndSuggestions.messageId = "expectedNoReturnValue"; + messageAndSuggestions.suggest = [{ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.argument, fixer); + } + }]; + } else { + messageAndSuggestions.messageId = "expectedNoReturnValue"; + } } } else { // if allowImplicit: false, should also check node.argument if (!options.allowImplicit && !node.argument) { - messageId = "expectedReturnValue"; + messageAndSuggestions.messageId = "expectedReturnValue"; } } - if (messageId) { + if (messageAndSuggestions.messageId) { context.report({ node, - messageId, + messageId: messageAndSuggestions.messageId, data: { name: astUtils.getFunctionNameWithKind(funcInfo.node), arrayMethodName: fullMethodName(funcInfo.arrayMethodName) - } + }, + suggest: messageAndSuggestions.suggest.length !== 0 ? messageAndSuggestions.suggest : null }); } }, diff --git a/node_modules/eslint/lib/rules/array-element-newline.js b/node_modules/eslint/lib/rules/array-element-newline.js index b7a9678..504fe04 100644 --- a/node_modules/eslint/lib/rules/array-element-newline.js +++ b/node_modules/eslint/lib/rules/array-element-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce line breaks after each array element * @author Jan Peer Stöcklmair + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/array-element-newline" }, fixable: "whitespace", @@ -47,6 +50,7 @@ module.exports = { ] } }, + type: "array", items: [ { oneOf: [ @@ -78,7 +82,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //---------------------------------------------------------------------- // Helpers @@ -239,19 +243,25 @@ module.exports = { .some(element => element.loc.start.line !== element.loc.end.line); } - const linebreaksCount = node.elements.map((element, i) => { + let linebreaksCount = 0; + + for (let i = 0; i < node.elements.length; i++) { + const element = node.elements[i]; + const previousElement = elements[i - 1]; if (i === 0 || element === null || previousElement === null) { - return false; + continue; } const commaToken = sourceCode.getFirstTokenBetween(previousElement, element, astUtils.isCommaToken); const lastTokenOfPreviousElement = sourceCode.getTokenBefore(commaToken); const firstTokenOfCurrentElement = sourceCode.getTokenAfter(commaToken); - return !astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement); - }).filter(isBreak => isBreak === true).length; + if (!astUtils.isTokenOnSameLine(lastTokenOfPreviousElement, firstTokenOfCurrentElement)) { + linebreaksCount++; + } + } const needsLinebreaks = ( elements.length >= options.minItems || diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js index 5b8a5f0..7590704 100644 --- a/node_modules/eslint/lib/rules/arrow-body-style.js +++ b/node_modules/eslint/lib/rules/arrow-body-style.js @@ -14,15 +14,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/arrow-body-style" }, schema: { @@ -74,7 +74,7 @@ module.exports = { const asNeeded = !options[0] || options[0] === "as-needed"; const never = options[0] === "never"; const requireReturnForObjectLiteral = options[1] && options[1].requireReturnForObjectLiteral; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let funcInfo = null; /** diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js index eaa1aab..2206d8c 100644 --- a/node_modules/eslint/lib/rules/arrow-parens.js +++ b/node_modules/eslint/lib/rules/arrow-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require parens in arrow function arguments. * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -27,15 +28,17 @@ function hasBlockBody(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/arrow-parens" }, fixable: "code", @@ -69,7 +72,7 @@ module.exports = { const asNeeded = context.options[0] === "as-needed"; const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Finds opening paren of parameters for the given arrow function, if it exists. diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js index e5110c6..2b7d464 100644 --- a/node_modules/eslint/lib/rules/arrow-spacing.js +++ b/node_modules/eslint/lib/rules/arrow-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to define spacing before/after arrow function's arrow. * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/arrow-spacing" }, fixable: "whitespace", @@ -61,7 +64,7 @@ module.exports = { rule.before = rule.before !== false; rule.after = rule.after !== false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Get tokens of arrow(`=>`) and before/after arrow. diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js index 481057b..ec597d5 100644 --- a/node_modules/eslint/lib/rules/block-scoped-var.js +++ b/node_modules/eslint/lib/rules/block-scoped-var.js @@ -8,26 +8,27 @@ // 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" + url: "https://eslint.org/docs/latest/rules/block-scoped-var" }, schema: [], messages: { - outOfScope: "'{{name}}' used outside of binding context." + outOfScope: "'{{name}}' declared on line {{definitionLine}} column {{definitionColumn}} is used outside of binding context." } }, create(context) { let stack = []; + const sourceCode = context.sourceCode; /** * Makes a block scope. @@ -49,12 +50,22 @@ module.exports = { /** * Reports a given reference. * @param {eslint-scope.Reference} reference A reference to report. + * @param {eslint-scope.Definition} definition A definition for which to report reference. * @returns {void} */ - function report(reference) { + function report(reference, definition) { const identifier = reference.identifier; + const definitionPosition = definition.name.loc.start; - context.report({ node: identifier, messageId: "outOfScope", data: { name: identifier.name } }); + context.report({ + node: identifier, + messageId: "outOfScope", + data: { + name: identifier.name, + definitionLine: definitionPosition.line, + definitionColumn: definitionPosition.column + 1 + } + }); } /** @@ -83,7 +94,7 @@ module.exports = { } // Gets declared variables, and checks its references. - const variables = context.getDeclaredVariables(node); + const variables = sourceCode.getDeclaredVariables(node); for (let i = 0; i < variables.length; ++i) { @@ -91,7 +102,7 @@ module.exports = { variables[i] .references .filter(isOutsideOfScope) - .forEach(report); + .forEach(ref => report(ref, variables[i].defs.find(def => def.parent === node))); } } @@ -113,6 +124,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 c4b30b0..9ca4611 100644 --- a/node_modules/eslint/lib/rules/block-spacing.js +++ b/node_modules/eslint/lib/rules/block-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const util = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/block-spacing" }, fixable: "whitespace", @@ -37,11 +40,11 @@ module.exports = { create(context) { const always = (context.options[0] !== "never"), messageId = always ? "missing" : "extra", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; /** * 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 +54,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 +82,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 +167,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 07223d1..0fb4c65 100644 --- a/node_modules/eslint/lib/rules/brace-style.js +++ b/node_modules/eslint/lib/rules/brace-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag block statements that do not use the one true brace style * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/brace-style" }, schema: [ @@ -53,7 +56,7 @@ module.exports = { create(context) { const style = context.options[0] || "1tbs", params = context.options[1] || {}, - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -156,6 +159,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 fa66e63..5d441bd 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,10 +19,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/callback-return" }, schema: [{ @@ -36,7 +37,7 @@ module.exports = { create(context) { const callbacks = context.options[0] || ["callback", "cb", "next"], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -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 d34656c..51bb412 100644 --- a/node_modules/eslint/lib/rules/camelcase.js +++ b/node_modules/eslint/lib/rules/camelcase.js @@ -5,19 +5,25 @@ "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" + url: "https://eslint.org/docs/latest/rules/camelcase" }, schema: [ @@ -55,32 +61,26 @@ 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"; - } + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // 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 +89,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,94 +108,76 @@ 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; - - if (parent && parent.type === "Property" && parent.computed && parent.key === current) { - return false; - } - - if (current.type === "ObjectPattern") { - return true; - } - - current = parent; - } - - return false; + function isGoodName(name) { + return !isUnderscored(name) || isAllowed(name); } /** - * 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 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 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 - ) - ); - } - 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. - */ - function isReferenceToGlobalVariable(node) { - const variable = globalScope.set.get(node.name); - - return variable && variable.defs.length === 0 && - variable.references.some(ref => ref.identifier === node); - } - - /** - * 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 - */ - function isPropertyNameInObjectLiteral(node) { + function isAssignmentTarget(node) { const parent = node.parent; - return ( - parent.type === "Property" && - parent.parent.type === "ObjectExpression" && - !parent.computed && - parent.key === node - ); + 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; + + default: + return false; + } + } + + /** + * 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 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; + } } /** @@ -204,122 +187,213 @@ module.exports = { * @private */ function report(node) { - if (!reported.includes(node)) { - reported.push(node); - context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + 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 } + }); + } + + /** + * Reports an identifier reference or a binding identifier. + * @param {ASTNode} node The `Identifier` node to report. + * @returns {void} + */ + function reportReferenceId(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; + } + + /* + * 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 { - Program() { - globalScope = context.getScope(); + // Report camelcase of global variable references ------------------ + Program(node) { + const scope = sourceCode.getScope(node); + + if (!ignoreGlobals) { + + // 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) { + + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(reference.identifier); + } + } + } + + // Undefined globals. + for (const reference of scope.through) { + const id = reference.identifier; + + if (isGoodName(id.name)) { + continue; + } + + /* + * For backward compatibility, this rule reports read-only + * references as well. + */ + reportReferenceId(id); + } }, - Identifier(node) { + // Report camelcase of declared variables -------------------------- + [[ + "VariableDeclaration", + "FunctionDeclaration", + "FunctionExpression", + "ArrowFunctionExpression", + "ClassDeclaration", + "ClassExpression", + "CatchClause" + ]](node) { + for (const variable of sourceCode.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; + } + const id = variable.identifiers[0]; - /* - * 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; + // Report declaration. + if (!(ignoreDestructuring && equalsToOriginalName(id))) { + report(id); + } - // First, we ignore the node if it match the ignore list - if (isAllowed(name)) { + /* + * 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); + } + } + }, + + // 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; } - - // Check if it's a global variable - if (ignoreGlobals && isReferenceToGlobalVariable(node) && !isPropertyNameInObjectLiteral(node)) { + report(node); + }, + "MemberExpression[computed!=true] > Identifier.property"(node) { + if ( + properties === "never" || + !isAssignmentTarget(node.parent) || // ← ignore read-only references. + isGoodName(node.name) + ) { return; } + report(node); + }, - // MemberExpressions get special rules - if (node.parent.type === "MemberExpression") { + // Report camelcase in import -------------------------------------- + ImportDeclaration(node) { + for (const variable of sourceCode.getDeclaredVariables(node)) { + if (isGoodName(variable.name)) { + continue; + } + const id = variable.identifiers[0]; - // "never" check properties - if (properties === "never") { - return; + // Report declaration. + if (!(ignoreImports && equalsToOriginalName(id))) { + report(id); } - // 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); - - } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) { - 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); } + } + }, + + // Report camelcase in re-export ----------------------------------- + [[ + "ExportAllDeclaration > Identifier.exported", + "ExportSpecifier > Identifier.exported" + ]](node) { + if (isGoodName(node.name)) { + return; + } + report(node); + }, + + // Report camelcase in labels -------------------------------------- + [[ + "LabeledStatement > Identifier.label", /* - * Properties have their own rules, and - * AssignmentPattern nodes can be treated like Properties: - * e.g.: const { no_camelcased = false } = bar; + * For backward compatibility, report references as well. + * It looks unnecessary because declarations are reported. */ - } 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); - } - - // prevent checking righthand side of destructured object - if (node.parent.key === node && node.parent.value !== node) { - return; - } - - const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; - - // ignore destructuring if the option is set, unless a new identifier is created - if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { - report(node); - } - } - - // "never" check properties or always ignore destructuring - if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { - return; - } - - // 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); - } - - // Check if it's an import specifier - } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) { - - if (node.parent.type === "ImportSpecifier" && ignoreImports) { - return; - } - - // Report only if the local imported identifier is underscored - if ( - node.parent.local && - node.parent.local.name === node.name && - nameIsUnderscored - ) { - report(node); - } - - // Report anything that is underscored that isn't a CallExpression - } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { - report(node); + "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 d7524b8..3a17b05 100644 --- a/node_modules/eslint/lib/rules/capitalized-comments.js +++ b/node_modules/eslint/lib/rules/capitalized-comments.js @@ -99,15 +99,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/capitalized-comments" }, fixable: "code", @@ -139,7 +139,7 @@ module.exports = { const capitalize = context.options[0] || "always", normalizedOptions = getAllNormalizedOptions(context.options[1]), - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; createRegExpForIgnorePatterns(normalizedOptions); @@ -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 2cc5cc4..9cf8a1b 100644 --- a/node_modules/eslint/lib/rules/class-methods-use-this.js +++ b/node_modules/eslint/lib/rules/class-methods-use-this.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/class-methods-use-this" }, schema: [{ @@ -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.sourceCode), 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 798c111..5f4180f 100644 --- a/node_modules/eslint/lib/rules/comma-dangle.js +++ b/node_modules/eslint/lib/rules/comma-dangle.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to forbid or enforce dangling commas. * @author Ian Christian Myers + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -50,7 +51,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) { @@ -70,15 +71,17 @@ function normalizeOptions(optionValue, ecmaVersion) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/comma-dangle" }, fixable: "code", @@ -123,7 +126,8 @@ module.exports = { } ] } - ] + ], + additionalItems: false }, messages: { @@ -133,9 +137,9 @@ 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(); + const sourceCode = context.sourceCode; /** * Gets the last item of the given node. @@ -242,8 +246,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), ""); } }); } @@ -281,8 +295,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), ""); } }); } @@ -325,7 +349,7 @@ module.exports = { "always-multiline": forceTrailingCommaIfMultiline, "only-multiline": allowTrailingCommaIfMultiline, never: forbidTrailingComma, - ignore: () => {} + ignore() {} }; return { diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js index 2bf41a0..e266de4 100644 --- a/node_modules/eslint/lib/rules/comma-spacing.js +++ b/node_modules/eslint/lib/rules/comma-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Comma spacing - validates spacing before and after comma * @author Vignesh Anand aka vegetableman. + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/comma-spacing" }, fixable: "whitespace", @@ -48,7 +51,7 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokensAndComments = sourceCode.tokensAndComments; const options = { @@ -103,38 +106,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 +143,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.includes(token) ? 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 824ad89..0b51219 100644 --- a/node_modules/eslint/lib/rules/comma-style.js +++ b/node_modules/eslint/lib/rules/comma-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Comma style - enforces comma styles of two types: last and first * @author Vignesh Anand aka vegetableman + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/comma-style" }, fixable: "code", @@ -51,7 +54,7 @@ module.exports = { create(context) { const style = context.options[0] || "last", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; const exceptions = { ArrayPattern: true, ArrowFunctionExpression: true, diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js index 116c8ad..b792507 100644 --- a/node_modules/eslint/lib/rules/complexity.js +++ b/node_modules/eslint/lib/rules/complexity.js @@ -17,15 +17,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/complexity" }, schema: [ @@ -75,60 +75,16 @@ module.exports = { // Helpers //-------------------------------------------------------------------------- - // Using a stack to store complexity (handling nested functions) - const fns = []; + // Using a stack to store complexity per code path + const complexities = []; /** - * 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 = upperCaseFirst(astUtils.getFunctionNameWithKind(node)); - const complexity = fns.pop(); - - if (complexity > THRESHOLD) { - context.report({ - node, - messageId: "complex", - data: { name, complexity, max: THRESHOLD } - }); - } - } - - /** - * 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]++; } //-------------------------------------------------------------------------- @@ -136,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, @@ -150,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 53fdb8f..2852877 100644 --- a/node_modules/eslint/lib/rules/computed-property-spacing.js +++ b/node_modules/eslint/lib/rules/computed-property-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside computed properties. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/computed-property-spacing" }, fixable: "whitespace", @@ -49,7 +52,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" const enforceForClassMembers = !context.options[1] || context.options[1].enforceForClassMembers; @@ -195,7 +198,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 0e20209..304e924 100644 --- a/node_modules/eslint/lib/rules/consistent-return.js +++ b/node_modules/eslint/lib/rules/consistent-return.js @@ -16,12 +16,19 @@ const { upperCaseFirst } = require("../shared/string-utils"); //------------------------------------------------------------------------------ /** - * Checks whether or not a given code path segment is unreachable. - * @param {CodePathSegment} segment A CodePathSegment to check. - * @returns {boolean} `true` if the segment is unreachable. + * Checks all segments in a set and returns true if all are unreachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if all segments are unreachable; false otherwise. */ -function isUnreachable(segment) { - return !segment.reachable; +function areAllSegmentsUnreachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return false; + } + } + + return true; } /** @@ -40,15 +47,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/consistent-return" }, schema: [{ @@ -88,7 +95,7 @@ module.exports = { * When unreachable, all paths are returned or thrown. */ if (!funcInfo.hasReturnValue || - funcInfo.codePath.currentSegments.every(isUnreachable) || + areAllSegmentsUnreachable(funcInfo.currentSegments) || astUtils.isES5Constructor(node) || isClassConstructor(node) ) { @@ -104,7 +111,7 @@ module.exports = { } else if (node.type === "ArrowFunctionExpression") { // `=>` token - loc = context.getSourceCode().getTokenBefore(node.body, astUtils.isArrowToken).loc; + loc = context.sourceCode.getTokenBefore(node.body, astUtils.isArrowToken).loc; } else if ( node.parent.type === "MethodDefinition" || (node.parent.type === "Property" && node.parent.method) @@ -115,7 +122,7 @@ module.exports = { } else { // Function name or `function` keyword. - loc = (node.id || context.getSourceCode().getFirstToken(node)).loc; + loc = (node.id || context.sourceCode.getFirstToken(node)).loc; } if (!name) { @@ -141,13 +148,31 @@ module.exports = { hasReturn: false, hasReturnValue: false, messageId: "", - node + node, + currentSegments: new Set() }; }, onCodePathEnd() { funcInfo = funcInfo.upper; }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + // Reports a given return statement if it's inconsistent. ReturnStatement(node) { const argument = node.argument; diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js index e5bc967..658957a 100644 --- a/node_modules/eslint/lib/rules/consistent-this.js +++ b/node_modules/eslint/lib/rules/consistent-this.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/consistent-this" }, schema: { @@ -36,6 +36,7 @@ module.exports = { create(context) { let aliases = []; + const sourceCode = context.sourceCode; if (context.options.length === 0) { aliases.push("that"); @@ -47,7 +48,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 +66,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); } @@ -115,10 +116,11 @@ module.exports = { /** * Check each alias to ensure that is was assigned to the correct value. + * @param {ASTNode} node The node that represents the scope to check. * @returns {void} */ - function ensureWasAssigned() { - const scope = context.getScope(); + function ensureWasAssigned(node) { + const scope = sourceCode.getScope(node); aliases.forEach(alias => { checkWasAssigned(alias, scope); diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js index dfec18f..330be80 100644 --- a/node_modules/eslint/lib/rules/constructor-super.js +++ b/node_modules/eslint/lib/rules/constructor-super.js @@ -10,12 +10,19 @@ //------------------------------------------------------------------------------ /** - * Checks whether a given code path segment is reachable or not. - * @param {CodePathSegment} segment A code path segment to check. - * @returns {boolean} `true` if the segment is reachable. + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. */ -function isReachable(segment) { - return segment.reachable; +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; } /** @@ -116,15 +123,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/constructor-super" }, schema: [], @@ -210,7 +217,8 @@ module.exports = { isConstructor: true, hasExtends: Boolean(superClass), superIsConstructor: isPossibleConstructor(superClass), - codePath + codePath, + currentSegments: new Set() }; } else { funcInfo = { @@ -218,7 +226,8 @@ module.exports = { isConstructor: false, hasExtends: false, superIsConstructor: false, - codePath + codePath, + currentSegments: new Set() }; } }, @@ -261,6 +270,9 @@ module.exports = { * @returns {void} */ onCodePathSegmentStart(segment) { + + funcInfo.currentSegments.add(segment); + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; } @@ -281,6 +293,19 @@ module.exports = { } }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + /** * Update information of the code path segment when a code path was * looped. @@ -344,12 +369,11 @@ module.exports = { // Reports if needed. if (funcInfo.hasExtends) { - const segments = funcInfo.codePath.currentSegments; + const segments = funcInfo.currentSegments; let duplicate = false; let info = null; - for (let i = 0; i < segments.length; ++i) { - const segment = segments[i]; + for (const segment of segments) { if (segment.reachable) { info = segInfoMap[segment.id]; @@ -374,7 +398,7 @@ module.exports = { info.validNodes.push(node); } } - } else if (funcInfo.codePath.currentSegments.some(isReachable)) { + } else if (isAnySegmentReachable(funcInfo.currentSegments)) { context.report({ messageId: "unexpected", node @@ -398,10 +422,9 @@ module.exports = { } // Returning argument is a substitute of 'super()'. - const segments = funcInfo.codePath.currentSegments; + const segments = funcInfo.currentSegments; - for (let i = 0; i < segments.length; ++i) { - const segment = segments[i]; + for (const segment of segments) { if (segment.reachable) { const info = segInfoMap[segment.id]; diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js index 61dcd80..3540824 100644 --- a/node_modules/eslint/lib/rules/curly.js +++ b/node_modules/eslint/lib/rules/curly.js @@ -14,15 +14,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/curly" }, schema: { @@ -70,7 +70,7 @@ module.exports = { const multiOrNest = (context.options[0] === "multi-or-nest"); const consistent = (context.options[1] === "consistent"); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/default-case-last.js b/node_modules/eslint/lib/rules/default-case-last.js index 80c5d6b..d4a83b5 100644 --- a/node_modules/eslint/lib/rules/default-case-last.js +++ b/node_modules/eslint/lib/rules/default-case-last.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/default-case-last" }, schema: [], diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js index 821e0d7..4f2fad0 100644 --- a/node_modules/eslint/lib/rules/default-case.js +++ b/node_modules/eslint/lib/rules/default-case.js @@ -10,15 +10,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/default-case" }, schema: [{ @@ -42,7 +42,7 @@ module.exports = { ? new RegExp(options.commentPattern, "u") : DEFAULT_COMMENT_PATTERN; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -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 12e0b59..3254fa8 100644 --- a/node_modules/eslint/lib/rules/default-param-last.js +++ b/node_modules/eslint/lib/rules/default-param-last.js @@ -5,15 +5,15 @@ "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" + url: "https://eslint.org/docs/latest/rules/default-param-last" }, schema: [], @@ -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 a8d5a76..0d017c1 100644 --- a/node_modules/eslint/lib/rules/dot-location.js +++ b/node_modules/eslint/lib/rules/dot-location.js @@ -1,6 +1,7 @@ /** * @fileoverview Validates newlines before and after dots * @author Greg Cochard + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/dot-location" }, schema: [ @@ -43,7 +46,7 @@ module.exports = { // default to onObject if no preference is passed const onObject = config === "object" || !config; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports if the dot between object and property is on the correct location. diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js index 3aa9f31..21cba54 100644 --- a/node_modules/eslint/lib/rules/dot-notation.js +++ b/node_modules/eslint/lib/rules/dot-notation.js @@ -20,15 +20,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/dot-notation" }, schema: [ @@ -59,7 +59,7 @@ module.exports = { create(context) { const options = context.options[0] || {}; const allowKeywords = options.allowKeywords === void 0 || options.allowKeywords; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let allowPattern; @@ -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}\``; @@ -133,15 +133,15 @@ module.exports = { } if ( node.computed && - node.property.type === "TemplateLiteral" && - node.property.expressions.length === 0 + astUtils.isStaticTemplateLiteral(node.property) ) { checkComputedProperty(node, node.property.quasis[0].value.cooked); } 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, diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js index 24b0c92..03487b0 100644 --- a/node_modules/eslint/lib/rules/eol-last.js +++ b/node_modules/eslint/lib/rules/eol-last.js @@ -1,6 +1,7 @@ /** * @fileoverview Require or disallow newline at the end of files * @author Nodeca Team + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -8,15 +9,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/eol-last" }, fixable: "whitespace", @@ -40,7 +43,7 @@ module.exports = { return { Program: function checkBadEOF(node) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, src = sourceCode.getText(), lastLine = sourceCode.lines[sourceCode.lines.length - 1], location = { @@ -86,10 +89,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 57926db..12b1e80 100644 --- a/node_modules/eslint/lib/rules/eqeqeq.js +++ b/node_modules/eslint/lib/rules/eqeqeq.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/eqeqeq" }, schema: { @@ -68,7 +68,7 @@ module.exports = { create(context) { const config = context.options[0] || "always"; const options = context.options[1] || {}; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const nullOption = (config === "always") ? options.null || "always" @@ -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 c15d10e..69198d1 100644 --- a/node_modules/eslint/lib/rules/for-direction.js +++ b/node_modules/eslint/lib/rules/for-direction.js @@ -5,19 +5,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getStaticValue } = require("@eslint-community/eslint-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/for-direction" }, fixable: null, @@ -29,6 +35,7 @@ module.exports = { }, create(context) { + const { sourceCode } = context; /** * report an error. @@ -46,17 +53,17 @@ module.exports = { * check the right side of the assignment * @param {ASTNode} update UpdateExpression to check * @param {int} dir expected direction that could either be turned around or invalidated - * @returns {int} return dir, the negated dir or zero if it's not clear for identifiers + * @returns {int} return dir, the negated dir, or zero if the counter does not change or the direction is not clear */ function getRightDirection(update, dir) { - if (update.right.type === "UnaryExpression") { - if (update.right.operator === "-") { - return -dir; - } - } else if (update.right.type === "Identifier") { - return 0; + const staticValue = getStaticValue(update.right, sourceCode.getScope(update)); + + if (staticValue && ["bigint", "boolean", "number"].includes(typeof staticValue.value)) { + const sign = Math.sign(Number(staticValue.value)) || 0; // convert NaN to 0 + + return dir * sign; } - return dir; + return 0; } /** @@ -94,30 +101,37 @@ module.exports = { } return 0; } + return { ForStatement(node) { - if (node.test && node.test.type === "BinaryExpression" && node.test.left.type === "Identifier" && node.update) { - const counter = node.test.left.name; - const operator = node.test.operator; - const update = node.update; + if (node.test && node.test.type === "BinaryExpression" && node.update) { + for (const counterPosition of ["left", "right"]) { + if (node.test[counterPosition].type !== "Identifier") { + continue; + } - let wrongDirection; + const counter = node.test[counterPosition].name; + const operator = node.test.operator; + const update = node.update; - if (operator === "<" || operator === "<=") { - wrongDirection = -1; - } else if (operator === ">" || operator === ">=") { - wrongDirection = 1; - } else { - return; - } + let wrongDirection; - if (update.type === "UpdateExpression") { - if (getUpdateDirection(update, counter) === wrongDirection) { + if (operator === "<" || operator === "<=") { + wrongDirection = counterPosition === "left" ? -1 : 1; + } else if (operator === ">" || operator === ">=") { + wrongDirection = counterPosition === "left" ? 1 : -1; + } else { + return; + } + + if (update.type === "UpdateExpression") { + if (getUpdateDirection(update, counter) === wrongDirection) { + report(node); + } + } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { report(node); } - } else if (update.type === "AssignmentExpression" && getAssignmentDirection(update, counter) === wrongDirection) { - report(node); } } } diff --git a/node_modules/eslint/lib/rules/func-call-spacing.js b/node_modules/eslint/lib/rules/func-call-spacing.js index 132a583..33f7372 100644 --- a/node_modules/eslint/lib/rules/func-call-spacing.js +++ b/node_modules/eslint/lib/rules/func-call-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to control spacing within function calls * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/func-call-spacing" }, fixable: "whitespace", @@ -73,7 +76,7 @@ module.exports = { const never = context.options[0] !== "always"; const allowNewlines = !never && context.options[1] && context.options[1].allowNewlines; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const text = sourceCode.getText(); /** diff --git a/node_modules/eslint/lib/rules/func-name-matching.js b/node_modules/eslint/lib/rules/func-name-matching.js index 755c2ee..b9555d6 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,15 +68,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/func-name-matching" }, schema: { @@ -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 ecfedb9..b180580 100644 --- a/node_modules/eslint/lib/rules/func-names.js +++ b/node_modules/eslint/lib/rules/func-names.js @@ -24,15 +24,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/func-names" }, schema: { @@ -69,7 +69,7 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Returns the config option for the given node. @@ -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); } @@ -158,7 +159,7 @@ module.exports = { function handleFunction(node) { // Skip recursive functions. - const nameVar = context.getDeclaredVariables(node)[0]; + const nameVar = sourceCode.getDeclaredVariables(node)[0]; if (isFunctionName(nameVar) && nameVar.references.length > 0) { return; diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js index e150b1a..ab83772 100644 --- a/node_modules/eslint/lib/rules/func-style.js +++ b/node_modules/eslint/lib/rules/func-style.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/func-style" }, schema: [ 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 b6abbe9..458399d 100644 --- a/node_modules/eslint/lib/rules/function-call-argument-newline.js +++ b/node_modules/eslint/lib/rules/function-call-argument-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce line breaks between arguments of a function call * @author Alexey Gonchar + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/function-call-argument-newline" }, fixable: "whitespace", @@ -35,7 +38,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const checkers = { unexpected: { diff --git a/node_modules/eslint/lib/rules/function-paren-newline.js b/node_modules/eslint/lib/rules/function-paren-newline.js index 9d8d67b..de315a0 100644 --- a/node_modules/eslint/lib/rules/function-paren-newline.js +++ b/node_modules/eslint/lib/rules/function-paren-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce consistent line breaks inside function parentheses * @author Teddy Katz + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/function-paren-newline" }, fixable: "whitespace", @@ -57,7 +60,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const rawOption = context.options[0] || "multiline"; const multilineOption = rawOption === "multiline"; const multilineArgumentsOption = rawOption === "multiline-arguments"; @@ -183,6 +186,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 +194,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 +233,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 65534f7..c633f97 100644 --- a/node_modules/eslint/lib/rules/generator-star-spacing.js +++ b/node_modules/eslint/lib/rules/generator-star-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check the spacing around the * in generator functions. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -25,15 +26,17 @@ const OVERRIDE_SCHEMA = { ] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/generator-star-spacing" }, fixable: "whitespace", @@ -102,7 +105,7 @@ module.exports = { }; }(context.options[0] || {})); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Checks if the given token is a star token or not. diff --git a/node_modules/eslint/lib/rules/getter-return.js b/node_modules/eslint/lib/rules/getter-return.js index c54ebfb..79ebf3e 100644 --- a/node_modules/eslint/lib/rules/getter-return.js +++ b/node_modules/eslint/lib/rules/getter-return.js @@ -14,30 +14,38 @@ const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u; /** - * Checks a given code path segment is reachable. - * @param {CodePathSegment} segment A segment to check. - * @returns {boolean} `true` if the segment is reachable. + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. */ -function isReachable(segment) { - return segment.reachable; +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; } //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/getter-return" }, fixable: null, @@ -64,14 +72,15 @@ module.exports = { create(context) { const options = context.options[0] || { allowImplicit: false }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let funcInfo = { upper: null, codePath: null, hasReturn: false, shouldCheck: false, - node: null + node: null, + currentSegments: [] }; /** @@ -85,7 +94,7 @@ module.exports = { */ function checkLastSegment(node) { if (funcInfo.shouldCheck && - funcInfo.codePath.currentSegments.some(isReachable) + isAnySegmentReachable(funcInfo.currentSegments) ) { context.report({ node, @@ -112,18 +121,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"); } } } @@ -138,7 +153,8 @@ module.exports = { codePath, hasReturn: false, shouldCheck: isGetter(node), - node + node, + currentSegments: new Set() }; }, @@ -146,6 +162,21 @@ module.exports = { onCodePathEnd() { funcInfo = funcInfo.upper; }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, // Checks the return statement is valid. ReturnStatement(node) { diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js index 09d0332..deae9d2 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,10 +59,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/global-require" }, schema: [], @@ -69,12 +71,14 @@ module.exports = { }, create(context) { + const sourceCode = context.sourceCode; + return { CallExpression(node) { - const currentScope = context.getScope(); + const currentScope = sourceCode.getScope(node); if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { - const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); + const isGoodRequire = sourceCode.getAncestors(node).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 a790f83..9556f47 100644 --- a/node_modules/eslint/lib/rules/grouped-accessor-pairs.js +++ b/node_modules/eslint/lib/rules/grouped-accessor-pairs.js @@ -90,15 +90,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/grouped-accessor-pairs" }, schema: [ @@ -115,7 +115,7 @@ module.exports = { create(context) { const order = context.options[0] || "anyOrder"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports the given accessor pair. @@ -137,43 +137,6 @@ module.exports = { }); } - /** - * Creates a new `AccessorData` object for the given getter or setter node. - * @param {ASTNode} node A getter or setter node. - * @returns {AccessorData} New `AccessorData` object that contains the given node. - * @private - */ - function createAccessorData(node) { - const name = astUtils.getStaticPropertyName(node); - const key = (name !== null) ? name : sourceCode.getTokens(node.key); - - return { - key, - getters: node.kind === "get" ? [node] : [], - setters: node.kind === "set" ? [node] : [] - }; - } - - /** - * Merges the given `AccessorData` object into the given accessors list. - * @param {AccessorData[]} accessors The list to merge into. - * @param {AccessorData} accessorData The object to merge. - * @returns {AccessorData[]} The same instance with the merged object. - * @private - */ - function mergeAccessorData(accessors, accessorData) { - const equalKeyElement = accessors.find(a => areEqualKeys(a.key, accessorData.key)); - - if (equalKeyElement) { - equalKeyElement.getters.push(...accessorData.getters); - equalKeyElement.setters.push(...accessorData.setters); - } else { - accessors.push(accessorData); - } - - return accessors; - } - /** * Checks accessor pairs in the given list of nodes. * @param {ASTNode[]} nodes The list to check. @@ -182,11 +145,39 @@ module.exports = { * @private */ function checkList(nodes, shouldCheck) { - const accessors = nodes - .filter(shouldCheck) - .filter(isAccessorKind) - .map(createAccessorData) - .reduce(mergeAccessorData, []); + const accessors = []; + let found = false; + + for (let i = 0; i < nodes.length; i++) { + const node = nodes[i]; + + if (shouldCheck(node) && isAccessorKind(node)) { + + // Creates a new `AccessorData` object for the given getter or setter node. + const name = astUtils.getStaticPropertyName(node); + const key = (name !== null) ? name : sourceCode.getTokens(node.key); + + // Merges the given `AccessorData` object into the given accessors list. + for (let j = 0; j < accessors.length; j++) { + const accessor = accessors[j]; + + if (areEqualKeys(accessor.key, key)) { + accessor.getters.push(...node.kind === "get" ? [node] : []); + accessor.setters.push(...node.kind === "set" ? [node] : []); + found = true; + break; + } + } + if (!found) { + accessors.push({ + key, + getters: node.kind === "get" ? [node] : [], + setters: node.kind === "set" ? [node] : [] + }); + } + found = false; + } + } for (const { getters, setters } of accessors) { diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js index 2c0976d..d6e70d0 100644 --- a/node_modules/eslint/lib/rules/guard-for-in.js +++ b/node_modules/eslint/lib/rules/guard-for-in.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/guard-for-in" }, schema: [], diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js index b92490a..ad84931 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,10 +20,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/handle-callback-err" }, schema: [ @@ -37,6 +38,7 @@ module.exports = { create(context) { const errorArgument = context.options[0] || "err"; + const sourceCode = context.sourceCode; /** * Checks if the given argument should be interpreted as a regexp pattern. @@ -78,7 +80,7 @@ module.exports = { * @returns {void} */ function checkForError(node) { - const scope = context.getScope(), + const scope = sourceCode.getScope(node), parameters = getParameters(scope), firstParameter = parameters[0]; diff --git a/node_modules/eslint/lib/rules/id-blacklist.js b/node_modules/eslint/lib/rules/id-blacklist.js index 4fbba90..6b7f561 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,10 +119,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/id-blacklist" }, schema: { @@ -139,6 +140,7 @@ module.exports = { const denyList = new Set(context.options); const reportedNodes = new Set(); + const sourceCode = context.sourceCode; let globalScope; @@ -205,7 +207,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,14 +225,15 @@ module.exports = { name: node.name } }); - reportedNodes.add(node); + reportedNodes.add(node.range.toString()); } + } return { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, Identifier(node) { diff --git a/node_modules/eslint/lib/rules/id-denylist.js b/node_modules/eslint/lib/rules/id-denylist.js index 112fd8a..baaa65f 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,40 +84,24 @@ 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" + url: "https://eslint.org/docs/latest/rules/id-denylist" }, schema: { @@ -128,7 +112,8 @@ module.exports = { uniqueItems: true }, messages: { - restricted: "Identifier '{{name}}' is restricted." + restricted: "Identifier '{{name}}' is restricted.", + restrictedPrivate: "Identifier '#{{name}}' is restricted." } }, @@ -136,6 +121,7 @@ module.exports = { const denyList = new Set(context.options); const reportedNodes = new Set(); + const sourceCode = context.sourceCode; let globalScope; @@ -187,11 +173,8 @@ module.exports = { parent.type !== "CallExpression" && parent.type !== "NewExpression" && !isRenamedImport(node) && - !isRenamedInDestructuring(node) && - !( - isReferenceToGlobalVariable(node) && - !isShorthandPropertyDefinition(node) - ) + !isPropertyNameInDestructuring(node) && + !isReferenceToGlobalVariable(node) ); } @@ -202,25 +185,40 @@ 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()); } } return { - Program() { - globalScope = context.getScope(); + Program(node) { + globalScope = sourceCode.getScope(node); }, - 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 4df081f..97bc0e4 100644 --- a/node_modules/eslint/lib/rules/id-length.js +++ b/node_modules/eslint/lib/rules/id-length.js @@ -6,19 +6,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getGraphemeCount } = require("../shared/string-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/id-length" }, schema: [ @@ -55,7 +61,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 +74,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 +107,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 +123,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 = getGraphemeCount(name); + + const isShort = nameLength < minLength; + const isLong = nameLength > maxLength; if (!(isShort || isLong) || exceptions.has(name) || matchesExceptionPattern(name)) { return; // Nothing to report @@ -131,11 +147,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 7e400d0..e225454 100644 --- a/node_modules/eslint/lib/rules/id-match.js +++ b/node_modules/eslint/lib/rules/id-match.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/id-match" }, schema: [ @@ -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,37 @@ 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; + const sourceCode = context.sourceCode; + 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 +142,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(node) { + globalScope = sourceCode.getScope(node); + }, + 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 +212,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 +231,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 +251,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 +268,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 409145e..32f422c 100644 --- a/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +++ b/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce the location of arrow function bodies * @author Sharmila Jesupaul + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/implicit-arrow-linebreak" }, fixable: "whitespace", @@ -34,7 +37,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const option = context.options[0] || "beside"; /** diff --git a/node_modules/eslint/lib/rules/indent-legacy.js b/node_modules/eslint/lib/rules/indent-legacy.js index a26ee87..78bf965 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,17 +18,17 @@ 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" + url: "https://eslint.org/docs/latest/rules/indent-legacy" }, deprecated: true, @@ -205,16 +206,16 @@ module.exports = { ObjectExpression: 1 }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; if (context.options.length) { 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 04f41db..9bcbd64 100644 --- a/node_modules/eslint/lib/rules/indent.js +++ b/node_modules/eslint/lib/rules/indent.js @@ -4,6 +4,7 @@ * @author Teddy Katz * @author Vitaly Puzrin * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,8 +13,6 @@ // Requirements //------------------------------------------------------------------------------ -const createTree = require("functional-red-black-tree"); - const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ @@ -60,12 +59,15 @@ const KNOWN_NODES = new Set([ "NewExpression", "ObjectExpression", "ObjectPattern", + "PrivateIdentifier", "Program", "Property", + "PropertyDefinition", "RestElement", "ReturnStatement", "SequenceExpression", "SpreadElement", + "StaticBlock", "Super", "SwitchCase", "SwitchStatement", @@ -122,44 +124,48 @@ const KNOWN_NODES = new Set([ /** - * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. - * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation + * A mutable map that stores (key, value) pairs. The keys are numeric indices, and must be unique. + * This is intended to be a generic wrapper around a map with non-negative integer keys, so that the underlying implementation * can easily be swapped out. */ -class BinarySearchTree { +class IndexMap { /** - * Creates an empty tree + * Creates an empty map + * @param {number} maxKey The maximum key */ - constructor() { - this._rbTree = createTree(); + constructor(maxKey) { + + // Initializing the array with the maximum expected size avoids dynamic reallocations that could degrade performance. + this._values = Array(maxKey + 1); } /** - * Inserts an entry into the tree. + * Inserts an entry into the map. * @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._values[key] = value; } /** - * Finds the entry with the largest key less than or equal to the provided key + * Finds the value of the entry with the largest key less than or equal to the provided key * @param {number} key The provided key - * @returns {{key: number, value: *}|null} The found entry, or null if no such entry exists. + * @returns {*|undefined} The value of the found entry, or undefined if no such entry exists. */ - findLe(key) { - const iterator = this._rbTree.le(key); + findLastNotAfter(key) { + const values = this._values; - return iterator && { key: iterator.key, value: iterator.value }; + for (let index = key; index >= 0; index--) { + const value = values[index]; + + if (value) { + return value; + } + } + return void 0; } /** @@ -169,17 +175,7 @@ class BinarySearchTree { * @returns {void} */ deleteRange(start, end) { - - // Exit without traversing the tree if the range has zero size. - if (start === end) { - return; - } - const iterator = this._rbTree.ge(start); - - while (iterator.valid && iterator.key < end) { - this._rbTree = this._rbTree.remove(iterator.key); - iterator.next(); - } + this._values.fill(void 0, start, end); } } @@ -188,21 +184,24 @@ class BinarySearchTree { */ class TokenInfo { - // eslint-disable-next-line jsdoc/require-description /** * @param {SourceCode} sourceCode A SourceCode object */ constructor(sourceCode) { this.sourceCode = sourceCode; - this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce((map, token) => { - if (!map.has(token.loc.start.line)) { - map.set(token.loc.start.line, token); + this.firstTokensByLineNumber = new Map(); + const tokens = sourceCode.tokensAndComments; + + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + + if (!this.firstTokensByLineNumber.has(token.loc.start.line)) { + this.firstTokensByLineNumber.set(token.loc.start.line, token); } - if (!map.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { - map.set(token.loc.end.line, token); + if (!this.firstTokensByLineNumber.has(token.loc.end.line) && sourceCode.text.slice(token.range[1] - token.loc.end.column, token.range[1]).trim()) { + this.firstTokensByLineNumber.set(token.loc.end.line, token); } - return map; - }, new Map()); + } } /** @@ -238,19 +237,19 @@ 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 * @param {string} indentType The indentation character + * @param {number} maxIndex The maximum end index of any token */ - constructor(tokenInfo, indentSize, indentType) { + constructor(tokenInfo, indentSize, indentType, maxIndex) { this._tokenInfo = tokenInfo; this._indentSize = indentSize; this._indentType = indentType; - this._tree = new BinarySearchTree(); - this._tree.insert(0, { offset: 0, from: null, force: false }); + this._indexMap = new IndexMap(maxIndex); + this._indexMap.insert(0, { offset: 0, from: null, force: false }); this._lockedFirstTokens = new WeakMap(); this._desiredIndentCache = new WeakMap(); @@ -258,12 +257,12 @@ class OffsetStorage { } _getOffsetDescriptor(token) { - return this._tree.findLe(token.range[0]).value; + return this._indexMap.findLastNotAfter(token.range[0]); } /** * 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 +351,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);` @@ -379,37 +378,36 @@ class OffsetStorage { * * key: 820, value: { offset: 1, from: bazToken } * * To find the offset descriptor for any given token, one needs to find the node with the largest key - * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary - * search tree indexed by key. + * which is <= token.start. To make this operation fast, the nodes are stored in a map indexed by key. */ const descriptorToInsert = { offset, from: fromToken, force }; - const descriptorAfterRange = this._tree.findLe(range[1]).value; + const descriptorAfterRange = this._indexMap.findLastNotAfter(range[1]); const fromTokenIsInRange = fromToken && fromToken.range[0] >= range[0] && fromToken.range[1] <= range[1]; const fromTokenDescriptor = fromTokenIsInRange && this._getOffsetDescriptor(fromToken); - // First, remove any existing nodes in the range from the tree. - this._tree.deleteRange(range[0] + 1, range[1]); + // First, remove any existing nodes in the range from the map. + this._indexMap.deleteRange(range[0] + 1, range[1]); - // Insert a new node into the tree for this range - this._tree.insert(range[0], descriptorToInsert); + // Insert a new node into the map for this range + this._indexMap.insert(range[0], descriptorToInsert); /* * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, * even if it's in the current range. */ if (fromTokenIsInRange) { - this._tree.insert(fromToken.range[0], fromTokenDescriptor); - this._tree.insert(fromToken.range[1], descriptorToInsert); + this._indexMap.insert(fromToken.range[0], fromTokenDescriptor); + this._indexMap.insert(fromToken.range[1], descriptorToInsert); } /* * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following * tokens the same as it was before. */ - this._tree.insert(range[1], descriptorAfterRange); + this._indexMap.insert(range[1], descriptorAfterRange); } /** @@ -493,15 +491,17 @@ const ELEMENT_LIST_SCHEMA = { ] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { - description: "enforce consistent indentation", - category: "Stylistic Issues", + description: "Enforce consistent indentation", recommended: false, - url: "https://eslint.org/docs/rules/indent" + url: "https://eslint.org/docs/latest/rules/indent" }, fixable: "whitespace", @@ -584,6 +584,16 @@ module.exports = { }, additionalProperties: false }, + StaticBlock: { + type: "object", + properties: { + body: { + type: "integer", + minimum: 0 + } + }, + additionalProperties: false + }, CallExpression: { type: "object", properties: { @@ -647,6 +657,9 @@ module.exports = { parameters: DEFAULT_PARAMETER_INDENT, body: DEFAULT_FUNCTION_BODY_INDENT }, + StaticBlock: { + body: DEFAULT_FUNCTION_BODY_INDENT + }, CallExpression: { arguments: DEFAULT_PARAMETER_INDENT }, @@ -681,9 +694,9 @@ module.exports = { } } - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokenInfo = new TokenInfo(sourceCode); - const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t"); + const offsets = new OffsetStorage(tokenInfo, indentSize, indentType === "space" ? " " : "\t", sourceCode.text.length); const parameterParens = new WeakSet(); /** @@ -782,7 +795,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 +915,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); - } } } @@ -970,19 +971,19 @@ module.exports = { const parenStack = []; const parenPairs = []; - tokens.forEach(nextToken => { + for (let i = 0; i < tokens.length; i++) { + const nextToken = tokens[i]; - // Accumulate a list of parenthesis pairs if (astUtils.isOpeningParenToken(nextToken)) { parenStack.push(nextToken); } else if (astUtils.isClosingParenToken(nextToken)) { - parenPairs.unshift({ left: parenStack.pop(), right: nextToken }); + parenPairs.push({ left: parenStack.pop(), right: nextToken }); } - }); + } - parenPairs.forEach(pair => { - const leftParen = pair.left; - const rightParen = pair.right; + for (let i = parenPairs.length - 1; i >= 0; i--) { + const leftParen = parenPairs[i].left; + const rightParen = parenPairs[i].right; // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. if (!parameterParens.has(leftParen) && !parameterParens.has(rightParen)) { @@ -996,7 +997,7 @@ module.exports = { } offsets.setDesiredOffset(rightParen, leftParen, 0); - }); + } } /** @@ -1209,7 +1210,7 @@ module.exports = { } }, - "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement": node => addBlocklessNodeIndent(node.body), + "DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement": node => addBlocklessNodeIndent(node.body), ExportNamedDeclaration(node) { if (node.declaration === null) { @@ -1252,11 +1253,55 @@ module.exports = { IfStatement(node) { addBlocklessNodeIndent(node.consequent); - if (node.alternate && node.alternate.type !== "IfStatement") { + if (node.alternate) { addBlocklessNodeIndent(node.alternate); } }, + /* + * 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); @@ -1359,6 +1404,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); @@ -1627,9 +1718,13 @@ module.exports = { } // Invoke the queued offset listeners for the nodes that aren't ignored. - listenerCallQueue - .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) - .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); + for (let i = 0; i < listenerCallQueue.length; i++) { + const nodeInfo = listenerCallQueue[i]; + + if (!ignoredNodes.has(nodeInfo.node)) { + nodeInfo.listener(nodeInfo.node); + } + } // Update the offsets for ignored nodes to prevent their child tokens from being reported. ignoredNodes.forEach(ignoreNode); @@ -1640,27 +1735,31 @@ module.exports = { * Create a Map from (tokenOrComment) => (precedingToken). * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. */ - const precedingTokens = sourceCode.ast.comments.reduce((commentMap, comment) => { + const precedingTokens = new WeakMap(); + + for (let i = 0; i < sourceCode.ast.comments.length; i++) { + const comment = sourceCode.ast.comments[i]; + const tokenOrCommentBefore = sourceCode.getTokenBefore(comment, { includeComments: true }); + const hasToken = precedingTokens.has(tokenOrCommentBefore) ? precedingTokens.get(tokenOrCommentBefore) : tokenOrCommentBefore; - return commentMap.set(comment, commentMap.has(tokenOrCommentBefore) ? commentMap.get(tokenOrCommentBefore) : tokenOrCommentBefore); - }, new WeakMap()); + precedingTokens.set(comment, hasToken); + } - sourceCode.lines.forEach((line, lineIndex) => { - const lineNumber = lineIndex + 1; + for (let i = 1; i < sourceCode.lines.length + 1; i++) { - if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { + if (!tokenInfo.firstTokensByLineNumber.has(i)) { // Don't check indentation on blank lines - return; + continue; } - const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(lineNumber); + const firstTokenOfLine = tokenInfo.firstTokensByLineNumber.get(i); - if (firstTokenOfLine.loc.start.line !== lineNumber) { + if (firstTokenOfLine.loc.start.line !== i) { // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. - return; + continue; } if (astUtils.isCommentToken(firstTokenOfLine)) { @@ -1685,18 +1784,18 @@ module.exports = { mayAlignWithBefore && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenBefore)) || mayAlignWithAfter && validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(tokenAfter)) ) { - return; + continue; } } // If the token matches the expected indentation, don't report it. if (validateTokenIndent(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine))) { - return; + continue; } // Otherwise, report the token/comment. report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); - }); + } } } ); diff --git a/node_modules/eslint/lib/rules/index.js b/node_modules/eslint/lib/rules/index.js index 35af38f..840abe7 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,12 +168,14 @@ 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"), "no-new-wrappers": () => require("./no-new-wrappers"), "no-nonoctal-decimal-escape": () => require("./no-nonoctal-decimal-escape"), "no-obj-calls": () => require("./no-obj-calls"), + "no-object-constructor": () => require("./no-object-constructor"), "no-octal": () => require("./no-octal"), "no-octal-escape": () => require("./no-octal-escape"), "no-param-reassign": () => require("./no-param-reassign"), @@ -221,6 +226,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 +260,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 6cfdf92..3abe107 100644 --- a/node_modules/eslint/lib/rules/init-declarations.js +++ b/node_modules/eslint/lib/rules/init-declarations.js @@ -42,15 +42,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/init-declarations" }, schema: { diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js index 3b282df..3dcd5fa 100644 --- a/node_modules/eslint/lib/rules/jsx-quotes.js +++ b/node_modules/eslint/lib/rules/jsx-quotes.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure consistent quotes used in jsx syntax. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -36,15 +37,17 @@ const QUOTE_SETTINGS = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/jsx-quotes" }, fixable: "whitespace", @@ -70,7 +73,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 fc885a1..19fc016 100644 --- a/node_modules/eslint/lib/rules/key-spacing.js +++ b/node_modules/eslint/lib/rules/key-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to specify spacing of object literal keys and values * @author Brandon Mills + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,10 +10,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ +const { getGraphemeCount } = require("../shared/string-utils"); /** * Checks whether a string contains a line terminator as defined in @@ -133,15 +131,17 @@ function initOptions(toOptions, fromOptions) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/key-spacing" }, fixable: "whitespace", @@ -329,44 +329,7 @@ module.exports = { singleLineOptions = ruleOptions.singleLine, alignmentOptions = ruleOptions.align || null; - const sourceCode = context.getSourceCode(); - - /** - * 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. - * @param {ASTNode} candidate The next Property that might be in the group. - * @returns {boolean} True if the candidate property is part of the group. - */ - function continuesPropertyGroup(lastMember, candidate) { - const groupEndLine = lastMember.loc.start.line, - candidateStartLine = candidate.loc.start.line; - - if (candidateStartLine - groupEndLine <= 1) { - return true; - } - - /* - * Check that the first comment is adjacent to the end of the group, the - * last comment is adjacent to the candidate property, and that successive - * comments are adjacent to each other. - */ - const leadingComments = sourceCode.getCommentsBefore(candidate); - - if ( - leadingComments.length && - leadingComments[0].loc.start.line - groupEndLine <= 1 && - candidateStartLine - 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) { - return false; - } - } - return true; - } - - return false; - } + const sourceCode = context.sourceCode; /** * Determines if the given property is key-value property. @@ -382,19 +345,7 @@ module.exports = { } /** - * 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 + * 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. @@ -403,6 +354,67 @@ module.exports = { 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. + * @param {ASTNode} candidate The next Property that might be in the group. + * @returns {boolean} True if the candidate property is part of the group. + */ + function continuesPropertyGroup(lastMember, candidate) { + const groupEndLine = lastMember.loc.start.line, + candidateValueStartLine = (isKeyValueProperty(candidate) ? getFirstTokenAfterColon(candidate.key) : candidate).loc.start.line; + + if (candidateValueStartLine - groupEndLine <= 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 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) { + return false; + } + } + return true; + } + + return false; + } + /** * 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 +440,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 +448,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 +520,7 @@ module.exports = { const startToken = sourceCode.getFirstToken(property); const endToken = getLastTokenBeforeColon(property.key); - return endToken.range[1] - startToken.range[0]; + return getGraphemeCount(sourceCode.getText().slice(startToken.range[0], endToken.range[1])); } /** @@ -531,8 +544,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 +613,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 +642,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 913cf46..9d18441 100644 --- a/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/node_modules/eslint/lib/rules/keyword-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing before and after keywords. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -22,7 +23,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,15 +62,17 @@ function isCloseParenOfTemplate(token) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/keyword-spacing" }, fixable: "whitespace", @@ -108,7 +111,9 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + + const tokensToIgnore = new WeakSet(); /** * Reports a given token if there are not space(s) before the token. @@ -122,6 +127,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 +154,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 +181,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 +208,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 +412,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 +436,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 +472,7 @@ module.exports = { const asToken = sourceCode.getTokenBefore(node.exported); checkSpacingBefore(asToken, PREV_TOKEN_M); + checkSpacingAfter(asToken, NEXT_TOKEN_M); } if (node.source) { @@ -457,6 +483,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 +528,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 +621,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 77ee147..314fac1 100644 --- a/node_modules/eslint/lib/rules/line-comment-position.js +++ b/node_modules/eslint/lib/rules/line-comment-position.js @@ -10,15 +10,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/line-comment-position" }, schema: [ @@ -78,7 +78,7 @@ module.exports = { const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN; const fallThroughRegExp = /^\s*falls?\s?through/u; const customIgnoreRegExp = new RegExp(ignorePattern, "u"); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Public diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js index b3b393e..e59acca 100644 --- a/node_modules/eslint/lib/rules/linebreak-style.js +++ b/node_modules/eslint/lib/rules/linebreak-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce a single linebreak style. * @author Erik Mueller + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/linebreak-style" }, fixable: "whitespace", @@ -40,7 +43,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js index 6806e79..2a6e472 100644 --- a/node_modules/eslint/lib/rules/lines-around-comment.js +++ b/node_modules/eslint/lib/rules/lines-around-comment.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforces empty lines around comments. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,7 +16,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 +30,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,15 +50,17 @@ function getCommentLineNums(comments) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/lines-around-comment" }, fixable: "whitespace", @@ -113,6 +116,10 @@ module.exports = { }, applyDefaultIgnorePatterns: { type: "boolean" + }, + afterHashbangComment: { + type: "boolean", + default: false } }, additionalProperties: false @@ -134,14 +141,14 @@ module.exports = { options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const lines = sourceCode.lines, numLines = lines.length + 1, 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 +193,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 +237,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 +263,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 +273,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 +288,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 +407,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 +422,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 +456,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 fb439da..1c82d8f 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,15 +12,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/lines-around-directive" }, schema: [{ @@ -54,7 +54,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const config = context.options[0] || "always"; const expectLineBefore = typeof config === "string" ? config : config.before; const expectLineAfter = typeof config === "string" ? config : config.after; 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 9723530..5f36d46 100644 --- a/node_modules/eslint/lib/rules/lines-between-class-members.js +++ b/node_modules/eslint/lib/rules/lines-between-class-members.js @@ -1,31 +1,78 @@ /** * @fileoverview Rule to check empty newline between class members * @author 薛定谔的猫 + * @deprecated in ESLint v8.53.0 */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Types of class members. + * Those have `test` method to check it matches to the given class member. + * @private + */ +const ClassMemberTypes = { + "*": { test: () => true }, + field: { test: node => node.type === "PropertyDefinition" }, + method: { test: node => node.type === "MethodDefinition" } +}; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/lines-between-class-members" }, fixable: "whitespace", schema: [ { - enum: ["always", "never"] + anyOf: [ + { + type: "object", + properties: { + enforce: { + type: "array", + items: { + type: "object", + properties: { + blankLine: { enum: ["always", "never"] }, + prev: { enum: ["method", "field", "*"] }, + next: { enum: ["method", "field", "*"] } + }, + additionalProperties: false, + required: ["blankLine", "prev", "next"] + }, + minItems: 1 + } + }, + additionalProperties: false, + required: ["enforce"] + }, + { + enum: ["always", "never"] + } + ] }, { type: "object", @@ -51,7 +98,53 @@ module.exports = { options[0] = context.options[0] || "always"; options[1] = context.options[1] || { exceptAfterSingleLine: false }; - const sourceCode = context.getSourceCode(); + const configureList = typeof options[0] === "object" ? options[0].enforce : [{ blankLine: options[0], prev: "*", next: "*" }]; + const sourceCode = context.sourceCode; + + /** + * 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. @@ -95,14 +188,45 @@ module.exports = { return sourceCode.getTokensBetween(before, after, { includeComments: true }).length !== 0; } + /** + * Checks whether the given node matches the given type. + * @param {ASTNode} node The class member node to check. + * @param {string} type The class member type to check. + * @returns {boolean} `true` if the class member node matched the type. + * @private + */ + function match(node, type) { + return ClassMemberTypes[type].test(node); + } + + /** + * Finds the last matched configuration from the configureList. + * @param {ASTNode} prevNode The previous node to match. + * @param {ASTNode} nextNode The current node to match. + * @returns {string|null} Padding type or `null` if no matches were found. + * @private + */ + function getPaddingType(prevNode, nextNode) { + for (let i = configureList.length - 1; i >= 0; --i) { + const configure = configureList[i]; + const matched = + match(prevNode, configure.prev) && + match(nextNode, configure.next); + + if (matched) { + return configure.blankLine; + } + } + return null; + } + return { ClassBody(node) { const body = node.body; 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); @@ -110,22 +234,34 @@ module.exports = { const isPadded = afterPadding.loc.start.line - beforePadding.loc.end.line > 1; const hasTokenInPadding = hasTokenOrCommentBetween(beforePadding, afterPadding); const curLineLastToken = findLastConsecutiveTokenAfter(curLast, nextFirst, 0); + const paddingType = getPaddingType(body[i], body[i + 1]); - if ((options[0] === "always" && !skip && !isPadded) || - (options[0] === "never" && isPadded)) { + if (paddingType === "never" && isPadded) { context.report({ node: body[i + 1], - messageId: isPadded ? "never" : "always", + messageId: "never", + fix(fixer) { if (hasTokenInPadding) { return null; } - return isPadded - ? fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n") - : fixer.insertTextAfter(curLineLastToken, "\n"); + return fixer.replaceTextRange([beforePadding.range[1], afterPadding.range[0]], "\n"); + } + }); + } else if (paddingType === "always" && !skip && !isPadded) { + context.report({ + node: body[i + 1], + messageId: "always", + + fix(fixer) { + if (hasTokenInPadding) { + return null; + } + return fixer.insertTextAfter(curLineLastToken, "\n"); } }); } + } } }; 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 bb48a54..241e060 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" + url: "https://eslint.org/docs/latest/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 5c5296b..7a8e9f9 100644 --- a/node_modules/eslint/lib/rules/max-depth.js +++ b/node_modules/eslint/lib/rules/max-depth.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/max-depth" }, schema: [ @@ -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 dd76760..138a0f2 100644 --- a/node_modules/eslint/lib/rules/max-len.js +++ b/node_modules/eslint/lib/rules/max-len.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check for max length on a line. * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -63,15 +64,17 @@ const OPTIONS_OR_INTEGER_SCHEMA = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/max-len" }, schema: [ @@ -97,7 +100,7 @@ module.exports = { */ const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Computes the length of a line that may contain tabs. The width of each @@ -215,7 +218,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 */ @@ -252,19 +255,23 @@ module.exports = { return sourceCode.ast.tokens.filter(token => token.type === "RegularExpression"); } - /** - * A reducer to group an AST node by line number, both start and end. - * @param {Object} acc the accumulator - * @param {ASTNode} node the AST node in question - * @returns {Object} the modified accumulator - * @private + * + * reduce an array of AST nodes by line number, both start and end. + * @param {ASTNode[]} arr array of AST nodes + * @returns {Object} accululated AST nodes */ - function groupByLineNumber(acc, node) { - for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) { - ensureArrayAndPush(acc, i, node); + function groupArrayByLineNumber(arr) { + const obj = {}; + + for (let i = 0; i < arr.length; i++) { + const node = arr[i]; + + for (let j = node.loc.start.line; j <= node.loc.end.line; ++j) { + ensureArrayAndPush(obj, j, node); + } } - return acc; + return obj; } /** @@ -312,13 +319,13 @@ module.exports = { let commentsIndex = 0; const strings = getAllStrings(); - const stringsByLine = strings.reduce(groupByLineNumber, {}); + const stringsByLine = groupArrayByLineNumber(strings); const templateLiterals = getAllTemplateLiterals(); - const templateLiteralsByLine = templateLiterals.reduce(groupByLineNumber, {}); + const templateLiteralsByLine = groupArrayByLineNumber(templateLiterals); const regExpLiterals = getAllRegExpLiterals(); - const regExpLiteralsByLine = regExpLiterals.reduce(groupByLineNumber, {}); + const regExpLiteralsByLine = groupArrayByLineNumber(regExpLiterals); lines.forEach((line, i) => { 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 60e2e87..f981922 100644 --- a/node_modules/eslint/lib/rules/max-lines-per-function.js +++ b/node_modules/eslint/lib/rules/max-lines-per-function.js @@ -48,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(); @@ -65,15 +65,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/max-lines-per-function" }, schema: [ @@ -85,7 +85,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const lines = sourceCode.lines; const option = context.options[0]; diff --git a/node_modules/eslint/lib/rules/max-lines.js b/node_modules/eslint/lib/rules/max-lines.js index 8bd5a1c..e85d442 100644 --- a/node_modules/eslint/lib/rules/max-lines.js +++ b/node_modules/eslint/lib/rules/max-lines.js @@ -28,15 +28,15 @@ function range(start, end) { // 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" + url: "https://eslint.org/docs/latest/rules/max-lines" }, schema: [ @@ -87,7 +87,7 @@ module.exports = { const skipComments = option && option.skipComments; const skipBlankLines = option && option.skipBlankLines; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Returns whether or not a token is a comment node type @@ -137,20 +137,6 @@ module.exports = { return []; } - /** - * Returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. - * TODO(stephenwade): Replace this with array.flatMap when we drop support for Node v10 - * @param {any[]} array The array to process - * @param {Function} fn The function to use - * @returns {any[]} The result array - */ - function flatMap(array, fn) { - const mapped = array.map(fn); - const flattened = [].concat(...mapped); - - return flattened; - } - return { "Program:exit"() { let lines = sourceCode.lines.map((text, i) => ({ @@ -173,10 +159,10 @@ module.exports = { if (skipComments) { const comments = sourceCode.getAllComments(); - const commentLines = flatMap(comments, comment => getLinesWithoutCode(comment)); + const commentLines = new Set(comments.flatMap(getLinesWithoutCode)); lines = lines.filter( - l => !commentLines.includes(l.lineNumber) + l => !commentLines.has(l.lineNumber) ); } diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js index df1bace..d8f380b 100644 --- a/node_modules/eslint/lib/rules/max-nested-callbacks.js +++ b/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/max-nested-callbacks" }, schema: [ diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js index 8fb7984..213477a 100644 --- a/node_modules/eslint/lib/rules/max-params.js +++ b/node_modules/eslint/lib/rules/max-params.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/max-params" }, schema: [ @@ -57,7 +57,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const option = context.options[0]; let numParams = 3; 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 5407cff..4ad73a6 100644 --- a/node_modules/eslint/lib/rules/max-statements-per-line.js +++ b/node_modules/eslint/lib/rules/max-statements-per-line.js @@ -1,6 +1,7 @@ /** * @fileoverview Specify the maximum number of statements allowed per line. * @author Kenneth Williams + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/max-statements-per-line" }, schema: [ @@ -45,7 +48,7 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, options = context.options[0] || {}, maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js index 65d5539..7805383 100644 --- a/node_modules/eslint/lib/rules/max-statements.js +++ b/node_modules/eslint/lib/rules/max-statements.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/max-statements" }, schema: [ @@ -124,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 { @@ -149,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 9524818..6da9862 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" + url: "https://eslint.org/docs/latest/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.", @@ -35,8 +65,10 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 98360b9..8155dd7 100644 --- a/node_modules/eslint/lib/rules/multiline-ternary.js +++ b/node_modules/eslint/lib/rules/multiline-ternary.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforce newlines between operands of ternary expressions * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/multiline-ternary" }, schema: [ @@ -39,7 +42,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const option = context.options[0]; const multiline = option !== "never"; const allowSingleLine = option === "always-multiline"; @@ -73,7 +76,7 @@ module.exports = { end: lastTokenOfTest.loc.end }, messageId: "unexpectedTestCons", - fix: fixer => { + fix(fixer) { if (hasComments) { return null; } @@ -101,7 +104,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 4249a54..f81e42f 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,15 +76,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/new-cap" }, schema: [ @@ -146,7 +147,7 @@ module.exports = { const listeners = {}; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js index 405ec1b..1c5d21d 100644 --- a/node_modules/eslint/lib/rules/new-parens.js +++ b/node_modules/eslint/lib/rules/new-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when using constructor without parentheses * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -19,32 +20,25 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/new-parens" }, fixable: "code", - schema: { - anyOf: [ - { - type: "array", - items: [ - { - enum: ["always", "never"] - } - ], - minItems: 0, - maxItems: 1 - } - ] - }, + schema: [ + { + enum: ["always", "never"] + } + ], messages: { missing: "Missing '()' invoking a constructor.", unnecessary: "Unnecessary '()' invoking a constructor with no arguments." @@ -55,7 +49,7 @@ module.exports = { const options = context.options; const always = options[0] !== "never"; // Default is always - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { NewExpression(node) { diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js index 4809d9b..dc8b24d 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,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/newline-after-var" }, schema: [ { @@ -43,7 +43,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; // Default `mode` to "always". const mode = context.options[0] === "never" ? "never" : "always"; @@ -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; @@ -212,7 +212,6 @@ module.exports = { context.report({ node, messageId: "unexpected", - data: { identifier: node.name }, fix(fixer) { const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); @@ -231,7 +230,6 @@ module.exports = { context.report({ node, messageId: "expected", - data: { identifier: node.name }, fix(fixer) { if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { return fixer.insertTextBefore(nextToken, "\n\n"); diff --git a/node_modules/eslint/lib/rules/newline-before-return.js b/node_modules/eslint/lib/rules/newline-before-return.js index 65ca323..73d8ef9 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,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/newline-before-return" }, fixable: "whitespace", @@ -31,7 +31,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -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 46c9d6c..3124ac2 100644 --- a/node_modules/eslint/lib/rules/newline-per-chained-call.js +++ b/node_modules/eslint/lib/rules/newline-per-chained-call.js @@ -2,6 +2,7 @@ * @fileoverview Rule to ensure newline per method call when chaining calls * @author Rajendra Patil * @author Burak Yigit Kaya + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -12,15 +13,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/newline-per-chained-call" }, fixable: "whitespace", @@ -47,13 +50,13 @@ module.exports = { const options = context.options[0] || {}, ignoreChainWithDepth = options.ignoreChainWithDepth || 2; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * 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 702b4d2..cc87285 100644 --- a/node_modules/eslint/lib/rules/no-alert.js +++ b/node_modules/eslint/lib/rules/no-alert.js @@ -82,15 +82,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-alert" }, schema: [], @@ -101,10 +101,12 @@ module.exports = { }, create(context) { + const sourceCode = context.sourceCode; + return { CallExpression(node) { const callee = skipChainExpression(node.callee), - currentScope = context.getScope(); + currentScope = sourceCode.getScope(node); // without window. if (callee.type === "Identifier") { diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js index 90c6d6b..f56b687 100644 --- a/node_modules/eslint/lib/rules/no-array-constructor.js +++ b/node_modules/eslint/lib/rules/no-array-constructor.js @@ -5,30 +5,72 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { + getVariableByName, + isClosingParenToken, + isOpeningParenToken, + isStartOfExpressionStatement, + needsPrecedingSemicolon +} = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-array-constructor" }, + hasSuggestions: true, + schema: [], messages: { - preferLiteral: "The array literal notation [] is preferable." + preferLiteral: "The array literal notation [] is preferable.", + useLiteral: "Replace with an array literal.", + useLiteralAfterSemicolon: "Replace with an array literal, add preceding semicolon." } }, create(context) { + const sourceCode = context.sourceCode; + + /** + * Gets the text between the calling parentheses of a CallExpression or NewExpression. + * @param {ASTNode} node A CallExpression or NewExpression node. + * @returns {string} The text between the calling parentheses, or an empty string if there are none. + */ + function getArgumentsText(node) { + const lastToken = sourceCode.getLastToken(node); + + if (!isClosingParenToken(lastToken)) { + return ""; + } + + let firstToken = node.callee; + + do { + firstToken = sourceCode.getTokenAfter(firstToken); + if (!firstToken || firstToken === lastToken) { + return ""; + } + } while (!isOpeningParenToken(firstToken)); + + return sourceCode.text.slice(firstToken.range[1], lastToken.range[0]); + } + /** * Disallow construction of dense arrays using the Array constructor * @param {ASTNode} node node to evaluate @@ -37,11 +79,48 @@ module.exports = { */ function check(node) { if ( - node.arguments.length !== 1 && - node.callee.type === "Identifier" && - node.callee.name === "Array" - ) { - context.report({ node, messageId: "preferLiteral" }); + node.callee.type !== "Identifier" || + node.callee.name !== "Array" || + node.arguments.length === 1 && + node.arguments[0].type !== "SpreadElement") { + return; + } + + const variable = getVariableByName(sourceCode.getScope(node), "Array"); + + /* + * Check if `Array` is a predefined global variable: predefined globals have no declarations, + * meaning that the `identifiers` list of the variable object is empty. + */ + if (variable && variable.identifiers.length === 0) { + const argsText = getArgumentsText(node); + let fixText; + let messageId; + + /* + * Check if the suggested change should include a preceding semicolon or not. + * Due to JavaScript's ASI rules, a missing semicolon may be inserted automatically + * before an expression like `Array()` or `new Array()`, but not when the expression + * is changed into an array literal like `[]`. + */ + if (isStartOfExpressionStatement(node) && needsPrecedingSemicolon(sourceCode, node)) { + fixText = `;[${argsText}]`; + messageId = "useLiteralAfterSemicolon"; + } else { + fixText = `[${argsText}]`; + messageId = "useLiteral"; + } + + context.report({ + node, + messageId: "preferLiteral", + suggest: [ + { + messageId, + fix: fixer => fixer.replaceText(node, fixText) + } + ] + }); } } 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 553311e..ea6c851 100644 --- a/node_modules/eslint/lib/rules/no-async-promise-executor.js +++ b/node_modules/eslint/lib/rules/no-async-promise-executor.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-async-promise-executor" }, fixable: null, @@ -30,7 +30,7 @@ module.exports = { return { "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { context.report({ - node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), + node: context.sourceCode.getFirstToken(node.arguments[0], token => token.value === "async"), messageId: "async" }); } 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 9ca8986..20230de 100644 --- a/node_modules/eslint/lib/rules/no-await-in-loop.js +++ b/node_modules/eslint/lib/rules/no-await-in-loop.js @@ -53,15 +53,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-await-in-loop" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js index a9c3360..d90992b 100644 --- a/node_modules/eslint/lib/rules/no-bitwise.js +++ b/node_modules/eslint/lib/rules/no-bitwise.js @@ -20,15 +20,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-bitwise" }, schema: [ @@ -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 152dda0..0b73c76 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,10 +19,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-buffer-constructor" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js index 5fe1bd4..3e61a8e 100644 --- a/node_modules/eslint/lib/rules/no-caller.js +++ b/node_modules/eslint/lib/rules/no-caller.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-caller" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js index 1d54e22..8dc5b02 100644 --- a/node_modules/eslint/lib/rules/no-case-declarations.js +++ b/node_modules/eslint/lib/rules/no-case-declarations.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-case-declarations" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js index 4917af8..f9d8552 100644 --- a/node_modules/eslint/lib/rules/no-catch-shadow.js +++ b/node_modules/eslint/lib/rules/no-catch-shadow.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-catch-shadow" }, replacedBy: ["no-shadow"], @@ -39,6 +39,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -60,7 +62,7 @@ module.exports = { return { "CatchClause[param!=null]"(node) { - let scope = context.getScope(); + let scope = sourceCode.getScope(node); /* * When ecmaVersion >= 6, CatchClause creates its own scope diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js index 887058b..49f3b84 100644 --- a/node_modules/eslint/lib/rules/no-class-assign.js +++ b/node_modules/eslint/lib/rules/no-class-assign.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-class-assign" }, schema: [], @@ -31,6 +31,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -49,7 +51,7 @@ module.exports = { * @returns {void} */ function checkForClass(node) { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } return { 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 0c6865a..112f6c1 100644 --- a/node_modules/eslint/lib/rules/no-compare-neg-zero.js +++ b/node_modules/eslint/lib/rules/no-compare-neg-zero.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-compare-neg-zero" }, fixable: null, diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js index 3843a7a..9529202 100644 --- a/node_modules/eslint/lib/rules/no-cond-assign.js +++ b/node_modules/eslint/lib/rules/no-cond-assign.js @@ -28,15 +28,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-cond-assign" }, schema: [ @@ -57,7 +57,7 @@ module.exports = { const prohibitAssign = (context.options[0] || "except-parens"); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Check whether an AST node is the test expression for a conditional statement. diff --git a/node_modules/eslint/lib/rules/no-confusing-arrow.js b/node_modules/eslint/lib/rules/no-confusing-arrow.js index 9009b64..6fef187 100644 --- a/node_modules/eslint/lib/rules/no-confusing-arrow.js +++ b/node_modules/eslint/lib/rules/no-confusing-arrow.js @@ -2,6 +2,7 @@ * @fileoverview A rule to warn against using arrow functions when they could be * confused with comparisons * @author Jxck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -25,15 +26,17 @@ function isConditional(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-confusing-arrow" }, fixable: "code", @@ -41,7 +44,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,7 +58,8 @@ module.exports = { create(context) { const config = context.options[0] || {}; const allowParens = config.allowParens || (config.allowParens === void 0); - const sourceCode = context.getSourceCode(); + const onlyOneSimpleParam = config.onlyOneSimpleParam; + const sourceCode = context.sourceCode; /** @@ -65,7 +70,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 56dbbc3..d20477c 100644 --- a/node_modules/eslint/lib/rules/no-console.js +++ b/node_modules/eslint/lib/rules/no-console.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-console" }, schema: [ @@ -43,14 +43,18 @@ module.exports = { } ], + hasSuggestions: true, + messages: { - unexpected: "Unexpected console statement." + unexpected: "Unexpected console statement.", + removeConsole: "Remove the console.{{ propertyName }}()." } }, create(context) { const options = context.options[0] || {}; const allowed = options.allow || []; + const sourceCode = context.sourceCode; /** * Checks whether the given reference is 'console' or not. @@ -72,7 +76,7 @@ module.exports = { function isAllowed(node) { const propertyName = astUtils.getStaticPropertyName(node); - return propertyName && allowed.indexOf(propertyName) !== -1; + return propertyName && allowed.includes(propertyName); } /** @@ -93,6 +97,64 @@ module.exports = { ); } + /** + * Checks if removing the ExpressionStatement node will cause ASI to + * break. + * eg. + * foo() + * console.log(); + * [1, 2, 3].forEach(a => doSomething(a)) + * + * Removing the console.log(); statement should leave two statements, but + * here the two statements will become one because [ causes continuation after + * foo(). + * @param {ASTNode} node The ExpressionStatement node to check. + * @returns {boolean} `true` if ASI will break after removing the ExpressionStatement + * node. + */ + function maybeAsiHazard(node) { + const SAFE_TOKENS_BEFORE = /^[:;{]$/u; // One of :;{ + const UNSAFE_CHARS_AFTER = /^[-[(/+`]/u; // One of [(/+-` + + const tokenBefore = sourceCode.getTokenBefore(node); + const tokenAfter = sourceCode.getTokenAfter(node); + + return ( + Boolean(tokenAfter) && + UNSAFE_CHARS_AFTER.test(tokenAfter.value) && + tokenAfter.value !== "++" && + tokenAfter.value !== "--" && + Boolean(tokenBefore) && + !SAFE_TOKENS_BEFORE.test(tokenBefore.value) + ); + } + + /** + * Checks if the MemberExpression node's parent.parent.parent is a + * Program, BlockStatement, StaticBlock, or SwitchCase node. This check + * is necessary to avoid providing a suggestion that might cause a syntax error. + * + * eg. if (a) console.log(b), removing console.log() here will lead to a + * syntax error. + * if (a) { console.log(b) }, removing console.log() here is acceptable. + * + * Additionally, it checks if the callee of the CallExpression node is + * the node itself. + * + * eg. foo(console.log), cannot provide a suggestion here. + * @param {ASTNode} node The MemberExpression node to check. + * @returns {boolean} `true` if a suggestion can be provided for a node. + */ + function canProvideSuggestions(node) { + return ( + node.parent.type === "CallExpression" && + node.parent.callee === node && + node.parent.parent.type === "ExpressionStatement" && + astUtils.STATEMENT_LIST_PARENTS.has(node.parent.parent.parent.type) && + !maybeAsiHazard(node.parent.parent) + ); + } + /** * Reports the given reference as a violation. * @param {eslint-scope.Reference} reference The reference to report. @@ -101,16 +163,27 @@ module.exports = { function report(reference) { const node = reference.identifier.parent; + const propertyName = astUtils.getStaticPropertyName(node); + context.report({ node, loc: node.loc, - messageId: "unexpected" + messageId: "unexpected", + suggest: canProvideSuggestions(node) + ? [{ + messageId: "removeConsole", + data: { propertyName }, + fix(fixer) { + return fixer.remove(node.parent.parent); + } + }] + : [] }); } return { - "Program:exit"() { - const scope = context.getScope(); + "Program:exit"(node) { + const scope = sourceCode.getScope(node); const consoleVar = astUtils.getVariableByName(scope, "console"); const shadowed = consoleVar && consoleVar.defs.length > 0; diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js index e4ae891..0ceaf7e 100644 --- a/node_modules/eslint/lib/rules/no-const-assign.js +++ b/node_modules/eslint/lib/rules/no-const-assign.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-const-assign" }, schema: [], @@ -31,6 +31,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -45,7 +47,7 @@ module.exports = { return { VariableDeclaration(node) { if (node.kind === "const") { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } } }; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js index 3c2d68c..24abe36 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,15 +15,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-constant-condition" }, schema: [ @@ -46,6 +48,7 @@ module.exports = { const options = context.options[0] || {}, checkLoops = options.checkLoops !== false, loopSetStack = []; + const sourceCode = context.sourceCode; let loopsInCurrentScope = new Set(); @@ -53,153 +56,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 +63,7 @@ module.exports = { * @private */ function trackConstantConditionLoop(node) { - if (node.test && isConstant(node.test, true)) { + if (node.test && isConstant(sourceCode.getScope(node), node.test, true)) { loopsInCurrentScope.add(node); } } @@ -232,7 +88,7 @@ module.exports = { * @private */ function reportIfConstant(node) { - if (node.test && isConstant(node.test, true)) { + if (node.test && isConstant(sourceCode.getScope(node), 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 4757770..d7d9893 100644 --- a/node_modules/eslint/lib/rules/no-constructor-return.js +++ b/node_modules/eslint/lib/rules/no-constructor-return.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-constructor-return" }, schema: {}, diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js index 96718d1..f6e484b 100644 --- a/node_modules/eslint/lib/rules/no-continue.js +++ b/node_modules/eslint/lib/rules/no-continue.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-continue" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js index 6feeb64..dc412fc 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 = ""; @@ -14,6 +14,16 @@ const collector = new (class { } onPatternEnter() { + + /* + * `RegExpValidator` may parse the pattern twice in one `validatePattern`. + * So `this._controlChars` should be cleared here as well. + * + * For example, the `/(?\x1f)/` regex will parse the pattern twice. + * This is based on the content described in Annex B. + * If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice. + * See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb + */ this._controlChars = []; } @@ -30,10 +40,15 @@ const collector = new (class { } } - collectControlChars(regexpStr) { + collectControlChars(regexpStr, flags) { + const uFlag = typeof flags === "string" && flags.includes("u"); + const vFlag = typeof flags === "string" && flags.includes("v"); + + this._controlChars = []; + this._source = regexpStr; + try { - this._source = regexpStr; - this._validator.validatePattern(regexpStr); // Call onCharacter hook + this._validator.validatePattern(regexpStr, void 0, void 0, { unicode: uFlag, unicodeSets: vFlag }); // Call onCharacter hook } catch { // Ignore syntax errors in RegExp. @@ -46,15 +61,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-control-regex" }, schema: [], @@ -68,13 +83,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 +99,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 +115,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 95a28a8..f698435 100644 --- a/node_modules/eslint/lib/rules/no-debugger.js +++ b/node_modules/eslint/lib/rules/no-debugger.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-debugger" }, fixable: null, diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js index aeab951..126603c 100644 --- a/node_modules/eslint/lib/rules/no-delete-var.js +++ b/node_modules/eslint/lib/rules/no-delete-var.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-delete-var" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js index 0ccabdc..208f840 100644 --- a/node_modules/eslint/lib/rules/no-div-regex.js +++ b/node_modules/eslint/lib/rules/no-div-regex.js @@ -9,15 +9,15 @@ // 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 equal signs explicitly at the beginning of regular expressions", recommended: false, - url: "https://eslint.org/docs/rules/no-div-regex" + url: "https://eslint.org/docs/latest/rules/no-div-regex" }, fixable: "code", @@ -30,7 +30,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js index 817277f..c04ede5 100644 --- a/node_modules/eslint/lib/rules/no-dupe-args.js +++ b/node_modules/eslint/lib/rules/no-dupe-args.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-dupe-args" }, schema: [], @@ -29,6 +29,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -49,7 +51,7 @@ module.exports = { * @private */ function checkParams(node) { - const variables = context.getDeclaredVariables(node); + const variables = sourceCode.getDeclaredVariables(node); for (let i = 0; i < variables.length; ++i) { const variable = variables[i]; 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 b12939d..2a7a9e8 100644 --- a/node_modules/eslint/lib/rules/no-dupe-class-members.js +++ b/node_modules/eslint/lib/rules/no-dupe-class-members.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-dupe-class-members" }, schema: [], @@ -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 cbeb437..60f436d 100644 --- a/node_modules/eslint/lib/rules/no-dupe-else-if.js +++ b/node_modules/eslint/lib/rules/no-dupe-else-if.js @@ -46,15 +46,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-dupe-else-if" }, schema: [], @@ -65,7 +65,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js index 89e1f2d..980b004 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,15 +82,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-dupe-keys" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js index e2d9665..839f357 100644 --- a/node_modules/eslint/lib/rules/no-duplicate-case.js +++ b/node_modules/eslint/lib/rules/no-duplicate-case.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-duplicate-case" }, schema: [], @@ -35,7 +35,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Determines whether the two given nodes are considered to be equal. diff --git a/node_modules/eslint/lib/rules/no-duplicate-imports.js b/node_modules/eslint/lib/rules/no-duplicate-imports.js index cc3da1d..25c07b7 100644 --- a/node_modules/eslint/lib/rules/no-duplicate-imports.js +++ b/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -227,15 +227,15 @@ function handleImportsExports( }; } +/** @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" + url: "https://eslint.org/docs/latest/rules/no-duplicate-imports" }, schema: [ diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js index 84409fa..9dbf569 100644 --- a/node_modules/eslint/lib/rules/no-else-return.js +++ b/node_modules/eslint/lib/rules/no-else-return.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-else-return" }, schema: [{ @@ -47,6 +47,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -169,25 +171,24 @@ module.exports = { /** * Display the context report if rule is violated - * @param {Node} node The 'else' node + * @param {Node} elseNode The 'else' node * @returns {void} */ - function displayReport(node) { - const currentScope = context.getScope(); + function displayReport(elseNode) { + const currentScope = sourceCode.getScope(elseNode.parent); context.report({ - node, + node: elseNode, messageId: "unexpected", - fix: fixer => { + fix(fixer) { - if (!isSafeFromNameCollisions(node, currentScope)) { + if (!isSafeFromNameCollisions(elseNode, currentScope)) { return null; } - const sourceCode = context.getSourceCode(); - const startToken = sourceCode.getFirstToken(node); + const startToken = sourceCode.getFirstToken(elseNode); const elseToken = sourceCode.getTokenBefore(startToken); - const source = sourceCode.getText(node); + const source = sourceCode.getText(elseNode); const lastIfToken = sourceCode.getTokenBefore(elseToken); let fixedSource, firstTokenOfElseBlock; @@ -203,14 +204,14 @@ module.exports = { * safe to remove the else keyword, because ASI will not add a semicolon * after the if block */ - const ifBlockMaybeUnsafe = node.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; + const ifBlockMaybeUnsafe = elseNode.parent.consequent.type !== "BlockStatement" && lastIfToken.value !== ";"; const elseBlockUnsafe = /^[([/+`-]/u.test(firstTokenOfElseBlock.value); if (ifBlockMaybeUnsafe && elseBlockUnsafe) { return null; } - const endToken = sourceCode.getLastToken(node); + const endToken = sourceCode.getLastToken(elseNode); const lastTokenOfElseBlock = sourceCode.getTokenBefore(endToken); if (lastTokenOfElseBlock.value !== ";") { @@ -244,8 +245,8 @@ module.exports = { * Also, to avoid name collisions between two else blocks. */ return new FixTracker(fixer, sourceCode) - .retainEnclosingFunction(node) - .replaceTextRange([elseToken.range[0], node.range[1]], fixedSource); + .retainEnclosingFunction(elseNode) + .replaceTextRange([elseToken.range[0], elseNode.range[1]], fixedSource); } }); } 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 7dc219f..5c84102 100644 --- a/node_modules/eslint/lib/rules/no-empty-character-class.js +++ b/node_modules/eslint/lib/rules/no-empty-character-class.js @@ -5,37 +5,32 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -/* - * 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 - */ -const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u; +const parser = new RegExpParser(); +const QUICK_TEST_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" + url: "https://eslint.org/docs/latest/rules/no-empty-character-class" }, schema: [], @@ -46,18 +41,35 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); - return { + "Literal[regex]"(node) { + const { pattern, flags } = node.regex; - Literal(node) { - const token = sourceCode.getFirstToken(node); - - if (token.type === "RegularExpression" && !regex.test(token.value)) { - context.report({ node, messageId: "unexpected" }); + if (!QUICK_TEST_REGEX.test(pattern)) { + return; } - } + let regExpAST; + + try { + regExpAST = parser.parsePattern(pattern, 0, pattern.length, { + unicode: flags.includes("u"), + unicodeSets: flags.includes("v") + }); + } catch { + + // Ignore regular expressions that regexpp cannot parse + return; + } + + visitRegExpAST(regExpAST, { + onCharacterClassEnter(characterClass) { + if (!characterClass.negate && characterClass.elements.length === 0) { + 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 c512f8c..2fcb755 100644 --- a/node_modules/eslint/lib/rules/no-empty-function.js +++ b/node_modules/eslint/lib/rules/no-empty-function.js @@ -89,15 +89,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-empty-function" }, schema: [ @@ -123,7 +123,7 @@ module.exports = { const options = context.options[0] || {}; const allowed = options.allow || []; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports a given function node if the node matches the following patterns. @@ -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 9f34bfd..fb75f6d 100644 --- a/node_modules/eslint/lib/rules/no-empty-pattern.js +++ b/node_modules/eslint/lib/rules/no-empty-pattern.js @@ -4,22 +4,35 @@ */ "use strict"; +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-empty-pattern" }, - schema: [], + schema: [ + { + type: "object", + properties: { + allowObjectPatternsAsParameters: { + type: "boolean", + default: false + } + }, + additionalProperties: false + } + ], messages: { unexpected: "Unexpected empty {{type}} pattern." @@ -27,11 +40,33 @@ module.exports = { }, create(context) { + const options = context.options[0] || {}, + allowObjectPatternsAsParameters = options.allowObjectPatternsAsParameters || false; + return { ObjectPattern(node) { - if (node.properties.length === 0) { - context.report({ node, messageId: "unexpected", data: { type: "object" } }); + + if (node.properties.length > 0) { + return; } + + // Allow {} and {} = {} empty object patterns as parameters when allowObjectPatternsAsParameters is true + if ( + allowObjectPatternsAsParameters && + ( + astUtils.isFunction(node.parent) || + ( + node.parent.type === "AssignmentPattern" && + astUtils.isFunction(node.parent.parent) && + node.parent.right.type === "ObjectExpression" && + node.parent.right.properties.length === 0 + ) + ) + ) { + return; + } + + context.report({ node, messageId: "unexpected", data: { type: "object" } }); }, ArrayPattern(node) { if (node.elements.length === 0) { diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js index 45bf03c..1c15796 100644 --- a/node_modules/eslint/lib/rules/no-empty.js +++ b/node_modules/eslint/lib/rules/no-empty.js @@ -14,15 +14,16 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-empty" }, schema: [ @@ -39,7 +40,8 @@ module.exports = { ], messages: { - unexpected: "Empty {{type}} statement." + unexpected: "Empty {{type}} statement.", + suggestComment: "Add comment inside empty {{type}} statement." } }, @@ -47,7 +49,7 @@ module.exports = { const options = context.options[0] || {}, allowEmptyCatch = options.allowEmptyCatch || false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { BlockStatement(node) { @@ -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 b8dead9..9252907 100644 --- a/node_modules/eslint/lib/rules/no-eq-null.js +++ b/node_modules/eslint/lib/rules/no-eq-null.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-eq-null" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js index a020fde..a059526 100644 --- a/node_modules/eslint/lib/rules/no-eval.js +++ b/node_modules/eslint/lib/rules/no-eval.js @@ -37,15 +37,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-eval" }, schema: [ @@ -68,25 +68,29 @@ module.exports = { context.options[0] && context.options[0].allowIndirect ); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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) { - const strict = context.getScope().isStrict; + function enterThisScope(node) { + const strict = sourceCode.getScope(node).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; } @@ -217,36 +221,40 @@ module.exports = { }, Program(node) { - const scope = context.getScope(), + const scope = sourceCode.getScope(node), features = context.parserOptions.ecmaFeatures || {}, 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 }; }, - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); - 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 1163920..d0e9feb 100644 --- a/node_modules/eslint/lib/rules/no-ex-assign.js +++ b/node_modules/eslint/lib/rules/no-ex-assign.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-ex-assign" }, schema: [], @@ -31,6 +31,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Finds and reports references that are non initializer and writable. * @param {Variable} variable A variable to check. @@ -44,7 +46,7 @@ module.exports = { return { CatchClause(node) { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } }; diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js index 2a804b5..fcbb385 100644 --- a/node_modules/eslint/lib/rules/no-extend-native.js +++ b/node_modules/eslint/lib/rules/no-extend-native.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-extend-native" }, schema: [ @@ -51,6 +51,7 @@ module.exports = { create(context) { const config = context.options[0] || {}; + const sourceCode = context.sourceCode; const exceptions = new Set(config.exceptions || []); const modifiedBuiltins = new Set( Object.keys(globals.builtin) @@ -159,8 +160,8 @@ module.exports = { return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); modifiedBuiltins.forEach(builtin => { const builtinVar = globalScope.set.get(builtin); diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js index 2db440d..e1e72b0 100644 --- a/node_modules/eslint/lib/rules/no-extra-bind.js +++ b/node_modules/eslint/lib/rules/no-extra-bind.js @@ -20,15 +20,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-extra-bind" }, schema: [], @@ -40,7 +40,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; /** 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 6ae3ea6..f342533 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,15 +18,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-extra-boolean-cast" }, schema: [{ @@ -48,16 +48,16 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; // 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 81406e7..45ff441 100644 --- a/node_modules/eslint/lib/rules/no-extra-label.js +++ b/node_modules/eslint/lib/rules/no-extra-label.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-extra-label" }, schema: [], @@ -35,7 +35,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; /** diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js index 307e340..75c082b 100644 --- a/node_modules/eslint/lib/rules/no-extra-parens.js +++ b/node_modules/eslint/lib/rules/no-extra-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow parenthesising higher precedence subexpressions. * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -8,18 +9,20 @@ // 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: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-extra-parens" }, fixable: "code", @@ -46,13 +49,15 @@ module.exports = { type: "object", properties: { conditionalAssign: { type: "boolean" }, + ternaryOperandBinaryExpressions: { type: "boolean" }, nestedBinaryExpressions: { type: "boolean" }, returnAssign: { type: "boolean" }, ignoreJSX: { enum: ["none", "all", "single-line", "multi-line"] }, enforceForArrowConditionals: { type: "boolean" }, enforceForSequenceExpressions: { type: "boolean" }, enforceForNewInMemberExpressions: { type: "boolean" }, - enforceForFunctionPrototypeMethods: { type: "boolean" } + enforceForFunctionPrototypeMethods: { type: "boolean" }, + allowParensAfterCommentPattern: { type: "string" } }, additionalProperties: false } @@ -69,12 +74,13 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const tokensToIgnore = new WeakSet(); const precedence = astUtils.getPrecedence; const ALL_NODES = context.options[0] !== "functions"; const EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + const EXCEPT_COND_TERNARY = ALL_NODES && context.options[1] && context.options[1].ternaryOperandBinaryExpressions === false; const NESTED_BINARY = ALL_NODES && context.options[1] && context.options[1].nestedBinaryExpressions === false; const EXCEPT_RETURN_ASSIGN = ALL_NODES && context.options[1] && context.options[1].returnAssign === false; const IGNORE_JSX = ALL_NODES && context.options[1] && context.options[1].ignoreJSX; @@ -86,6 +92,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" }); @@ -384,6 +391,30 @@ module.exports = { return node && (node.type === "Identifier" || node.type === "MemberExpression"); } + /** + * Checks if a node is fixable. + * A node is fixable if removing a single pair of surrounding parentheses does not turn it + * into a directive after fixing other nodes. + * Almost all nodes are fixable, except if all of the following conditions are met: + * The node is a string Literal + * It has a single pair of parentheses + * It is the only child of an ExpressionStatement + * @param {ASTNode} node The node to evaluate. + * @returns {boolean} Whether or not the node is fixable. + * @private + */ + function isFixable(node) { + + // if it's not a string literal it can be autofixed + if (node.type !== "Literal" || typeof node.value !== "string") { + return true; + } + if (isParenthesisedTwice(node)) { + return true; + } + return !astUtils.isTopLevelExpressionStatement(node.parent); + } + /** * Report the node * @param {ASTNode} node node to evaluate @@ -402,6 +433,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; + } + } } /** @@ -414,14 +458,16 @@ module.exports = { node, loc: leftParenToken.loc, messageId: "unexpected", - fix(fixer) { - const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); + fix: isFixable(node) + ? fixer => { + const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]); - return fixer.replaceTextRange([ - leftParenToken.range[0], - rightParenToken.range[1] - ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); - } + return fixer.replaceTextRange([ + leftParenToken.range[0], + rightParenToken.range[1] + ], (requiresLeadingSpace(node) ? " " : "") + parenthesizedSource + (requiresTrailingSpace(node) ? " " : "")); + } + : null }); } @@ -634,10 +680,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 +797,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 +867,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,29 +887,30 @@ 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; } + + const availableTypes = new Set(["BinaryExpression", "LogicalExpression"]); + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.test.type)) && !isCondAssignException(node) && hasExcessParensWithPrecedence(node.test, precedence({ type: "LogicalExpression", operator: "||" })) ) { report(node.test); } - if (hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.consequent.type)) && + hasExcessParensWithPrecedence(node.consequent, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.consequent); } - if (hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + if ( + !(EXCEPT_COND_TERNARY && availableTypes.has(node.alternate.type)) && + hasExcessParensWithPrecedence(node.alternate, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { report(node.alternate); } }, @@ -1063,6 +1143,12 @@ module.exports = { } }, + "MethodDefinition[computed=true]"(node) { + if (hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) { + report(node.key); + } + }, + NewExpression: checkCallNew, ObjectExpression(node) { @@ -1090,6 +1176,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 e0a8df0..af7eb88 100644 --- a/node_modules/eslint/lib/rules/no-extra-semi.js +++ b/node_modules/eslint/lib/rules/no-extra-semi.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of unnecessary semicolons * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -16,15 +17,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-extra-semi" }, fixable: "code", @@ -36,7 +39,24 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + + /** + * Checks if a node or token is fixable. + * A node is fixable if it can be removed without turning a subsequent statement into a directive after fixing other nodes. + * @param {Token} nodeOrToken The node or token to check. + * @returns {boolean} Whether or not the node is fixable. + */ + function isFixable(nodeOrToken) { + const nextToken = sourceCode.getTokenAfter(nodeOrToken); + + if (!nextToken || nextToken.type !== "String") { + return true; + } + const stringNode = sourceCode.getNodeByRangeIndex(nextToken.range[0]); + + return !astUtils.isTopLevelExpressionStatement(stringNode.parent); + } /** * Reports an unnecessary semicolon error. @@ -47,17 +67,18 @@ module.exports = { context.report({ node: nodeOrToken, messageId: "unexpected", - fix(fixer) { + fix: isFixable(nodeOrToken) + ? fixer => - /* - * Expand the replacement range to include the surrounding - * tokens to avoid conflicting with semi. - * https://github.com/eslint/eslint/issues/7928 - */ - return new FixTracker(fixer, context.getSourceCode()) - .retainSurroundingTokens(nodeOrToken) - .remove(nodeOrToken); - } + /* + * Expand the replacement range to include the surrounding + * tokens to avoid conflicting with semi. + * https://github.com/eslint/eslint/issues/7928 + */ + new FixTracker(fixer, context.sourceCode) + .retainSurroundingTokens(nodeOrToken) + .remove(nodeOrToken) + : null }); } @@ -98,7 +119,7 @@ module.exports = { "WithStatement" ]; - if (allowedParentTypes.indexOf(parent.type) === -1) { + if (!allowedParentTypes.includes(parent.type)) { report(node); } }, @@ -117,7 +138,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 3b949ac..91da121 100644 --- a/node_modules/eslint/lib/rules/no-fallthrough.js +++ b/node_modules/eslint/lib/rules/no-fallthrough.js @@ -4,12 +4,44 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { directivesPattern } = require("../shared/directives"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + +/** + * 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. @@ -19,29 +51,20 @@ const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu; * @returns {boolean} `true` if the case has a valid fallthrough comment. */ function hasFallthroughComment(caseWhichFallsThrough, subsequentCase, context, fallthroughCommentPattern) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 && fallthroughCommentPattern.test(commentInBlock.value)) { + if (commentInBlock && isFallThroughComment(commentInBlock.value, fallthroughCommentPattern)) { return true; } } const comment = sourceCode.getCommentsBefore(subsequentCase).pop(); - return Boolean(comment && fallthroughCommentPattern.test(comment.value)); -} - -/** - * Checks whether or not a given code path segment is reachable. - * @param {CodePathSegment} segment A CodePathSegment to check. - * @returns {boolean} `true` if the segment is reachable. - */ -function isReachable(segment) { - return segment.reachable; + return Boolean(comment && isFallThroughComment(comment.value, fallthroughCommentPattern)); } /** @@ -58,15 +81,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-fallthrough" }, schema: [ @@ -76,6 +99,10 @@ module.exports = { commentPattern: { type: "string", default: "" + }, + allowEmptyCase: { + type: "boolean", + default: false } }, additionalProperties: false @@ -89,8 +116,10 @@ module.exports = { create(context) { const options = context.options[0] || {}; - let currentCodePath = null; - const sourceCode = context.getSourceCode(); + const codePathSegments = []; + let currentCodePathSegments = new Set(); + const sourceCode = context.sourceCode; + const allowEmptyCase = options.allowEmptyCase || false; /* * We need to use leading comments of the next SwitchCase node because @@ -104,22 +133,42 @@ module.exports = { } else { fallthroughCommentPattern = DEFAULT_FALLTHROUGH_COMMENT; } - return { - onCodePathStart(codePath) { - currentCodePath = codePath; + + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); }, + onCodePathEnd() { - currentCodePath = currentCodePath.upper; + currentCodePathSegments = codePathSegments.pop(); }, + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + SwitchCase(node) { /* * Checks whether or not there is a fallthrough comment. * And reports the previous fallthrough node if that does not exist. */ - if (fallthroughCase && !hasFallthroughComment(fallthroughCase, node, context, fallthroughCommentPattern)) { + + if (fallthroughCase && (!hasFallthroughComment(fallthroughCase, node, context, fallthroughCommentPattern))) { context.report({ messageId: node.test ? "case" : "default", node @@ -136,8 +185,8 @@ module.exports = { * `break`, `return`, or `throw` are unreachable. * And allows empty cases and the last case. */ - if (currentCodePath.currentSegments.some(isReachable) && - (node.consequent.length > 0 || hasBlankLinesBetween(node, nextToken)) && + if (isAnySegmentReachable(currentCodePathSegments) && + (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 b1d8832..80e4994 100644 --- a/node_modules/eslint/lib/rules/no-floating-decimal.js +++ b/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal * @author James Allardice + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-floating-decimal" }, schema: [], @@ -35,7 +38,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { Literal(node) { diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js index 33d0ad9..8084af6 100644 --- a/node_modules/eslint/lib/rules/no-func-assign.js +++ b/node_modules/eslint/lib/rules/no-func-assign.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-func-assign" }, schema: [], @@ -31,6 +31,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Reports a reference if is non initializer and writable. * @param {References} references Collection of reference to check. @@ -65,7 +67,7 @@ module.exports = { * @returns {void} */ function checkForFunction(node) { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } return { diff --git a/node_modules/eslint/lib/rules/no-global-assign.js b/node_modules/eslint/lib/rules/no-global-assign.js index ea854c4..99ae7a2 100644 --- a/node_modules/eslint/lib/rules/no-global-assign.js +++ b/node_modules/eslint/lib/rules/no-global-assign.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-global-assign" }, schema: [ @@ -41,6 +41,7 @@ module.exports = { create(context) { const config = context.options[0]; + const sourceCode = context.sourceCode; const exceptions = (config && config.exceptions) || []; /** @@ -78,14 +79,14 @@ 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); } } return { - Program() { - const globalScope = context.getScope(); + Program(node) { + const globalScope = sourceCode.getScope(node); globalScope.variables.forEach(checkVariable); } diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js index 993b8d1..36baad3 100644 --- a/node_modules/eslint/lib/rules/no-implicit-coercion.js +++ b/node_modules/eslint/lib/rules/no-implicit-coercion.js @@ -30,9 +30,9 @@ function parseOptions(options) { } /** - * 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 ( @@ -71,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 @@ -167,15 +185,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-implicit-coercion" }, fixable: "code", @@ -217,7 +235,7 @@ module.exports = { create(context) { const options = parseOptions(context.options[0] || {}); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports an error and autofixes the node @@ -257,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)})`; @@ -265,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. @@ -276,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)})`; @@ -289,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)})`; @@ -299,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))})`; @@ -310,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)); diff --git a/node_modules/eslint/lib/rules/no-implicit-globals.js b/node_modules/eslint/lib/rules/no-implicit-globals.js index d4bfa3a..2a18247 100644 --- a/node_modules/eslint/lib/rules/no-implicit-globals.js +++ b/node_modules/eslint/lib/rules/no-implicit-globals.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-implicit-globals" }, schema: [{ @@ -43,6 +43,7 @@ module.exports = { create(context) { const checkLexicalBindings = context.options[0] && context.options[0].lexicalBindings === true; + const sourceCode = context.sourceCode; /** * Reports the node. @@ -62,8 +63,8 @@ module.exports = { } return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); scope.variables.forEach(variable => { @@ -77,6 +78,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 b8120a6..9a84f8c 100644 --- a/node_modules/eslint/lib/rules/no-implied-eval.js +++ b/node_modules/eslint/lib/rules/no-implied-eval.js @@ -10,21 +10,21 @@ //------------------------------------------------------------------------------ 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" + url: "https://eslint.org/docs/latest/rules/no-implied-eval" }, schema: [], @@ -37,6 +37,7 @@ module.exports = { create(context) { const GLOBAL_CANDIDATES = Object.freeze(["global", "window", "globalThis"]); const EVAL_LIKE_FUNC_PATTERN = /^(?:set(?:Interval|Timeout)|execScript)$/u; + const sourceCode = context.sourceCode; /** * Checks whether a node is evaluated as a string or not. @@ -66,7 +67,7 @@ module.exports = { if (firstArgument) { - const staticValue = getStaticValue(firstArgument, context.getScope()); + const staticValue = getStaticValue(firstArgument, sourceCode.getScope(node)); const isStaticString = staticValue && typeof staticValue.value === "string"; const isString = isStaticString || isEvaluatedString(firstArgument); @@ -117,8 +118,8 @@ module.exports = { reportImpliedEvalCallExpression(node); } }, - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); GLOBAL_CANDIDATES .map(candidate => astUtils.getVariableByName(globalScope, candidate)) diff --git a/node_modules/eslint/lib/rules/no-import-assign.js b/node_modules/eslint/lib/rules/no-import-assign.js index 41060d8..c699886 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,15 +174,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-import-assign" }, schema: [], @@ -194,11 +194,13 @@ module.exports = { }, create(context) { + const sourceCode = context.sourceCode; + return { ImportDeclaration(node) { - const scope = context.getScope(); + const scope = sourceCode.getScope(node); - for (const variable of context.getDeclaredVariables(node)) { + for (const variable of sourceCode.getDeclaredVariables(node)) { const shouldCheckMembers = variable.defs.some( d => d.node.type === "ImportNamespaceSpecifier" ); diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js index dec2786..d96e647 100644 --- a/node_modules/eslint/lib/rules/no-inline-comments.js +++ b/node_modules/eslint/lib/rules/no-inline-comments.js @@ -10,15 +10,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-inline-comments" }, schema: [ @@ -39,7 +39,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = context.options[0]; let customIgnoreRegExp; diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js index 0768bc6..f4bae43 100644 --- a/node_modules/eslint/lib/rules/no-inner-declarations.js +++ b/node_modules/eslint/lib/rules/no-inner-declarations.js @@ -15,18 +15,42 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-inner-declarations" }, schema: [ @@ -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 94ad5ba..3c42a68 100644 --- a/node_modules/eslint/lib/rules/no-invalid-regexp.js +++ b/node_modules/eslint/lib/rules/no-invalid-regexp.js @@ -8,24 +8,24 @@ // Requirements //------------------------------------------------------------------------------ -const RegExpValidator = require("regexpp").RegExpValidator; +const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator; const validator = new RegExpValidator(); -const validFlags = /[gimuys]/gu; +const validFlags = /[dgimsuvy]/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" + url: "https://eslint.org/docs/latest/rules/no-invalid-regexp" }, schema: [{ @@ -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 @@ -94,12 +108,14 @@ module.exports = { /** * Check syntax error in a given pattern. * @param {string} pattern The RegExp pattern to validate. - * @param {boolean} uFlag The Unicode flag. + * @param {Object} flags The RegExp flags to validate. + * @param {boolean} [flags.unicode] The Unicode flag. + * @param {boolean} [flags.unicodeSets] The UnicodeSets flag. * @returns {string|null} The syntax error. */ - function validateRegExpPattern(pattern, uFlag) { + function validateRegExpPattern(pattern, flags) { try { - validator.validatePattern(pattern, undefined1, undefined1, uFlag); + validator.validatePattern(pattern, undefined1, undefined1, flags); return null; } catch (err) { return err.message; @@ -108,48 +124,69 @@ 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; } catch { return `Invalid flags supplied to RegExp constructor '${flags}'`; } + + /* + * `regexpp` checks the combination of `u` and `v` flags when parsing `Pattern` according to `ecma262`, + * but this rule may check only the flag when the pattern is unidentifiable, so check it here. + * https://tc39.es/ecma262/multipage/text-processing.html#sec-parsepattern + */ + if (flags.includes("u") && flags.includes("v")) { + return "Regex 'u' and 'v' flags cannot be used together"; + } + return null; } 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) - ) || - ( - - // 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")) - ); + let message = validateRegExpFlags(flags); if (message) { - context.report({ - node, - messageId: "regexMessage", - data: { 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, { unicode: true, unicodeSets: false }) && + validateRegExpPattern(pattern, { unicode: false, unicodeSets: true }) && + validateRegExpPattern(pattern, { unicode: false, unicodeSets: false }) + ) + : validateRegExpPattern(pattern, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }) + ); + + if (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 a79c586..9e21403 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,19 +11,34 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-invalid-this" }, schema: [ @@ -48,7 +63,7 @@ module.exports = { const options = context.options[0] || {}; const capIsConstructor = options.capIsConstructor !== false; const stack = [], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; /** * Gets the current checking context. @@ -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 - }); - } - - /** - * Pops the current checking context from the stack. - * @returns {void} - */ - function exitFunction() { - stack.pop(); - } - return { - /* - * `this` is invalid only under strict mode. - * Modules is always strict mode. - */ - Program(node) { - const scope = context.getScope(), - features = context.parserOptions.ecmaFeatures || {}; + onCodePathStart(codePath, node) { + if (isCodePathWithLexicalThis(codePath, node)) { + return; + } + if (codePath.origin === "program") { + const scope = sourceCode.getScope(node); + const features = context.languageOptions.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: !sourceCode.getScope(node).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 15711c6..ab7ccac 100644 --- a/node_modules/eslint/lib/rules/no-irregular-whitespace.js +++ b/node_modules/eslint/lib/rules/no-irregular-whitespace.js @@ -25,15 +25,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-irregular-whitespace" }, schema: [ @@ -55,6 +55,10 @@ module.exports = { skipRegExps: { type: "boolean", default: false + }, + skipJSXText: { + type: "boolean", + default: false } }, additionalProperties: false @@ -77,8 +81,9 @@ module.exports = { const skipStrings = options.skipStrings !== false; const skipRegExps = !!options.skipRegExps; const skipTemplates = !!options.skipTemplates; + const skipJSXText = !!options.skipJSXText; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const commentNodes = sourceCode.getAllComments(); /** @@ -100,12 +105,12 @@ module.exports = { } /** - * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors * @param {ASTNode} node to check for matching errors. * @returns {void} * @private */ - function removeInvalidNodeErrorsInIdentifierOrLiteral(node) { + function removeInvalidNodeErrorsInLiteral(node) { const shouldCheckStrings = skipStrings && (typeof node.value === "string"); const shouldCheckRegExps = skipRegExps && Boolean(node.regex); @@ -144,6 +149,18 @@ module.exports = { } } + /** + * Checks JSX nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInJSXText(node) { + if (ALL_IRREGULARS.test(node.raw)) { + removeWhitespaceError(node); + } + } + /** * Checks the program source for irregular whitespace * @param {ASTNode} node The program node @@ -237,9 +254,9 @@ module.exports = { checkForIrregularLineTerminators(node); }; - nodes.Identifier = removeInvalidNodeErrorsInIdentifierOrLiteral; - nodes.Literal = removeInvalidNodeErrorsInIdentifierOrLiteral; + nodes.Literal = removeInvalidNodeErrorsInLiteral; nodes.TemplateElement = skipTemplates ? removeInvalidNodeErrorsInTemplateLiteral : noop; + nodes.JSXText = skipJSXText ? removeInvalidNodeErrorsInJSXText : noop; nodes["Program:exit"] = function() { if (skipComments) { diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js index 9ba1e7a..dcd9683 100644 --- a/node_modules/eslint/lib/rules/no-iterator.js +++ b/node_modules/eslint/lib/rules/no-iterator.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-iterator" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js index 570db03..bf33cd1 100644 --- a/node_modules/eslint/lib/rules/no-label-var.js +++ b/node_modules/eslint/lib/rules/no-label-var.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-label-var" }, schema: [], @@ -34,6 +34,7 @@ module.exports = { }, create(context) { + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -59,7 +60,7 @@ module.exports = { LabeledStatement(node) { // Fetch the innermost scope. - const scope = context.getScope(); + const scope = sourceCode.getScope(node); /* * Recursively find the identifier walking up the scope, starting diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js index 85760d8..d991a0a 100644 --- a/node_modules/eslint/lib/rules/no-labels.js +++ b/node_modules/eslint/lib/rules/no-labels.js @@ -14,15 +14,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-labels" }, schema: [ @@ -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 290784b..767eec2 100644 --- a/node_modules/eslint/lib/rules/no-lone-blocks.js +++ b/node_modules/eslint/lib/rules/no-lone-blocks.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-lone-blocks" }, schema: [], @@ -33,6 +33,7 @@ module.exports = { // A stack of lone blocks to be checked for block-level bindings const loneBlocks = []; let ruleDef; + const sourceCode = context.sourceCode; /** * Reports a node as invalid. @@ -40,7 +41,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 +58,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. @@ -64,14 +68,15 @@ module.exports = { /** * Checks the enclosing block of the current node for block-level bindings, * and "marks it" as valid if any. + * @param {ASTNode} node The current node to check. * @returns {void} */ - function markLoneBlock() { + function markLoneBlock(node) { if (loneBlocks.length === 0) { return; } - const block = context.getAncestors().pop(); + const block = node.parent; if (loneBlocks[loneBlocks.length - 1] === block) { loneBlocks.pop(); @@ -88,7 +93,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 +105,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); @@ -110,13 +118,13 @@ module.exports = { ruleDef.VariableDeclaration = function(node) { if (node.kind === "let" || node.kind === "const") { - markLoneBlock(); + markLoneBlock(node); } }; - ruleDef.FunctionDeclaration = function() { - if (context.getScope().isStrict) { - markLoneBlock(); + ruleDef.FunctionDeclaration = function(node) { + if (sourceCode.getScope(node).isStrict) { + markLoneBlock(node); } }; diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js index 6552adc..eefd2c6 100644 --- a/node_modules/eslint/lib/rules/no-lonely-if.js +++ b/node_modules/eslint/lib/rules/no-lonely-if.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-lonely-if" }, schema: [], @@ -28,13 +28,12 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { IfStatement(node) { - const ancestors = context.getAncestors(), - parent = ancestors.pop(), - grandparent = ancestors.pop(); + const parent = node.parent, + grandparent = parent.parent; if (parent && parent.type === "BlockStatement" && parent.body.length === 1 && grandparent && diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js index 13ebd3e..48312fb 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,15 +148,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-loop-func" }, schema: [], @@ -168,13 +168,15 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Reports functions which match the following condition: * * - 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); @@ -183,8 +185,8 @@ module.exports = { return; } - const references = context.getScope().through; - const unsafeRefs = references.filter(r => !isSafe(loopNode, r)).map(r => r.identifier.name); + const references = sourceCode.getScope(node).through; + const unsafeRefs = references.filter(r => r.resolved && !isSafe(loopNode, r)).map(r => r.identifier.name); if (unsafeRefs.length > 0) { context.report({ 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 2d0c618..b3635e3 100644 --- a/node_modules/eslint/lib/rules/no-loss-of-precision.js +++ b/node_modules/eslint/lib/rules/no-loss-of-precision.js @@ -9,15 +9,15 @@ // 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, - url: "https://eslint.org/docs/rules/no-loss-of-precision" + description: "Disallow literal numbers that lose precision", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-loss-of-precision" }, schema: [], messages: { @@ -83,7 +83,7 @@ module.exports = { * @returns {string} the numeric string with a decimal point in the proper place */ function addDecimalPointToNumber(stringNumber) { - return `${stringNumber.slice(0, 1)}.${stringNumber.slice(1)}`; + return `${stringNumber[0]}.${stringNumber.slice(1)}`; } /** @@ -92,7 +92,12 @@ module.exports = { * @returns {string} the stripped string */ function removeLeadingZeros(numberAsString) { - return numberAsString.replace(/^0*/u, ""); + for (let i = 0; i < numberAsString.length; i++) { + if (numberAsString[i] !== "0") { + return numberAsString.slice(i); + } + } + return numberAsString; } /** @@ -101,11 +106,16 @@ module.exports = { * @returns {string} the stripped string */ function removeTrailingZeros(numberAsString) { - return numberAsString.replace(/0*$/u, ""); + for (let i = numberAsString.length - 1; i >= 0; i--) { + if (numberAsString[i] !== "0") { + return numberAsString.slice(0, i + 1); + } + } + return numberAsString; } /** - * 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 +130,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 */ @@ -128,7 +138,7 @@ module.exports = { const trimmedFloat = removeLeadingZeros(stringFloat); if (trimmedFloat.startsWith(".")) { - const decimalDigits = trimmedFloat.split(".").pop(); + const decimalDigits = trimmedFloat.slice(1); const significantDigits = removeLeadingZeros(decimalDigits); return { @@ -144,7 +154,6 @@ module.exports = { }; } - /** * Converts a base ten number to proper scientific notation * @param {string} stringNumber the string representation of the base ten number to be converted @@ -160,7 +169,6 @@ module.exports = { : normalizedNumber.magnitude; return `${normalizedCoefficient}e${magnitude}`; - } /** diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js index 510b3f9..f48a62d 100644 --- a/node_modules/eslint/lib/rules/no-magic-numbers.js +++ b/node_modules/eslint/lib/rules/no-magic-numbers.js @@ -26,15 +26,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-magic-numbers" }, schema: [{ @@ -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 3d00461..20591df 100644 --- a/node_modules/eslint/lib/rules/no-misleading-character-class.js +++ b/node_modules/eslint/lib/rules/no-misleading-character-class.js @@ -3,38 +3,50 @@ */ "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 { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); const { isCombiningCharacter, isEmojiModifier, isRegionalIndicatorSymbol, isSurrogatePair } = require("./utils/unicode"); +const astUtils = require("./utils/ast-utils.js"); +const { isValidWithUnicodeFlag } = require("./utils/regular-expressions"); //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ +/** + * @typedef {import('@eslint-community/regexpp').AST.Character} Character + * @typedef {import('@eslint-community/regexpp').AST.CharacterClassElement} CharacterClassElement + */ + /** * Iterate character sequences of a given nodes. * * CharacterClassRange syntax can steal a part of character sequence, * so this function reverts CharacterClassRange syntax and restore the sequence. - * @param {regexpp.AST.CharacterClassElement[]} nodes The node list to iterate character sequences. - * @returns {IterableIterator} The list of character sequences. + * @param {CharacterClassElement[]} nodes The node list to iterate character sequences. + * @returns {IterableIterator} The list of character sequences. */ function *iterateCharacterSequence(nodes) { + + /** @type {Character[]} */ let seq = []; for (const node of nodes) { switch (node.type) { case "Character": - seq.push(node.value); + seq.push(node); break; case "CharacterClassRange": - seq.push(node.min.value); + seq.push(node.min); yield seq; - seq = [node.max.value]; + seq = [node.max]; break; case "CharacterSet": + case "CharacterClass": // [[]] nesting character class + case "ClassStringDisjunction": // \q{...} + case "ExpressionCharacterClass": // [A--B] if (seq.length > 0) { yield seq; seq = []; @@ -50,32 +62,74 @@ function *iterateCharacterSequence(nodes) { } } + +/** + * Checks whether the given character node is a Unicode code point escape or not. + * @param {Character} char the character node to check. + * @returns {boolean} `true` if the character node is a Unicode code point escape. + */ +function isUnicodeCodePointEscape(char) { + return /^\\u\{[\da-f]+\}$/iu.test(char.raw); +} + +/** + * Each function returns `true` if it detects that kind of problem. + * @type {Record boolean>} + */ const hasCharacterSequence = { surrogatePairWithoutUFlag(chars) { - return chars.some((c, i) => i !== 0 && isSurrogatePair(chars[i - 1], c)); + return chars.some((c, i) => { + if (i === 0) { + return false; + } + const c1 = chars[i - 1]; + + return ( + isSurrogatePair(c1.value, c.value) && + !isUnicodeCodePointEscape(c1) && + !isUnicodeCodePointEscape(c) + ); + }); + }, + + surrogatePair(chars) { + return chars.some((c, i) => { + if (i === 0) { + return false; + } + const c1 = chars[i - 1]; + + return ( + isSurrogatePair(c1.value, c.value) && + ( + isUnicodeCodePointEscape(c1) || + isUnicodeCodePointEscape(c) + ) + ); + }); }, combiningClass(chars) { return chars.some((c, i) => ( i !== 0 && - isCombiningCharacter(c) && - !isCombiningCharacter(chars[i - 1]) + isCombiningCharacter(c.value) && + !isCombiningCharacter(chars[i - 1].value) )); }, emojiModifier(chars) { return chars.some((c, i) => ( i !== 0 && - isEmojiModifier(c) && - !isEmojiModifier(chars[i - 1]) + isEmojiModifier(c.value) && + !isEmojiModifier(chars[i - 1].value) )); }, regionalIndicatorSymbol(chars) { return chars.some((c, i) => ( i !== 0 && - isRegionalIndicatorSymbol(c) && - isRegionalIndicatorSymbol(chars[i - 1]) + isRegionalIndicatorSymbol(c.value) && + isRegionalIndicatorSymbol(chars[i - 1].value) )); }, @@ -85,9 +139,9 @@ const hasCharacterSequence = { return chars.some((c, i) => ( i !== 0 && i !== lastIndex && - c === 0x200d && - chars[i - 1] !== 0x200d && - chars[i + 1] !== 0x200d + c.value === 0x200d && + chars[i - 1].value !== 0x200d && + chars[i + 1].value !== 0x200d )); } }; @@ -98,28 +152,33 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-misleading-character-class" }, + hasSuggestions: true, + schema: [], messages: { surrogatePairWithoutUFlag: "Unexpected surrogate pair in character class. Use 'u' flag.", + surrogatePair: "Unexpected surrogate pair in character class.", 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.sourceCode; const parser = new RegExpParser(); /** @@ -127,17 +186,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 { @@ -145,7 +197,10 @@ module.exports = { pattern, 0, pattern.length, - flags.includes("u") + { + unicode: flags.includes("u"), + unicodeSets: flags.includes("v") + } ); } catch { @@ -153,29 +208,50 @@ 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 + }); } } return { "Literal[regex]"(node) { - verify(node, node.regex.pattern, node.regex.flags); + verify(node, node.regex.pattern, node.regex.flags, fixer => { + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern)) { + return null; + } + + return fixer.insertTextAfter(node, "u"); + }); }, - "Program"() { - const scope = context.getScope(); + "Program"(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); /* @@ -183,15 +259,39 @@ module.exports = { * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`, * `const {RegExp: a} = window; new a()`, etc... */ - for (const { node } of tracker.iterateGlobalReferences({ + for (const { node: refNode } of tracker.iterateGlobalReferences({ RegExp: { [CALL]: true, [CONSTRUCT]: true } })) { - const [patternNode, flagsNode] = node.arguments; + const [patternNode, flagsNode] = refNode.arguments; const pattern = getStringIfConstant(patternNode, scope); const flags = getStringIfConstant(flagsNode, scope); if (typeof pattern === "string") { - verify(node, pattern, flags || ""); + verify(refNode, pattern, flags || "", fixer => { + + if (!isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern)) { + return null; + } + + if (refNode.arguments.length === 1) { + const penultimateToken = sourceCode.getLastToken(refNode, { 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 5a2e139..6b6f736 100644 --- a/node_modules/eslint/lib/rules/no-mixed-operators.js +++ b/node_modules/eslint/lib/rules/no-mixed-operators.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disallow mixed binary operators. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -58,13 +59,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,15 +83,17 @@ function getChildNode(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-mixed-operators" }, schema: [ @@ -122,7 +125,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = normalizeOptions(context.options[0]); /** diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js index a02de91..9e7b803 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,10 +20,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-mixed-requires" }, schema: [ @@ -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 287cbda..7698b5d 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 @@ -1,6 +1,7 @@ /** * @fileoverview Disallow mixed spaces and tabs for indentation * @author Jary Niebur + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -8,15 +9,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs" }, schema: [ @@ -31,7 +34,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let smartTabs; diff --git a/node_modules/eslint/lib/rules/no-multi-assign.js b/node_modules/eslint/lib/rules/no-multi-assign.js index d2606a1..a7a50c1 100644 --- a/node_modules/eslint/lib/rules/no-multi-assign.js +++ b/node_modules/eslint/lib/rules/no-multi-assign.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-multi-assign" }, schema: [{ @@ -45,16 +45,21 @@ module.exports = { const options = context.options[0] || { ignoreNonDeclaration: false }; - const targetParent = options.ignoreNonDeclaration ? ["VariableDeclarator"] : ["AssignmentExpression", "VariableDeclarator"]; + const selectors = [ + "VariableDeclarator > AssignmentExpression.init", + "PropertyDefinition > AssignmentExpression.value" + ]; + + if (!options.ignoreNonDeclaration) { + selectors.push("AssignmentExpression > AssignmentExpression.right"); + } return { - AssignmentExpression(node) { - if (targetParent.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 d43ed73..bc90ee5 100644 --- a/node_modules/eslint/lib/rules/no-multi-spaces.js +++ b/node_modules/eslint/lib/rules/no-multi-spaces.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow use of multiple spaces. * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-multi-spaces" }, fixable: "whitespace", @@ -52,11 +55,11 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; 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 7cf1ae3..8011729 100644 --- a/node_modules/eslint/lib/rules/no-multi-str.js +++ b/node_modules/eslint/lib/rules/no-multi-str.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-multi-str" }, schema: [], 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 9cccef3..5d038ff 100644 --- a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +++ b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js @@ -2,6 +2,7 @@ * @fileoverview Disallows multiple blank lines. * implementation adapted from the no-trailing-spaces rule. * @author Greg Cochard + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-multiple-empty-lines" }, fixable: "whitespace", @@ -64,7 +67,7 @@ module.exports = { maxBOF = typeof context.options[0].maxBOF !== "undefined" ? context.options[0].maxBOF : max; } - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; // Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue const allLines = sourceCode.lines[sourceCode.lines.length - 1] === "" ? sourceCode.lines.slice(0, -1) : sourceCode.lines; diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js index 833e3b7..e3fed44 100644 --- a/node_modules/eslint/lib/rules/no-native-reassign.js +++ b/node_modules/eslint/lib/rules/no-native-reassign.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-native-reassign" }, deprecated: true, @@ -47,6 +47,7 @@ module.exports = { create(context) { const config = context.options[0]; const exceptions = (config && config.exceptions) || []; + const sourceCode = context.sourceCode; /** * Reports write references. @@ -81,14 +82,14 @@ 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); } } return { - Program() { - const globalScope = context.getScope(); + Program(node) { + const globalScope = sourceCode.getScope(node); globalScope.variables.forEach(checkVariable); } diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js index 8a9eba8..3cb7590 100644 --- a/node_modules/eslint/lib/rules/no-negated-condition.js +++ b/node_modules/eslint/lib/rules/no-negated-condition.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-negated-condition" }, schema: [], 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 1229ced..7a50be7 100644 --- a/node_modules/eslint/lib/rules/no-negated-in-lhs.js +++ b/node_modules/eslint/lib/rules/no-negated-in-lhs.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs" }, replacedBy: ["no-unsafe-negation"], diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js index 383bb23..faf8041 100644 --- a/node_modules/eslint/lib/rules/no-nested-ternary.js +++ b/node_modules/eslint/lib/rules/no-nested-ternary.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-nested-ternary" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js index 9af4e31..d58b2d7 100644 --- a/node_modules/eslint/lib/rules/no-new-func.js +++ b/node_modules/eslint/lib/rules/no-new-func.js @@ -5,19 +5,31 @@ "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" + url: "https://eslint.org/docs/latest/rules/no-new-func" }, schema: [], @@ -28,24 +40,41 @@ module.exports = { }, create(context) { + const sourceCode = context.sourceCode; return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const variable = globalScope.set.get("Function"); if (variable && variable.defs.length === 0) { variable.references.forEach(ref => { - const node = ref.identifier; - const { parent } = node; + const idNode = ref.identifier; + const { parent } = idNode; + let evalNode; - if ( - parent && - (parent.type === "NewExpression" || parent.type === "CallExpression") && - node === parent.callee - ) { + if (parent) { + if (idNode === parent.callee && ( + parent.type === "NewExpression" || + parent.type === "CallExpression" + )) { + evalNode = parent; + } else if ( + parent.type === "MemberExpression" && + idNode === 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 (evalNode) { context.report({ - node: parent, + node: evalNode, messageId: "noFunctionConstructor" }); } diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js index e9f915d..06275f4 100644 --- a/node_modules/eslint/lib/rules/no-new-object.js +++ b/node_modules/eslint/lib/rules/no-new-object.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to disallow calls to the Object constructor * @author Matt DuVall + * @deprecated in ESLint v8.50.0 */ "use strict"; @@ -15,29 +16,38 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-new-object" }, + deprecated: true, + + replacedBy: [ + "no-object-constructor" + ], + schema: [], messages: { - preferLiteral: "The object literal notation {} is preferrable." + preferLiteral: "The object literal notation {} is preferable." } }, create(context) { + + const sourceCode = context.sourceCode; + return { NewExpression(node) { const variable = astUtils.getVariableByName( - context.getScope(), + sourceCode.getScope(node), node.callee.name ); diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js index 063f783..6abfc17 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,10 +20,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-new-require" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-new-symbol.js b/node_modules/eslint/lib/rules/no-new-symbol.js index aeb509c..9983022 100644 --- a/node_modules/eslint/lib/rules/no-new-symbol.js +++ b/node_modules/eslint/lib/rules/no-new-symbol.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-new-symbol" }, schema: [], @@ -29,19 +29,21 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const variable = globalScope.set.get("Symbol"); if (variable && variable.defs.length === 0) { variable.references.forEach(ref => { - const node = ref.identifier; - const parent = node.parent; + const idNode = ref.identifier; + const parent = idNode.parent; - if (parent && parent.type === "NewExpression" && parent.callee === node) { + if (parent && parent.type === "NewExpression" && parent.callee === idNode) { context.report({ - node, + node: idNode, messageId: "noNewSymbol" }); } diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js index d276c48..5050a98 100644 --- a/node_modules/eslint/lib/rules/no-new-wrappers.js +++ b/node_modules/eslint/lib/rules/no-new-wrappers.js @@ -5,19 +5,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const { getVariableByName } = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-new-wrappers" }, schema: [], @@ -28,18 +34,24 @@ module.exports = { }, create(context) { + const { sourceCode } = context; return { NewExpression(node) { const wrapperObjects = ["String", "Number", "Boolean"]; + const { name } = node.callee; - if (wrapperObjects.indexOf(node.callee.name) > -1) { - context.report({ - node, - messageId: "noConstructor", - data: { fn: node.callee.name } - }); + if (wrapperObjects.includes(name)) { + const variable = getVariableByName(sourceCode.getScope(node), name); + + if (variable && variable.identifiers.length === 0) { + context.report({ + node, + messageId: "noConstructor", + data: { fn: name } + }); + } } } }; diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js index aa8a4e2..9e20bad 100644 --- a/node_modules/eslint/lib/rules/no-new.js +++ b/node_modules/eslint/lib/rules/no-new.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-new" }, schema: [], 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 a4b46d9..5939390 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/latest/rules/no-nonoctal-decimal-escape" }, + hasSuggestions: true, + schema: [], messages: { @@ -48,7 +49,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Creates a new Suggestion object. diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js index 6eb200c..ee767ea 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,15 +37,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-obj-calls" }, schema: [], @@ -58,9 +58,11 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = {}; @@ -71,12 +73,12 @@ module.exports = { }; } - for (const { node, path } of tracker.iterateGlobalReferences(traceMap)) { - const name = getReportNodeName(node.callee); + for (const { node: refNode, path } of tracker.iterateGlobalReferences(traceMap)) { + const name = getReportNodeName(refNode.callee); const ref = path[0]; const messageId = name === ref ? "unexpectedCall" : "unexpectedRefCall"; - context.report({ node, messageId, data: { name, ref } }); + context.report({ node: refNode, messageId, data: { name, ref } }); } } }; diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js index 5b4c7b2..6924d54 100644 --- a/node_modules/eslint/lib/rules/no-octal-escape.js +++ b/node_modules/eslint/lib/rules/no-octal-escape.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-octal-escape" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js index e9940be..dc02769 100644 --- a/node_modules/eslint/lib/rules/no-octal.js +++ b/node_modules/eslint/lib/rules/no-octal.js @@ -9,21 +9,21 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-octal" }, 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 6874af4..607cafd 100644 --- a/node_modules/eslint/lib/rules/no-param-reassign.js +++ b/node_modules/eslint/lib/rules/no-param-reassign.js @@ -10,15 +10,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-param-reassign" }, schema: [ @@ -70,6 +70,7 @@ module.exports = { const props = context.options[0] && context.options[0].props; const ignoredPropertyAssignmentsFor = context.options[0] && context.options[0].ignorePropertyModificationsFor || []; const ignoredPropertyAssignmentsForRegex = context.options[0] && context.options[0].ignorePropertyModificationsForRegex || []; + const sourceCode = context.sourceCode; /** * Checks whether or not the reference modifies properties of its variable. @@ -214,7 +215,7 @@ module.exports = { * @returns {void} */ function checkForFunction(node) { - context.getDeclaredVariables(node).forEach(checkVariable); + sourceCode.getDeclaredVariables(node).forEach(checkVariable); } return { diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js index fc1f894..2e4a3a2 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,10 +19,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-path-concat" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js index 84d6c3e..22a6fd0 100644 --- a/node_modules/eslint/lib/rules/no-plusplus.js +++ b/node_modules/eslint/lib/rules/no-plusplus.js @@ -45,15 +45,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-plusplus" }, schema: [ diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js index 49d1734..8dac648 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,10 +19,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-process-env" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js index 77c9cfd..fa398a7 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,10 +19,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-process-exit" }, schema: [], 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 32ee6e1..b27e440 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,8 @@ // Requirements //------------------------------------------------------------------------------ -const { findVariable } = require("eslint-utils"); +const { findVariable } = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils"); //------------------------------------------------------------------------------ // Helpers @@ -59,51 +60,170 @@ function isPromiseExecutor(node, scope) { isGlobalReference(parent.callee, getOuterScope(scope)); } +/** + * Checks if the given node is a void expression. + * @param {ASTNode} node The node to check. + * @returns {boolean} - `true` if the node is a void expression + */ +function expressionIsVoid(node) { + return node.type === "UnaryExpression" && node.operator === "void"; +} + +/** + * Fixes the linting error by prepending "void " to the given node + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function voidPrependFixer(sourceCode, node, fixer) { + + const requiresParens = + + // prepending `void ` will fail if the node has a lower precedence than void + astUtils.getPrecedence(node) < astUtils.getPrecedence({ type: "UnaryExpression", operator: "void" }) && + + // check if there are parentheses around the node to avoid redundant parentheses + !astUtils.isParenthesised(sourceCode, node); + + // avoid parentheses issues + const returnOrArrowToken = sourceCode.getTokenBefore( + node, + node.parent.type === "ArrowFunctionExpression" + ? astUtils.isArrowToken + + // isReturnToken + : token => token.type === "Keyword" && token.value === "return" + ); + + const firstToken = sourceCode.getTokenAfter(returnOrArrowToken); + + const prependSpace = + + // is return token, as => allows void to be adjacent + returnOrArrowToken.value === "return" && + + // If two tokens (return and "(") are adjacent + returnOrArrowToken.range[1] === firstToken.range[0]; + + return [ + fixer.insertTextBefore(firstToken, `${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`), + fixer.insertTextAfter(node, requiresParens ? ")" : "") + ]; +} + +/** + * Fixes the linting error by `wrapping {}` around the given node's body. + * @param {Object} sourceCode context given by context.sourceCode + * @param {ASTNode} node The node to fix. + * @param {Object} fixer The fixer object provided by ESLint. + * @returns {Array} - An array of fix objects to apply to the node. + */ +function curlyWrapFixer(sourceCode, node, fixer) { + + // https://github.com/eslint/eslint/pull/17282#issuecomment-1592795923 + const arrowToken = sourceCode.getTokenBefore(node.body, astUtils.isArrowToken); + const firstToken = sourceCode.getTokenAfter(arrowToken); + const lastToken = sourceCode.getLastToken(node); + + return [ + fixer.insertTextBefore(firstToken, "{"), + fixer.insertTextAfter(lastToken, "}") + ]; +} + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-promise-executor-return" }, - schema: [], + hasSuggestions: true, + + schema: [{ + type: "object", + properties: { + allowVoid: { + type: "boolean", + default: false + } + }, + additionalProperties: false + }], messages: { - returnsValue: "Return values from promise executor functions cannot be read." + returnsValue: "Return values from promise executor functions cannot be read.", + + // arrow and function suggestions + prependVoid: "Prepend `void` to the expression.", + + // only arrow suggestions + wrapBraces: "Wrap the expression in `{}`." } }, create(context) { let funcInfo = null; - - /** - * Reports the given node. - * @param {ASTNode} node Node to report. - * @returns {void} - */ - function report(node) { - context.report({ node, messageId: "returnsValue" }); - } + const sourceCode = context.sourceCode; + const { + allowVoid = false + } = context.options[0] || {}; return { onCodePathStart(_, node) { funcInfo = { upper: funcInfo, - shouldCheck: functionTypesToCheck.has(node.type) && isPromiseExecutor(node, context.getScope()) + shouldCheck: + functionTypesToCheck.has(node.type) && + isPromiseExecutor(node, sourceCode.getScope(node)) }; - if (funcInfo.shouldCheck && node.type === "ArrowFunctionExpression" && node.expression) { - report(node.body); + if (// Is a Promise executor + funcInfo.shouldCheck && + node.type === "ArrowFunctionExpression" && + node.expression && + + // Except void + !(allowVoid && expressionIsVoid(node.body)) + ) { + const suggest = []; + + // prevent useless refactors + if (allowVoid) { + suggest.push({ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.body, fixer); + } + }); + } + + // Do not suggest wrapping an unnamed FunctionExpression in braces as that would be invalid syntax. + if (!(node.body.type === "FunctionExpression" && !node.body.id)) { + suggest.push({ + messageId: "wrapBraces", + fix(fixer) { + return curlyWrapFixer(sourceCode, node, fixer); + } + }); + } + + context.report({ + node: node.body, + messageId: "returnsValue", + suggest + }); } }, @@ -112,9 +232,31 @@ module.exports = { }, ReturnStatement(node) { - if (funcInfo.shouldCheck && node.argument) { - report(node); + if (!(funcInfo.shouldCheck && node.argument)) { + return; } + + // node is `return ` + if (!allowVoid) { + context.report({ node, messageId: "returnsValue" }); + return; + } + + if (expressionIsVoid(node.argument)) { + return; + } + + // allowVoid && !expressionIsVoid + context.report({ + node, + messageId: "returnsValue", + suggest: [{ + messageId: "prependVoid", + fix(fixer) { + return voidPrependFixer(sourceCode, node.argument, fixer); + } + }] + }); } }; } diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js index 82ce02f..28320d5 100644 --- a/node_modules/eslint/lib/rules/no-proto.js +++ b/node_modules/eslint/lib/rules/no-proto.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-proto" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-prototype-builtins.js b/node_modules/eslint/lib/rules/no-prototype-builtins.js index c5e4d49..b61e585 100644 --- a/node_modules/eslint/lib/rules/no-prototype-builtins.js +++ b/node_modules/eslint/lib/rules/no-prototype-builtins.js @@ -10,34 +10,68 @@ const astUtils = require("./utils/ast-utils"); +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Returns true if the node or any of the objects + * to the left of it in the member/call chain is optional. + * + * e.g. `a?.b`, `a?.b.c`, `a?.()`, `a()?.()` + * @param {ASTNode} node The expression to check + * @returns {boolean} `true` if there is a short-circuiting optional `?.` + * in the same option chain to the left of this call or member expression, + * or the node itself is an optional call or member `?.`. + */ +function isAfterOptional(node) { + let leftNode; + + if (node.type === "MemberExpression") { + leftNode = node.object; + } else if (node.type === "CallExpression") { + leftNode = node.callee; + } else { + return false; + } + if (node.optional) { + return true; + } + return isAfterOptional(leftNode); +} + + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-prototype-builtins" }, + hasSuggestions: true, + schema: [], messages: { - prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object." + prototypeBuildIn: "Do not access Object.prototype method '{{prop}}' from target object.", + callObjectPrototype: "Call Object.prototype.{{prop}} explicitly." } }, create(context) { - const DISALLOWED_PROPS = [ + const DISALLOWED_PROPS = new Set([ "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable" - ]; + ]); /** * Reports if a disallowed property is used in a CallExpression @@ -54,12 +88,66 @@ 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, data: { prop: propName }, - node + node, + suggest: [ + { + messageId: "callObjectPrototype", + data: { prop: propName }, + fix(fixer) { + const sourceCode = context.sourceCode; + + /* + * A call after an optional chain (e.g. a?.b.hasOwnProperty(c)) + * must be fixed manually because the call can be short-circuited + */ + if (isAfterOptional(node)) { + return null; + } + + /* + * A call on a ChainExpression (e.g. (a?.hasOwnProperty)(c)) will trigger + * no-unsafe-optional-chaining which should be fixed before this suggestion + */ + if (node.callee.type === "ChainExpression") { + return null; + } + + const objectVariable = astUtils.getVariableByName(sourceCode.getScope(node), "Object"); + + /* + * We can't use Object if the global Object was shadowed, + * or Object does not exist in the global scope for some reason + */ + if (!objectVariable || objectVariable.scope.type !== "global" || objectVariable.defs.length > 0) { + return null; + } + + let objectText = sourceCode.getText(callee.object); + + if (astUtils.getPrecedence(callee.object) <= astUtils.getPrecedence({ type: "SequenceExpression" })) { + objectText = `(${objectText})`; + } + + const openParenToken = sourceCode.getTokenAfter( + node.callee, + astUtils.isOpeningParenToken + ); + const isEmptyParameters = node.arguments.length === 0; + const delim = isEmptyParameters ? "" : ", "; + const fixes = [ + fixer.replaceText(callee, `Object.prototype.${propName}.call`), + fixer.insertTextAfter(openParenToken, objectText + delim) + ]; + + return fixes; + } + } + ] }); } } diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js index 6ddb21c..8a4877e 100644 --- a/node_modules/eslint/lib/rules/no-redeclare.js +++ b/node_modules/eslint/lib/rules/no-redeclare.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-redeclare" }, messages: { @@ -50,7 +50,7 @@ module.exports = { context.options[0].builtinGlobals ) }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Iterate declarations of a given variable. @@ -129,7 +129,7 @@ module.exports = { * @private */ function checkForBlock(node) { - const scope = context.getScope(); + const scope = sourceCode.getScope(node); /* * In ES5, some node type such as `BlockStatement` doesn't have that scope. @@ -141,8 +141,8 @@ module.exports = { } return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); findVariablesInScope(scope); @@ -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 e6d4c9e..cb25010 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,15 +33,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-regex-spaces" }, schema: [], @@ -54,6 +54,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Validate regular expression * @param {ASTNode} nodeToReport Node to report. @@ -75,7 +77,7 @@ module.exports = { let regExpAST; try { - regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + regExpAST = regExpParser.parsePattern(pattern, 0, pattern.length, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }); } catch { // Ignore regular expressions with syntax errors @@ -149,17 +151,32 @@ module.exports = { * @private */ function checkFunction(node) { - const scope = context.getScope(); + const scope = sourceCode.getScope(node); const regExpVar = astUtils.getVariableByName(scope, "RegExp"); const shadowed = regExpVar && regExpVar.defs.length > 0; const patternNode = node.arguments[0]; - const flagsNode = node.arguments[1]; if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(patternNode) && !shadowed) { const pattern = patternNode.value; const rawPattern = patternNode.raw.slice(1, -1); const rawPatternStartRange = patternNode.range[0] + 1; - const flags = isString(flagsNode) ? flagsNode.value : ""; + let flags; + + if (node.arguments.length < 2) { + + // It has no flags. + flags = ""; + } else { + const flagsNode = node.arguments[1]; + + if (isString(flagsNode)) { + flags = flagsNode.value; + } else { + + // The flags cannot be determined. + return; + } + } checkRegex( node, diff --git a/node_modules/eslint/lib/rules/no-restricted-exports.js b/node_modules/eslint/lib/rules/no-restricted-exports.js index f0df0ff..a1d54b0 100644 --- a/node_modules/eslint/lib/rules/no-restricted-exports.js +++ b/node_modules/eslint/lib/rules/no-restricted-exports.js @@ -5,51 +5,109 @@ "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" + url: "https://eslint.org/docs/latest/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 + } }, - 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 + } + }, + 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; + const sourceCode = context.sourceCode; /** - * 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 +115,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 +161,15 @@ module.exports = { } }, + ExportDefaultDeclaration(node) { + if (restrictDefaultExports && restrictDefaultExports.direct) { + context.report({ + node, + messageId: "restrictedDefault" + }); + } + }, + ExportNamedDeclaration(node) { const declaration = node.declaration; @@ -74,7 +177,7 @@ module.exports = { if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") { checkExportedName(declaration.id); } else if (declaration.type === "VariableDeclaration") { - context.getDeclaredVariables(declaration) + sourceCode.getDeclaredVariables(declaration) .map(v => v.defs.find(d => d.parent === declaration)) .map(d => d.name) // Identifier nodes .forEach(checkExportedName); diff --git a/node_modules/eslint/lib/rules/no-restricted-globals.js b/node_modules/eslint/lib/rules/no-restricted-globals.js index 2c932a7..919a8ee 100644 --- a/node_modules/eslint/lib/rules/no-restricted-globals.js +++ b/node_modules/eslint/lib/rules/no-restricted-globals.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-restricted-globals" }, schema: { @@ -43,13 +43,15 @@ 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}}" } }, create(context) { + const sourceCode = context.sourceCode; + // If no globals are restricted, we don't need to do anything if (context.options.length === 0) { return {}; @@ -99,8 +101,8 @@ module.exports = { } return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); // Report variables declared elsewhere (ex: variables defined as "global" by eslint) scope.variables.forEach(variable => { diff --git a/node_modules/eslint/lib/rules/no-restricted-imports.js b/node_modules/eslint/lib/rules/no-restricted-imports.js index 414164d..eb59f4c 100644 --- a/node_modules/eslint/lib/rules/no-restricted-imports.js +++ b/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -4,6 +4,12 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -52,6 +58,14 @@ const arrayOfStringsOrObjectPatterns = { items: { type: "object", properties: { + importNames: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, group: { type: "array", items: { @@ -60,9 +74,15 @@ const arrayOfStringsOrObjectPatterns = { minItems: 1, uniqueItems: true }, + importNamePattern: { + type: "string" + }, message: { type: "string", minLength: 1 + }, + caseSensitive: { + type: "boolean" } }, additionalProperties: false, @@ -73,32 +93,44 @@ const arrayOfStringsOrObjectPatterns = { ] }; +/** @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" + url: "https://eslint.org/docs/latest/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 + // 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.", + + patternAndEverythingWithRegexImportName: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used.", + // 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}}", + // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period + patternAndEverythingWithRegexImportNameAndCustomMessage: "* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used. {{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}}" }, @@ -122,7 +154,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = Array.isArray(context.options) ? context.options : []; const isPathAndPatternsObject = typeof options[0] === "object" && @@ -142,12 +174,22 @@ module.exports = { }, {}); // Handle patterns too, either as strings or groups - const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; - const restrictedPatternGroups = restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string" - ? [{ matcher: ignore().add(restrictedPatterns) }] - : restrictedPatterns.map(({ group, message }) => ({ matcher: ignore().add(group), customMessage: message })); + let restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || []; - // if no imports are restricted we don"t need to check + // 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, importNamePattern }) => ({ + matcher: ignore({ allowRelativePaths: true, ignorecase: !caseSensitive }).add(group), + customMessage: message, + importNames, + importNamePattern + })); + + // if no imports are restricted we don't need to check if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) { return {}; } @@ -217,19 +259,82 @@ module.exports = { /** * Report a restricted path specifically for patterns. * @param {node} node representing the restricted path reference - * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails + * @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, group) { + function reportPathForPatterns(node, group, importNames) { const importSource = node.source.value.trim(); - context.report({ - node, - messageId: group.customMessage ? "patternWithCustomMessage" : "patterns", - data: { - importSource, - customMessage: group.customMessage + const customMessage = group.customMessage; + const restrictedImportNames = group.importNames; + const restrictedImportNamePattern = group.importNamePattern ? new RegExp(group.importNamePattern, "u") : null; + + /* + * If we are not restricting to any specific import names and just the pattern itself, + * report the error and move on + */ + if (!restrictedImportNames && !restrictedImportNamePattern) { + context.report({ + node, + messageId: customMessage ? "patternWithCustomMessage" : "patterns", + data: { + importSource, + customMessage + } + }); + return; + } + + importNames.forEach((specifiers, importName) => { + if (importName === "*") { + const [specifier] = specifiers; + + if (restrictedImportNames) { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithCustomMessage" : "patternAndEverything", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNames, + customMessage + } + }); + } else { + context.report({ + node, + messageId: customMessage ? "patternAndEverythingWithRegexImportNameAndCustomMessage" : "patternAndEverythingWithRegexImportName", + loc: specifier.loc, + data: { + importSource, + importNames: restrictedImportNamePattern, + customMessage + } + }); + } + + return; + } + + if ( + (restrictedImportNames && restrictedImportNames.includes(importName)) || + (restrictedImportNamePattern && restrictedImportNamePattern.test(importName)) + ) { + specifiers.forEach(specifier => { + context.report({ + node, + messageId: customMessage ? "patternAndImportNameWithCustomMessage" : "patternAndImportName", + loc: specifier.loc, + data: { + importSource, + customMessage, + importName + } + }); + }); } }); } @@ -269,12 +374,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 { @@ -287,7 +392,7 @@ module.exports = { checkRestrictedPathAndReport(importSource, importNames, node); restrictedPatternGroups.forEach(group => { if (isRestrictedPattern(importSource, group)) { - reportPathForPatterns(node, group); + reportPathForPatterns(node, group, importNames); } }); } diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js index d0b8a78..4a9b0a4 100644 --- a/node_modules/eslint/lib/rules/no-restricted-modules.js +++ b/node_modules/eslint/lib/rules/no-restricted-modules.js @@ -1,9 +1,16 @@ /** * @fileoverview Restrict usage of specified node modules. * @author Christian Schulz + * @deprecated in ESLint v7.0.0 */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -38,6 +45,7 @@ const arrayOfStringsOrObjects = { uniqueItems: true }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { deprecated: true, @@ -47,10 +55,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-restricted-modules" }, schema: { @@ -73,7 +80,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 +104,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); /** @@ -114,15 +122,6 @@ module.exports = { return node && node.type === "Literal" && typeof node.value === "string"; } - /** - * Function to check if a node is a static string template literal. - * @param {ASTNode} node The node to check. - * @returns {boolean} If the node is a string template literal. - */ - function isStaticTemplateLiteral(node) { - return node && node.type === "TemplateLiteral" && node.expressions.length === 0; - } - /** * Function to check if a node is a require call. * @param {ASTNode} node The node to check. @@ -142,7 +141,7 @@ module.exports = { return node.value.trim(); } - if (isStaticTemplateLiteral(node)) { + if (astUtils.isStaticTemplateLiteral(node)) { return node.quasis[0].value.cooked.trim(); } diff --git a/node_modules/eslint/lib/rules/no-restricted-properties.js b/node_modules/eslint/lib/rules/no-restricted-properties.js index 7ab8399..acd178a 100644 --- a/node_modules/eslint/lib/rules/no-restricted-properties.js +++ b/node_modules/eslint/lib/rules/no-restricted-properties.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-restricted-properties" }, schema: { @@ -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}}" } }, @@ -142,40 +142,27 @@ module.exports = { } } - /** - * Checks property accesses in a destructuring assignment expression, e.g. `var foo; ({foo} = bar);` - * @param {ASTNode} node An AssignmentExpression or AssignmentPattern node - * @returns {undefined} - */ - function checkDestructuringAssignment(node) { - if (node.right.type === "Identifier") { - const objectName = node.right.name; - - if (node.left.type === "ObjectPattern") { - node.left.properties.forEach(property => { - checkPropertyAccess(node.left, objectName, astUtils.getStaticPropertyName(property)); - }); - } - } - } - return { MemberExpression(node) { checkPropertyAccess(node, node.object && node.object.name, astUtils.getStaticPropertyName(node)); }, - VariableDeclarator(node) { - if (node.init && node.init.type === "Identifier") { - const objectName = node.init.name; + ObjectPattern(node) { + let objectName = null; - if (node.id.type === "ObjectPattern") { - node.id.properties.forEach(property => { - checkPropertyAccess(node.id, objectName, astUtils.getStaticPropertyName(property)); - }); + if (node.parent.type === "VariableDeclarator") { + if (node.parent.init && node.parent.init.type === "Identifier") { + objectName = node.parent.init.name; + } + } else if (node.parent.type === "AssignmentExpression" || node.parent.type === "AssignmentPattern") { + if (node.parent.right.type === "Identifier") { + objectName = node.parent.right.name; } } - }, - AssignmentExpression: checkDestructuringAssignment, - AssignmentPattern: checkDestructuringAssignment + + node.properties.forEach(property => { + checkPropertyAccess(node, objectName, astUtils.getStaticPropertyName(property)); + }); + } }; } }; diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js index 9572603..930882c 100644 --- a/node_modules/eslint/lib/rules/no-restricted-syntax.js +++ b/node_modules/eslint/lib/rules/no-restricted-syntax.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-restricted-syntax" }, schema: { @@ -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 4b57d42..73caf0e 100644 --- a/node_modules/eslint/lib/rules/no-return-assign.js +++ b/node_modules/eslint/lib/rules/no-return-assign.js @@ -20,15 +20,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-return-assign" }, schema: [ @@ -45,7 +45,7 @@ module.exports = { create(context) { const always = (context.options[0] || "except-parens") !== "except-parens"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { AssignmentExpression(node) { diff --git a/node_modules/eslint/lib/rules/no-return-await.js b/node_modules/eslint/lib/rules/no-return-await.js index d1d8982..77abda0 100644 --- a/node_modules/eslint/lib/rules/no-return-await.js +++ b/node_modules/eslint/lib/rules/no-return-await.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows unnecessary `return await` * @author Jordan Harband + * @deprecated in ESLint v8.46.0 */ "use strict"; @@ -10,25 +11,31 @@ 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, - url: "https://eslint.org/docs/rules/no-return-await" + url: "https://eslint.org/docs/latest/rules/no-return-await" }, fixable: null, + deprecated: true, + + replacedBy: [], + schema: [ ], messages: { + removeAwait: "Remove redundant `await`.", redundantUseOfAwait: "Redundant use of `await` on a return value." } }, @@ -42,9 +49,34 @@ module.exports = { */ function reportUnnecessaryAwait(node) { context.report({ - node: context.getSourceCode().getFirstToken(node), + node: context.sourceCode.getFirstToken(node), loc: node.loc, - messageId: "redundantUseOfAwait" + messageId: "redundantUseOfAwait", + suggest: [ + { + messageId: "removeAwait", + fix(fixer) { + const sourceCode = context.sourceCode; + 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 0c82052..1d16bde 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,15 +12,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-script-url" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-self-assign.js b/node_modules/eslint/lib/rules/no-self-assign.js index 705be32..33ac8fb 100644 --- a/node_modules/eslint/lib/rules/no-self-assign.js +++ b/node_modules/eslint/lib/rules/no-self-assign.js @@ -124,15 +124,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-self-assign" }, schema: [ @@ -154,7 +154,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const [{ props = true } = {}] = context.options; /** @@ -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 79b6ac7..3b076eb 100644 --- a/node_modules/eslint/lib/rules/no-self-compare.js +++ b/node_modules/eslint/lib/rules/no-self-compare.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-self-compare" }, schema: [], @@ -29,7 +29,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Determines whether two nodes are composed of the same tokens. diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js index fe51697..cd21fc7 100644 --- a/node_modules/eslint/lib/rules/no-sequences.js +++ b/node_modules/eslint/lib/rules/no-sequences.js @@ -23,15 +23,15 @@ const DEFAULT_OPTIONS = { // 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" + url: "https://eslint.org/docs/latest/rules/no-sequences" }, schema: [{ @@ -51,7 +51,7 @@ module.exports = { create(context) { const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Parts of the grammar that are required to have parens. diff --git a/node_modules/eslint/lib/rules/no-setter-return.js b/node_modules/eslint/lib/rules/no-setter-return.js index 9c79240..a5abaaa 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,15 +136,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-setter-return" }, schema: [], @@ -155,6 +156,7 @@ module.exports = { create(context) { let funcInfo = null; + const sourceCode = context.sourceCode; /** * Creates and pushes to the stack a function info object for the given function node. @@ -162,7 +164,7 @@ module.exports = { * @returns {void} */ function enterFunction(node) { - const outerScope = getOuterScope(context.getScope()); + const outerScope = getOuterScope(sourceCode.getScope(node)); funcInfo = { upper: funcInfo, 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 9647e9a..29560ff 100644 --- a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +++ b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js @@ -21,15 +21,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names" }, schema: [], @@ -43,10 +43,11 @@ module.exports = { const RESTRICTED = new Set(["undefined", "NaN", "Infinity", "arguments", "eval"]); + const sourceCode = context.sourceCode; return { "VariableDeclaration, :function, CatchClause"(node) { - for (const variable of context.getDeclaredVariables(node)) { + for (const variable of sourceCode.getDeclaredVariables(node)) { if (variable.defs.length > 0 && RESTRICTED.has(variable.name) && !safelyShadowsUndefined(variable)) { context.report({ node: variable.defs[0].name, diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js index a0b1db5..3e4d998 100644 --- a/node_modules/eslint/lib/rules/no-shadow.js +++ b/node_modules/eslint/lib/rules/no-shadow.js @@ -11,19 +11,28 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-shadow" }, schema: [ @@ -37,7 +46,8 @@ module.exports = { items: { type: "string" } - } + }, + ignoreOnInitialization: { type: "boolean", default: false } }, additionalProperties: false } @@ -54,16 +64,117 @@ 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 }; + const sourceCode = context.sourceCode; + + /** + * 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 +210,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 +265,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 +286,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 +296,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"; @@ -207,8 +319,8 @@ module.exports = { } return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const stack = globalScope.childScopes.slice(); while (stack.length) { diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js index 961bc68..d79c184 100644 --- a/node_modules/eslint/lib/rules/no-spaced-func.js +++ b/node_modules/eslint/lib/rules/no-spaced-func.js @@ -10,15 +10,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-spaced-func" }, deprecated: true, @@ -35,7 +35,7 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Check if open space is present in a function name diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js index e8407c3..c65b0ab 100644 --- a/node_modules/eslint/lib/rules/no-sparse-arrays.js +++ b/node_modules/eslint/lib/rules/no-sparse-arrays.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-sparse-arrays" }, schema: [], @@ -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 06424e0..8f79a36 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,10 +20,9 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-sync" }, schema: [ diff --git a/node_modules/eslint/lib/rules/no-tabs.js b/node_modules/eslint/lib/rules/no-tabs.js index ca7be26..8581e19 100644 --- a/node_modules/eslint/lib/rules/no-tabs.js +++ b/node_modules/eslint/lib/rules/no-tabs.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check for tabs inside a file * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -16,15 +17,17 @@ const anyNonWhitespaceRegex = /\S/u; // Public Interface //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { - description: "disallow all tabs", - category: "Stylistic Issues", + description: "Disallow all tabs", recommended: false, - url: "https://eslint.org/docs/rules/no-tabs" + url: "https://eslint.org/docs/latest/rules/no-tabs" }, schema: [{ type: "object", @@ -43,7 +46,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const allowIndentationTabs = context.options && context.options[0] && context.options[0].allowIndentationTabs; return { 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 539cd5b..92b4c1c 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,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js index b3ced86..4d43c7e 100644 --- a/node_modules/eslint/lib/rules/no-ternary.js +++ b/node_modules/eslint/lib/rules/no-ternary.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-ternary" }, schema: [], 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 5bfba66..f96d8ac 100644 --- a/node_modules/eslint/lib/rules/no-this-before-super.js +++ b/node_modules/eslint/lib/rules/no-this-before-super.js @@ -34,15 +34,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-this-before-super" }, schema: [], @@ -90,6 +90,21 @@ module.exports = { return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); } + /** + * Determines if every segment in a set has been called. + * @param {Set} segments The segments to search. + * @returns {boolean} True if every segment has been called; false otherwise. + */ + function isEverySegmentCalled(segments) { + for (const segment of segments) { + if (!isCalled(segment)) { + return false; + } + } + + return true; + } + /** * Checks whether or not this is before `super()` is called. * @returns {boolean} `true` if this is before `super()` is called. @@ -97,7 +112,7 @@ module.exports = { function isBeforeCallOfSuper() { return ( isInConstructorOfDerivedClass() && - !funcInfo.codePath.currentSegments.every(isCalled) + !isEverySegmentCalled(funcInfo.currentSegments) ); } @@ -108,11 +123,9 @@ module.exports = { * @returns {void} */ function setInvalid(node) { - const segments = funcInfo.codePath.currentSegments; - - for (let i = 0; i < segments.length; ++i) { - const segment = segments[i]; + const segments = funcInfo.currentSegments; + for (const segment of segments) { if (segment.reachable) { segInfoMap[segment.id].invalidNodes.push(node); } @@ -124,11 +137,9 @@ module.exports = { * @returns {void} */ function setSuperCalled() { - const segments = funcInfo.codePath.currentSegments; - - for (let i = 0; i < segments.length; ++i) { - const segment = segments[i]; + const segments = funcInfo.currentSegments; + for (const segment of segments) { if (segment.reachable) { segInfoMap[segment.id].superCalled = true; } @@ -156,14 +167,16 @@ module.exports = { classNode.superClass && !astUtils.isNullOrUndefined(classNode.superClass) ), - codePath + codePath, + currentSegments: new Set() }; } else { funcInfo = { upper: funcInfo, isConstructor: false, hasExtends: false, - codePath + codePath, + currentSegments: new Set() }; } }, @@ -211,6 +224,8 @@ module.exports = { * @returns {void} */ onCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + if (!isInConstructorOfDerivedClass()) { return; } @@ -225,6 +240,18 @@ module.exports = { }; }, + onUnreachableCodePathSegmentStart(segment) { + funcInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + funcInfo.currentSegments.delete(segment); + }, + /** * Update information of the code path segment when a code path was * looped. diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js index 29fb371..07a0df6 100644 --- a/node_modules/eslint/lib/rules/no-throw-literal.js +++ b/node_modules/eslint/lib/rules/no-throw-literal.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-throw-literal" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js index 98ae62c..eede46c 100644 --- a/node_modules/eslint/lib/rules/no-trailing-spaces.js +++ b/node_modules/eslint/lib/rules/no-trailing-spaces.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallow trailing spaces at the end of lines. * @author Nodeca Team + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-trailing-spaces" }, fixable: "whitespace", @@ -50,7 +53,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u3000]", SKIP_BLANK = `^${BLANK_CLASS}*$`, diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js index 5c240fe..be19d6f 100644 --- a/node_modules/eslint/lib/rules/no-undef-init.js +++ b/node_modules/eslint/lib/rules/no-undef-init.js @@ -11,15 +11,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-undef-init" }, schema: [], @@ -32,14 +32,14 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { VariableDeclarator(node) { const name = sourceCode.getText(node.id), init = node.init && node.init.name, - scope = context.getScope(), + scope = sourceCode.getScope(node), undefinedVar = astUtils.getVariableByName(scope, "undefined"), shadowed = undefinedVar && undefinedVar.defs.length > 0, lastToken = sourceCode.getLastToken(node); diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js index 6b51408..fe47028 100644 --- a/node_modules/eslint/lib/rules/no-undef.js +++ b/node_modules/eslint/lib/rules/no-undef.js @@ -23,15 +23,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-undef" }, schema: [ @@ -54,10 +54,11 @@ module.exports = { create(context) { const options = context.options[0]; const considerTypeOf = options && options.typeof === true || false; + const sourceCode = context.sourceCode; return { - "Program:exit"(/* node */) { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); globalScope.through.forEach(ref => { const identifier = ref.identifier; diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js index a075d90..8f47ca1 100644 --- a/node_modules/eslint/lib/rules/no-undefined.js +++ b/node_modules/eslint/lib/rules/no-undefined.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-undefined" }, schema: [], @@ -28,6 +28,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Report an invalid "undefined" identifier node. * @param {ASTNode} node The node to report. @@ -66,8 +68,8 @@ module.exports = { } return { - "Program:exit"() { - const globalScope = context.getScope(); + "Program:exit"(node) { + const globalScope = sourceCode.getScope(node); const stack = [globalScope]; diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js index 87d2336..a0e05c6 100644 --- a/node_modules/eslint/lib/rules/no-underscore-dangle.js +++ b/node_modules/eslint/lib/rules/no-underscore-dangle.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-underscore-dangle" }, schema: [ @@ -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,11 @@ 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; + const sourceCode = context.sourceCode; //------------------------------------------------------------------------- // Helpers @@ -81,7 +97,7 @@ module.exports = { * @private */ function isAllowed(identifier) { - return ALLOWED_VARIABLES.some(ident => ident === identifier); + return ALLOWED_VARIABLES.includes(identifier); } /** @@ -190,6 +206,7 @@ module.exports = { checkForDanglingUnderscoreInFunctionParameters(node); } + /** * Check if variable expression has a dangling underscore * @param {ASTNode} node node to evaluate @@ -197,18 +214,32 @@ module.exports = { * @private */ function checkForDanglingUnderscoreInVariableExpression(node) { - const identifier = node.id.name; + sourceCode.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 +284,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 +325,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 7af3fe6..810c08b 100644 --- a/node_modules/eslint/lib/rules/no-unexpected-multiline.js +++ b/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -14,15 +14,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline" }, schema: [], @@ -38,7 +38,7 @@ module.exports = { const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Check to see if there is a newline between the node and the following open bracket 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 7031a4d..768a155 100644 --- a/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js +++ b/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js @@ -156,15 +156,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition" }, schema: [], @@ -175,7 +175,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let groupMap = null; /** @@ -340,8 +340,8 @@ module.exports = { } return { - "Program:exit"() { - const queue = [context.getScope()]; + "Program:exit"(node) { + const queue = [sourceCode.getScope(node)]; groupMap = new Map(); diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js index 06c615f..ab1bdc5 100644 --- a/node_modules/eslint/lib/rules/no-unneeded-ternary.js +++ b/node_modules/eslint/lib/rules/no-unneeded-ternary.js @@ -23,15 +23,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary" }, schema: [ @@ -58,7 +58,7 @@ module.exports = { create(context) { const options = context.options[0] || {}; const defaultAssignment = options.defaultAssignment !== false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Test if the node is a boolean literal @@ -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 868a6ff..577d39a 100644 --- a/node_modules/eslint/lib/rules/no-unreachable-loop.js +++ b/node_modules/eslint/lib/rules/no-unreachable-loop.js @@ -11,6 +11,22 @@ const allLoopTypes = ["WhileStatement", "DoWhileStatement", "ForStatement", "ForInStatement", "ForOfStatement"]; +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + /** * Determines whether the given node is the first node in the code path to which a loop statement * 'loops' for the next iteration. @@ -53,15 +69,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unreachable-loop" }, schema: [{ @@ -90,29 +106,36 @@ module.exports = { loopsByTargetSegments = new Map(), loopsToReport = new Set(); - let currentCodePath = null; + const codePathSegments = []; + let currentCodePathSegments = new Set(); return { - onCodePathStart(codePath) { - currentCodePath = codePath; + + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); }, onCodePathEnd() { - currentCodePath = currentCodePath.upper; + currentCodePathSegments = codePathSegments.pop(); }, - [loopSelector](node) { + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, - /** - * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. - * For unreachable segments, the code path analysis does not raise events required for this implementation. - */ - if (currentCodePath.currentSegments.some(segment => segment.reachable)) { - loopsToReport.add(node); - } + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); }, onCodePathSegmentStart(segment, node) { + + currentCodePathSegments.add(segment); + if (isLoopingTarget(node)) { const loop = node.parent; @@ -140,6 +163,18 @@ module.exports = { } }, + [loopSelector](node) { + + /** + * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise. + * For unreachable segments, the code path analysis does not raise events required for this implementation. + */ + if (isAnySegmentReachable(currentCodePathSegments)) { + loopsToReport.add(node); + } + }, + + "Program:exit"() { loopsToReport.forEach( node => context.report({ node, messageId: "invalid" }) diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js index 415631a..0cf750e 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. @@ -18,12 +24,19 @@ function isInitialized(node) { } /** - * Checks whether or not a given code path segment is unreachable. - * @param {CodePathSegment} segment A CodePathSegment to check. - * @returns {boolean} `true` if the segment is unreachable. + * Checks all segments in a set and returns true if all are unreachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if all segments are unreachable; false otherwise. */ -function isUnreachable(segment) { - return !segment.reachable; +function areAllSegmentsUnreachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return false; + } + } + + return true; } /** @@ -99,15 +112,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unreachable" }, schema: [], @@ -118,9 +131,18 @@ module.exports = { }, create(context) { - let currentCodePath = null; - const range = new ConsecutiveRange(context.getSourceCode()); + /** @type {ConstructorInfo | null} */ + let constructorInfo = null; + + /** @type {ConsecutiveRange} */ + const range = new ConsecutiveRange(context.sourceCode); + + /** @type {Array>} */ + const codePathSegments = []; + + /** @type {Set} */ + let currentCodePathSegments = new Set(); /** * Reports a given node if it's unreachable. @@ -130,7 +152,7 @@ module.exports = { function reportIfUnreachable(node) { let nextNode = null; - if (node && currentCodePath.currentSegments.every(isUnreachable)) { + if (node && (node.type === "PropertyDefinition" || areAllSegmentsUnreachable(currentCodePathSegments))) { // Store this statement to distinguish consecutive statements. if (range.isEmpty) { @@ -171,12 +193,29 @@ module.exports = { return { // Manages the current code path. - onCodePathStart(codePath) { - currentCodePath = codePath; + onCodePathStart() { + codePathSegments.push(currentCodePathSegments); + currentCodePathSegments = new Set(); }, onCodePathEnd() { - currentCodePath = currentCodePath.upper; + currentCodePathSegments = codePathSegments.pop(); + }, + + onUnreachableCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + currentCodePathSegments.delete(segment); + }, + + onCodePathSegmentStart(segment) { + currentCodePathSegments.add(segment); }, // Registers for all statement nodes (excludes FunctionDeclaration). @@ -212,6 +251,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 11bf06e..ebd2432 100644 --- a/node_modules/eslint/lib/rules/no-unsafe-finally.js +++ b/node_modules/eslint/lib/rules/no-unsafe-finally.js @@ -18,15 +18,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unsafe-finally" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-unsafe-negation.js b/node_modules/eslint/lib/rules/no-unsafe-negation.js index a9c2ee7..cabd7e2 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/latest/rules/no-unsafe-negation" }, + hasSuggestions: true, + schema: [ { type: "object", @@ -81,7 +82,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = context.options[0] || {}; const enforceForOrderingRelations = options.enforceForOrderingRelations === true; 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 2eafc1a..fe2bead 100644 --- a/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js +++ b/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js @@ -18,15 +18,15 @@ 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, - url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining" + description: "Disallow use of optional chaining in contexts where the `undefined` value is not allowed", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining" }, schema: [{ type: "object", diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js index 58c9b33..46bb7ba 100644 --- a/node_modules/eslint/lib/rules/no-unused-expressions.js +++ b/node_modules/eslint/lib/rules/no-unused-expressions.js @@ -4,6 +4,8 @@ */ "use strict"; +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -24,15 +26,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unused-expressions" }, schema: [ @@ -72,8 +74,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 +84,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 +99,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,19 +108,20 @@ 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 */ - function isDirective(node, ancestors) { - const parent = ancestors[ancestors.length - 1], - grandparent = ancestors[ancestors.length - 2]; + function isDirective(node) { - return (parent.type === "Program" || parent.type === "BlockStatement" && - (/Function/u.test(grandparent.type))) && - directives(parent).indexOf(node) >= 0; + /** + * https://tc39.es/ecma262/#directive-prologue + * + * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue. + * Class static blocks do not have directive prologue. + */ + return astUtils.isTopLevelExpressionStatement(node) && directives(node.parent).includes(node); } /** @@ -174,7 +177,7 @@ module.exports = { return { ExpressionStatement(node) { - if (Checker.isDisallowed(node.expression) && !isDirective(node, context.getAncestors())) { + if (Checker.isDisallowed(node.expression) && !isDirective(node)) { context.report({ node, messageId: "unusedExpression" }); } } diff --git a/node_modules/eslint/lib/rules/no-unused-labels.js b/node_modules/eslint/lib/rules/no-unused-labels.js index b33fcb7..be06b32 100644 --- a/node_modules/eslint/lib/rules/no-unused-labels.js +++ b/node_modules/eslint/lib/rules/no-unused-labels.js @@ -5,19 +5,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-unused-labels" }, schema: [], @@ -30,7 +36,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; /** @@ -46,6 +52,45 @@ module.exports = { }; } + /** + * Checks if a `LabeledStatement` node is fixable. + * For a node to be fixable, there must be no comments between the label and the body. + * Furthermore, is must be possible to remove the label without turning the body statement into a + * directive after other fixes are applied. + * @param {ASTNode} node The node to evaluate. + * @returns {boolean} Whether or not the node is fixable. + */ + function isFixable(node) { + + /* + * Only perform a fix if there are no comments between the label and the body. This will be the case + * when there is exactly one token/comment (the ":") between the label and the body. + */ + if (sourceCode.getTokenAfter(node.label, { includeComments: true }) !== + sourceCode.getTokenBefore(node.body, { includeComments: true })) { + return false; + } + + // Looking for the node's deepest ancestor which is not a `LabeledStatement`. + let ancestor = node.parent; + + while (ancestor.type === "LabeledStatement") { + ancestor = ancestor.parent; + } + + if (ancestor.type === "Program" || + (ancestor.type === "BlockStatement" && astUtils.isFunction(ancestor.parent))) { + const { body } = node; + + if (body.type === "ExpressionStatement" && + ((body.expression.type === "Literal" && typeof body.expression.value === "string") || + astUtils.isStaticTemplateLiteral(body.expression))) { + return false; // potential directive + } + } + return true; + } + /** * Removes the top of the stack. * At the same time, this reports the label if it's never used. @@ -58,19 +103,7 @@ module.exports = { node: node.label, messageId: "unused", data: node.label, - fix(fixer) { - - /* - * Only perform a fix if there are no comments between the label and the body. This will be the case - * when there is exactly one token/comment (the ":") between the label and the body. - */ - if (sourceCode.getTokenAfter(node.label, { includeComments: true }) === - sourceCode.getTokenBefore(node.body, { includeComments: true })) { - return fixer.removeRange([node.range[0], node.body.range[0]]); - } - - return null; - } + fix: isFixable(node) ? fixer => fixer.removeRange([node.range[0], node.body.range[0]]) : null }); } diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js index f04818f..f29e678 100644 --- a/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/node_modules/eslint/lib/rules/no-unused-vars.js @@ -27,15 +27,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-unused-vars" }, schema: [ @@ -67,6 +67,9 @@ module.exports = { }, caughtErrorsIgnorePattern: { type: "string" + }, + destructuredArrayIgnorePattern: { + type: "string" } }, additionalProperties: false @@ -81,7 +84,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const REST_PROPERTY_TYPE = /^(?:RestElement|(?:Experimental)?RestProperty)$/u; @@ -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, @@ -245,7 +259,7 @@ module.exports = { let scope = ref.from; while (scope) { - if (nodes.indexOf(scope.block) >= 0) { + if (nodes.includes(scope.block)) { return true; } @@ -295,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. @@ -313,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); @@ -327,7 +365,7 @@ module.exports = { } if (parent.type === "AssignmentExpression" && - grandparent.type === "ExpressionStatement" && + isUnusedExpression(parent) && id === parent.left && !canBeUsedLater ) { @@ -410,31 +448,6 @@ 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; - } - /** * Checks whether a given reference is a read to update itself or not. * @param {eslint-scope.Reference} ref A reference to check. @@ -453,7 +466,8 @@ module.exports = { ( parent.type === "AssignmentExpression" && parent.left === id && - isUnusedExpression(parent) + isUnusedExpression(parent) && + !astUtils.isLogicalAssignmentOperator(parent.operator) ) || ( parent.type === "UpdateExpression" && @@ -471,12 +485,12 @@ module.exports = { } /** - * 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; @@ -485,7 +499,7 @@ module.exports = { target = target.parent.parent; } - if (target.type !== "ForInStatement") { + if (target.type !== "ForInStatement" && target.type !== "ForOfStatement") { return false; } @@ -518,7 +532,7 @@ module.exports = { let rhsNode = null; return variable.references.some(ref => { - if (isForInRef(ref)) { + if (isForInOfRef(ref)) { return true; } @@ -542,7 +556,7 @@ module.exports = { */ function isAfterLastUsedArg(variable) { const def = variable.defs[0]; - const params = context.getDeclaredVariables(def.node); + const params = sourceCode.getDeclaredVariables(def.node); const posteriorParams = params.slice(params.indexOf(variable) + 1); // If any used parameters occur after this parameter, do not report. @@ -585,6 +599,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") { @@ -647,7 +674,7 @@ module.exports = { return { "Program:exit"(programNode) { - const unusedVars = collectUnusedVariables(context.getScope(), []); + const unusedVars = collectUnusedVariables(sourceCode.getScope(programNode), []); for (let i = 0, l = unusedVars.length; i < l; ++i) { const unusedVar = unusedVars[i]; 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 c730056..9d6b043 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,44 +29,10 @@ function parseOptions(options) { functions = options.functions !== false; classes = options.classes !== false; variables = options.variables !== false; + allowNamedExports = !!options.allowNamedExports; } - return { functions, classes, variables }; -} - -/** - * 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. - */ -function isFunction(variable) { - return variable.defs[0].type === "FunctionName"; -} - -/** - * 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. - */ -function isOuterClass(variable, reference) { - return ( - variable.defs[0].type === "ClassName" && - variable.scope.variableScope !== reference.from.variableScope - ); -} - -/** - * 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. - */ -function isOuterVariable(variable, reference) { - return ( - variable.defs[0].type === "Variable" && - variable.scope.variableScope !== reference.from.variableScope - ); + return { functions, classes, variables, allowNamedExports }; } /** @@ -79,7 +46,103 @@ function isInRange(node, location) { } /** - * Checks whether or not a given reference is inside of the initializers of a given variable. + * 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 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 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 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 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 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 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,15 +220,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-use-before-define" }, schema: [ @@ -151,7 +242,8 @@ module.exports = { properties: { functions: { type: "boolean" }, classes: { type: "boolean" }, - variables: { type: "boolean" } + variables: { type: "boolean" }, + allowNamedExports: { type: "boolean" } }, additionalProperties: false } @@ -166,67 +258,90 @@ module.exports = { create(context) { const options = parseOptions(context.options[0]); + const sourceCode = context.sourceCode; /** - * 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; } - if (isOuterVariable(variable, reference)) { - return options.variables; + + 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 ( + ( + !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()); + Program(node) { + checkReferencesInScope(sourceCode.getScope(node)); } }; } diff --git a/node_modules/eslint/lib/rules/no-useless-backreference.js b/node_modules/eslint/lib/rules/no-useless-backreference.js index 529c164..7ca43c8 100644 --- a/node_modules/eslint/lib/rules/no-useless-backreference.js +++ b/node_modules/eslint/lib/rules/no-useless-backreference.js @@ -9,8 +9,8 @@ // Requirements //------------------------------------------------------------------------------ -const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("eslint-utils"); -const { RegExpParser, visitRegExpAST } = require("regexpp"); +const { CALL, CONSTRUCT, ReferenceTracker, getStringIfConstant } = require("@eslint-community/eslint-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); //------------------------------------------------------------------------------ // Helpers @@ -58,15 +58,15 @@ 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, - url: "https://eslint.org/docs/rules/no-useless-backreference" + description: "Disallow useless backreferences in regular expressions", + recommended: true, + url: "https://eslint.org/docs/latest/rules/no-useless-backreference" }, schema: [], @@ -82,6 +82,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Checks and reports useless backreferences in the given regular expression. * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call. @@ -93,7 +95,7 @@ module.exports = { let regExpAST; try { - regExpAST = parser.parsePattern(pattern, 0, pattern.length, flags.includes("u")); + regExpAST = parser.parsePattern(pattern, 0, pattern.length, { unicode: flags.includes("u"), unicodeSets: flags.includes("v") }); } catch { // Ignore regular expressions with syntax errors @@ -167,8 +169,8 @@ module.exports = { checkRegex(node, pattern, flags); }, - Program() { - const scope = context.getScope(), + Program(node) { + const scope = sourceCode.getScope(node), tracker = new ReferenceTracker(scope), traceMap = { RegExp: { @@ -177,13 +179,13 @@ module.exports = { } }; - for (const { node } of tracker.iterateGlobalReferences(traceMap)) { - const [patternNode, flagsNode] = node.arguments, + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + const [patternNode, flagsNode] = refNode.arguments, pattern = getStringIfConstant(patternNode, scope), flags = getStringIfConstant(flagsNode, scope); if (typeof pattern === "string") { - checkRegex(node, pattern, flags || ""); + checkRegex(refNode, pattern, flags || ""); } } } diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js index b1382a2..dea2b47 100644 --- a/node_modules/eslint/lib/rules/no-useless-call.js +++ b/node_modules/eslint/lib/rules/no-useless-call.js @@ -49,15 +49,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-useless-call" }, schema: [], @@ -68,7 +68,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { CallExpression(node) { diff --git a/node_modules/eslint/lib/rules/no-useless-catch.js b/node_modules/eslint/lib/rules/no-useless-catch.js index f303c27..e02013d 100644 --- a/node_modules/eslint/lib/rules/no-useless-catch.js +++ b/node_modules/eslint/lib/rules/no-useless-catch.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-useless-catch" }, schema: [], 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 a1cacc2..f2d9f33 100644 --- a/node_modules/eslint/lib/rules/no-useless-computed-key.js +++ b/node_modules/eslint/lib/rules/no-useless-computed-key.js @@ -10,19 +10,90 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-useless-computed-key" }, schema: [{ @@ -42,7 +113,7 @@ module.exports = { } }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const enforceForClassMembers = context.options[0] && context.options[0].enforceForClassMembers; /** @@ -51,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", @@ -103,7 +161,8 @@ module.exports = { return { Property: check, - MethodDefinition: enforceForClassMembers ? check : 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 cfc60c8..c566c62 100644 --- a/node_modules/eslint/lib/rules/no-useless-concat.js +++ b/node_modules/eslint/lib/rules/no-useless-concat.js @@ -64,15 +64,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-useless-concat" }, schema: [], @@ -83,7 +83,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { BinaryExpression(node) { diff --git a/node_modules/eslint/lib/rules/no-useless-constructor.js b/node_modules/eslint/lib/rules/no-useless-constructor.js index baabe7e..2b9c18e 100644 --- a/node_modules/eslint/lib/rules/no-useless-constructor.js +++ b/node_modules/eslint/lib/rules/no-useless-constructor.js @@ -132,15 +132,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-useless-constructor" }, schema: [], diff --git a/node_modules/eslint/lib/rules/no-useless-escape.js b/node_modules/eslint/lib/rules/no-useless-escape.js index 512c93a..0e0f6f0 100644 --- a/node_modules/eslint/lib/rules/no-useless-escape.js +++ b/node_modules/eslint/lib/rules/no-useless-escape.js @@ -6,7 +6,12 @@ "use strict"; const astUtils = require("./utils/ast-utils"); +const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp"); +/** + * @typedef {import('@eslint-community/regexpp').AST.CharacterClass} CharacterClass + * @typedef {import('@eslint-community/regexpp').AST.ExpressionCharacterClass} ExpressionCharacterClass + */ //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -28,70 +33,35 @@ const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS); const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]"); const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+?[{}|()Bk")); -/** - * Parses a regular expression into a list of characters with character class info. - * @param {string} regExpText The raw text used to create the regular expression - * @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class. - * @example - * - * parseRegExp('a\\b[cd-]') - * - * 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} - * ] +/* + * Set of characters that require escaping in character classes in `unicodeSets` mode. + * ( ) [ ] { } / - \ | are ClassSetSyntaxCharacter */ -function parseRegExp(regExpText) { - const charList = []; +const REGEX_CLASSSET_CHARACTER_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("q/[{}|()-")); - regExpText.split("").reduce((state, char, index) => { - if (!state.escapeNextChar) { - if (char === "\\") { - return Object.assign(state, { escapeNextChar: true }); - } - if (char === "[" && !state.inCharClass) { - return Object.assign(state, { inCharClass: true, startingCharClass: true }); - } - if (char === "]" && state.inCharClass) { - if (charList.length && charList[charList.length - 1].inCharClass) { - charList[charList.length - 1].endsCharClass = true; - } - return Object.assign(state, { inCharClass: false, startingCharClass: false }); - } - } - charList.push({ - text: char, - index, - escaped: state.escapeNextChar, - inCharClass: state.inCharClass, - startsCharClass: state.startingCharClass, - endsCharClass: false - }); - return Object.assign(state, { escapeNextChar: false, startingCharClass: false }); - }, { escapeNextChar: false, inCharClass: false, startingCharClass: false }); - - return charList; -} +/* + * A single character set of ClassSetReservedDoublePunctuator. + * && !! ## $$ %% ** ++ ,, .. :: ;; << == >> ?? @@ ^^ `` ~~ are ClassSetReservedDoublePunctuator + */ +const REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR = new Set("!#$%&*+,.:;<=>?@^`~"); +/** @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/latest/rules/no-useless-escape" }, + hasSuggestions: true, + messages: { unnecessaryEscape: "Unnecessary escape character: \\{{character}}.", removeEscape: "Remove the `\\`. This maintains the current functionality.", + removeEscapeDoNotKeepSemantics: "Remove the `\\` if it was inserted by mistake.", escapeBackslash: "Replace the `\\` with `\\\\` to include the actual backslash character." }, @@ -99,16 +69,18 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; + const parser = new RegExpParser(); /** * Reports a node * @param {ASTNode} node The node to report * @param {number} startOffset The backslash's offset from the start of the node * @param {string} character The uselessly escaped character (not including the backslash) + * @param {boolean} [disableEscapeBackslashSuggest] `true` if escapeBackslash suggestion should be turned off. * @returns {void} */ - function report(node, startOffset, character) { + function report(node, startOffset, character, disableEscapeBackslashSuggest) { const rangeStart = node.range[0] + startOffset; const range = [rangeStart, rangeStart + 1]; const start = sourceCode.getLocFromIndex(rangeStart); @@ -123,17 +95,24 @@ module.exports = { data: { character }, suggest: [ { - messageId: "removeEscape", + + // Removing unnecessary `\` characters in a directive is not guaranteed to maintain functionality. + messageId: astUtils.isDirective(node.parent) + ? "removeEscapeDoNotKeepSemantics" : "removeEscape", fix(fixer) { return fixer.removeRange(range); } }, - { - messageId: "escapeBackslash", - fix(fixer) { - return fixer.insertTextBeforeRange(range, "\\"); - } - } + ...disableEscapeBackslashSuggest + ? [] + : [ + { + messageId: "escapeBackslash", + fix(fixer) { + return fixer.insertTextBeforeRange(range, "\\"); + } + } + ] ] }); } @@ -176,6 +155,133 @@ module.exports = { } } + /** + * Checks if the escape character in given regexp is unnecessary. + * @private + * @param {ASTNode} node node to validate. + * @returns {void} + */ + function validateRegExp(node) { + const { pattern, flags } = node.regex; + let patternNode; + const unicode = flags.includes("u"); + const unicodeSets = flags.includes("v"); + + try { + patternNode = parser.parsePattern(pattern, 0, pattern.length, { unicode, unicodeSets }); + } catch { + + // Ignore regular expressions with syntax errors + return; + } + + /** @type {(CharacterClass | ExpressionCharacterClass)[]} */ + const characterClassStack = []; + + visitRegExpAST(patternNode, { + onCharacterClassEnter: characterClassNode => characterClassStack.unshift(characterClassNode), + onCharacterClassLeave: () => characterClassStack.shift(), + onExpressionCharacterClassEnter: characterClassNode => characterClassStack.unshift(characterClassNode), + onExpressionCharacterClassLeave: () => characterClassStack.shift(), + onCharacterEnter(characterNode) { + if (!characterNode.raw.startsWith("\\")) { + + // It's not an escaped character. + return; + } + + const escapedChar = characterNode.raw.slice(1); + + if (escapedChar !== String.fromCodePoint(characterNode.value)) { + + // It's a valid escape. + return; + } + let allowedEscapes; + + if (characterClassStack.length) { + allowedEscapes = unicodeSets ? REGEX_CLASSSET_CHARACTER_ESCAPES : REGEX_GENERAL_ESCAPES; + } else { + allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES; + } + if (allowedEscapes.has(escapedChar)) { + return; + } + + const reportedIndex = characterNode.start + 1; + let disableEscapeBackslashSuggest = false; + + if (characterClassStack.length) { + const characterClassNode = characterClassStack[0]; + + if (escapedChar === "^") { + + /* + * The '^' character is also a special case; it must always be escaped outside of character classes, but + * it only needs to be escaped in character classes if it's at the beginning of the character class. To + * account for this, consider it to be a valid escape character outside of character classes, and filter + * out '^' characters that appear at the start of a character class. + */ + if (characterClassNode.start + 1 === characterNode.start) { + + return; + } + } + if (!unicodeSets) { + if (escapedChar === "-") { + + /* + * The '-' character is a special case, because it's only valid to escape it if it's in a character + * class, and is not at either edge of the character class. To account for this, don't consider '-' + * characters to be valid in general, and filter out '-' characters that appear in the middle of a + * character class. + */ + if (characterClassNode.start + 1 !== characterNode.start && characterNode.end !== characterClassNode.end - 1) { + + return; + } + } + } else { // unicodeSets mode + if (REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR.has(escapedChar)) { + + // Escaping is valid if it is a ClassSetReservedDoublePunctuator. + if (pattern[characterNode.end] === escapedChar) { + return; + } + if (pattern[characterNode.start - 1] === escapedChar) { + if (escapedChar !== "^") { + return; + } + + // If the previous character is a `negate` caret(`^`), escape to caret is unnecessary. + + if (!characterClassNode.negate) { + return; + } + const negateCaretIndex = characterClassNode.start + 1; + + if (negateCaretIndex < characterNode.start - 1) { + return; + } + } + } + + if (characterNode.parent.type === "ClassIntersection" || characterNode.parent.type === "ClassSubtraction") { + disableEscapeBackslashSuggest = true; + } + } + } + + report( + node, + reportedIndex, + escapedChar, + disableEscapeBackslashSuggest + ); + } + }); + } + /** * Checks if a node has an escape. * @param {ASTNode} node node to check. @@ -214,32 +320,7 @@ module.exports = { validateString(node, match); } } else if (node.regex) { - parseRegExp(node.regex.pattern) - - /* - * The '-' character is a special case, because it's only valid to escape it if it's in a character - * class, and is not at either edge of the character class. To account for this, don't consider '-' - * characters to be valid in general, and filter out '-' characters that appear in the middle of a - * character class. - */ - .filter(charInfo => !(charInfo.text === "-" && charInfo.inCharClass && !charInfo.startsCharClass && !charInfo.endsCharClass)) - - /* - * The '^' character is also a special case; it must always be escaped outside of character classes, but - * it only needs to be escaped in character classes if it's at the beginning of the character class. To - * account for this, consider it to be a valid escape character outside of character classes, and filter - * out '^' characters that appear at the start of a character class. - */ - .filter(charInfo => !(charInfo.text === "^" && charInfo.startsCharClass)) - - // Filter out characters that aren't escaped. - .filter(charInfo => charInfo.escaped) - - // Filter out characters that are valid to escape, based on their position in the regular expression. - .filter(charInfo => !(charInfo.inCharClass ? REGEX_GENERAL_ESCAPES : REGEX_NON_CHARCLASS_ESCAPES).has(charInfo.text)) - - // Report all the remaining characters. - .forEach(charInfo => report(node, charInfo.index, charInfo.text)); + validateRegExp(node); } } diff --git a/node_modules/eslint/lib/rules/no-useless-rename.js b/node_modules/eslint/lib/rules/no-useless-rename.js index a7cec02..0c818fb 100644 --- a/node_modules/eslint/lib/rules/no-useless-rename.js +++ b/node_modules/eslint/lib/rules/no-useless-rename.js @@ -15,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-useless-rename" }, fixable: "code", @@ -46,7 +46,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, options = context.options[0] || {}, ignoreDestructuring = options.ignoreDestructuring === true, ignoreImport = options.ignoreImport === true, @@ -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 111cb21..81d6105 100644 --- a/node_modules/eslint/lib/rules/no-useless-return.js +++ b/node_modules/eslint/lib/rules/no-useless-return.js @@ -57,19 +57,35 @@ function isInFinally(node) { return false; } +/** + * Checks all segments in a set and returns true if any are reachable. + * @param {Set} segments The segments to check. + * @returns {boolean} True if any segment is reachable; false otherwise. + */ +function isAnySegmentReachable(segments) { + + for (const segment of segments) { + if (segment.reachable) { + return true; + } + } + + return false; +} + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/no-useless-return" }, fixable: "code", @@ -82,8 +98,7 @@ module.exports = { create(context) { const segmentInfoMap = new WeakMap(); - const usedUnreachableSegments = new WeakSet(); - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; /** @@ -152,24 +167,44 @@ module.exports = { * This behavior would simulate code paths for the case that the return * statement does not exist. * @param {CodePathSegment} segment The segment to get return statements. + * @param {Set} usedUnreachableSegments A set of segments that have already been traversed in this call. * @returns {void} */ - function markReturnStatementsOnSegmentAsUsed(segment) { + function markReturnStatementsOnSegmentAsUsed(segment, usedUnreachableSegments) { if (!segment.reachable) { usedUnreachableSegments.add(segment); segment.allPrevSegments .filter(isReturned) .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) - .forEach(markReturnStatementsOnSegmentAsUsed); + .forEach(prevSegment => markReturnStatementsOnSegmentAsUsed(prevSegment, usedUnreachableSegments)); return; } const info = segmentInfoMap.get(segment); - for (const node of info.uselessReturns) { + info.uselessReturns = info.uselessReturns.filter(node => { + if (scopeInfo.traversedTryBlockStatements && scopeInfo.traversedTryBlockStatements.length > 0) { + const returnInitialRange = node.range[0]; + const returnFinalRange = node.range[1]; + + const areBlocksInRange = scopeInfo.traversedTryBlockStatements.some(tryBlockStatement => { + const blockInitialRange = tryBlockStatement.range[0]; + const blockFinalRange = tryBlockStatement.range[1]; + + return ( + returnInitialRange >= blockInitialRange && + returnFinalRange <= blockFinalRange + ); + }); + + if (areBlocksInRange) { + return true; + } + } + remove(scopeInfo.uselessReturns, node); - } - info.uselessReturns = []; + return false; + }); } /** @@ -186,9 +221,8 @@ module.exports = { */ function markReturnStatementsOnCurrentSegmentsAsUsed() { scopeInfo - .codePath .currentSegments - .forEach(markReturnStatementsOnSegmentAsUsed); + .forEach(segment => markReturnStatementsOnSegmentAsUsed(segment, new Set())); } //---------------------------------------------------------------------- @@ -197,12 +231,14 @@ module.exports = { return { - // Makes and pushs a new scope information. + // Makes and pushes a new scope information. onCodePathStart(codePath) { scopeInfo = { upper: scopeInfo, uselessReturns: [], - codePath + traversedTryBlockStatements: [], + codePath, + currentSegments: new Set() }; }, @@ -239,6 +275,9 @@ module.exports = { * NOTE: This event is notified for only reachable segments. */ onCodePathSegmentStart(segment) { + + scopeInfo.currentSegments.add(segment); + const info = { uselessReturns: getUselessReturns([], segment.allPrevSegments), returned: false @@ -248,6 +287,18 @@ module.exports = { segmentInfoMap.set(segment, info); }, + onUnreachableCodePathSegmentStart(segment) { + scopeInfo.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + scopeInfo.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + scopeInfo.currentSegments.delete(segment); + }, + // Adds ReturnStatement node to check whether it's useless or not. ReturnStatement(node) { if (node.argument) { @@ -259,12 +310,12 @@ module.exports = { isInFinally(node) || // Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647). - !scopeInfo.codePath.currentSegments.some(s => s.reachable) + !isAnySegmentReachable(scopeInfo.currentSegments) ) { return; } - for (const segment of scopeInfo.codePath.currentSegments) { + for (const segment of scopeInfo.currentSegments) { const info = segmentInfoMap.get(segment); if (info) { @@ -275,6 +326,14 @@ module.exports = { scopeInfo.uselessReturns.push(node); }, + "TryStatement > BlockStatement.block:exit"(node) { + scopeInfo.traversedTryBlockStatements.push(node); + }, + + "TryStatement:exit"() { + scopeInfo.traversedTryBlockStatements.pop(); + }, + /* * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement. * Removes return statements of the current segments from the useless return statement list. diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js index f2cb96b..d45a91a 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,15 +179,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-var" }, schema: [], @@ -199,7 +199,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Checks whether the variables which are defined by the given declarator node have their references in TDZ. @@ -210,7 +210,7 @@ module.exports = { if (!declarator.init) { return false; } - const variables = context.getDeclaredVariables(declarator); + const variables = sourceCode.getDeclaredVariables(declarator); return variables.some(hasReferenceInTDZ(declarator.init)); } @@ -268,7 +268,7 @@ module.exports = { * @returns {boolean} `true` if it can fix the node. */ function canFix(node) { - const variables = context.getDeclaredVariables(node); + const variables = sourceCode.getDeclaredVariables(node); const scopeNode = getScopeNode(node); if (node.parent.type === "SwitchCase" || diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js index 99c8378..9546d7a 100644 --- a/node_modules/eslint/lib/rules/no-void.js +++ b/node_modules/eslint/lib/rules/no-void.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-void" }, messages: { diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js index e5f702b..c415bee 100644 --- a/node_modules/eslint/lib/rules/no-warning-comments.js +++ b/node_modules/eslint/lib/rules/no-warning-comments.js @@ -14,15 +14,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/no-warning-comments" }, schema: [ @@ -37,6 +37,15 @@ module.exports = { }, location: { enum: ["start", "anywhere"] + }, + decoration: { + type: "array", + items: { + type: "string", + pattern: "^\\S$" + }, + minItems: 1, + uniqueItems: true } }, additionalProperties: false @@ -49,10 +58,11 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, 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"; + + let prefix = ""; if (location === "start") { - - /* - * When matching at the start, ignore leading whitespace, and - * there's no need to worry about word boundaries. - */ - prefix = "^\\s*"; + 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 226f873..94a166e 100644 --- a/node_modules/eslint/lib/rules/no-whitespace-before-property.js +++ b/node_modules/eslint/lib/rules/no-whitespace-before-property.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disallow whitespace before properties * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property" }, fixable: "whitespace", @@ -34,7 +37,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js index d3e52e0..0fb2c45 100644 --- a/node_modules/eslint/lib/rules/no-with.js +++ b/node_modules/eslint/lib/rules/no-with.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/no-with" }, schema: [], 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 34e6eea..811b32b 100644 --- a/node_modules/eslint/lib/rules/nonblock-statement-body-position.js +++ b/node_modules/eslint/lib/rules/nonblock-statement-body-position.js @@ -1,6 +1,7 @@ /** * @fileoverview enforce the location of single-line statements * @author Teddy Katz + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const POSITION_SCHEMA = { enum: ["beside", "below", "any"] }; +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position" }, fixable: "whitespace", @@ -49,7 +52,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //---------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/object-curly-newline.js b/node_modules/eslint/lib/rules/object-curly-newline.js index 1fbea00..176694b 100644 --- a/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/node_modules/eslint/lib/rules/object-curly-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require or disallow line breaks inside braces. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -144,15 +145,17 @@ function areLineBreaksRequired(node, options, first, last) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], type: "layout", docs: { - description: "enforce consistent line breaks after opening and before closing 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" + url: "https://eslint.org/docs/latest/rules/object-curly-newline" }, fixable: "whitespace", @@ -185,7 +188,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const normalizedOptions = normalizeOptions(context.options[0]); /** diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js index c0044f5..4463bcd 100644 --- a/node_modules/eslint/lib/rules/object-curly-spacing.js +++ b/node_modules/eslint/lib/rules/object-curly-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of object literals. * @author Jamund Ferguson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/object-curly-spacing" }, fixable: "whitespace", @@ -51,7 +54,7 @@ module.exports = { create(context) { const spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; /** * Determines whether an option is set, relative to the spacing option. @@ -81,7 +84,7 @@ module.exports = { * @returns {void} */ function reportNoBeginningSpace(node, token) { - const nextToken = context.getSourceCode().getTokenAfter(token, { includeComments: true }); + const nextToken = context.sourceCode.getTokenAfter(token, { includeComments: true }); context.report({ node, @@ -103,7 +106,7 @@ module.exports = { * @returns {void} */ function reportNoEndingSpace(node, token) { - const previousToken = context.getSourceCode().getTokenBefore(token, { includeComments: true }); + const previousToken = context.sourceCode.getTokenBefore(token, { includeComments: true }); context.report({ node, diff --git a/node_modules/eslint/lib/rules/object-property-newline.js b/node_modules/eslint/lib/rules/object-property-newline.js index 0c7f800..6ffa064 100644 --- a/node_modules/eslint/lib/rules/object-property-newline.js +++ b/node_modules/eslint/lib/rules/object-property-newline.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce placing object properties on separate lines. * @author Vitor Balocco + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/object-property-newline" }, schema: [ @@ -53,7 +56,7 @@ module.exports = { ? "propertiesOnNewlineAll" : "propertiesOnNewline"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { ObjectExpression(node) { diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js index 3999ff8..e4cb3a4 100644 --- a/node_modules/eslint/lib/rules/object-shorthand.js +++ b/node_modules/eslint/lib/rules/object-shorthand.js @@ -22,15 +22,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/object-shorthand" }, fixable: "code", @@ -78,6 +78,9 @@ module.exports = { ignoreConstructors: { type: "boolean" }, + methodsIgnorePattern: { + type: "string" + }, avoidQuotes: { type: "boolean" }, @@ -115,9 +118,12 @@ 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(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -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) { @@ -352,11 +354,12 @@ module.exports = { /** * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack. * Also, this marks all `arguments` identifiers so that they can be detected later. + * @param {ASTNode} node The node representing the function. * @returns {void} */ - function enterFunction() { + function enterFunction(node) { lexicalScopeStack.unshift(new Set()); - context.getScope().variables.filter(variable => variable.name === "arguments").forEach(variable => { + sourceCode.getScope(node).variables.filter(variable => variable.name === "arguments").forEach(variable => { variable.references.map(ref => ref.identifier).forEach(identifier => argumentsIdentifiers.add(identifier)); }); } @@ -461,6 +464,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 db46747..340eac1 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 @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check multiple var declarations per line * @author Alberto Rodríguez + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -8,15 +9,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line" }, schema: [ diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js index e3df832..abb1525 100644 --- a/node_modules/eslint/lib/rules/one-var.js +++ b/node_modules/eslint/lib/rules/one-var.js @@ -28,15 +28,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/one-var" }, fixable: "code", @@ -121,7 +121,7 @@ module.exports = { } } - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -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 a48d272..f71d73b 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,15 +57,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/operator-assignment" }, schema: [ @@ -76,14 +76,14 @@ module.exports = { fixable: "code", messages: { - replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}=).", - unexpected: "Unexpected operator assignment ({{operator}}=) shorthand." + replaced: "Assignment (=) can be replaced with operator assignment ({{operator}}).", + unexpected: "Unexpected operator assignment ({{operator}}) shorthand." } }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Returns the operator token of an AssignmentExpression or BinaryExpression @@ -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,11 +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 }, + data: { operator: replacementOperator }, fix(fixer) { if (canBeFixed(left) && canBeFixed(expr.left)) { const equalsToken = getOperatorToken(node); @@ -126,7 +128,7 @@ module.exports = { return null; } - return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`); + return fixer.replaceText(node, `${leftText}${replacementOperator}${rightText}`); } return null; } @@ -141,7 +143,7 @@ module.exports = { context.report({ node, messageId: "replaced", - data: { operator } + data: { operator: replacementOperator } }); } } @@ -149,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) { diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js index 18da5c5..3065e66 100644 --- a/node_modules/eslint/lib/rules/operator-linebreak.js +++ b/node_modules/eslint/lib/rules/operator-linebreak.js @@ -1,6 +1,7 @@ /** * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before * @author Benoît Zugmeyer + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/operator-linebreak" }, schema: [ @@ -69,7 +72,7 @@ module.exports = { styleOverrides[":"] = "before"; } - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -136,23 +139,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 +223,7 @@ module.exports = { * @returns {void} */ function validateBinaryExpression(node) { - validateNode(node, node.left); + validateNode(node, node.right, node.operator); } //-------------------------------------------------------------------------- @@ -235,12 +236,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 f8b5bd9..ec4756b 100644 --- a/node_modules/eslint/lib/rules/padded-blocks.js +++ b/node_modules/eslint/lib/rules/padded-blocks.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure blank lines within blocks. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/padded-blocks" }, fixable: "whitespace", @@ -96,7 +99,7 @@ module.exports = { options.allowSingleLineBlocks = exceptOptions.allowSingleLineBlocks === true; } - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Gets the open brace token from a given node. @@ -107,6 +110,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 +176,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 +293,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 c97b995..084651b 100644 --- a/node_modules/eslint/lib/rules/padding-line-between-statements.js +++ b/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to require or disallow newlines between statements * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -130,49 +131,6 @@ function isBlockLikeStatement(sourceCode, node) { ); } -/** - * Check whether the given node is a directive or not. - * @param {ASTNode} node The node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is a directive. - */ -function isDirective(node, sourceCode) { - return ( - node.type === "ExpressionStatement" && - ( - node.parent.type === "Program" || - ( - node.parent.type === "BlockStatement" && - astUtils.isFunction(node.parent.parent) - ) - ) && - node.expression.type === "Literal" && - typeof node.expression.value === "string" && - !astUtils.isParenthesised(sourceCode, node.expression) - ); -} - -/** - * Check whether the given node is a part of directive prologue or not. - * @param {ASTNode} node The node to check. - * @param {SourceCode} sourceCode The source code object to get tokens. - * @returns {boolean} `true` if the node is a part of directive prologue. - */ -function isDirectivePrologue(node, sourceCode) { - if (isDirective(node, sourceCode)) { - for (const sibling of node.parent.body) { - if (sibling === node) { - break; - } - if (!isDirective(sibling, sourceCode)) { - return false; - } - } - return true; - } - return false; -} - /** * Gets the actual last token. * @@ -253,7 +211,7 @@ function verifyForNever(context, _, nextNode, paddingLines) { const nextToken = paddingLines[0][1]; const start = prevToken.range[1]; const end = nextToken.range[0]; - const text = context.getSourceCode().text + const text = context.sourceCode.text .slice(start, end) .replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines); @@ -284,7 +242,7 @@ function verifyForAlways(context, prevNode, nextNode, paddingLines) { node: nextNode, messageId: "expectedBlankLine", fix(fixer) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let prevToken = getActualLastToken(sourceCode, prevNode); const nextToken = sourceCode.getFirstTokenBetween( prevToken, @@ -366,12 +324,10 @@ const StatementTypes = { CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)) }, directive: { - test: isDirectivePrologue + test: astUtils.isDirective }, expression: { - test: (node, sourceCode) => - node.type === "ExpressionStatement" && - !isDirectivePrologue(node, sourceCode) + test: node => node.type === "ExpressionStatement" && !astUtils.isDirective(node) }, iife: { test: isIIFEStatement @@ -382,10 +338,10 @@ const StatementTypes = { isBlockLikeStatement(sourceCode, node) }, "multiline-expression": { - test: (node, sourceCode) => + test: node => node.loc.start.line !== node.loc.end.line && node.type === "ExpressionStatement" && - !isDirectivePrologue(node, sourceCode) + !astUtils.isDirective(node) }, "multiline-const": newMultilineKeywordTester("const"), @@ -425,15 +381,17 @@ const StatementTypes = { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/padding-line-between-statements" }, fixable: "whitespace", @@ -450,8 +408,7 @@ module.exports = { type: "array", items: { enum: Object.keys(StatementTypes) }, minItems: 1, - uniqueItems: true, - additionalItems: false + uniqueItems: true } ] } @@ -466,8 +423,7 @@ module.exports = { }, additionalProperties: false, required: ["blankLine", "prev", "next"] - }, - additionalItems: false + } }, messages: { @@ -477,7 +433,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const configureList = context.options || []; let scopeInfo = null; @@ -619,9 +575,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 a01c034..d22e508 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,15 +145,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback" }, schema: [ @@ -184,7 +185,7 @@ module.exports = { const allowUnboundThis = options.allowUnboundThis !== false; // default to true const allowNamedFunctions = options.allowNamedFunctions; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /* * {Array<{this: boolean, super: boolean, meta: boolean}>} @@ -262,14 +263,14 @@ module.exports = { } // Skip recursive functions. - const nameVar = context.getDeclaredVariables(node)[0]; + const nameVar = sourceCode.getDeclaredVariables(node)[0]; if (isFunctionName(nameVar) && nameVar.references.length > 0) { return; } // Skip if it's using arguments. - const variable = getVariableOfArguments(context.getScope()); + const variable = getVariableOfArguments(sourceCode.getScope(node)); if (variable && variable.references.length > 0) { return; @@ -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 f6e79e7..b43975e 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,15 +326,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-const" }, fixable: "code", @@ -356,7 +356,7 @@ module.exports = { create(context) { const options = context.options[0] || {}; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const shouldMatchAnyDestructuredVariable = options.destructuring !== "all"; const ignoreReadBeforeAssign = options.ignoreReadBeforeAssign === true; const variables = []; @@ -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); } } @@ -481,7 +493,7 @@ module.exports = { VariableDeclaration(node) { if (node.kind === "let" && !isInitOfForStatement(node)) { - variables.push(...context.getDeclaredVariables(node)); + variables.push(...sourceCode.getDeclaredVariables(node)); } } }; diff --git a/node_modules/eslint/lib/rules/prefer-destructuring.js b/node_modules/eslint/lib/rules/prefer-destructuring.js index f82bb75..c6075c5 100644 --- a/node_modules/eslint/lib/rules/prefer-destructuring.js +++ b/node_modules/eslint/lib/rules/prefer-destructuring.js @@ -20,15 +20,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-destructuring" }, fixable: "code", @@ -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 @@ -190,7 +190,7 @@ module.exports = { */ function fixIntoObjectDestructuring(fixer, node) { const rightNode = node.init; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved. if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) { @@ -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 6121af8..6d807f9 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 @@ -55,11 +55,12 @@ function doesExponentNeedParens(exponent) { function doesExponentiationExpressionNeedParens(node, sourceCode) { const parent = node.parent.type === "ChainExpression" ? node.parent.parent : node.parent; + const parentPrecedence = astUtils.getPrecedence(parent); const needsParens = ( parent.type === "ClassDeclaration" || ( parent.type.endsWith("Expression") && - astUtils.getPrecedence(parent) >= PRECEDENCE_OF_EXPONENTIATION_EXPR && + (parentPrecedence === -1 || parentPrecedence >= PRECEDENCE_OF_EXPONENTIATION_EXPR) && !(parent.type === "BinaryExpression" && parent.operator === "**" && parent.right === node) && !((parent.type === "CallExpression" || parent.type === "NewExpression") && parent.arguments.includes(node)) && !(parent.type === "MemberExpression" && parent.computed && parent.property === node) && @@ -84,15 +85,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator" }, schema: [], @@ -104,7 +105,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Reports the given node. @@ -172,8 +173,8 @@ module.exports = { } return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { Math: { @@ -181,8 +182,8 @@ module.exports = { } }; - for (const { node } of tracker.iterateGlobalReferences(trackMap)) { - report(node); + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { + report(refNode); } } }; 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 7d0aa3f..a82ee1f 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,42 +23,106 @@ 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" + url: "https://eslint.org/docs/latest/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.sourceCode; /** * 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 {boolean} uFlag Flag indicates whether unicode mode is enabled or not. + * @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 {string|null} flags The regular expression flags to be checked. * @returns {void} */ - function checkRegex(pattern, node, uFlag) { + function checkRegex(pattern, node, regexNode, flags) { let ast; try { - ast = parser.parsePattern(pattern, 0, pattern.length, uFlag); + ast = parser.parsePattern(pattern, 0, pattern.length, { + unicode: Boolean(flags && flags.includes("u")), + unicodeSets: Boolean(flags && flags.includes("v")) + }); } catch { // ignore regex syntax errors @@ -68,12 +132,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,11 +151,11 @@ 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); } }, - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = { RegExp: { @@ -96,12 +164,12 @@ module.exports = { } }; - for (const { node } of tracker.iterateGlobalReferences(traceMap)) { - const regex = getStringIfConstant(node.arguments[0]); - const flags = getStringIfConstant(node.arguments[1]); + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + const regex = getStringIfConstant(refNode.arguments[0]); + const flags = getStringIfConstant(refNode.arguments[1]); if (regex) { - checkRegex(regex, node, flags && flags.includes("u")); + checkRegex(regex, refNode, refNode.arguments[0], flags); } } } diff --git a/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/node_modules/eslint/lib/rules/prefer-numeric-literals.js index cc82e66..118d6dc 100644 --- a/node_modules/eslint/lib/rules/prefer-numeric-literals.js +++ b/node_modules/eslint/lib/rules/prefer-numeric-literals.js @@ -39,15 +39,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals" }, schema: [], @@ -60,7 +60,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //---------------------------------------------------------------------- // Public diff --git a/node_modules/eslint/lib/rules/prefer-object-spread.js b/node_modules/eslint/lib/rules/prefer-object-spread.js index ab252c7..60b0c31 100644 --- a/node_modules/eslint/lib/rules/prefer-object-spread.js +++ b/node_modules/eslint/lib/rules/prefer-object-spread.js @@ -1,12 +1,11 @@ /** * @fileoverview Prefers object spread property over Object.assign * @author Sharmila Jesupaul - * See LICENSE file in root directory for full license. */ "use strict"; -const { CALL, ReferenceTracker } = require("eslint-utils"); +const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils"); const { isCommaToken, isOpeningParenToken, @@ -240,16 +239,16 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-object-spread" }, schema: [], @@ -262,11 +261,11 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { Object: { @@ -275,22 +274,22 @@ module.exports = { }; // Iterate all calls of `Object.assign` (only of the global variable `Object`). - for (const { node } of tracker.iterateGlobalReferences(trackMap)) { + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { if ( - node.arguments.length >= 1 && - node.arguments[0].type === "ObjectExpression" && - !hasArraySpread(node) && + refNode.arguments.length >= 1 && + refNode.arguments[0].type === "ObjectExpression" && + !hasArraySpread(refNode) && !( - node.arguments.length > 1 && - hasArgumentsWithAccessors(node) + refNode.arguments.length > 1 && + hasArgumentsWithAccessors(refNode) ) ) { - const messageId = node.arguments.length === 1 + const messageId = refNode.arguments.length === 1 ? "useLiteralMessage" : "useSpreadMessage"; - const fix = defineFixer(node, sourceCode); + const fix = defineFixer(refNode, sourceCode); - context.report({ node, messageId, fix }); + context.report({ node: refNode, messageId, fix }); } } } 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 ec16e44..e990265 100644 --- a/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js +++ b/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js @@ -10,15 +10,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors" }, fixable: null, @@ -41,6 +41,7 @@ module.exports = { create(context) { const ALLOW_EMPTY_REJECT = context.options.length && context.options[0].allowEmptyReject; + const sourceCode = context.sourceCode; //---------------------------------------------------------------------- // Helpers @@ -100,7 +101,7 @@ module.exports = { node.arguments.length && astUtils.isFunction(node.arguments[0]) && node.arguments[0].params.length > 1 && node.arguments[0].params[1].type === "Identifier" ) { - context.getDeclaredVariables(node.arguments[0]) + sourceCode.getDeclaredVariables(node.arguments[0]) /* * Find the first variable that matches the second parameter's name. diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js index 156d612..d579b48 100644 --- a/node_modules/eslint/lib/rules/prefer-reflect.js +++ b/node_modules/eslint/lib/rules/prefer-reflect.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/prefer-reflect" }, deprecated: true, @@ -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 9e8ce02..ffaaeac 100644 --- a/node_modules/eslint/lib/rules/prefer-regex-literals.js +++ b/node_modules/eslint/lib/rules/prefer-regex-literals.js @@ -10,7 +10,10 @@ //------------------------------------------------------------------------------ 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"); +const { REGEXPP_LATEST_ECMA_VERSION } = require("./utils/regular-expressions"); //------------------------------------------------------------------------------ // Helpers @@ -34,31 +37,89 @@ function isRegexLiteral(node) { return node.type === "Literal" && Object.prototype.hasOwnProperty.call(node, "regex"); } -/** - * Determines whether the given node is a template literal without expressions. - * @param {ASTNode} node Node to check. - * @returns {boolean} True if the node is a template literal without expressions. - */ -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" + url: "https://eslint.org/docs/latest/rules/prefer-regex-literals" }, + hasSuggestions: true, + schema: [ { type: "object", @@ -74,6 +135,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 +145,7 @@ module.exports = { create(context) { const [{ disallowRedundantWrapping = false } = {}] = context.options; + const sourceCode = context.sourceCode; /** * Determines whether the given identifier node is a reference to a global variable. @@ -88,7 +153,7 @@ module.exports = { * @returns {boolean} True if the identifier is a reference to a global variable. */ function isGlobalReference(node) { - const scope = context.getScope(); + const scope = sourceCode.getScope(node); const variable = findVariable(scope, node); return variable !== null && variable.scope.type === "global" && variable.defs.length === 0; @@ -104,7 +169,28 @@ module.exports = { return node.type === "TaggedTemplateExpression" && astUtils.isSpecificMemberAccess(node.tag, "String", "raw") && isGlobalReference(astUtils.skipChainExpression(node.tag).object) && - isStaticTemplateLiteral(node.quasi); + astUtils.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 (astUtils.isStaticTemplateLiteral(node)) { + return node.quasis[0].value.cooked; + } + + if (isStringRawTaggedStaticTemplateLiteral(node)) { + return node.quasi.quasis[0].value.raw; + } + + return null; } /** @@ -114,7 +200,7 @@ module.exports = { */ function isStaticString(node) { return isStringLiteral(node) || - isStaticTemplateLiteral(node) || + astUtils.isStaticTemplateLiteral(node) || isStringRawTaggedStaticTemplateLiteral(node); } @@ -152,9 +238,138 @@ module.exports = { return false; } + /** + * Returns a ecmaVersion compatible for regexpp. + * @param {number} ecmaVersion The ecmaVersion to convert. + * @returns {import("@eslint-community/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, { + unicode: flags ? flags.includes("u") : false, + unicodeSets: flags ? flags.includes("v") : 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(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const traceMap = { RegExp: { @@ -163,15 +378,127 @@ module.exports = { } }; - for (const { node } of tracker.iterateGlobalReferences(traceMap)) { - if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(node)) { - if (node.arguments.length === 2) { - context.report({ node, messageId: "unexpectedRedundantRegExpWithFlags" }); + for (const { node: refNode } of tracker.iterateGlobalReferences(traceMap)) { + if (disallowRedundantWrapping && isUnnecessarilyWrappedRegexLiteral(refNode)) { + const regexNode = refNode.arguments[0]; + + if (refNode.arguments.length === 2) { + const suggests = []; + + const argFlags = getStringValue(refNode.arguments[1]) || ""; + + if (canFixTo(refNode, 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(refNode, regexNode.regex.pattern, mergedFlags) + ) { + suggests.push({ + messageId: "replaceWithIntendedLiteralAndFlags", + pattern: regexNode.regex.pattern, + flags: mergedFlags + }); + } + + context.report({ + node: refNode, + messageId: "unexpectedRedundantRegExpWithFlags", + suggest: suggests.map(({ flags, pattern, messageId }) => ({ + messageId, + data: { + flags + }, + fix(fixer) { + return fixer.replaceText(refNode, getSafeOutput(refNode, `/${pattern}/${flags}`)); + } + })) + }); } else { - context.report({ node, messageId: "unexpectedRedundantRegExp" }); + const outputs = []; + + if (canFixTo(refNode, regexNode.regex.pattern, regexNode.regex.flags)) { + outputs.push(sourceCode.getText(regexNode)); + } + + + context.report({ + node: refNode, + messageId: "unexpectedRedundantRegExp", + suggest: outputs.map(output => ({ + messageId: "replaceWithLiteral", + fix(fixer) { + return fixer.replaceText( + refNode, + getSafeOutput(refNode, output) + ); + } + })) + }); } - } else if (hasOnlyStaticStringArguments(node)) { - context.report({ node, messageId: "unexpectedRegExp" }); + } else if (hasOnlyStaticStringArguments(refNode)) { + let regexContent = getStringValue(refNode.arguments[0]); + let noFix = false; + let flags; + + if (refNode.arguments[1]) { + flags = getStringValue(refNode.arguments[1]); + } + + if (!canFixTo(refNode, 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 fab7bdc..fe26eed 100644 --- a/node_modules/eslint/lib/rules/quote-props.js +++ b/node_modules/eslint/lib/rules/quote-props.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag non-quoted property names in object literals. * @author Mathias Bynens + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -16,15 +17,17 @@ const keywords = require("./utils/keywords"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/quote-props" }, schema: { @@ -86,29 +89,29 @@ module.exports = { CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, NUMBERS = context.options[1] && context.options[1].numbers, - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; /** * 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 +142,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 +198,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 +216,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 da7e127..17d97dd 100644 --- a/node_modules/eslint/lib/rules/quotes.js +++ b/node_modules/eslint/lib/rules/quotes.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to choose between single and double quote marks * @author Matt DuVall , Brandon Payton + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -74,15 +75,17 @@ const AVOID_ESCAPE = "avoid-escape"; // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/quotes" }, fixable: "code", @@ -123,7 +126,7 @@ module.exports = { settings = QUOTE_SETTINGS[quoteOption || "double"], options = context.options[1], allowTemplateLiterals = options && options.allowTemplateLiterals === true, - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let avoidEscape = options && options.avoidEscape === true; // deprecated @@ -157,7 +160,8 @@ module.exports = { /** * Checks whether or not a given node is a directive. - * The directive is a `ExpressionStatement` which has only a string literal. + * The directive is a `ExpressionStatement` which has only a string literal not surrounded by + * parentheses. * @param {ASTNode} node A node to check. * @returns {boolean} Whether or not the node is a directive. * @private @@ -166,23 +170,23 @@ module.exports = { return ( node.type === "ExpressionStatement" && node.expression.type === "Literal" && - typeof node.expression.value === "string" + typeof node.expression.value === "string" && + !astUtils.isParenthesised(sourceCode, node.expression) ); } /** - * Checks whether or not a given node is a part of directive prologues. - * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive + * Checks whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue. + * @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive} * @param {ASTNode} node A node to check. - * @returns {boolean} Whether or not the node is a part of directive prologues. + * @returns {boolean} Whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue. * @private */ - function isPartOfDirectivePrologue(node) { - const block = node.parent.parent; - - if (block.type !== "Program" && (block.type !== "BlockStatement" || !astUtils.isFunction(block.parent))) { + function isExpressionInOrJustAfterDirectivePrologue(node) { + if (!astUtils.isTopLevelExpressionStatement(node.parent)) { return false; } + const block = node.parent.parent; // Check the node is at a prologue. for (let i = 0; i < block.body.length; ++i) { @@ -212,19 +216,31 @@ module.exports = { // Directive Prologues. case "ExpressionStatement": - return isPartOfDirectivePrologue(node); + return !astUtils.isParenthesised(sourceCode, node) && isExpressionInOrJustAfterDirectivePrologue(node); // 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 +287,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) { @@ -316,12 +332,11 @@ module.exports = { description: settings.description }, fix(fixer) { - if (isPartOfDirectivePrologue(node)) { + if (astUtils.isTopLevelExpressionStatement(node.parent) && !astUtils.isParenthesised(sourceCode, node)) { /* - * TemplateLiterals in a directive prologue aren't actually directives, but if they're - * in the directive prologue, then fixing them might turn them into directives and change - * the behavior of the code. + * TemplateLiterals aren't actually directives, but fixing them might turn + * them into directives and change the behavior of the code. */ return null; } diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js index d1b67e5..7df97d9 100644 --- a/node_modules/eslint/lib/rules/radix.js +++ b/node_modules/eslint/lib/rules/radix.js @@ -74,18 +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", - suggestion: true + url: "https://eslint.org/docs/latest/rules/radix" }, + hasSuggestions: true, + schema: [ { enum: ["always", "as-needed"] @@ -103,6 +104,7 @@ module.exports = { create(context) { const mode = context.options[0] || MODE_ALWAYS; + const sourceCode = context.sourceCode; /** * Checks the arguments of a given CallExpression node and reports it if it @@ -130,7 +132,6 @@ module.exports = { { 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. @@ -161,18 +162,18 @@ module.exports = { } return { - "Program:exit"() { - const scope = context.getScope(); + "Program:exit"(node) { + const scope = sourceCode.getScope(node); let variable; // Check `parseInt()` variable = astUtils.getVariableByName(scope, "parseInt"); if (variable && !isShadowed(variable)) { variable.references.forEach(reference => { - const node = reference.identifier; + const idNode = reference.identifier; - if (astUtils.isCallee(node)) { - checkArguments(node.parent); + if (astUtils.isCallee(idNode)) { + checkArguments(idNode.parent); } }); } @@ -181,12 +182,12 @@ module.exports = { variable = astUtils.getVariableByName(scope, "Number"); if (variable && !isShadowed(variable)) { variable.references.forEach(reference => { - const node = reference.identifier.parent; - const maybeCallee = node.parent.type === "ChainExpression" - ? node.parent - : node; + const parentNode = reference.identifier.parent; + const maybeCallee = parentNode.parent.type === "ChainExpression" + ? parentNode.parent + : parentNode; - if (isParseIntMethod(node) && astUtils.isCallee(maybeCallee)) { + if (isParseIntMethod(parentNode) && astUtils.isCallee(maybeCallee)) { checkArguments(maybeCallee.parent); } }); diff --git a/node_modules/eslint/lib/rules/require-atomic-updates.js b/node_modules/eslint/lib/rules/require-atomic-updates.js index b3df907..7e397ce 100644 --- a/node_modules/eslint/lib/rules/require-atomic-updates.js +++ b/node_modules/eslint/lib/rules/require-atomic-updates.js @@ -79,6 +79,9 @@ function isLocalVariableWithoutEscape(variable, isMemberAccess) { reference.from.variableScope === functionScope); } +/** + * Represents segment information. + */ class SegmentInfo { constructor() { this.info = new WeakMap(); @@ -162,34 +165,47 @@ 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" + url: "https://eslint.org/docs/latest/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 sourceCode = context.getSourceCode(); + const allowProperties = !!context.options[0] && context.options[0].allowProperties; + + const sourceCode = context.sourceCode; const assignmentReferences = new Map(); const segmentInfo = new SegmentInfo(); let stack = null; return { - onCodePathStart(codePath) { - const scope = context.getScope(); + onCodePathStart(codePath, node) { + const scope = sourceCode.getScope(node); const shouldVerify = scope.type === "function" && (scope.block.async || scope.block.generator); @@ -197,7 +213,8 @@ module.exports = { stack = { upper: stack, codePath, - referenceMap: shouldVerify ? createReferenceMap(scope) : null + referenceMap: shouldVerify ? createReferenceMap(scope) : null, + currentSegments: new Set() }; }, onCodePathEnd() { @@ -207,11 +224,25 @@ module.exports = { // Initialize the segment information. onCodePathSegmentStart(segment) { segmentInfo.initialize(segment); + stack.currentSegments.add(segment); }, + onUnreachableCodePathSegmentStart(segment) { + stack.currentSegments.add(segment); + }, + + onUnreachableCodePathSegmentEnd(segment) { + stack.currentSegments.delete(segment); + }, + + onCodePathSegmentEnd(segment) { + stack.currentSegments.delete(segment); + }, + + // Handle references to prepare verification. Identifier(node) { - const { codePath, referenceMap } = stack; + const { referenceMap } = stack; const reference = referenceMap && referenceMap.get(node); // Ignore if this is not a valid variable reference. @@ -224,7 +255,7 @@ module.exports = { // Add a fresh read variable. if (reference.isRead() && !(writeExpr && writeExpr.parent.operator === "=")) { - segmentInfo.markAsRead(codePath.currentSegments, variable); + segmentInfo.markAsRead(stack.currentSegments, variable); } /* @@ -251,16 +282,15 @@ module.exports = { * If the reference exists in `outdatedReadVariables` list, report it. */ ":expression:exit"(node) { - const { codePath, referenceMap } = stack; // referenceMap exists if this is in a resumable function scope. - if (!referenceMap) { + if (!stack.referenceMap) { return; } // Mark the read variables on this code path as outdated. if (node.type === "AwaitExpression" || node.type === "YieldExpression") { - segmentInfo.makeOutdated(codePath.currentSegments); + segmentInfo.makeOutdated(stack.currentSegments); } // Verify. @@ -272,14 +302,26 @@ module.exports = { for (const reference of references) { const variable = reference.resolved; - if (segmentInfo.isOutdated(codePath.currentSegments, variable)) { - context.report({ - node: node.parent, - messageId: "nonAtomicUpdate", - data: { - value: sourceCode.getText(node.parent.left) - } - }); + if (segmentInfo.isOutdated(stack.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 9b5acc7..952dde5 100644 --- a/node_modules/eslint/lib/rules/require-await.js +++ b/node_modules/eslint/lib/rules/require-await.js @@ -28,15 +28,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/require-await" }, schema: [], @@ -47,7 +47,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; let scopeInfo = null; /** diff --git a/node_modules/eslint/lib/rules/require-jsdoc.js b/node_modules/eslint/lib/rules/require-jsdoc.js index e581b2b..b6fedf2 100644 --- a/node_modules/eslint/lib/rules/require-jsdoc.js +++ b/node_modules/eslint/lib/rules/require-jsdoc.js @@ -1,18 +1,19 @@ /** * @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" + url: "https://eslint.org/docs/latest/rules/require-jsdoc" }, schema: [ @@ -60,7 +61,7 @@ module.exports = { }, create(context) { - const source = context.getSourceCode(); + const source = context.sourceCode; const DEFAULT_OPTIONS = { FunctionDeclaration: true, MethodDefinition: false, diff --git a/node_modules/eslint/lib/rules/require-unicode-regexp.js b/node_modules/eslint/lib/rules/require-unicode-regexp.js index 880405e..dd687f8 100644 --- a/node_modules/eslint/lib/rules/require-unicode-regexp.js +++ b/node_modules/eslint/lib/rules/require-unicode-regexp.js @@ -14,24 +14,29 @@ const { CONSTRUCT, ReferenceTracker, getStringIfConstant -} = require("eslint-utils"); +} = require("@eslint-community/eslint-utils"); +const astUtils = require("./utils/ast-utils.js"); +const { isValidWithUnicodeFlag } = require("./utils/regular-expressions"); //------------------------------------------------------------------------------ // 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` or `v` flag on RegExp", recommended: false, - url: "https://eslint.org/docs/rules/require-unicode-regexp" + url: "https://eslint.org/docs/latest/rules/require-unicode-regexp" }, + hasSuggestions: true, + messages: { + addUFlag: "Add the 'u' flag.", requireUFlag: "Use the 'u' flag." }, @@ -39,28 +44,83 @@ module.exports = { }, create(context) { + + const sourceCode = context.sourceCode; + return { "Literal[regex]"(node) { const flags = node.regex.flags || ""; - if (!flags.includes("u")) { - context.report({ node, messageId: "requireUFlag" }); + if (!flags.includes("u") && !flags.includes("v")) { + context.report({ + messageId: "requireUFlag", + node, + suggest: isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, node.regex.pattern) + ? [ + { + fix(fixer) { + return fixer.insertTextAfter(node, "u"); + }, + messageId: "addUFlag" + } + ] + : null + }); } }, - Program() { - const scope = context.getScope(); + Program(node) { + const scope = sourceCode.getScope(node); const tracker = new ReferenceTracker(scope); const trackMap = { RegExp: { [CALL]: true, [CONSTRUCT]: true } }; - for (const { node } of tracker.iterateGlobalReferences(trackMap)) { - const flagsNode = node.arguments[1]; + for (const { node: refNode } of tracker.iterateGlobalReferences(trackMap)) { + const [patternNode, flagsNode] = refNode.arguments; + + if (patternNode && patternNode.type === "SpreadElement") { + continue; + } + const pattern = getStringIfConstant(patternNode, scope); const flags = getStringIfConstant(flagsNode, scope); - if (!flagsNode || (typeof flags === "string" && !flags.includes("u"))) { - context.report({ node, messageId: "requireUFlag" }); + if (!flagsNode || (typeof flags === "string" && !flags.includes("u") && !flags.includes("v"))) { + context.report({ + messageId: "requireUFlag", + node: refNode, + suggest: typeof pattern === "string" && isValidWithUnicodeFlag(context.languageOptions.ecmaVersion, pattern) + ? [ + { + fix(fixer) { + if (flagsNode) { + if ((flagsNode.type === "Literal" && typeof flagsNode.value === "string") || flagsNode.type === "TemplateLiteral") { + const flagsNodeText = sourceCode.getText(flagsNode); + + return fixer.replaceText(flagsNode, [ + flagsNodeText.slice(0, flagsNodeText.length - 1), + flagsNodeText.slice(flagsNodeText.length - 1) + ].join("u")); + } + + // We intentionally don't suggest concatenating + "u" to non-literals + return null; + } + + const penultimateToken = sourceCode.getLastToken(refNode, { skip: 1 }); // skip closing parenthesis + + return fixer.insertTextAfter( + penultimateToken, + astUtils.isCommaToken(penultimateToken) + ? ' "u",' + : ', "u"' + ); + }, + messageId: "addUFlag" + } + ] + : null + }); } } } diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js index af2344d..f801af0 100644 --- a/node_modules/eslint/lib/rules/require-yield.js +++ b/node_modules/eslint/lib/rules/require-yield.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/require-yield" }, schema: [], @@ -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 8cb9814..287e56f 100644 --- a/node_modules/eslint/lib/rules/rest-spread-spacing.js +++ b/node_modules/eslint/lib/rules/rest-spread-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Enforce spacing between rest and spread operators and their expressions. * @author Kai Cataldo + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/rest-spread-spacing" }, fixable: "whitespace", @@ -35,7 +38,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, alwaysSpace = context.options[0] === "always"; //-------------------------------------------------------------------------- diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js index 5c546f2..35a49d2 100644 --- a/node_modules/eslint/lib/rules/semi-spacing.js +++ b/node_modules/eslint/lib/rules/semi-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Validates spacing before and after semicolon * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -11,15 +12,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/semi-spacing" }, fixable: "whitespace", @@ -52,7 +55,7 @@ module.exports = { create(context) { const config = context.options[0], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let requireSpaceBefore = false, requireSpaceAfter = true; @@ -238,7 +241,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 0c9bec4..caf2224 100644 --- a/node_modules/eslint/lib/rules/semi-style.js +++ b/node_modules/eslint/lib/rules/semi-style.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce location of semicolons. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,19 +16,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 +35,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,15 +68,17 @@ function isLastChild(node) { return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc. } +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/semi-style" }, schema: [{ enum: ["last", "first"] }], @@ -83,7 +90,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const option = context.options[0] || "last"; /** diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js index d2f0670..01586b8 100644 --- a/node_modules/eslint/lib/rules/semi.js +++ b/node_modules/eslint/lib/rules/semi.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag missing semicolons. * @author Nicholas C. Zakas + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/semi" }, fixable: "code", @@ -58,7 +61,8 @@ module.exports = { { type: "object", properties: { - omitLastInOneLineBlock: { type: "boolean" } + omitLastInOneLineBlock: { type: "boolean" }, + omitLastInOneLineClassBody: { type: "boolean" } }, additionalProperties: false } @@ -78,11 +82,14 @@ 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); + const exceptOneLineClassBody = Boolean(options && options.omitLastInOneLineClassBody); const beforeStatementContinuationChars = options && options.beforeStatementContinuationChars || "any"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers @@ -166,6 +173,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 +289,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 +312,52 @@ 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; + } + + /** + * Checks a node to see if it's the last item in a one-liner `ClassBody` node. + * ClassBody 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 the last item in a one-liner ClassBody. + */ + function isLastInOneLinerClassBody(node) { + const parent = node.parent; + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + + if (parent.type === "ClassBody") { + return parent.loc.start.line === parent.loc.end.line; + } + + return false; } /** @@ -276,15 +371,21 @@ 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)); + const oneLinerClassBody = (exceptOneLineClassBody && isLastInOneLinerClassBody(node)); + const oneLinerBlockOrClassBody = oneLinerBlock || oneLinerClassBody; - if (isSemi && oneLinerBlock) { + if (isSemi && oneLinerBlockOrClassBody) { report(node, true); - } else if (!isSemi && !oneLinerBlock) { + } else if (!isSemi && !oneLinerBlockOrClassBody) { report(node); } } @@ -329,7 +430,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 4c3ddec..04814ed 100644 --- a/node_modules/eslint/lib/rules/sort-imports.js +++ b/node_modules/eslint/lib/rules/sort-imports.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/sort-imports" }, schema: [ @@ -71,7 +71,7 @@ module.exports = { ignoreMemberSort = configuration.ignoreMemberSort || false, memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"], allowSeparatedGroups = configuration.allowSeparatedGroups || false, - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let previousDeclaration = null; /** diff --git a/node_modules/eslint/lib/rules/sort-keys.js b/node_modules/eslint/lib/rules/sort-keys.js index 8a95ee2..088b589 100644 --- a/node_modules/eslint/lib/rules/sort-keys.js +++ b/node_modules/eslint/lib/rules/sort-keys.js @@ -75,15 +75,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/sort-keys" }, schema: [ @@ -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.sourceCode; 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 7add2cf..8fd723f 100644 --- a/node_modules/eslint/lib/rules/sort-vars.js +++ b/node_modules/eslint/lib/rules/sort-vars.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/sort-vars" }, schema: [ @@ -44,7 +44,7 @@ module.exports = { const configuration = context.options[0] || {}, ignoreCase = configuration.ignoreCase || false, - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; return { VariableDeclaration(node) { diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js index 87ef9bf..a4a5449 100644 --- a/node_modules/eslint/lib/rules/space-before-blocks.js +++ b/node_modules/eslint/lib/rules/space-before-blocks.js @@ -1,6 +1,7 @@ /** * @fileoverview A rule to ensure whitespace before blocks. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -34,15 +35,17 @@ function isFunctionBody(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/space-before-blocks" }, fixable: "whitespace", @@ -80,7 +83,7 @@ module.exports = { create(context) { const config = context.options[0], - sourceCode = context.getSourceCode(); + sourceCode = context.sourceCode; let alwaysFunctions = true, alwaysKeywords = true, alwaysClasses = true, @@ -108,13 +111,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 1021a11..575a159 100644 --- a/node_modules/eslint/lib/rules/space-before-function-paren.js +++ b/node_modules/eslint/lib/rules/space-before-function-paren.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to validate spacing before function paren. * @author Mathias Schreck + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/space-before-function-paren" }, fixable: "whitespace", @@ -59,7 +62,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const baseConfig = typeof context.options[0] === "string" ? context.options[0] : "always"; const overrideConfig = typeof context.options[0] === "object" ? context.options[0] : {}; diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js index b0a604d..d15a643 100644 --- a/node_modules/eslint/lib/rules/space-in-parens.js +++ b/node_modules/eslint/lib/rules/space-in-parens.js @@ -1,6 +1,7 @@ /** * @fileoverview Disallows or enforces spaces inside of parentheses. * @author Jonathan Rajavuori + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,15 +11,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/space-in-parens" }, fixable: "whitespace", @@ -102,7 +105,7 @@ module.exports = { //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Determines if a token is one of the exceptions for the opener paren diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js index 3c55098..4007101 100644 --- a/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/node_modules/eslint/lib/rules/space-infix-ops.js @@ -1,22 +1,27 @@ /** * @fileoverview Require spaces around infix operators * @author Michael Ficarra + * @deprecated in ESLint v8.53.0 */ "use strict"; +const { isEqToken } = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/space-infix-ops" }, fixable: "whitespace", @@ -41,7 +46,7 @@ module.exports = { create(context) { const int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Returns the first token which violates the rule @@ -164,7 +169,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 57f6e78..aed43e7 100644 --- a/node_modules/eslint/lib/rules/space-unary-ops.js +++ b/node_modules/eslint/lib/rules/space-unary-ops.js @@ -1,6 +1,7 @@ /** * @fileoverview This rule should require or disallow spaces before or after unary operations. * @author Marcin Kumorek + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -14,15 +15,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/space-unary-ops" }, fixable: "whitespace", @@ -62,7 +65,7 @@ module.exports = { create(context) { const options = context.options[0] || { words: true, nonwords: false }; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; //-------------------------------------------------------------------------- // Helpers diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js index 226a2d4..90ac703 100644 --- a/node_modules/eslint/lib/rules/spaced-comment.js +++ b/node_modules/eslint/lib/rules/spaced-comment.js @@ -1,6 +1,7 @@ /** * @fileoverview Source code for spaced-comments rule * @author Gyandeep Singh + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -39,7 +40,7 @@ function escapeAndRepeat(s) { function parseMarkersOption(markers) { // `*` is a marker for JSDoc comments. - if (markers.indexOf("*") === -1) { + if (!markers.includes("*")) { return markers.concat("*"); } @@ -146,15 +147,17 @@ function createNeverStylePattern(markers) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/spaced-comment" }, fixable: "whitespace", @@ -235,7 +238,7 @@ module.exports = { create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; // Unless the first option is never, require a space const requireSpace = context.options[0] !== "never"; diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js index b0d6cf9..f9dd750 100644 --- a/node_modules/eslint/lib/rules/strict.js +++ b/node_modules/eslint/lib/rules/strict.js @@ -63,15 +63,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/strict" }, schema: [ @@ -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 c906415..3ea63ca 100644 --- a/node_modules/eslint/lib/rules/switch-colon-spacing.js +++ b/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing around colons of switch statements. * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/switch-colon-spacing" }, schema: [ @@ -46,23 +49,11 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const options = context.options[0] || {}; 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 +106,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 155cea4..4528f09 100644 --- a/node_modules/eslint/lib/rules/symbol-description.js +++ b/node_modules/eslint/lib/rules/symbol-description.js @@ -16,15 +16,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/symbol-description" }, fixable: null, schema: [], @@ -35,6 +35,8 @@ module.exports = { create(context) { + const sourceCode = context.sourceCode; + /** * Reports if node does not conform the rule in case rule is set to * report missing description @@ -51,16 +53,16 @@ module.exports = { } return { - "Program:exit"() { - const scope = context.getScope(); + "Program:exit"(node) { + const scope = sourceCode.getScope(node); const variable = astUtils.getVariableByName(scope, "Symbol"); if (variable && variable.defs.length === 0) { variable.references.forEach(reference => { - const node = reference.identifier; + const idNode = reference.identifier; - if (astUtils.isCallee(node)) { - checkArgument(node.parent); + if (astUtils.isCallee(idNode)) { + checkArgument(idNode.parent); } }); } diff --git a/node_modules/eslint/lib/rules/template-curly-spacing.js b/node_modules/eslint/lib/rules/template-curly-spacing.js index 26043bc..1f8cc34 100644 --- a/node_modules/eslint/lib/rules/template-curly-spacing.js +++ b/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to enforce spacing around embedded expressions of template strings * @author Toru Nagashima + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -15,15 +16,17 @@ const astUtils = require("./utils/ast-utils"); // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/template-curly-spacing" }, fixable: "whitespace", @@ -40,7 +43,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const always = context.options[0] === "always"; /** diff --git a/node_modules/eslint/lib/rules/template-tag-spacing.js b/node_modules/eslint/lib/rules/template-tag-spacing.js index 16f5862..52e0bcf 100644 --- a/node_modules/eslint/lib/rules/template-tag-spacing.js +++ b/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check spacing between template tags and their literals * @author Jonathan Wilsson + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/template-tag-spacing" }, fixable: "whitespace", @@ -33,7 +36,7 @@ module.exports = { create(context) { const never = context.options[0] !== "always"; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Check if a space is present between a template tag and its literal diff --git a/node_modules/eslint/lib/rules/unicode-bom.js b/node_modules/eslint/lib/rules/unicode-bom.js index 39642f8..09971d2 100644 --- a/node_modules/eslint/lib/rules/unicode-bom.js +++ b/node_modules/eslint/lib/rules/unicode-bom.js @@ -8,15 +8,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/unicode-bom" }, fixable: "whitespace", @@ -42,7 +42,7 @@ module.exports = { Program: function checkUnicodeBOM(node) { - const sourceCode = context.getSourceCode(), + const sourceCode = context.sourceCode, location = { column: 0, line: 1 }, requireBOM = context.options[0] || "never"; diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js index ef95b21..21dc395 100644 --- a/node_modules/eslint/lib/rules/use-isnan.js +++ b/node_modules/eslint/lib/rules/use-isnan.js @@ -31,15 +31,15 @@ function isNaNIdentifier(node) { // 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" + url: "https://eslint.org/docs/latest/rules/use-isnan" }, schema: [ diff --git a/node_modules/eslint/lib/rules/utils/ast-utils.js b/node_modules/eslint/lib/rules/utils/ast-utils.js index 6b85300..962bdde 100644 --- a/node_modules/eslint/lib/rules/utils/ast-utils.js +++ b/node_modules/eslint/lib/rules/utils/ast-utils.js @@ -9,6 +9,7 @@ // Requirements //------------------------------------------------------------------------------ +const { KEYS: eslintVisitorKeys } = require("eslint-visitor-keys"); const esutils = require("esutils"); const espree = require("espree"); const escapeRegExp = require("escape-string-regexp"); @@ -25,17 +26,18 @@ const { const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u; const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u; +const arrayMethodWithThisArgPattern = /^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|some)$/u; const arrayOrTypedArrayPattern = /Array$/u; -const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/u; const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u; 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 +268,7 @@ function getStaticPropertyName(node) { return getStaticPropertyName(node.expression); case "Property": + case "PropertyDefinition": case "MethodDefinition": prop = node.key; break; @@ -407,6 +410,7 @@ function isSameReference(left, right, disableStaticComputedKey = false) { return true; case "Identifier": + case "PrivateIdentifier": return left.name === right.name; case "Literal": return equalLiteralValue(left, right); @@ -463,12 +467,12 @@ function isArrayFromMethod(node) { } /** - * Checks whether or not a node is a method which has `thisArg`. + * Checks whether or not a node is a method which expects a function as a first argument, and `thisArg` as a second argument. * @param {ASTNode} node A node to check. - * @returns {boolean} Whether or not the node is a method which has `thisArg`. + * @returns {boolean} Whether or not the node is a method which expects a function as a first argument, and `thisArg` as a second argument. */ function isMethodWhichHasThisArg(node) { - return isSpecificMemberAccess(node, null, arrayMethodPattern); + return isSpecificMemberAccess(node, null, arrayMethodWithThisArgPattern); } /** @@ -516,6 +520,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 +662,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 +758,371 @@ 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; +} + +/** + * Checks whether a node is an ExpressionStatement at the top level of a file or function body. + * A top-level ExpressionStatement node is a directive if it contains a single unparenthesized + * string literal and if it occurs either as the first sibling or immediately after another + * directive. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node is an ExpressionStatement at the top level of a + * file or function body. + */ +function isTopLevelExpressionStatement(node) { + if (node.type !== "ExpressionStatement") { + return false; + } + const parent = node.parent; + + return parent.type === "Program" || (parent.type === "BlockStatement" && isFunction(parent.parent)); + +} + +/** + * Check whether the given node is a part of a directive prologue or not. + * @param {ASTNode} node The node to check. + * @returns {boolean} `true` if the node is a part of directive prologue. + */ +function isDirective(node) { + return node.type === "ExpressionStatement" && typeof node.directive === "string"; +} + +/** + * Tests if a node appears at the beginning of an ancestor ExpressionStatement node. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether the node appears at the beginning of an ancestor ExpressionStatement node. + */ +function isStartOfExpressionStatement(node) { + const start = node.range[0]; + let ancestor = node; + + while ((ancestor = ancestor.parent) && ancestor.range[0] === start) { + if (ancestor.type === "ExpressionStatement") { + return true; + } + } + return false; +} + +/** + * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon. + * This opening parenthesis or bracket should be at the start of an `ExpressionStatement` or at the start of the body of an `ArrowFunctionExpression`. + * @type {(sourceCode: SourceCode, node: ASTNode) => boolean} + * @param {SourceCode} sourceCode The source code object. + * @param {ASTNode} node A node at the position where an opening parenthesis or bracket will be inserted. + * @returns {boolean} Whether a semicolon is required before the opening parenthesis or braket. + */ +let needsPrecedingSemicolon; + +{ + const BREAK_OR_CONTINUE = new Set(["BreakStatement", "ContinueStatement"]); + + // Declaration types that must contain a string Literal node at the end. + const DECLARATIONS = new Set(["ExportAllDeclaration", "ExportNamedDeclaration", "ImportDeclaration"]); + + const IDENTIFIER_OR_KEYWORD = new Set(["Identifier", "Keyword"]); + + // Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types. + const NODE_TYPES_BY_KEYWORD = { + __proto__: null, + break: "BreakStatement", + continue: "ContinueStatement", + debugger: "DebuggerStatement", + do: "DoWhileStatement", + else: "IfStatement", + return: "ReturnStatement", + yield: "YieldExpression" + }; + + /* + * Before an opening parenthesis, postfix `++` and `--` always trigger ASI; + * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement. + */ + const PUNCTUATORS = new Set([":", ";", "{", "=>", "++", "--"]); + + /* + * Statements that can contain an `ExpressionStatement` after a closing parenthesis. + * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis. + */ + const STATEMENTS = new Set([ + "DoWhileStatement", + "ForInStatement", + "ForOfStatement", + "ForStatement", + "IfStatement", + "WhileStatement", + "WithStatement" + ]); + + needsPrecedingSemicolon = + function(sourceCode, node) { + const prevToken = sourceCode.getTokenBefore(node); + + if (!prevToken || prevToken.type === "Punctuator" && PUNCTUATORS.has(prevToken.value)) { + return false; + } + + const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + + if (isClosingParenToken(prevToken)) { + return !STATEMENTS.has(prevNode.type); + } + + if (isClosingBraceToken(prevToken)) { + return ( + prevNode.type === "BlockStatement" && prevNode.parent.type === "FunctionExpression" || + prevNode.type === "ClassBody" && prevNode.parent.type === "ClassExpression" || + prevNode.type === "ObjectExpression" + ); + } + + if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) { + if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) { + return false; + } + + const keyword = prevToken.value; + const nodeType = NODE_TYPES_BY_KEYWORD[keyword]; + + return prevNode.type !== nodeType; + } + + if (prevToken.type === "String") { + return !DECLARATIONS.has(prevNode.parent.type); + } + + return true; + }; +} + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -794,6 +1182,7 @@ module.exports = { isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, + isEqToken, /** * Checks whether or not a given node is a string literal. @@ -836,8 +1225,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 +1243,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 +1287,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 +1303,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 +1386,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 +1487,7 @@ module.exports = { } } - /* istanbul ignore next */ + /* c8 ignore next */ return true; }, @@ -1174,7 +1579,16 @@ module.exports = { return 19; default: - return 20; + if (node.type in eslintVisitorKeys) { + return 20; + } + + /* + * if the node is not a standard node that we know about, then assume it has the lowest precedence + * this will mean that rules will wrap unknown nodes in parentheses where applicable instead of + * unwrapping them and potentially changing the meaning of the code or introducing a syntax error. + */ + return -1; } }, @@ -1233,7 +1647,6 @@ module.exports = { return directives; }, - /** * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added * after the node will be parsed as a decimal point, rather than a property-access dot. @@ -1261,7 +1674,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 +1737,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 +1754,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 +1771,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 +1782,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 +1897,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 +1912,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 +2019,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 +2123,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 +2131,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 +2158,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 +2197,10 @@ module.exports = { return true; } + if (rightToken.type === "PrivateIdentifier") { + return true; + } + return false; }, @@ -1794,6 +2250,16 @@ module.exports = { return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString); }, + /** + * Determines whether the given node is a template literal without expressions. + * @param {ASTNode} node Node to check. + * @returns {boolean} True if the node is a template literal without expressions. + */ + isStaticTemplateLiteral(node) { + return node.type === "TemplateLiteral" && node.expressions.length === 0; + }, + + isReferenceToGlobalVariable, isLogicalExpression, isCoalesceExpression, isMixedLogicalAndCoalesceExpressions, @@ -1805,5 +2271,12 @@ module.exports = { isSpecificMemberAccess, equalLiteralValue, isSameReference, - isLogicalAssignmentOperator + isLogicalAssignmentOperator, + getSwitchCaseColonToken, + getModuleExportName, + isConstant, + isTopLevelExpressionStatement, + isDirective, + isStartOfExpressionStatement, + needsPrecedingSemicolon }; 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 d426d85..7f116a2 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 9ec6938..919975f 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,15 +15,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/valid-jsdoc" }, schema: [ @@ -95,7 +96,7 @@ module.exports = { const options = context.options[0] || {}, prefer = options.prefer || {}, - sourceCode = context.getSourceCode(), + sourceCode = context.sourceCode, // these both default to true, so you have to explicitly make them false requireReturn = options.requireReturn !== false, @@ -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 a0f20f7..3818daf 100644 --- a/node_modules/eslint/lib/rules/valid-typeof.js +++ b/node_modules/eslint/lib/rules/valid-typeof.js @@ -4,21 +4,29 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("./utils/ast-utils"); + //------------------------------------------------------------------------------ // 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" + url: "https://eslint.org/docs/latest/rules/valid-typeof" }, + hasSuggestions: true, + schema: [ { type: "object", @@ -33,17 +41,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 sourceCode = context.sourceCode; 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 +83,37 @@ module.exports = { return { + Program(node) { + globalScope = sourceCode.getScope(node); + }, + UnaryExpression(node) { if (isTypeofExpression(node)) { - const parent = context.getAncestors().pop(); + const { parent } = node; - 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) { + if (sibling.type === "Literal" || astUtils.isStaticTemplateLiteral(sibling)) { 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 28ddae4..81f5d62 100644 --- a/node_modules/eslint/lib/rules/vars-on-top.js +++ b/node_modules/eslint/lib/rules/vars-on-top.js @@ -9,15 +9,15 @@ // 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" + url: "https://eslint.org/docs/latest/rules/vars-on-top" }, schema: [], @@ -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 07e5b84..5180710 100644 --- a/node_modules/eslint/lib/rules/wrap-iife.js +++ b/node_modules/eslint/lib/rules/wrap-iife.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when IIFE is not wrapped in parens * @author Ilya Volodin + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -10,7 +11,7 @@ //------------------------------------------------------------------------------ const astUtils = require("./utils/ast-utils"); -const eslintUtils = require("eslint-utils"); +const eslintUtils = require("@eslint-community/eslint-utils"); //---------------------------------------------------------------------- // Helpers @@ -37,15 +38,17 @@ function isCalleeOfNewExpression(node) { // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/wrap-iife" }, schema: [ @@ -77,7 +80,7 @@ module.exports = { const style = context.options[0] || "outside"; const includeFunctionPrototypeMethods = context.options[1] && context.options[1].functionPrototypeMethods; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if() diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js index 4ecbcec..9e2808d 100644 --- a/node_modules/eslint/lib/rules/wrap-regex.js +++ b/node_modules/eslint/lib/rules/wrap-regex.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag when regex literals are not wrapped in parens * @author Matt DuVall + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/wrap-regex" }, schema: [], @@ -29,7 +32,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; return { @@ -40,10 +43,9 @@ module.exports = { if (nodeType === "RegularExpression") { const beforeToken = sourceCode.getTokenBefore(node); const afterToken = sourceCode.getTokenAfter(node); - const ancestors = context.getAncestors(); - const grandparent = ancestors[ancestors.length - 1]; + const { parent } = node; - if (grandparent.type === "MemberExpression" && grandparent.object === node && + if (parent.type === "MemberExpression" && parent.object === node && !(beforeToken && beforeToken.value === "(" && afterToken && afterToken.value === ")")) { context.report({ node, diff --git a/node_modules/eslint/lib/rules/yield-star-spacing.js b/node_modules/eslint/lib/rules/yield-star-spacing.js index 20b8e9e..9a67b78 100644 --- a/node_modules/eslint/lib/rules/yield-star-spacing.js +++ b/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to check the spacing around the * in yield* expressions. * @author Bryan Smith + * @deprecated in ESLint v8.53.0 */ "use strict"; @@ -9,15 +10,17 @@ // Rule Definition //------------------------------------------------------------------------------ +/** @type {import('../shared/types').Rule} */ module.exports = { meta: { + deprecated: true, + replacedBy: [], 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" + url: "https://eslint.org/docs/latest/rules/yield-star-spacing" }, fixable: "whitespace", @@ -48,7 +51,7 @@ module.exports = { }, create(context) { - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; const mode = (function(option) { if (!option || typeof option === "string") { diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js index 2fca757..af8f525 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); } /** @@ -58,22 +58,13 @@ function isNegativeNumericLiteral(node) { ); } -/** - * Determines whether a node is a Template Literal which can be determined statically. - * @param {ASTNode} node Node to test - * @returns {boolean} True if the node is a Template Literal without expression. - */ -function isStaticTemplateLiteral(node) { - return node.type === "TemplateLiteral" && node.expressions.length === 0; -} - /** * Determines whether a non-Literal node should be treated as a single Literal node. * @param {ASTNode} node Node to test * @returns {boolean} True if the node should be treated as a single Literal node. */ function looksLikeLiteral(node) { - return isNegativeNumericLiteral(node) || isStaticTemplateLiteral(node); + return isNegativeNumericLiteral(node) || astUtils.isStaticTemplateLiteral(node); } /** @@ -100,7 +91,7 @@ function getNormalizedLiteral(node) { }; } - if (isStaticTemplateLiteral(node)) { + if (astUtils.isStaticTemplateLiteral(node)) { return { type: "Literal", value: node.quasis[0].value.cooked, @@ -115,15 +106,15 @@ 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" + url: "https://eslint.org/docs/latest/rules/yoda" }, schema: [ @@ -162,7 +153,7 @@ module.exports = { const onlyEquality = context.options[1] && context.options[1].onlyEquality; - const sourceCode = context.getSourceCode(); + const sourceCode = context.sourceCode; /** * Determines whether node represents a range test. @@ -343,7 +334,7 @@ module.exports = { ) && !(!isEqualityOperator(node.operator) && onlyEquality) && isComparisonOperator(node.operator) && - !(exceptRange && isRangeTest(context.getAncestors().pop())) + !(exceptRange && isRangeTest(node.parent)) ) { context.report({ node, diff --git a/node_modules/eslint/lib/shared/ajv.js b/node_modules/eslint/lib/shared/ajv.js index 3fb0fbd..f4f6a62 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 03b32f1..47353ac 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 1a0501a..d09cafb 100644 --- a/node_modules/eslint/lib/shared/deprecation-warnings.js +++ b/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -17,14 +17,7 @@ const path = require("path"); // 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(); diff --git a/node_modules/eslint/lib/shared/logging.js b/node_modules/eslint/lib/shared/logging.js index 6aa1f5a..fd5e8a6 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 cd743f3..18a6949 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 aa5eff7..b99ad10 100644 --- a/node_modules/eslint/lib/shared/runtime-info.js +++ b/node_modules/eslint/lib/shared/runtime-info.js @@ -40,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) { @@ -73,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) { @@ -90,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"); diff --git a/node_modules/eslint/lib/shared/string-utils.js b/node_modules/eslint/lib/shared/string-utils.js index e4a55d7..ed0781e 100644 --- a/node_modules/eslint/lib/shared/string-utils.js +++ b/node_modules/eslint/lib/shared/string-utils.js @@ -5,6 +5,26 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const Graphemer = require("graphemer").default; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +// eslint-disable-next-line no-control-regex -- intentionally including control characters +const ASCII_REGEX = /^[\u0000-\u007f]*$/u; + +/** @type {Graphemer | undefined} */ +let splitter; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + /** * Converts the first letter of a string to uppercase. * @param {string} string The string to operate on @@ -17,6 +37,24 @@ function upperCaseFirst(string) { return string[0].toUpperCase() + string.slice(1); } +/** + * Counts graphemes in a given string. + * @param {string} value A string to count graphemes. + * @returns {number} The number of graphemes in `value`. + */ +function getGraphemeCount(value) { + if (ASCII_REGEX.test(value)) { + return value.length; + } + + if (!splitter) { + splitter = new Graphemer(); + } + + return splitter.countGraphemes(value); +} + module.exports = { - upperCaseFirst + upperCaseFirst, + getGraphemeCount }; diff --git a/node_modules/eslint/lib/shared/traverser.js b/node_modules/eslint/lib/shared/traverser.js index 32f7677..38b4e21 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 c3b76e4..e3a40bc 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|15|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024} [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,37 @@ 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 {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} [messageId] The ID of the message in the rule's meta. + * @property {(string|null)} nodeType Type of node * @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} [messageId] The ID of the message in the rule's meta. + * @property {(string|null)} nodeType Type of node + * @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 +140,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 +150,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 +177,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 cc4524f..236f6b5 100644 --- a/node_modules/eslint/lib/source-code/source-code.js +++ b/node_modules/eslint/lib/source-code/source-code.js @@ -9,15 +9,31 @@ //------------------------------------------------------------------------------ const - { isCommentToken } = require("eslint-utils"), + { isCommentToken } = require("@eslint-community/eslint-utils"), TokenStore = require("./token-store"), astUtils = require("../shared/ast-utils"), - Traverser = require("../shared/traverser"); + Traverser = require("../shared/traverser"), + globals = require("../../conf/globals"), + { + directivesPattern + } = require("../shared/directives"), + + /* eslint-disable-next-line n/no-restricted-require -- Too messy to figure out right now. */ + ConfigCommentParser = require("../linter/config-comment-parser"), + eslintScope = require("eslint-scope"); + +//------------------------------------------------------------------------------ +// Type Definitions +//------------------------------------------------------------------------------ + +/** @typedef {import("eslint-scope").Variable} Variable */ //------------------------------------------------------------------------------ // Private //------------------------------------------------------------------------------ +const commentParser = new ConfigCommentParser(); + /** * Validates that the given AST has the required information. * @param {ASTNode} ast The Program node of the AST to check. @@ -43,6 +59,29 @@ function validate(ast) { } } +/** + * 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}`]; + } +} + /** * Check to see if its a ES6 export declaration. * @param {ASTNode} astNode An AST node. @@ -77,6 +116,36 @@ function sortedMerge(tokens, comments) { return result; } +/** + * 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')`); + } +} + /** * Determines if two nodes or tokens overlap. * @param {ASTNode|Token} first The first node or token to check. @@ -139,14 +208,110 @@ function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) { return false; } +//----------------------------------------------------------------------------- +// Directive Comments +//----------------------------------------------------------------------------- + +/** + * Ensures that variables representing built-in properties of the Global Object, + * and any globals declared by special block comments, are present in the global + * scope. + * @param {Scope} globalScope The global scope. + * @param {Object|undefined} configGlobals The globals declared in configuration + * @param {Object|undefined} inlineGlobals The globals declared in the source code + * @returns {void} + */ +function addDeclaredGlobals(globalScope, configGlobals = {}, inlineGlobals = {}) { + + // Define configured global variables. + for (const id of new Set([...Object.keys(configGlobals), ...Object.keys(inlineGlobals)])) { + + /* + * `normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would + * typically be caught when validating a config anyway (validity for inline global comments is checked separately). + */ + const configValue = configGlobals[id] === void 0 ? void 0 : normalizeConfigGlobal(configGlobals[id]); + const commentValue = inlineGlobals[id] && inlineGlobals[id].value; + const value = commentValue || configValue; + const sourceComments = inlineGlobals[id] && inlineGlobals[id].comments; + + if (value === "off") { + continue; + } + + let variable = globalScope.set.get(id); + + if (!variable) { + variable = new eslintScope.Variable(id, globalScope); + + globalScope.variables.push(variable); + globalScope.set.set(id, variable); + } + + variable.eslintImplicitGlobalSetting = configValue; + variable.eslintExplicitGlobal = sourceComments !== void 0; + variable.eslintExplicitGlobalComments = sourceComments; + variable.writeable = (value === "writable"); + } + + /* + * "through" contains all references which definitions cannot be found. + * Since we augment the global scope using configuration, we need to update + * references and remove the ones that were added by configuration. + */ + globalScope.through = globalScope.through.filter(reference => { + const name = reference.identifier.name; + const variable = globalScope.set.get(name); + + if (variable) { + + /* + * Links the variable and the reference. + * And this reference is removed from `Scope#through`. + */ + reference.resolved = variable; + variable.references.push(reference); + + return false; + } + + return true; + }); +} + +/** + * Sets the given variable names as exported so they won't be triggered by + * the `no-unused-vars` rule. + * @param {eslint.Scope} globalScope The global scope to define exports in. + * @param {Record} variables An object whose keys are the variable + * names to export. + * @returns {void} + */ +function markExportedVariables(globalScope, variables) { + + Object.keys(variables).forEach(name => { + const variable = globalScope.set.get(name); + + if (variable) { + variable.eslintUsed = true; + variable.eslintExported = true; + } + }); + +} + //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ +const caches = Symbol("caches"); + +/** + * 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. @@ -173,22 +338,31 @@ class SourceCode extends TokenStore { validate(ast); super(ast.tokens, ast.comments); + /** + * General purpose caching for the class. + */ + this[caches] = new Map([ + ["scopes", new WeakMap()], + ["vars", new Map()], + ["configNodes", void 0] + ]); + /** * 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; @@ -223,7 +397,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]; @@ -249,7 +423,7 @@ class SourceCode extends TokenStore { // Cache for comments found using getComments(). this._commentCache = new WeakMap(); - // don't allow modification of this object + // don't allow further modification of this object Object.freeze(this); Object.freeze(this.lines); } @@ -506,6 +680,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 */ @@ -545,6 +720,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 */ @@ -582,6 +760,296 @@ class SourceCode extends TokenStore { return positionIndex; } + + /** + * Gets the scope for the given node + * @param {ASTNode} currentNode The node to get the scope of + * @returns {eslint-scope.Scope} The scope information for this node + * @throws {TypeError} If the `currentNode` argument is missing. + */ + getScope(currentNode) { + + if (!currentNode) { + throw new TypeError("Missing required argument: node."); + } + + // check cache first + const cache = this[caches].get("scopes"); + const cachedScope = cache.get(currentNode); + + if (cachedScope) { + return cachedScope; + } + + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== "Program"; + + for (let node = currentNode; node; node = node.parent) { + const scope = this.scopeManager.acquire(node, inner); + + if (scope) { + if (scope.type === "function-expression-name") { + cache.set(currentNode, scope.childScopes[0]); + return scope.childScopes[0]; + } + + cache.set(currentNode, scope); + return scope; + } + } + + cache.set(currentNode, this.scopeManager.scopes[0]); + return this.scopeManager.scopes[0]; + } + + /** + * Get the variables that `node` defines. + * This is a convenience method that passes through + * to the same method on the `scopeManager`. + * @param {ASTNode} node The node for which the variables are obtained. + * @returns {Array} An array of variable nodes representing + * the variables that `node` defines. + */ + getDeclaredVariables(node) { + return this.scopeManager.getDeclaredVariables(node); + } + + /* eslint-disable class-methods-use-this -- node is owned by SourceCode */ + /** + * Gets all the ancestors of a given node + * @param {ASTNode} node The node + * @returns {Array} All the ancestor nodes in the AST, not including the provided node, starting + * from the root node at index 0 and going inwards to the parent node. + * @throws {TypeError} When `node` is missing. + */ + getAncestors(node) { + + if (!node) { + throw new TypeError("Missing required argument: node."); + } + + const ancestorsStartingAtParent = []; + + for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + ancestorsStartingAtParent.push(ancestor); + } + + return ancestorsStartingAtParent.reverse(); + } + /* eslint-enable class-methods-use-this -- node is owned by SourceCode */ + + /** + * Marks a variable as used in the current scope + * @param {string} name The name of the variable to mark as used. + * @param {ASTNode} [refNode] The closest node to the variable reference. + * @returns {boolean} True if the variable was found and marked as used, false if not. + */ + markVariableAsUsed(name, refNode = this.ast) { + + const currentScope = this.getScope(refNode); + let initialScope = currentScope; + + /* + * When we are in an ESM or CommonJS module, we need to start searching + * from the top-level scope, not the global scope. For ESM the top-level + * scope is the module scope; for CommonJS the top-level scope is the + * outer function scope. + * + * Without this check, we might miss a variable declared with `var` at + * the top-level because it won't exist in the global scope. + */ + if ( + currentScope.type === "global" && + currentScope.childScopes.length > 0 && + + // top-level scopes refer to a `Program` node + currentScope.childScopes[0].block === this.ast + ) { + initialScope = currentScope.childScopes[0]; + } + + for (let scope = initialScope; scope; scope = scope.upper) { + const variable = scope.variables.find(scopeVar => scopeVar.name === name); + + if (variable) { + variable.eslintUsed = true; + return true; + } + } + + return false; + } + + + /** + * Returns an array of all inline configuration nodes found in the + * source code. + * @returns {Array} An array of all inline configuration nodes. + */ + getInlineConfigNodes() { + + // check the cache first + let configNodes = this[caches].get("configNodes"); + + if (configNodes) { + return configNodes; + } + + // calculate fresh config nodes + configNodes = this.ast.comments.filter(comment => { + + // shebang comments are never directives + if (comment.type === "Shebang") { + return false; + } + + const { directivePart } = commentParser.extractDirectiveComment(comment.value); + + const directiveMatch = directivesPattern.exec(directivePart); + + if (!directiveMatch) { + return false; + } + + // only certain comment types are supported as line comments + return comment.type !== "Line" || !!/^eslint-disable-(next-)?line$/u.test(directiveMatch[1]); + }); + + this[caches].set("configNodes", configNodes); + + return configNodes; + } + + /** + * Applies language options sent in from the core. + * @param {Object} languageOptions The language options for this run. + * @returns {void} + */ + applyLanguageOptions(languageOptions) { + + /* + * Add configured globals and language globals + * + * Using Object.assign instead of object spread for performance reasons + * https://github.com/eslint/eslint/issues/16302 + */ + const configGlobals = Object.assign( + {}, + getGlobalsForEcmaVersion(languageOptions.ecmaVersion), + languageOptions.sourceType === "commonjs" ? globals.commonjs : void 0, + languageOptions.globals + ); + const varsCache = this[caches].get("vars"); + + varsCache.set("configGlobals", configGlobals); + } + + /** + * Applies configuration found inside of the source code. This method is only + * called when ESLint is running with inline configuration allowed. + * @returns {{problems:Array,configs:{config:FlatConfigArray,node:ASTNode}}} Information + * that ESLint needs to further process the inline configuration. + */ + applyInlineConfig() { + + const problems = []; + const configs = []; + const exportedVariables = {}; + const inlineGlobals = Object.create(null); + + this.getInlineConfigNodes().forEach(comment => { + + const { directiveText, directiveValue } = commentParser.parseDirective(comment); + + switch (directiveText) { + case "exported": + Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment)); + break; + + case "globals": + case "global": + for (const [id, { value }] of Object.entries(commentParser.parseStringConfig(directiveValue, comment))) { + let normalizedValue; + + try { + normalizedValue = normalizeConfigGlobal(value); + } catch (err) { + problems.push({ + ruleId: null, + loc: comment.loc, + message: err.message + }); + continue; + } + + if (inlineGlobals[id]) { + inlineGlobals[id].comments.push(comment); + inlineGlobals[id].value = normalizedValue; + } else { + inlineGlobals[id] = { + comments: [comment], + value: normalizedValue + }; + } + } + break; + + case "eslint": { + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); + + if (parseResult.success) { + configs.push({ + config: { + rules: parseResult.config + }, + node: comment + }); + } else { + problems.push(parseResult.error); + } + + break; + } + + // no default + } + }); + + // save all the new variables for later + const varsCache = this[caches].get("vars"); + + varsCache.set("inlineGlobals", inlineGlobals); + varsCache.set("exportedVariables", exportedVariables); + + return { + configs, + problems + }; + } + + /** + * Called by ESLint core to indicate that it has finished providing + * information. We now add in all the missing variables and ensure that + * state-changing methods cannot be called by rules. + * @returns {void} + */ + finalize() { + + // Step 1: ensure that all of the necessary variables are up to date + const varsCache = this[caches].get("vars"); + const globalScope = this.scopeManager.scopes[0]; + const configGlobals = varsCache.get("configGlobals"); + const inlineGlobals = varsCache.get("inlineGlobals"); + const exportedVariables = varsCache.get("exportedVariables"); + + addDeclaredGlobals(globalScope, configGlobals, inlineGlobals); + + if (exportedVariables) { + markExportedVariables(globalScope, exportedVariables); + } + + } + } module.exports = SourceCode; 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 4e1595c..0b72600 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 25db8a4..46a96b2 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 a2bd77d..3e01470 100644 --- a/node_modules/eslint/lib/source-code/token-store/utils.js +++ b/node_modules/eslint/lib/source-code/token-store/utils.js @@ -4,20 +4,6 @@ */ "use strict"; -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Gets `token.range[0]` from the given token. - * @param {Node|Token|Comment} token The token to get. - * @returns {number} The start location. - * @private - */ -function getStartLocation(token) { - return token.range[0]; -} - //------------------------------------------------------------------------------ // Exports //------------------------------------------------------------------------------ @@ -30,9 +16,28 @@ function getStartLocation(token) { * @returns {number} The found index or `tokens.length`. */ exports.search = function search(tokens, location) { - const index = tokens.findIndex(el => location <= getStartLocation(el)); + for (let minIndex = 0, maxIndex = tokens.length - 1; minIndex <= maxIndex;) { - return index === -1 ? tokens.length : index; + /* + * Calculate the index in the middle between minIndex and maxIndex. + * `| 0` is used to round a fractional value down to the nearest integer: this is similar to + * using `Math.trunc()` or `Math.floor()`, but performance tests have shown this method to + * be faster. + */ + const index = (minIndex + maxIndex) / 2 | 0; + const token = tokens[index]; + const tokenStartLocation = token.range[0]; + + if (location <= tokenStartLocation) { + if (index === minIndex) { + return index; + } + maxIndex = index; + } else { + minIndex = index + 1; + } + } + return tokens.length; }; /** @@ -49,13 +54,18 @@ exports.getFirstIndex = function getFirstIndex(tokens, indexMap, startLoc) { } if ((startLoc - 1) in indexMap) { const index = indexMap[startLoc - 1]; - const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + const token = tokens[index]; + + // If the mapped index is out of bounds, the returned cursor index will point after the end of the tokens array. + if (!token) { + return tokens.length; + } /* * For the map of "comment's location -> token's index", it points the next token of a comment. * In that case, +1 is unnecessary. */ - if (token && token.range[0] >= startLoc) { + if (token.range[0] >= startLoc) { return index; } return index + 1; @@ -77,13 +87,18 @@ exports.getLastIndex = function getLastIndex(tokens, indexMap, endLoc) { } if ((endLoc - 1) in indexMap) { const index = indexMap[endLoc - 1]; - const token = (index >= 0 && index < tokens.length) ? tokens[index] : null; + const token = tokens[index]; + + // If the mapped index is out of bounds, the returned cursor index will point before the end of the tokens array. + if (!token) { + return tokens.length - 1; + } /* * For the map of "comment's location -> token's index", it points the next token of a comment. * In that case, -1 is necessary. */ - if (token && token.range[1] > endLoc) { + if (token.range[1] > endLoc) { return index - 1; } return index; diff --git a/node_modules/eslint/messages/all-files-ignored.js b/node_modules/eslint/messages/all-files-ignored.js index d85828d..70877a4 100644 --- a/node_modules/eslint/messages/all-files-ignored.js +++ b/node_modules/eslint/messages/all-files-ignored.js @@ -12,5 +12,5 @@ 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. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/extend-config-missing.js b/node_modules/eslint/messages/extend-config-missing.js index db8a5c6..5b3498f 100644 --- a/node_modules/eslint/messages/extend-config-missing.js +++ b/node_modules/eslint/messages/extend-config-missing.js @@ -9,5 +9,5 @@ ESLint couldn't find the config "${configName}" to extend from. Please check tha 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. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/failed-to-read-json.js b/node_modules/eslint/messages/failed-to-read-json.js index 5114de3..e7c6cb5 100644 --- a/node_modules/eslint/messages/failed-to-read-json.js +++ b/node_modules/eslint/messages/failed-to-read-json.js @@ -7,5 +7,5 @@ module.exports = function(it) { Failed to read JSON file at ${path}: ${message} -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/file-not-found.js b/node_modules/eslint/messages/file-not-found.js index 26a5d57..1a62fcf 100644 --- a/node_modules/eslint/messages/file-not-found.js +++ b/node_modules/eslint/messages/file-not-found.js @@ -6,5 +6,5 @@ module.exports = function(it) { return ` No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found. Please check for typing mistakes in the pattern. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/no-config-found.js b/node_modules/eslint/messages/no-config-found.js index 1042143..21cf549 100644 --- a/node_modules/eslint/messages/no-config-found.js +++ b/node_modules/eslint/messages/no-config-found.js @@ -6,10 +6,10 @@ module.exports = function(it) { return ` ESLint couldn't find a configuration file. To set up a configuration file for this project, please run: - eslint --init + 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 chat room: https://eslint.org/chat/help -`.trimLeft(); +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/plugin-invalid.js b/node_modules/eslint/messages/plugin-invalid.js index 7913576..8b471d4 100644 --- a/node_modules/eslint/messages/plugin-invalid.js +++ b/node_modules/eslint/messages/plugin-invalid.js @@ -12,5 +12,5 @@ module.exports = function(it) { "${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. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/plugin-missing.js b/node_modules/eslint/messages/plugin-missing.js index f58c78c..0b7d34e 100644 --- a/node_modules/eslint/messages/plugin-missing.js +++ b/node_modules/eslint/messages/plugin-missing.js @@ -15,5 +15,5 @@ It's likely that the plugin isn't installed correctly. Try reinstalling by runni 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. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/messages/print-config-with-directory-path.js b/node_modules/eslint/messages/print-config-with-directory-path.js index 6a5d571..4559c8d 100644 --- a/node_modules/eslint/messages/print-config-with-directory-path.js +++ b/node_modules/eslint/messages/print-config-with-directory-path.js @@ -3,6 +3,6 @@ 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/user-guide/command-line-interface#--print-config -`.trimLeft(); +See also: https://eslint.org/docs/latest/use/command-line-interface#--print-config +`.trimStart(); }; diff --git a/node_modules/eslint/messages/whitespace-found.js b/node_modules/eslint/messages/whitespace-found.js index 4ce49ca..8a801bc 100644 --- a/node_modules/eslint/messages/whitespace-found.js +++ b/node_modules/eslint/messages/whitespace-found.js @@ -7,5 +7,5 @@ module.exports = function(it) { 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. -`.trimLeft(); +`.trimStart(); }; diff --git a/node_modules/eslint/node_modules/.bin/semver b/node_modules/eslint/node_modules/.bin/semver deleted file mode 120000 index 5aaadf4..0000000 --- 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/LICENSE b/node_modules/eslint/node_modules/@babel/code-frame/LICENSE deleted file mode 100644 index f31575e..0000000 --- a/node_modules/eslint/node_modules/@babel/code-frame/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2014-present Sebastian McKenzie and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/eslint/node_modules/@babel/code-frame/README.md b/node_modules/eslint/node_modules/@babel/code-frame/README.md deleted file mode 100644 index 08cacb0..0000000 --- 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 28d86f7..0000000 --- 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 07a28a6..0000000 --- a/node_modules/eslint/node_modules/@babel/code-frame/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@babel/code-frame", - "version": "7.12.11", - "description": "Generate errors that contain a code frame that point to source locations.", - "author": "Sebastian McKenzie ", - "homepage": "https://babeljs.io/", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "https://github.com/babel/babel.git", - "directory": "packages/babel-code-frame" - }, - "main": "lib/index.js", - "dependencies": { - "@babel/highlight": "^7.10.4" - }, - "devDependencies": { - "@types/chalk": "^2.0.0", - "chalk": "^2.0.0", - "strip-ansi": "^4.0.0" - } -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/semver/LICENSE b/node_modules/eslint/node_modules/semver/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/eslint/node_modules/semver/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/eslint/node_modules/semver/README.md b/node_modules/eslint/node_modules/semver/README.md deleted file mode 100644 index ede7b7d..0000000 --- a/node_modules/eslint/node_modules/semver/README.md +++ /dev/null @@ -1,654 +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 semverSimplifyRange = require('semver/ranges/simplify') -const semverRangeSubset = require('semver/ranges/subset') -``` - -As a command-line utility: - -``` -$ semver -h - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --n <0|1> - This is the base to be used for the prerelease identifier. - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them. -``` - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` that specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and -would match the versions `2.0.0` and `3.1.0`, but not the versions -`1.0.1` or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. -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 of 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 -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 range-matching) -by setting the `includePrerelease` flag on the options -object to any -[functions](https://github.com/npm/node-semver#functions) that do -range matching. - -#### Prerelease Identifiers - -The method `.inc` takes an additional `identifier` string argument that -will append the value of the string as a prerelease identifier: - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta') -// '1.2.4-beta.0' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```bash -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -#### Prerelease Identifier Base - -The method `.inc` takes an optional parameter 'identifierBase' string -that will let you let your prerelease number as zero-based or one-based. -Set to `false` to omit the prerelease number altogether. -If you do not specify this parameter, it will default to zero-based. - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta', '1') -// '1.2.4-beta.1' -``` - -```javascript -semver.inc('1.2.3', 'prerelease', 'beta', false) -// '1.2.4-beta' -``` - -command-line example: - -```bash -$ semver 1.2.3 -i prerelease --preid beta -n 1 -1.2.4-beta.1 -``` - -```bash -$ semver 1.2.3 -i prerelease --preid beta -n false -1.2.4-beta -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless - `includePrerelease` is specified, in which case any version at all - satisfies) -* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero element in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0-0` -* `^0.2.3` := `>=0.2.3 <0.3.0-0` -* `^0.0.3` := `>=0.0.3 <0.0.4-0` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0-0` -* `^0.0.x` := `>=0.0.0 <0.1.0-0` -* `^0.0` := `>=0.0.0 <0.1.0-0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0-0` -* `^0.x` := `>=0.0.0 <1.0.0-0` - -### Range Grammar - -Putting all this together, here is a Backus-Naur grammar for ranges, -for the benefit of parser authors: - -```bnf -range-set ::= range ( logical-or range ) * -logical-or ::= ( ' ' ) * '||' ( ' ' ) * -range ::= hyphen | simple ( ' ' simple ) * | '' -hyphen ::= partial ' - ' partial -simple ::= primitive | partial | tilde | caret -primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial -partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? -xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * -tilde ::= '~' partial -caret ::= '^' partial -qualifier ::= ( '-' pre )? ( '+' build )? -pre ::= parts -build ::= parts -parts ::= part ( '.' part ) * -part ::= nr | [-0-9A-Za-z]+ -``` - -## Functions - -All methods and classes take a final `options` object argument. All -options in this object are `false` by default. The options supported -are: - -- `loose`: Be more forgiving about not-quite-valid semver strings. - (Any resulting output will always be 100% strict compliant, of - course.) For backwards compatibility reasons, if the `options` - argument is a boolean value instead of an object, it is interpreted - to be the `loose` param. -- `includePrerelease`: Set to suppress the [default - behavior](https://github.com/npm/node-semver#prerelease-tags) of - excluding prerelease tagged versions from ranges unless they are - explicitly opted into. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release, options, identifier, identifierBase)`: - 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, `prerelease` will work the - same as `prepatch`. It increments the patch version and then makes a - prerelease. If the input version is already a prerelease it simply - increments it. - * `identifier` can be used to prefix `premajor`, `preminor`, - `prepatch`, or `prerelease` version increments. `identifierBase` - is the base to be used for the `prerelease` identifier. -* `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 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()`. -* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`. -* `diff(v1, v2)`: Returns the difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - -### Sorting - -* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` - function. -* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on - the `compareBuild` function in descending order. - -### 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 match - the given range. -* `gtr(version, range)`: Return `true` if the version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if the 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 range comparators intersect. -* `simplifyRange(versions, range)`: Return a "simplified" range that - matches the same items in the `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 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. - -If the `options.includePrerelease` flag is set, then the `coerce` result will contain -prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2` -will preserve prerelease `rc.1` and build `rev.2` in the result. - -### Clean - -* `clean(version)`: Clean a string to be a valid semver if possible - -This will return a cleaned and trimmed semver version. If the provided -version is not valid a null will be returned. This does not work for -ranges. - -ex. -* `s.clean(' = v 2.1.5foo')`: `null` -* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean(' = v 2.1.5-foo')`: `null` -* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` -* `s.clean('=v2.1.5')`: `'2.1.5'` -* `s.clean(' =v2.1.5')`: `'2.1.5'` -* `s.clean(' 2.1.5 ')`: `'2.1.5'` -* `s.clean('~1.0.0')`: `null` - -## Constants - -As a convenience, helper constants are exported to provide information about what `node-semver` supports: - -### `RELEASE_TYPES` - -- major -- premajor -- minor -- preminor -- patch -- prepatch -- prerelease - -``` -const semver = require('semver'); - -if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { - console.log('This is a valid release type!'); -} else { - console.warn('This is NOT a valid release type!'); -} -``` - -### `SEMVER_SPEC_VERSION` - -2.0.0 - -``` -const semver = require('semver'); - -console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); -``` - -## Exported Modules - - - -You may pull in just the part of this semver utility that you need if you -are sensitive to packing and tree-shaking concerns. The main -`require('semver')` export uses getter functions to lazily load the parts -of the API that are used. - -The following modules are available: - -* `require('semver')` -* `require('semver/classes')` -* `require('semver/classes/comparator')` -* `require('semver/classes/range')` -* `require('semver/classes/semver')` -* `require('semver/functions/clean')` -* `require('semver/functions/cmp')` -* `require('semver/functions/coerce')` -* `require('semver/functions/compare')` -* `require('semver/functions/compare-build')` -* `require('semver/functions/compare-loose')` -* `require('semver/functions/diff')` -* `require('semver/functions/eq')` -* `require('semver/functions/gt')` -* `require('semver/functions/gte')` -* `require('semver/functions/inc')` -* `require('semver/functions/lt')` -* `require('semver/functions/lte')` -* `require('semver/functions/major')` -* `require('semver/functions/minor')` -* `require('semver/functions/neq')` -* `require('semver/functions/parse')` -* `require('semver/functions/patch')` -* `require('semver/functions/prerelease')` -* `require('semver/functions/rcompare')` -* `require('semver/functions/rsort')` -* `require('semver/functions/satisfies')` -* `require('semver/functions/sort')` -* `require('semver/functions/valid')` -* `require('semver/ranges/gtr')` -* `require('semver/ranges/intersects')` -* `require('semver/ranges/ltr')` -* `require('semver/ranges/max-satisfying')` -* `require('semver/ranges/min-satisfying')` -* `require('semver/ranges/min-version')` -* `require('semver/ranges/outside')` -* `require('semver/ranges/simplify')` -* `require('semver/ranges/subset')` -* `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 f62b566..0000000 --- a/node_modules/eslint/node_modules/semver/bin/semver.js +++ /dev/null @@ -1,188 +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 - -let identifierBase - -const semver = require('../') -const parseOptions = require('../internal/parse-options') - -let reverse = false - -let options = {} - -const main = () => { - if (!argv.length) { - return help() - } - while (argv.length) { - let a = argv.shift() - const indexOfEqualSign = a.indexOf('=') - if (indexOfEqualSign !== -1) { - const value = a.slice(indexOfEqualSign + 1) - a = a.slice(0, indexOfEqualSign) - argv.unshift(value) - } - switch (a) { - case '-rv': case '-rev': case '--rev': case '--reverse': - reverse = true - break - case '-l': case '--loose': - loose = true - break - case '-p': case '--include-prerelease': - includePrerelease = true - break - case '-v': case '--version': - versions.push(argv.shift()) - break - case '-i': case '--inc': case '--increment': - switch (argv[0]) { - case 'major': case 'minor': case 'patch': case 'prerelease': - case 'premajor': case 'preminor': case 'prepatch': - inc = argv.shift() - break - default: - inc = 'patch' - break - } - break - case '--preid': - identifier = argv.shift() - break - case '-r': case '--range': - range.push(argv.shift()) - break - case '-n': - identifierBase = argv.shift() - if (identifierBase === 'false') { - identifierBase = false - } - break - case '-c': case '--coerce': - coerce = true - break - case '--rtl': - rtl = true - break - case '--ltr': - rtl = false - break - case '-h': case '--help': case '-?': - return help() - default: - versions.push(a) - break - } - } - - options = parseOptions({ loose, includePrerelease, rtl }) - - versions = versions.map((v) => { - return coerce ? (semver.coerce(v, options) || { version: v }).version : v - }).filter((v) => { - return semver.valid(v) - }) - if (!versions.length) { - return fail() - } - if (inc && (versions.length !== 1 || range.length)) { - return failInc() - } - - for (let i = 0, l = range.length; i < l; i++) { - versions = versions.filter((v) => { - return semver.satisfies(v, range[i], options) - }) - if (!versions.length) { - return fail() - } - } - versions - .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options)) - .map(v => semver.clean(v, options)) - .map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v) - .forEach(v => console.log(v)) -} - -const failInc = () => { - console.error('--inc can only be used on a single version with no range') - fail() -} - -const fail = () => process.exit(1) - -const help = () => console.log( -`SemVer ${version} - -A JavaScript implementation of the https://semver.org/ specification -Copyright Isaac Z. Schlueter - -Usage: semver [options] [ [...]] -Prints valid versions sorted by SemVer precedence - -Options: --r --range - Print versions that match the specified range. - --i --increment [] - Increment a version by the specified level. Level can - be one of: major, minor, patch, premajor, preminor, - prepatch, or prerelease. Default level is 'patch'. - Only one version may be specified. - ---preid - Identifier to be used to prefix premajor, preminor, - prepatch or prerelease version increments. - --l --loose - Interpret versions and ranges loosely - --p --include-prerelease - Always include prerelease versions in range matching - --c --coerce - Coerce a string into SemVer if possible - (does not imply --loose) - ---rtl - Coerce version strings right to left - ---ltr - Coerce version strings left to right (default) - --n - Base number to be used for the prerelease identifier. - Can be either 0 or 1, or false to omit the number altogether. - Defaults to 0. - -Program exits successfully if any valid version satisfies -all supplied ranges, and prints all satisfying versions. - -If no satisfying versions are found, then exits failure. - -Versions are printed in ascending order, so supplying -multiple versions to the utility will just sort them.`) - -main() diff --git a/node_modules/eslint/node_modules/semver/classes/comparator.js b/node_modules/eslint/node_modules/semver/classes/comparator.js deleted file mode 100644 index 3d39c0e..0000000 --- a/node_modules/eslint/node_modules/semver/classes/comparator.js +++ /dev/null @@ -1,141 +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 - } - } - - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - options = parseOptions(options) - - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false - } -} - -module.exports = Comparator - -const parseOptions = require('../internal/parse-options') -const { safeRe: re, t } = require('../internal/re') -const cmp = require('../functions/cmp') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const Range = require('./range') diff --git a/node_modules/eslint/node_modules/semver/classes/index.js b/node_modules/eslint/node_modules/semver/classes/index.js deleted file mode 100644 index 5e3f5c9..0000000 --- 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 ceee231..0000000 --- a/node_modules/eslint/node_modules/semver/classes/range.js +++ /dev/null @@ -1,554 +0,0 @@ -const SPACE_CHARACTERS = /\s+/g - -// 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.formatted = undefined - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') - - // First, split on || - this.set = this.raw - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.formatted = undefined - } - - get range () { - if (this.formatted === undefined) { - this.formatted = '' - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += '||' - } - const comps = this.set[i] - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += ' ' - } - this.formatted += comps[k].toString().trim() - } - } - } - return this.formatted - } - - format () { - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} - -module.exports = Range - -const LRU = require('../internal/lrucache') -const cache = new LRU() - -const parseOptions = require('../internal/parse-options') -const Comparator = require('./comparator') -const debug = require('../internal/debug') -const SemVer = require('./semver') -const { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = require('../internal/re') -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -// TODO build? -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr) => { - 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 13e66ce..0000000 --- a/node_modules/eslint/node_modules/semver/classes/semver.js +++ /dev/null @@ -1,302 +0,0 @@ -const debug = require('../internal/debug') -const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') -const { safeRe: re, t } = require('../internal/re') - -const parseOptions = require('../internal/parse-options') -const { compareIdentifiers } = require('../internal/identifiers') -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('build compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier, identifierBase) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier, identifierBase) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier, identifierBase) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) - } - this.inc('pre', identifier, identifierBase) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - - if (this.prerelease.length === 0) { - this.prerelease = [base] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease - } - } else { - this.prerelease = prerelease - } - } - break - } - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } - return this - } -} - -module.exports = SemVer diff --git a/node_modules/eslint/node_modules/semver/functions/clean.js b/node_modules/eslint/node_modules/semver/functions/clean.js deleted file mode 100644 index 811fe6b..0000000 --- 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 4011909..0000000 --- a/node_modules/eslint/node_modules/semver/functions/cmp.js +++ /dev/null @@ -1,52 +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 b378dce..0000000 --- a/node_modules/eslint/node_modules/semver/functions/coerce.js +++ /dev/null @@ -1,60 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = require('./parse') -const { safeRe: re, t } = require('../internal/re') - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(options.includePrerelease ? re[t.COERCEFULL] : 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' - // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.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. - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] - let next - while ((next = coerceRtlRegex.exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - coerceRtlRegex.lastIndex = -1 - } - - if (match === null) { - return null - } - - const major = match[2] - const minor = match[3] || '0' - const patch = match[4] || '0' - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' - const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' - - return parse(`${major}.${minor}.${patch}${prerelease}${build}`, 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 9eb881b..0000000 --- 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 4881fbe..0000000 --- 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 748b7af..0000000 --- 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 fc224e3..0000000 --- a/node_modules/eslint/node_modules/semver/functions/diff.js +++ /dev/null @@ -1,65 +0,0 @@ -const parse = require('./parse.js') - -const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { - return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' - } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' - } - - // high and low are preleases - return 'prerelease' -} - -module.exports = diff diff --git a/node_modules/eslint/node_modules/semver/functions/eq.js b/node_modules/eslint/node_modules/semver/functions/eq.js deleted file mode 100644 index 271fed9..0000000 --- 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 d9b2156..0000000 --- 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 5aeaa63..0000000 --- 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 7670b1b..0000000 --- a/node_modules/eslint/node_modules/semver/functions/inc.js +++ /dev/null @@ -1,19 +0,0 @@ -const SemVer = require('../classes/semver') - -const inc = (version, release, options, identifier, identifierBase) => { - if (typeof (options) === 'string') { - identifierBase = identifier - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version - } catch (er) { - return null - } -} -module.exports = inc diff --git a/node_modules/eslint/node_modules/semver/functions/lt.js b/node_modules/eslint/node_modules/semver/functions/lt.js deleted file mode 100644 index b440ab7..0000000 --- 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 6dcc956..0000000 --- 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 4283165..0000000 --- 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 57b3455..0000000 --- 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 f944c01..0000000 --- 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 459b3b1..0000000 --- a/node_modules/eslint/node_modules/semver/functions/parse.js +++ /dev/null @@ -1,16 +0,0 @@ -const SemVer = require('../classes/semver') -const parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version - } - try { - return new SemVer(version, options) - } catch (er) { - if (!throwErrors) { - return null - } - throw er - } -} - -module.exports = parse diff --git a/node_modules/eslint/node_modules/semver/functions/patch.js b/node_modules/eslint/node_modules/semver/functions/patch.js deleted file mode 100644 index 63afca2..0000000 --- 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 06aa132..0000000 --- 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 0ac509e..0000000 --- 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 82404c5..0000000 --- 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 50af1c1..0000000 --- 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 4d10917..0000000 --- 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 f27bae1..0000000 --- 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 86d42ac..0000000 --- a/node_modules/eslint/node_modules/semver/index.js +++ /dev/null @@ -1,89 +0,0 @@ -// just pre-load all the stuff that index.js lazily exports -const internalRe = require('./internal/re') -const constants = require('./internal/constants') -const SemVer = require('./classes/semver') -const identifiers = require('./internal/identifiers') -const parse = require('./functions/parse') -const valid = require('./functions/valid') -const clean = require('./functions/clean') -const inc = require('./functions/inc') -const diff = require('./functions/diff') -const major = require('./functions/major') -const minor = require('./functions/minor') -const patch = require('./functions/patch') -const prerelease = require('./functions/prerelease') -const compare = require('./functions/compare') -const rcompare = require('./functions/rcompare') -const compareLoose = require('./functions/compare-loose') -const compareBuild = require('./functions/compare-build') -const sort = require('./functions/sort') -const rsort = require('./functions/rsort') -const gt = require('./functions/gt') -const lt = require('./functions/lt') -const eq = require('./functions/eq') -const neq = require('./functions/neq') -const gte = require('./functions/gte') -const lte = require('./functions/lte') -const cmp = require('./functions/cmp') -const coerce = require('./functions/coerce') -const Comparator = require('./classes/comparator') -const Range = require('./classes/range') -const satisfies = require('./functions/satisfies') -const toComparators = require('./ranges/to-comparators') -const maxSatisfying = require('./ranges/max-satisfying') -const minSatisfying = require('./ranges/min-satisfying') -const minVersion = require('./ranges/min-version') -const validRange = require('./ranges/valid') -const outside = require('./ranges/outside') -const gtr = require('./ranges/gtr') -const ltr = require('./ranges/ltr') -const intersects = require('./ranges/intersects') -const simplifyRange = require('./ranges/simplify') -const subset = require('./ranges/subset') -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} diff --git a/node_modules/eslint/node_modules/semver/internal/constants.js b/node_modules/eslint/node_modules/semver/internal/constants.js deleted file mode 100644 index 94be1c5..0000000 --- a/node_modules/eslint/node_modules/semver/internal/constants.js +++ /dev/null @@ -1,35 +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 - -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - -module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, -} diff --git a/node_modules/eslint/node_modules/semver/internal/debug.js b/node_modules/eslint/node_modules/semver/internal/debug.js deleted file mode 100644 index 1c00e13..0000000 --- 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 e612d0a..0000000 --- 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/lrucache.js b/node_modules/eslint/node_modules/semver/internal/lrucache.js deleted file mode 100644 index 6d89ec9..0000000 --- a/node_modules/eslint/node_modules/semver/internal/lrucache.js +++ /dev/null @@ -1,40 +0,0 @@ -class LRUCache { - constructor () { - this.max = 1000 - this.map = new Map() - } - - get (key) { - const value = this.map.get(key) - if (value === undefined) { - return undefined - } else { - // Remove the key from the map and add it to the end - this.map.delete(key) - this.map.set(key, value) - return value - } - } - - delete (key) { - return this.map.delete(key) - } - - set (key, value) { - const deleted = this.delete(key) - - if (!deleted && value !== undefined) { - // If cache is full, delete the least recently used item - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value - this.delete(firstKey) - } - - this.map.set(key, value) - } - - return this - } -} - -module.exports = LRUCache 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 10d64ce..0000000 --- a/node_modules/eslint/node_modules/semver/internal/parse-options.js +++ /dev/null @@ -1,15 +0,0 @@ -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} -module.exports = parseOptions diff --git a/node_modules/eslint/node_modules/semver/internal/re.js b/node_modules/eslint/node_modules/semver/internal/re.js deleted file mode 100644 index fd8920e..0000000 --- a/node_modules/eslint/node_modules/semver/internal/re.js +++ /dev/null @@ -1,217 +0,0 @@ -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = require('./constants') -const debug = require('./debug') -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const safeRe = exports.safeRe = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - -const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCEPLAIN', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) -createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) -createToken('COERCEFULL', src[t.COERCEPLAIN] + - `(?:${src[t.PRERELEASE]})?` + - `(?:${src[t.BUILD]})?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) -createToken('COERCERTLFULL', src[t.COERCEFULL], 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 663d370..0000000 --- a/node_modules/eslint/node_modules/semver/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "semver", - "version": "7.6.3", - "description": "The semantic version parser used by npm.", - "main": "index.js", - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", - "benchmark": "^2.1.4", - "tap": "^16.0.0" - }, - "license": "ISC", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" - }, - "bin": { - "semver": "bin/semver.js" - }, - "files": [ - "bin/", - "lib/", - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "tap": { - "timeout": 30, - "coverage-map": "map.js", - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "engines": { - "node": ">=10" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.22.0", - "engines": ">=10", - "distPaths": [ - "classes/", - "functions/", - "internal/", - "ranges/", - "index.js", - "preload.js", - "range.bnf" - ], - "allowPaths": [ - "/classes/", - "/functions/", - "/internal/", - "/ranges/", - "/index.js", - "/preload.js", - "/range.bnf", - "/benchmarks" - ], - "publish": "true" - } -} 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 947cd4f..0000000 --- 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 d4c6ae0..0000000 --- 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 db7e355..0000000 --- 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 e0e9b7c..0000000 --- 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, options) -} -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 528a885..0000000 --- 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 6e3d993..0000000 --- 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 9b60974..0000000 --- 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 350e1f7..0000000 --- a/node_modules/eslint/node_modules/semver/ranges/min-version.js +++ /dev/null @@ -1,61 +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 ae99b10..0000000 --- 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 618d5b6..0000000 --- a/node_modules/eslint/node_modules/semver/ranges/simplify.js +++ /dev/null @@ -1,47 +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 first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} diff --git a/node_modules/eslint/node_modules/semver/ranges/subset.js b/node_modules/eslint/node_modules/semver/ranges/subset.js deleted file mode 100644 index 1e5c268..0000000 --- a/node_modules/eslint/node_modules/semver/ranges/subset.js +++ /dev/null @@ -1,247 +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 minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = minimumVersion - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset diff --git a/node_modules/eslint/node_modules/semver/ranges/to-comparators.js b/node_modules/eslint/node_modules/semver/ranges/to-comparators.js deleted file mode 100644 index 6c8bc7e..0000000 --- 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 365f356..0000000 --- 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 1845500..a51b58b 100644 --- a/node_modules/eslint/package.json +++ b/node_modules/eslint/package.json @@ -1,34 +1,53 @@ { "name": "eslint", - "version": "7.32.0", + "version": "8.57.0", "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": { "eslint": "./bin/eslint.js" }, "main": "./lib/api.js", + "exports": { + "./package.json": "./package.json", + ".": "./lib/api.js", + "./use-at-your-own-risk": "./lib/unsupported-api.js" + }, "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:docs:rule-examples": "node Makefile.js checkRuleExamples", + "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", - "lint": "node Makefile.js lint", - "fix": "node Makefile.js lint -- fix", - "fuzz": "node Makefile.js fuzz", - "generate-release": "node Makefile.js generateRelease", - "generate-alpharelease": "node Makefile.js generatePrerelease -- alpha", - "generate-betarelease": "node Makefile.js generatePrerelease -- beta", - "generate-rcrelease": "node Makefile.js generatePrerelease -- rc", - "publish-release": "node Makefile.js publishRelease", - "docs": "node Makefile.js docs", - "gensite": "node Makefile.js gensite", - "webpack": "node Makefile.js webpack", - "perf": "node Makefile.js perf" + "test:fuzz": "node Makefile.js fuzz", + "test:performance": "node Makefile.js perf" }, "gitHooks": { "pre-commit": "lint-staged" }, "lint-staged": { "*.js": "eslint --fix", - "*.md": "markdownlint" + "*.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/check-rule-examples.js", + "node tools/fetch-docs-links.js", + "git add docs/src/_data/further_reading_links.json" + ], + "docs/**/*.svg": "npx svgo -r --multipass" }, "files": [ "LICENSE", @@ -43,91 +62,105 @@ "homepage": "https://eslint.org", "bugs": "https://github.com/eslint/eslint/issues/", "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "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", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "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.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "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-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "devDependencies": { "@babel/core": "^7.4.3", "@babel/preset-env": "^7.4.3", + "@wdio/browser-runner": "^8.14.6", + "@wdio/cli": "^8.14.6", + "@wdio/concise-reporter": "^8.14.0", + "@wdio/globals": "^8.14.6", + "@wdio/mocha-framework": "^8.14.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", "eslint": "file:.", "eslint-config-eslint": "file:packages/eslint-config-eslint", - "eslint-plugin-eslint-plugin": "^3.5.3", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-eslint-plugin": "^5.2.1", "eslint-plugin-internal-rules": "file:tools/internal-rules", - "eslint-plugin-jsdoc": "^25.4.3", - "eslint-plugin-node": "^11.1.0", - "eslint-release": "^2.0.0", + "eslint-plugin-jsdoc": "^46.2.5", + "eslint-plugin-n": "^16.6.0", + "eslint-plugin-unicorn": "^49.0.0", + "eslint-release": "^3.2.0", "eslump": "^3.0.0", "esprima": "^4.0.1", - "fs-teardown": "0.1.1", + "fast-glob": "^3.2.11", + "fs-teardown": "^0.1.3", "glob": "^7.1.6", - "jsdoc": "^3.5.5", - "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", + "got": "^11.8.3", + "gray-matter": "^4.0.3", + "lint-staged": "^11.0.0", "load-perf": "^0.2.0", - "markdownlint": "^0.19.0", - "markdownlint-cli": "^0.22.0", + "markdown-it": "^12.2.0", + "markdown-it-container": "^3.0.0", + "markdownlint": "^0.32.0", + "markdownlint-cli": "^0.37.0", + "marked": "^4.0.8", "memfs": "^3.0.1", + "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", - "regenerator-runtime": "^0.13.2", + "recast": "^0.23.0", + "regenerator-runtime": "^0.14.0", + "rollup-plugin-node-polyfills": "^0.2.1", + "semver": "^7.5.3", "shelljs": "^0.8.2", - "sinon": "^9.0.1", - "temp": "^0.9.0", + "sinon": "^11.0.0", + "vite-plugin-commonjs": "^0.10.0", + "webdriverio": "^8.14.6", "webpack": "^5.23.0", "webpack-cli": "^4.5.0", "yorkie": "^2.0.0" @@ -141,6 +174,6 @@ ], "license": "MIT", "engines": { - "node": "^10.12.0 || >=12.0.0" + "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 85409ca..0000000 --- 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 72d88f8..87ace4c 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, 14 or 15 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), 2023 (same as 14) or 2024 (same as 15) to use the year-based naming. + // You can also set "latest" to use the most recently supported version. + ecmaVersion: 3, - // specify which type of script you're parsing ("script" or "module") + allowReserved: true, // only allowed when ecmaVersion is 3 + + // 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 2023 features and partially supports ECMAScript 2024 features. -Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports: +Because ECMAScript 2024 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) +* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag) 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/espree.js b/node_modules/espree/espree.js index d806952..e9b1118 100644 --- a/node_modules/espree/espree.js +++ b/node_modules/espree/espree.js @@ -1,3 +1,5 @@ +/* eslint-disable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */ + /** * @fileoverview Main Espree file that converts Acorn into Esprima output. * @@ -54,15 +56,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* eslint no-undefined:0, no-use-before-define: 0 */ -"use strict"; +/* eslint-enable jsdoc/no-multi-asterisks -- needed to preserve original formatting of licences */ + +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,12 +109,12 @@ 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. if (!options || options.tokens !== true) { - options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice } return new Parser(options, code).tokenize(); @@ -128,7 +131,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 +141,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; - -// Deep copy. /* istanbul ignore next */ -exports.Syntax = (function() { - let name, +export const VisitorKeys = (function() { + return visitorKeys.KEYS; +}()); + +// Derive node types from VisitorKeys +/* istanbul ignore next */ +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 +172,6 @@ exports.Syntax = (function() { return types; }()); -/* istanbul ignore next */ -exports.VisitorKeys = (function() { - return require("eslint-visitor-keys").KEYS; -}()); +export const latestEcmaVersion = getLatestEcmaVersion(); -exports.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 2844024..0000000 --- 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 50ca6e4..2be1b56 100644 --- a/node_modules/espree/lib/espree.js +++ b/node_modules/espree/lib/espree.js @@ -1,8 +1,8 @@ -"use strict"; +/* eslint no-param-reassign: 0 -- stylistic choice */ + +import TokenTranslator from "./token-translator.js"; +import { normalizeOptions } from "./options.js"; -/* eslint-disable no-param-reassign*/ -const TokenTranslator = require("./token-translator"); -const { normalizeOptions } = require("./options"); const STATE = Symbol("espree's internal state"); const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode"); @@ -16,12 +16,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 +52,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 +68,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 +77,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 => { + 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); + onComment(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 +172,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 +188,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; } @@ -242,7 +315,7 @@ module.exports = () => Parser => { * 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 + jsx_readString(quote) { // eslint-disable-line camelcase -- required by API const result = super.jsx_readString(quote); if (this.type === tokTypes.string) { @@ -262,21 +335,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 d1ad5f8..31467d2 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 eddca20..1460ac2 100644 --- a/node_modules/espree/lib/options.js +++ b/node_modules/espree/lib/options.js @@ -3,37 +3,54 @@ * @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 + 15 // 2024 ]; +/** + * 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 +75,11 @@ function normalizeSourceType(sourceType = "script") { if (sourceType === "script" || sourceType === "module") { return sourceType; } + + if (sourceType === "commonjs") { + return "script"; + } + throw new Error("Invalid sourceType."); } @@ -67,40 +89,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 }); + + return Object.assign({}, options, { + ecmaVersion, + sourceType, + ranges, + locations, + allowReserved, + allowReturnOutsideFunction + }); } - -/** - * 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]; -} - -//------------------------------------------------------------------------------ -// 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 f06c7c0..2a915fb 100644 --- a/node_modules/espree/lib/token-translator.js +++ b/node_modules/espree/lib/token-translator.js @@ -2,9 +2,6 @@ * @fileoverview Translates tokens between Acorn format and Esprima format. * @author Nicholas C. Zakas */ -/* eslint no-underscore-dangle: 0 */ - -"use strict"; //------------------------------------------------------------------------------ // Requirements @@ -22,6 +19,7 @@ const Token = { Boolean: "Boolean", EOF: "", Identifier: "Identifier", + PrivateIdentifier: "PrivateIdentifier", Keyword: "Keyword", Null: "Null", Numeric: "Numeric", @@ -116,6 +114,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 || @@ -178,8 +179,7 @@ TokenTranslator.prototype = { */ onToken(token, extra) { - const that = this, - tt = this._acornTokTypes, + const tt = this._acornTokTypes, tokens = extra.tokens, templateTokens = this._tokens; @@ -189,10 +189,10 @@ TokenTranslator.prototype = { * @returns {void} * @private */ - function translateTemplateTokens() { - tokens.push(convertTemplatePart(that._tokens, that._code)); - that._tokens = []; - } + const translateTemplateTokens = () => { + tokens.push(convertTemplatePart(this._tokens, this._code)); + this._tokens = []; + }; if (token.type === tt.eof) { @@ -260,4 +260,4 @@ TokenTranslator.prototype = { // Public //------------------------------------------------------------------------------ -module.exports = TokenTranslator; +export default TokenTranslator; diff --git a/node_modules/espree/lib/visitor-keys.js b/node_modules/espree/lib/visitor-keys.js deleted file mode 100644 index 4216864..0000000 --- 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/eslint-visitor-keys/CHANGELOG.md b/node_modules/espree/node_modules/eslint-visitor-keys/CHANGELOG.md deleted file mode 100644 index dc1d4b5..0000000 --- a/node_modules/espree/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/espree/node_modules/eslint-visitor-keys/LICENSE b/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE deleted file mode 100644 index 17a2553..0000000 --- a/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright contributors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/espree/node_modules/eslint-visitor-keys/README.md b/node_modules/espree/node_modules/eslint-visitor-keys/README.md deleted file mode 100644 index 250f5fa..0000000 --- a/node_modules/espree/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/espree/node_modules/eslint-visitor-keys/lib/index.js b/node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js deleted file mode 100644 index cd8a326..0000000 --- a/node_modules/espree/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/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json deleted file mode 100644 index a33bbc6..0000000 --- a/node_modules/espree/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/espree/node_modules/eslint-visitor-keys/package.json b/node_modules/espree/node_modules/eslint-visitor-keys/package.json deleted file mode 100644 index 63267be..0000000 --- a/node_modules/espree/node_modules/eslint-visitor-keys/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "eslint-visitor-keys", - "version": "1.3.0", - "description": "Constants and utilities about visitor keys to traverse AST.", - "main": "lib/index.js", - "files": [ - "lib" - ], - "engines": { - "node": ">=4" - }, - "dependencies": {}, - "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" - }, - "scripts": { - "lint": "eslint lib tests/lib", - "pretest": "npm run -s lint", - "test": "nyc mocha tests/lib", - "coverage": "nyc 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", - "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" - }, - "homepage": "https://github.com/eslint/eslint-visitor-keys#readme" -} diff --git a/node_modules/espree/package.json b/node_modules/espree/package.json index 724e6fc..12c8d0b 100644 --- a/node_modules/espree/package.json +++ b/node_modules/espree/package.json @@ -3,42 +3,57 @@ "description": "An Esprima-compatible JavaScript parser built on Acorn", "author": "Nicholas C. Zakas ", "homepage": "https://github.com/eslint/espree", - "main": "espree.js", - "version": "7.3.1", + "main": "dist/espree.cjs", + "type": "module", + "exports": { + ".": [ + { + "import": "./espree.js", + "require": "./dist/espree.cjs", + "default": "./dist/espree.cjs" + }, + "./dist/espree.cjs" + ], + "./package.json": "./package.json" + }, + "version": "9.6.1", "files": [ "lib", + "dist/espree.cjs", "espree.js" ], "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "repository": "eslint/espree", "bugs": { - "url": "http://github.com/eslint/espree.git" + "url": "https://github.com/eslint/espree/issues" }, + "funding": "https://opencollective.com/eslint", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "devDependencies": { - "browserify": "^16.5.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", - "esprima": "latest", + "@rollup/plugin-commonjs": "^17.1.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^11.2.0", + "c8": "^7.11.0", + "chai": "^4.3.6", + "eslint": "^8.44.0", + "eslint-config-eslint": "^8.0.0", + "eslint-plugin-n": "^16.0.0", + "eslint-release": "^3.2.0", "esprima-fb": "^8001.2001.0-dev-harmony-fb", - "json-diff": "^0.5.4", - "leche": "^2.3.0", - "mocha": "^6.2.0", - "nyc": "^14.1.1", - "regenerate": "^1.4.0", + "globals": "^13.20.0", + "lint-staged": "^13.2.0", + "mocha": "^9.2.2", + "npm-run-all": "^4.1.5", + "rollup": "^2.41.2", "shelljs": "^0.3.0", - "shelljs-nodecli": "^0.1.1", - "unicode-6.3.0": "^0.7.5" + "yorkie": "^2.0.0" }, "keywords": [ "ast", @@ -48,13 +63,22 @@ "syntax", "acorn" ], + "gitHooks": { + "pre-commit": "lint-staged" + }, "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "test": "npm run-script lint && node Makefile.js test", - "lint": "node Makefile.js lint", - "fixlint": "node Makefile.js lint --fix", - "sync-docs": "node Makefile.js docs", - "browserify": "node Makefile.js browserify", + "unit": "npm-run-all -s unit:*", + "unit:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'", + "unit:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs", + "test": "npm-run-all -p unit lint", + "lint": "eslint . --report-unused-disable-directives", + "fixlint": "npm run lint -- --fix", + "build": "rollup -c rollup.config.js", + "build:debug": "npm run build -- -m", + "update-version": "node tools/update-version.js", + "pretest": "npm run build", + "prepublishOnly": "npm run update-version && npm run build", + "sync-docs": "node sync-docs.js", "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha", "generate-betarelease": "eslint-generate-prerelease beta", diff --git a/node_modules/esprima/ChangeLog b/node_modules/esprima/ChangeLog deleted file mode 100644 index fafe1c9..0000000 --- a/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,235 +0,0 @@ -2018-06-17: Version 4.0.1 - - * Fix parsing async get/set in a class (issue 1861, 1875) - * Account for different return statement argument (issue 1829, 1897, 1928) - * Correct the handling of HTML comment when parsing a module (issue 1841) - * Fix incorrect parse async with proto-identifier-shorthand (issue 1847) - * Fix negative column in binary expression (issue 1844) - * Fix incorrect YieldExpression in object methods (issue 1834) - * Various documentation fixes - -2017-06-10: Version 4.0.0 - - * Support ES2017 async function and await expression (issue 1079) - * Support ES2017 trailing commas in function parameters (issue 1550) - * Explicitly distinguish parsing a module vs a script (issue 1576) - * Fix JSX non-empty container (issue 1786) - * Allow JSX element in a yield expression (issue 1765) - * Allow `in` expression in a concise body with a function body (issue 1793) - * Setter function argument must not be a rest parameter (issue 1693) - * Limit strict mode directive to functions with a simple parameter list (issue 1677) - * Prohibit any escape sequence in a reserved word (issue 1612) - * Only permit hex digits in hex escape sequence (issue 1619) - * Prohibit labelled class/generator/function declaration (issue 1484) - * Limit function declaration as if statement clause only in non-strict mode (issue 1657) - * Tolerate missing ) in a with and do-while statement (issue 1481) - -2016-12-22: Version 3.1.3 - - * Support binding patterns as rest element (issue 1681) - * Account for different possible arguments of a yield expression (issue 1469) - -2016-11-24: Version 3.1.2 - - * Ensure that import specifier is more restrictive (issue 1615) - * Fix duplicated JSX tokens (issue 1613) - * Scan template literal in a JSX expression container (issue 1622) - * Improve XHTML entity scanning in JSX (issue 1629) - -2016-10-31: Version 3.1.1 - - * Fix assignment expression problem in an export declaration (issue 1596) - * Fix incorrect tokenization of hex digits (issue 1605) - -2016-10-09: Version 3.1.0 - - * Do not implicitly collect comments when comment attachment is specified (issue 1553) - * Fix incorrect handling of duplicated proto shorthand fields (issue 1485) - * Prohibit initialization in some variants of for statements (issue 1309, 1561) - * Fix incorrect parsing of export specifier (issue 1578) - * Fix ESTree compatibility for assignment pattern (issue 1575) - -2016-09-03: Version 3.0.0 - - * Support ES2016 exponentiation expression (issue 1490) - * Support JSX syntax (issue 1467) - * Use the latest Unicode 8.0 (issue 1475) - * Add the support for syntax node delegate (issue 1435) - * Fix ESTree compatibility on meta property (issue 1338) - * Fix ESTree compatibility on default parameter value (issue 1081) - * Fix ESTree compatibility on try handler (issue 1030) - -2016-08-23: Version 2.7.3 - - * Fix tokenizer confusion with a comment (issue 1493, 1516) - -2016-02-02: Version 2.7.2 - - * Fix out-of-bound error location in an invalid string literal (issue 1457) - * Fix shorthand object destructuring defaults in variable declarations (issue 1459) - -2015-12-10: Version 2.7.1 - - * Do not allow trailing comma in a variable declaration (issue 1360) - * Fix assignment to `let` in non-strict mode (issue 1376) - * Fix missing delegate property in YieldExpression (issue 1407) - -2015-10-22: Version 2.7.0 - - * Fix the handling of semicolon in a break statement (issue 1044) - * Run the test suite with major web browsers (issue 1259, 1317) - * Allow `let` as an identifier in non-strict mode (issue 1289) - * Attach orphaned comments as `innerComments` (issue 1328) - * Add the support for token delegator (issue 1332) - -2015-09-01: Version 2.6.0 - - * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) - * Add sourceType field for Program node (issue 1159) - * Ensure that strict mode reserved word binding throw an error (issue 1171) - * Run the test suite with Node.js and IE 11 on Windows (issue 1294) - * Allow binding pattern with no initializer in a for statement (issue 1301) - -2015-07-31: Version 2.5.0 - - * Run the test suite in a browser environment (issue 1004) - * Ensure a comma between imported default binding and named imports (issue 1046) - * Distinguish `yield` as a keyword vs an identifier (issue 1186) - * Support ES6 meta property `new.target` (issue 1203) - * Fix the syntax node for yield with expression (issue 1223) - * Fix the check of duplicated proto in property names (issue 1225) - * Fix ES6 Unicode escape in identifier name (issue 1229) - * Support ES6 IdentifierStart and IdentifierPart (issue 1232) - * Treat await as a reserved word when parsing as a module (issue 1234) - * Recognize identifier characters from Unicode SMP (issue 1244) - * Ensure that export and import can be followed by a comma (issue 1250) - * Fix yield operator precedence (issue 1262) - -2015-07-01: Version 2.4.1 - - * Fix some cases of comment attachment (issue 1071, 1175) - * Fix the handling of destructuring in function arguments (issue 1193) - * Fix invalid ranges in assignment expression (issue 1201) - -2015-06-26: Version 2.4.0 - - * Support ES6 for-of iteration (issue 1047) - * Support ES6 spread arguments (issue 1169) - * Minimize npm payload (issue 1191) - -2015-06-16: Version 2.3.0 - - * Support ES6 generator (issue 1033) - * Improve parsing of regular expressions with `u` flag (issue 1179) - -2015-04-17: Version 2.2.0 - - * Support ES6 import and export declarations (issue 1000) - * Fix line terminator before arrow not recognized as error (issue 1009) - * Support ES6 destructuring (issue 1045) - * Support ES6 template literal (issue 1074) - * Fix the handling of invalid/incomplete string escape sequences (issue 1106) - * Fix ES3 static member access restriction (issue 1120) - * Support for `super` in ES6 class (issue 1147) - -2015-03-09: Version 2.1.0 - - * Support ES6 class (issue 1001) - * Support ES6 rest parameter (issue 1011) - * Expand the location of property getter, setter, and methods (issue 1029) - * Enable TryStatement transition to a single handler (issue 1031) - * Support ES6 computed property name (issue 1037) - * Tolerate unclosed block comment (issue 1041) - * Support ES6 lexical declaration (issue 1065) - -2015-02-06: Version 2.0.0 - - * Support ES6 arrow function (issue 517) - * Support ES6 Unicode code point escape (issue 521) - * Improve the speed and accuracy of comment attachment (issue 522) - * Support ES6 default parameter (issue 519) - * Support ES6 regular expression flags (issue 557) - * Fix scanning of implicit octal literals (issue 565) - * Fix the handling of automatic semicolon insertion (issue 574) - * Support ES6 method definition (issue 620) - * Support ES6 octal integer literal (issue 621) - * Support ES6 binary integer literal (issue 622) - * Support ES6 object literal property value shorthand (issue 624) - -2015-03-03: Version 1.2.5 - - * Fix scanning of implicit octal literals (issue 565) - -2015-02-05: Version 1.2.4 - - * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) - * Fix the handling of automatic semicolon insertion (issue 574) - -2015-01-18: Version 1.2.3 - - * Fix division by this (issue 616) - -2014-05-18: Version 1.2.2 - - * Fix duplicated tokens when collecting comments (issue 537) - -2014-05-04: Version 1.2.1 - - * Ensure that Program node may still have leading comments (issue 536) - -2014-04-29: Version 1.2.0 - - * Fix semicolon handling for expression statement (issue 462, 533) - * Disallow escaped characters in regular expression flags (issue 503) - * Performance improvement for location tracking (issue 520) - * Improve the speed of comment attachment (issue 522) - -2014-03-26: Version 1.1.1 - - * Fix token handling of forward slash after an array literal (issue 512) - -2014-03-23: Version 1.1.0 - - * Optionally attach comments to the owning syntax nodes (issue 197) - * Simplify binary parsing with stack-based shift reduce (issue 352) - * Always include the raw source of literals (issue 376) - * Add optional input source information (issue 386) - * Tokenizer API for pure lexical scanning (issue 398) - * Improve the web site and its online demos (issue 337, 400, 404) - * Performance improvement for location tracking (issue 417, 424) - * Support HTML comment syntax (issue 451) - * Drop support for legacy browsers (issue 474) - -2013-08-27: Version 1.0.4 - - * Minimize the payload for packages (issue 362) - * Fix missing cases on an empty switch statement (issue 436) - * Support escaped ] in regexp literal character classes (issue 442) - * Tolerate invalid left-hand side expression (issue 130) - -2013-05-17: Version 1.0.3 - - * Variable declaration needs at least one declarator (issue 391) - * Fix benchmark's variance unit conversion (issue 397) - * IE < 9: \v should be treated as vertical tab (issue 405) - * Unary expressions should always have prefix: true (issue 418) - * Catch clause should only accept an identifier (issue 423) - * Tolerate setters without parameter (issue 426) - -2012-11-02: Version 1.0.2 - - Improvement: - - * Fix esvalidate JUnit output upon a syntax error (issue 374) - -2012-10-28: Version 1.0.1 - - Improvements: - - * esvalidate understands shebang in a Unix shell script (issue 361) - * esvalidate treats fatal parsing failure as an error (issue 361) - * Reduce Node.js package via .npmignore (issue 362) - -2012-10-22: Version 1.0.0 - - Initial release. diff --git a/node_modules/esprima/LICENSE.BSD b/node_modules/esprima/LICENSE.BSD deleted file mode 100644 index 7a55160..0000000 --- a/node_modules/esprima/LICENSE.BSD +++ /dev/null @@ -1,21 +0,0 @@ -Copyright JS Foundation and other contributors, https://js.foundation/ - -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/esprima/README.md b/node_modules/esprima/README.md deleted file mode 100644 index 8fb25e6..0000000 --- a/node_modules/esprima/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) -[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) -[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) -[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) - -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 2017 ([ECMA-262 8th Edition](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/es5.md) as standardized by [ESTree project](https://github.com/estree/estree) -- Experimental support for [JSX](https://facebook.github.io/jsx/), a syntax extension for [React](https://facebook.github.io/react/) -- Optional tracking of syntax node location (index-based and line-column) -- [Heavily tested](http://esprima.org/test/ci.html) (~1500 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) - -### API - -Esprima can be used to perform [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization) or [syntactic analysis](https://en.wikipedia.org/wiki/Parsing) (parsing) of a JavaScript program. - -A simple example on Node.js REPL: - -```javascript -> var esprima = require('esprima'); -> var program = 'const answer = 42'; - -> esprima.tokenize(program); -[ { type: 'Keyword', value: 'const' }, - { type: 'Identifier', value: 'answer' }, - { type: 'Punctuator', value: '=' }, - { type: 'Numeric', value: '42' } ] - -> esprima.parseScript(program); -{ type: 'Program', - body: - [ { type: 'VariableDeclaration', - declarations: [Object], - kind: 'const' } ], - sourceType: 'script' } -``` - -For more information, please read the [complete documentation](http://esprima.org/doc). \ No newline at end of file diff --git a/node_modules/esprima/bin/esparse.js b/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 45d05fb..0000000 --- a/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - 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 sloppy:true node:true rhino:true */ - -var fs, esprima, fname, forceFile, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] [file.js]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function run(content) { - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} - -try { - if (fname && (fname !== '-' || forceFile)) { - run(fs.readFileSync(fname, 'utf-8')); - } else { - var content = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(content); - }); - } -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/node_modules/esprima/bin/esvalidate.js b/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index d49a7e4..0000000 --- a/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env node -/* - Copyright JS Foundation and other contributors, https://js.foundation/ - - 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 sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, forceFile, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - try { - esprima = require('esprima'); - } catch (e) { - esprima = require('../'); - } - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { - argv: arguments, - exit: quit, - on: function (evt, callback) { - callback(); - } - }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] [file.js...]'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (forceFile || entry === '-' || entry.slice(0, 1) !== '-') { - fnames.push(entry); - } else if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry === '--') { - forceFile = true; - } else { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } -}); - -if (fnames.length === 0) { - fnames.push(''); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; - -function run(fname, content) { - var timestamp, syntax, name; - try { - if (typeof content !== 'string') { - throw content; - } - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log(fname + ':' + e.lineNumber + ': ' + e.message.replace(/^Line\ [0-9]*\:\ /, '')); - } - } -} - -fnames.forEach(function (fname) { - var content = ''; - try { - if (fname && (fname !== '-' || forceFile)) { - content = fs.readFileSync(fname, 'utf-8'); - } else { - fname = ''; - process.stdin.resume(); - process.stdin.on('data', function(chunk) { - content += chunk; - }); - process.stdin.on('end', function() { - run(fname, content); - }); - return; - } - } catch (e) { - content = e; - } - run(fname, content); -}); - -process.on('exit', function () { - if (options.format === 'junit') { - console.log(''); - } - - if (count > 0) { - process.exit(1); - } - - if (count === 0 && typeof phantom === 'object') { - process.exit(0); - } -}); diff --git a/node_modules/esprima/dist/esprima.js b/node_modules/esprima/dist/esprima.js deleted file mode 100644 index 2af3eee..0000000 --- a/node_modules/esprima/dist/esprima.js +++ /dev/null @@ -1,6709 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); -/* istanbul ignore next */ - else if(typeof exports === 'object') - exports["esprima"] = factory(); - else - root["esprima"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/* istanbul ignore if */ -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - /* - Copyright JS Foundation and other contributors, https://js.foundation/ - - 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. - */ - Object.defineProperty(exports, "__esModule", { value: true }); - var comment_handler_1 = __webpack_require__(1); - var jsx_parser_1 = __webpack_require__(3); - var parser_1 = __webpack_require__(8); - var tokenizer_1 = __webpack_require__(15); - function parse(code, options, delegate) { - var commentHandler = null; - var proxyDelegate = function (node, metadata) { - if (delegate) { - delegate(node, metadata); - } - if (commentHandler) { - commentHandler.visit(node, metadata); - } - }; - var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; - var collectComment = false; - if (options) { - collectComment = (typeof options.comment === 'boolean' && options.comment); - var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); - if (collectComment || attachComment) { - commentHandler = new comment_handler_1.CommentHandler(); - commentHandler.attach = attachComment; - options.comment = true; - parserDelegate = proxyDelegate; - } - } - var isModule = false; - if (options && typeof options.sourceType === 'string') { - isModule = (options.sourceType === 'module'); - } - var parser; - if (options && typeof options.jsx === 'boolean' && options.jsx) { - parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); - } - else { - parser = new parser_1.Parser(code, options, parserDelegate); - } - var program = isModule ? parser.parseModule() : parser.parseScript(); - var ast = program; - if (collectComment && commentHandler) { - ast.comments = commentHandler.comments; - } - if (parser.config.tokens) { - ast.tokens = parser.tokens; - } - if (parser.config.tolerant) { - ast.errors = parser.errorHandler.errors; - } - return ast; - } - exports.parse = parse; - function parseModule(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'module'; - return parse(code, parsingOptions, delegate); - } - exports.parseModule = parseModule; - function parseScript(code, options, delegate) { - var parsingOptions = options || {}; - parsingOptions.sourceType = 'script'; - return parse(code, parsingOptions, delegate); - } - exports.parseScript = parseScript; - function tokenize(code, options, delegate) { - var tokenizer = new tokenizer_1.Tokenizer(code, options); - var tokens; - tokens = []; - try { - while (true) { - var token = tokenizer.getNextToken(); - if (!token) { - break; - } - if (delegate) { - token = delegate(token); - } - tokens.push(token); - } - } - catch (e) { - tokenizer.errorHandler.tolerate(e); - } - if (tokenizer.errorHandler.tolerant) { - tokens.errors = tokenizer.errors(); - } - return tokens; - } - exports.tokenize = tokenize; - var syntax_1 = __webpack_require__(2); - exports.Syntax = syntax_1.Syntax; - // Sync with *.json manifests. - exports.version = '4.0.1'; - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - var CommentHandler = (function () { - function CommentHandler() { - this.attach = false; - this.comments = []; - this.stack = []; - this.leading = []; - this.trailing = []; - } - CommentHandler.prototype.insertInnerComments = function (node, metadata) { - // innnerComments for properties empty block - // `function a() {/** comments **\/}` - if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { - var innerComments = []; - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (metadata.end.offset >= entry.start) { - innerComments.unshift(entry.comment); - this.leading.splice(i, 1); - this.trailing.splice(i, 1); - } - } - if (innerComments.length) { - node.innerComments = innerComments; - } - } - }; - CommentHandler.prototype.findTrailingComments = function (metadata) { - var trailingComments = []; - if (this.trailing.length > 0) { - for (var i = this.trailing.length - 1; i >= 0; --i) { - var entry_1 = this.trailing[i]; - if (entry_1.start >= metadata.end.offset) { - trailingComments.unshift(entry_1.comment); - } - } - this.trailing.length = 0; - return trailingComments; - } - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.node.trailingComments) { - var firstComment = entry.node.trailingComments[0]; - if (firstComment && firstComment.range[0] >= metadata.end.offset) { - trailingComments = entry.node.trailingComments; - delete entry.node.trailingComments; - } - } - return trailingComments; - }; - CommentHandler.prototype.findLeadingComments = function (metadata) { - var leadingComments = []; - var target; - while (this.stack.length > 0) { - var entry = this.stack[this.stack.length - 1]; - if (entry && entry.start >= metadata.start.offset) { - target = entry.node; - this.stack.pop(); - } - else { - break; - } - } - if (target) { - var count = target.leadingComments ? target.leadingComments.length : 0; - for (var i = count - 1; i >= 0; --i) { - var comment = target.leadingComments[i]; - if (comment.range[1] <= metadata.start.offset) { - leadingComments.unshift(comment); - target.leadingComments.splice(i, 1); - } - } - if (target.leadingComments && target.leadingComments.length === 0) { - delete target.leadingComments; - } - return leadingComments; - } - for (var i = this.leading.length - 1; i >= 0; --i) { - var entry = this.leading[i]; - if (entry.start <= metadata.start.offset) { - leadingComments.unshift(entry.comment); - this.leading.splice(i, 1); - } - } - return leadingComments; - }; - CommentHandler.prototype.visitNode = function (node, metadata) { - if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { - return; - } - this.insertInnerComments(node, metadata); - var trailingComments = this.findTrailingComments(metadata); - var leadingComments = this.findLeadingComments(metadata); - if (leadingComments.length > 0) { - node.leadingComments = leadingComments; - } - if (trailingComments.length > 0) { - node.trailingComments = trailingComments; - } - this.stack.push({ - node: node, - start: metadata.start.offset - }); - }; - CommentHandler.prototype.visitComment = function (node, metadata) { - var type = (node.type[0] === 'L') ? 'Line' : 'Block'; - var comment = { - type: type, - value: node.value - }; - if (node.range) { - comment.range = node.range; - } - if (node.loc) { - comment.loc = node.loc; - } - this.comments.push(comment); - if (this.attach) { - var entry = { - comment: { - type: type, - value: node.value, - range: [metadata.start.offset, metadata.end.offset] - }, - start: metadata.start.offset - }; - if (node.loc) { - entry.comment.loc = node.loc; - } - node.type = type; - this.leading.push(entry); - this.trailing.push(entry); - } - }; - CommentHandler.prototype.visit = function (node, metadata) { - if (node.type === 'LineComment') { - this.visitComment(node, metadata); - } - else if (node.type === 'BlockComment') { - this.visitComment(node, metadata); - } - else if (this.attach) { - this.visitNode(node, metadata); - } - }; - return CommentHandler; - }()); - exports.CommentHandler = CommentHandler; - - -/***/ }, -/* 2 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Syntax = { - 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', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - 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' - }; - - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; -/* istanbul ignore next */ - var __extends = (this && this.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - })(); - Object.defineProperty(exports, "__esModule", { value: true }); - var character_1 = __webpack_require__(4); - var JSXNode = __webpack_require__(5); - var jsx_syntax_1 = __webpack_require__(6); - var Node = __webpack_require__(7); - var parser_1 = __webpack_require__(8); - var token_1 = __webpack_require__(13); - var xhtml_entities_1 = __webpack_require__(14); - token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; - token_1.TokenName[101 /* Text */] = 'JSXText'; - // Fully qualified element name, e.g. returns "svg:path" - function getQualifiedElementName(elementName) { - var qualifiedName; - switch (elementName.type) { - case jsx_syntax_1.JSXSyntax.JSXIdentifier: - var id = elementName; - qualifiedName = id.name; - break; - case jsx_syntax_1.JSXSyntax.JSXNamespacedName: - var ns = elementName; - qualifiedName = getQualifiedElementName(ns.namespace) + ':' + - getQualifiedElementName(ns.name); - break; - case jsx_syntax_1.JSXSyntax.JSXMemberExpression: - var expr = elementName; - qualifiedName = getQualifiedElementName(expr.object) + '.' + - getQualifiedElementName(expr.property); - break; - /* istanbul ignore next */ - default: - break; - } - return qualifiedName; - } - var JSXParser = (function (_super) { - __extends(JSXParser, _super); - function JSXParser(code, options, delegate) { - return _super.call(this, code, options, delegate) || this; - } - JSXParser.prototype.parsePrimaryExpression = function () { - return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); - }; - JSXParser.prototype.startJSX = function () { - // Unwind the scanner before the lookahead token. - this.scanner.index = this.startMarker.index; - this.scanner.lineNumber = this.startMarker.line; - this.scanner.lineStart = this.startMarker.index - this.startMarker.column; - }; - JSXParser.prototype.finishJSX = function () { - // Prime the next lookahead. - this.nextToken(); - }; - JSXParser.prototype.reenterJSX = function () { - this.startJSX(); - this.expectJSX('}'); - // Pop the closing '}' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - }; - JSXParser.prototype.createJSXNode = function () { - this.collectComments(); - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.createJSXChildNode = function () { - return { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - }; - JSXParser.prototype.scanXHTMLEntity = function (quote) { - var result = '&'; - var valid = true; - var terminated = false; - var numeric = false; - var hex = false; - while (!this.scanner.eof() && valid && !terminated) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === quote) { - break; - } - terminated = (ch === ';'); - result += ch; - ++this.scanner.index; - if (!terminated) { - switch (result.length) { - case 2: - // e.g. '{' - numeric = (ch === '#'); - break; - case 3: - if (numeric) { - // e.g. 'A' - hex = (ch === 'x'); - valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); - numeric = numeric && !hex; - } - break; - default: - valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); - valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); - break; - } - } - } - if (valid && terminated && result.length > 2) { - // e.g. 'A' becomes just '#x41' - var str = result.substr(1, result.length - 2); - if (numeric && str.length > 1) { - result = String.fromCharCode(parseInt(str.substr(1), 10)); - } - else if (hex && str.length > 2) { - result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); - } - else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { - result = xhtml_entities_1.XHTMLEntities[str]; - } - } - return result; - }; - // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. - JSXParser.prototype.lexJSX = function () { - var cp = this.scanner.source.charCodeAt(this.scanner.index); - // < > / : = { } - if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { - var value = this.scanner.source[this.scanner.index++]; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index - 1, - end: this.scanner.index - }; - } - // " ' - if (cp === 34 || cp === 39) { - var start = this.scanner.index; - var quote = this.scanner.source[this.scanner.index++]; - var str = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index++]; - if (ch === quote) { - break; - } - else if (ch === '&') { - str += this.scanXHTMLEntity(quote); - } - else { - str += ch; - } - } - return { - type: 8 /* StringLiteral */, - value: str, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ... or . - if (cp === 46) { - var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); - var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); - var value = (n1 === 46 && n2 === 46) ? '...' : '.'; - var start = this.scanner.index; - this.scanner.index += value.length; - return { - type: 7 /* Punctuator */, - value: value, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - // ` - if (cp === 96) { - // Only placeholder, since it will be rescanned as a real assignment expression. - return { - type: 10 /* Template */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: this.scanner.index, - end: this.scanner.index - }; - } - // Identifer can not contain backslash (char code 92). - if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { - var start = this.scanner.index; - ++this.scanner.index; - while (!this.scanner.eof()) { - var ch = this.scanner.source.charCodeAt(this.scanner.index); - if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { - ++this.scanner.index; - } - else if (ch === 45) { - // Hyphen (char code 45) can be part of an identifier. - ++this.scanner.index; - } - else { - break; - } - } - var id = this.scanner.source.slice(start, this.scanner.index); - return { - type: 100 /* Identifier */, - value: id, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - } - return this.scanner.lex(); - }; - JSXParser.prototype.nextJSXToken = function () { - this.collectComments(); - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var token = this.lexJSX(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - if (this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.nextJSXText = function () { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - var start = this.scanner.index; - var text = ''; - while (!this.scanner.eof()) { - var ch = this.scanner.source[this.scanner.index]; - if (ch === '{' || ch === '<') { - break; - } - ++this.scanner.index; - text += ch; - if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { - ++this.scanner.lineNumber; - if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { - ++this.scanner.index; - } - this.scanner.lineStart = this.scanner.index; - } - } - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - var token = { - type: 101 /* Text */, - value: text, - lineNumber: this.scanner.lineNumber, - lineStart: this.scanner.lineStart, - start: start, - end: this.scanner.index - }; - if ((text.length > 0) && this.config.tokens) { - this.tokens.push(this.convertToken(token)); - } - return token; - }; - JSXParser.prototype.peekJSXToken = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.lexJSX(); - this.scanner.restoreState(state); - return next; - }; - // Expect the next JSX token to match the specified punctuator. - // If not, an exception will be thrown. - JSXParser.prototype.expectJSX = function (value) { - var token = this.nextJSXToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next JSX token matches the specified punctuator. - JSXParser.prototype.matchJSX = function (value) { - var next = this.peekJSXToken(); - return next.type === 7 /* Punctuator */ && next.value === value; - }; - JSXParser.prototype.parseJSXIdentifier = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 100 /* Identifier */) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); - }; - JSXParser.prototype.parseJSXElementName = function () { - var node = this.createJSXNode(); - var elementName = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = elementName; - this.expectJSX(':'); - var name_1 = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); - } - else if (this.matchJSX('.')) { - while (this.matchJSX('.')) { - var object = elementName; - this.expectJSX('.'); - var property = this.parseJSXIdentifier(); - elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); - } - } - return elementName; - }; - JSXParser.prototype.parseJSXAttributeName = function () { - var node = this.createJSXNode(); - var attributeName; - var identifier = this.parseJSXIdentifier(); - if (this.matchJSX(':')) { - var namespace = identifier; - this.expectJSX(':'); - var name_2 = this.parseJSXIdentifier(); - attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); - } - else { - attributeName = identifier; - } - return attributeName; - }; - JSXParser.prototype.parseJSXStringLiteralAttribute = function () { - var node = this.createJSXNode(); - var token = this.nextJSXToken(); - if (token.type !== 8 /* StringLiteral */) { - this.throwUnexpectedToken(token); - } - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - JSXParser.prototype.parseJSXExpressionAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.finishJSX(); - if (this.match('}')) { - this.tolerateError('JSX attributes must only be assigned a non-empty expression'); - } - var expression = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXAttributeValue = function () { - return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : - this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); - }; - JSXParser.prototype.parseJSXNameValueAttribute = function () { - var node = this.createJSXNode(); - var name = this.parseJSXAttributeName(); - var value = null; - if (this.matchJSX('=')) { - this.expectJSX('='); - value = this.parseJSXAttributeValue(); - } - return this.finalize(node, new JSXNode.JSXAttribute(name, value)); - }; - JSXParser.prototype.parseJSXSpreadAttribute = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - this.expectJSX('...'); - this.finishJSX(); - var argument = this.parseAssignmentExpression(); - this.reenterJSX(); - return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); - }; - JSXParser.prototype.parseJSXAttributes = function () { - var attributes = []; - while (!this.matchJSX('/') && !this.matchJSX('>')) { - var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : - this.parseJSXNameValueAttribute(); - attributes.push(attribute); - } - return attributes; - }; - JSXParser.prototype.parseJSXOpeningElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXBoundaryElement = function () { - var node = this.createJSXNode(); - this.expectJSX('<'); - if (this.matchJSX('/')) { - this.expectJSX('/'); - var name_3 = this.parseJSXElementName(); - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); - } - var name = this.parseJSXElementName(); - var attributes = this.parseJSXAttributes(); - var selfClosing = this.matchJSX('/'); - if (selfClosing) { - this.expectJSX('/'); - } - this.expectJSX('>'); - return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); - }; - JSXParser.prototype.parseJSXEmptyExpression = function () { - var node = this.createJSXChildNode(); - this.collectComments(); - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - return this.finalize(node, new JSXNode.JSXEmptyExpression()); - }; - JSXParser.prototype.parseJSXExpressionContainer = function () { - var node = this.createJSXNode(); - this.expectJSX('{'); - var expression; - if (this.matchJSX('}')) { - expression = this.parseJSXEmptyExpression(); - this.expectJSX('}'); - } - else { - this.finishJSX(); - expression = this.parseAssignmentExpression(); - this.reenterJSX(); - } - return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); - }; - JSXParser.prototype.parseJSXChildren = function () { - var children = []; - while (!this.scanner.eof()) { - var node = this.createJSXChildNode(); - var token = this.nextJSXText(); - if (token.start < token.end) { - var raw = this.getTokenRaw(token); - var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); - children.push(child); - } - if (this.scanner.source[this.scanner.index] === '{') { - var container = this.parseJSXExpressionContainer(); - children.push(container); - } - else { - break; - } - } - return children; - }; - JSXParser.prototype.parseComplexJSXElement = function (el) { - var stack = []; - while (!this.scanner.eof()) { - el.children = el.children.concat(this.parseJSXChildren()); - var node = this.createJSXChildNode(); - var element = this.parseJSXBoundaryElement(); - if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { - var opening = element; - if (opening.selfClosing) { - var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); - el.children.push(child); - } - else { - stack.push(el); - el = { node: node, opening: opening, closing: null, children: [] }; - } - } - if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { - el.closing = element; - var open_1 = getQualifiedElementName(el.opening.name); - var close_1 = getQualifiedElementName(el.closing.name); - if (open_1 !== close_1) { - this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); - } - if (stack.length > 0) { - var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); - el = stack[stack.length - 1]; - el.children.push(child); - stack.pop(); - } - else { - break; - } - } - } - return el; - }; - JSXParser.prototype.parseJSXElement = function () { - var node = this.createJSXNode(); - var opening = this.parseJSXOpeningElement(); - var children = []; - var closing = null; - if (!opening.selfClosing) { - var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); - children = el.children; - closing = el.closing; - } - return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); - }; - JSXParser.prototype.parseJSXRoot = function () { - // Pop the opening '<' added from the lookahead. - if (this.config.tokens) { - this.tokens.pop(); - } - this.startJSX(); - var element = this.parseJSXElement(); - this.finishJSX(); - return element; - }; - JSXParser.prototype.isStartOfExpression = function () { - return _super.prototype.isStartOfExpression.call(this) || this.match('<'); - }; - return JSXParser; - }(parser_1.Parser)); - exports.JSXParser = JSXParser; - - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // See also tools/generate-unicode-regex.js. - var Regex = { - // Unicode v8.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\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F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD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uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, - // Unicode v8.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-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8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\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uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uD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EA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - exports.Character = { - /* tslint:disable:no-bitwise */ - fromCodePoint: function (cp) { - return (cp < 0x10000) ? String.fromCharCode(cp) : - String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + - String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); - }, - // https://tc39.github.io/ecma262/#sec-white-space - isWhiteSpace: function (cp) { - return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || - (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); - }, - // https://tc39.github.io/ecma262/#sec-line-terminators - isLineTerminator: function (cp) { - return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); - }, - // https://tc39.github.io/ecma262/#sec-names-and-keywords - isIdentifierStart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); - }, - isIdentifierPart: function (cp) { - return (cp === 0x24) || (cp === 0x5F) || - (cp >= 0x41 && cp <= 0x5A) || - (cp >= 0x61 && cp <= 0x7A) || - (cp >= 0x30 && cp <= 0x39) || - (cp === 0x5C) || - ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); - }, - // https://tc39.github.io/ecma262/#sec-literals-numeric-literals - isDecimalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39); // 0..9 - }, - isHexDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x39) || - (cp >= 0x41 && cp <= 0x46) || - (cp >= 0x61 && cp <= 0x66); // a..f - }, - isOctalDigit: function (cp) { - return (cp >= 0x30 && cp <= 0x37); // 0..7 - } - }; - - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var jsx_syntax_1 = __webpack_require__(6); - /* tslint:disable:max-classes-per-file */ - var JSXClosingElement = (function () { - function JSXClosingElement(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; - this.name = name; - } - return JSXClosingElement; - }()); - exports.JSXClosingElement = JSXClosingElement; - var JSXElement = (function () { - function JSXElement(openingElement, children, closingElement) { - this.type = jsx_syntax_1.JSXSyntax.JSXElement; - this.openingElement = openingElement; - this.children = children; - this.closingElement = closingElement; - } - return JSXElement; - }()); - exports.JSXElement = JSXElement; - var JSXEmptyExpression = (function () { - function JSXEmptyExpression() { - this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; - } - return JSXEmptyExpression; - }()); - exports.JSXEmptyExpression = JSXEmptyExpression; - var JSXExpressionContainer = (function () { - function JSXExpressionContainer(expression) { - this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; - this.expression = expression; - } - return JSXExpressionContainer; - }()); - exports.JSXExpressionContainer = JSXExpressionContainer; - var JSXIdentifier = (function () { - function JSXIdentifier(name) { - this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; - this.name = name; - } - return JSXIdentifier; - }()); - exports.JSXIdentifier = JSXIdentifier; - var JSXMemberExpression = (function () { - function JSXMemberExpression(object, property) { - this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; - this.object = object; - this.property = property; - } - return JSXMemberExpression; - }()); - exports.JSXMemberExpression = JSXMemberExpression; - var JSXAttribute = (function () { - function JSXAttribute(name, value) { - this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; - this.name = name; - this.value = value; - } - return JSXAttribute; - }()); - exports.JSXAttribute = JSXAttribute; - var JSXNamespacedName = (function () { - function JSXNamespacedName(namespace, name) { - this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; - this.namespace = namespace; - this.name = name; - } - return JSXNamespacedName; - }()); - exports.JSXNamespacedName = JSXNamespacedName; - var JSXOpeningElement = (function () { - function JSXOpeningElement(name, selfClosing, attributes) { - this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; - this.name = name; - this.selfClosing = selfClosing; - this.attributes = attributes; - } - return JSXOpeningElement; - }()); - exports.JSXOpeningElement = JSXOpeningElement; - var JSXSpreadAttribute = (function () { - function JSXSpreadAttribute(argument) { - this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; - this.argument = argument; - } - return JSXSpreadAttribute; - }()); - exports.JSXSpreadAttribute = JSXSpreadAttribute; - var JSXText = (function () { - function JSXText(value, raw) { - this.type = jsx_syntax_1.JSXSyntax.JSXText; - this.value = value; - this.raw = raw; - } - return JSXText; - }()); - exports.JSXText = JSXText; - - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JSXSyntax = { - JSXAttribute: 'JSXAttribute', - JSXClosingElement: 'JSXClosingElement', - JSXElement: 'JSXElement', - JSXEmptyExpression: 'JSXEmptyExpression', - JSXExpressionContainer: 'JSXExpressionContainer', - JSXIdentifier: 'JSXIdentifier', - JSXMemberExpression: 'JSXMemberExpression', - JSXNamespacedName: 'JSXNamespacedName', - JSXOpeningElement: 'JSXOpeningElement', - JSXSpreadAttribute: 'JSXSpreadAttribute', - JSXText: 'JSXText' - }; - - -/***/ }, -/* 7 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var syntax_1 = __webpack_require__(2); - /* tslint:disable:max-classes-per-file */ - var ArrayExpression = (function () { - function ArrayExpression(elements) { - this.type = syntax_1.Syntax.ArrayExpression; - this.elements = elements; - } - return ArrayExpression; - }()); - exports.ArrayExpression = ArrayExpression; - var ArrayPattern = (function () { - function ArrayPattern(elements) { - this.type = syntax_1.Syntax.ArrayPattern; - this.elements = elements; - } - return ArrayPattern; - }()); - exports.ArrayPattern = ArrayPattern; - var ArrowFunctionExpression = (function () { - function ArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = false; - } - return ArrowFunctionExpression; - }()); - exports.ArrowFunctionExpression = ArrowFunctionExpression; - var AssignmentExpression = (function () { - function AssignmentExpression(operator, left, right) { - this.type = syntax_1.Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return AssignmentExpression; - }()); - exports.AssignmentExpression = AssignmentExpression; - var AssignmentPattern = (function () { - function AssignmentPattern(left, right) { - this.type = syntax_1.Syntax.AssignmentPattern; - this.left = left; - this.right = right; - } - return AssignmentPattern; - }()); - exports.AssignmentPattern = AssignmentPattern; - var AsyncArrowFunctionExpression = (function () { - function AsyncArrowFunctionExpression(params, body, expression) { - this.type = syntax_1.Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.body = body; - this.generator = false; - this.expression = expression; - this.async = true; - } - return AsyncArrowFunctionExpression; - }()); - exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; - var AsyncFunctionDeclaration = (function () { - function AsyncFunctionDeclaration(id, params, body) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionDeclaration; - }()); - exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; - var AsyncFunctionExpression = (function () { - function AsyncFunctionExpression(id, params, body) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = false; - this.expression = false; - this.async = true; - } - return AsyncFunctionExpression; - }()); - exports.AsyncFunctionExpression = AsyncFunctionExpression; - var AwaitExpression = (function () { - function AwaitExpression(argument) { - this.type = syntax_1.Syntax.AwaitExpression; - this.argument = argument; - } - return AwaitExpression; - }()); - exports.AwaitExpression = AwaitExpression; - var BinaryExpression = (function () { - function BinaryExpression(operator, left, right) { - var logical = (operator === '||' || operator === '&&'); - this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - } - return BinaryExpression; - }()); - exports.BinaryExpression = BinaryExpression; - var BlockStatement = (function () { - function BlockStatement(body) { - this.type = syntax_1.Syntax.BlockStatement; - this.body = body; - } - return BlockStatement; - }()); - exports.BlockStatement = BlockStatement; - var BreakStatement = (function () { - function BreakStatement(label) { - this.type = syntax_1.Syntax.BreakStatement; - this.label = label; - } - return BreakStatement; - }()); - exports.BreakStatement = BreakStatement; - var CallExpression = (function () { - function CallExpression(callee, args) { - this.type = syntax_1.Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - } - return CallExpression; - }()); - exports.CallExpression = CallExpression; - var CatchClause = (function () { - function CatchClause(param, body) { - this.type = syntax_1.Syntax.CatchClause; - this.param = param; - this.body = body; - } - return CatchClause; - }()); - exports.CatchClause = CatchClause; - var ClassBody = (function () { - function ClassBody(body) { - this.type = syntax_1.Syntax.ClassBody; - this.body = body; - } - return ClassBody; - }()); - exports.ClassBody = ClassBody; - var ClassDeclaration = (function () { - function ClassDeclaration(id, superClass, body) { - this.type = syntax_1.Syntax.ClassDeclaration; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassDeclaration; - }()); - exports.ClassDeclaration = ClassDeclaration; - var ClassExpression = (function () { - function ClassExpression(id, superClass, body) { - this.type = syntax_1.Syntax.ClassExpression; - this.id = id; - this.superClass = superClass; - this.body = body; - } - return ClassExpression; - }()); - exports.ClassExpression = ClassExpression; - var ComputedMemberExpression = (function () { - function ComputedMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = true; - this.object = object; - this.property = property; - } - return ComputedMemberExpression; - }()); - exports.ComputedMemberExpression = ComputedMemberExpression; - var ConditionalExpression = (function () { - function ConditionalExpression(test, consequent, alternate) { - this.type = syntax_1.Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return ConditionalExpression; - }()); - exports.ConditionalExpression = ConditionalExpression; - var ContinueStatement = (function () { - function ContinueStatement(label) { - this.type = syntax_1.Syntax.ContinueStatement; - this.label = label; - } - return ContinueStatement; - }()); - exports.ContinueStatement = ContinueStatement; - var DebuggerStatement = (function () { - function DebuggerStatement() { - this.type = syntax_1.Syntax.DebuggerStatement; - } - return DebuggerStatement; - }()); - exports.DebuggerStatement = DebuggerStatement; - var Directive = (function () { - function Directive(expression, directive) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - this.directive = directive; - } - return Directive; - }()); - exports.Directive = Directive; - var DoWhileStatement = (function () { - function DoWhileStatement(body, test) { - this.type = syntax_1.Syntax.DoWhileStatement; - this.body = body; - this.test = test; - } - return DoWhileStatement; - }()); - exports.DoWhileStatement = DoWhileStatement; - var EmptyStatement = (function () { - function EmptyStatement() { - this.type = syntax_1.Syntax.EmptyStatement; - } - return EmptyStatement; - }()); - exports.EmptyStatement = EmptyStatement; - var ExportAllDeclaration = (function () { - function ExportAllDeclaration(source) { - this.type = syntax_1.Syntax.ExportAllDeclaration; - this.source = source; - } - return ExportAllDeclaration; - }()); - exports.ExportAllDeclaration = ExportAllDeclaration; - var ExportDefaultDeclaration = (function () { - function ExportDefaultDeclaration(declaration) { - this.type = syntax_1.Syntax.ExportDefaultDeclaration; - this.declaration = declaration; - } - return ExportDefaultDeclaration; - }()); - exports.ExportDefaultDeclaration = ExportDefaultDeclaration; - var ExportNamedDeclaration = (function () { - function ExportNamedDeclaration(declaration, specifiers, source) { - this.type = syntax_1.Syntax.ExportNamedDeclaration; - this.declaration = declaration; - this.specifiers = specifiers; - this.source = source; - } - return ExportNamedDeclaration; - }()); - exports.ExportNamedDeclaration = ExportNamedDeclaration; - var ExportSpecifier = (function () { - function ExportSpecifier(local, exported) { - this.type = syntax_1.Syntax.ExportSpecifier; - this.exported = exported; - this.local = local; - } - return ExportSpecifier; - }()); - exports.ExportSpecifier = ExportSpecifier; - var ExpressionStatement = (function () { - function ExpressionStatement(expression) { - this.type = syntax_1.Syntax.ExpressionStatement; - this.expression = expression; - } - return ExpressionStatement; - }()); - exports.ExpressionStatement = ExpressionStatement; - var ForInStatement = (function () { - function ForInStatement(left, right, body) { - this.type = syntax_1.Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - } - return ForInStatement; - }()); - exports.ForInStatement = ForInStatement; - var ForOfStatement = (function () { - function ForOfStatement(left, right, body) { - this.type = syntax_1.Syntax.ForOfStatement; - this.left = left; - this.right = right; - this.body = body; - } - return ForOfStatement; - }()); - exports.ForOfStatement = ForOfStatement; - var ForStatement = (function () { - function ForStatement(init, test, update, body) { - this.type = syntax_1.Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - } - return ForStatement; - }()); - exports.ForStatement = ForStatement; - var FunctionDeclaration = (function () { - function FunctionDeclaration(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionDeclaration; - }()); - exports.FunctionDeclaration = FunctionDeclaration; - var FunctionExpression = (function () { - function FunctionExpression(id, params, body, generator) { - this.type = syntax_1.Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.body = body; - this.generator = generator; - this.expression = false; - this.async = false; - } - return FunctionExpression; - }()); - exports.FunctionExpression = FunctionExpression; - var Identifier = (function () { - function Identifier(name) { - this.type = syntax_1.Syntax.Identifier; - this.name = name; - } - return Identifier; - }()); - exports.Identifier = Identifier; - var IfStatement = (function () { - function IfStatement(test, consequent, alternate) { - this.type = syntax_1.Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - } - return IfStatement; - }()); - exports.IfStatement = IfStatement; - var ImportDeclaration = (function () { - function ImportDeclaration(specifiers, source) { - this.type = syntax_1.Syntax.ImportDeclaration; - this.specifiers = specifiers; - this.source = source; - } - return ImportDeclaration; - }()); - exports.ImportDeclaration = ImportDeclaration; - var ImportDefaultSpecifier = (function () { - function ImportDefaultSpecifier(local) { - this.type = syntax_1.Syntax.ImportDefaultSpecifier; - this.local = local; - } - return ImportDefaultSpecifier; - }()); - exports.ImportDefaultSpecifier = ImportDefaultSpecifier; - var ImportNamespaceSpecifier = (function () { - function ImportNamespaceSpecifier(local) { - this.type = syntax_1.Syntax.ImportNamespaceSpecifier; - this.local = local; - } - return ImportNamespaceSpecifier; - }()); - exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; - var ImportSpecifier = (function () { - function ImportSpecifier(local, imported) { - this.type = syntax_1.Syntax.ImportSpecifier; - this.local = local; - this.imported = imported; - } - return ImportSpecifier; - }()); - exports.ImportSpecifier = ImportSpecifier; - var LabeledStatement = (function () { - function LabeledStatement(label, body) { - this.type = syntax_1.Syntax.LabeledStatement; - this.label = label; - this.body = body; - } - return LabeledStatement; - }()); - exports.LabeledStatement = LabeledStatement; - var Literal = (function () { - function Literal(value, raw) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - } - return Literal; - }()); - exports.Literal = Literal; - var MetaProperty = (function () { - function MetaProperty(meta, property) { - this.type = syntax_1.Syntax.MetaProperty; - this.meta = meta; - this.property = property; - } - return MetaProperty; - }()); - exports.MetaProperty = MetaProperty; - var MethodDefinition = (function () { - function MethodDefinition(key, computed, value, kind, isStatic) { - this.type = syntax_1.Syntax.MethodDefinition; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.static = isStatic; - } - return MethodDefinition; - }()); - exports.MethodDefinition = MethodDefinition; - var Module = (function () { - function Module(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'module'; - } - return Module; - }()); - exports.Module = Module; - var NewExpression = (function () { - function NewExpression(callee, args) { - this.type = syntax_1.Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - } - return NewExpression; - }()); - exports.NewExpression = NewExpression; - var ObjectExpression = (function () { - function ObjectExpression(properties) { - this.type = syntax_1.Syntax.ObjectExpression; - this.properties = properties; - } - return ObjectExpression; - }()); - exports.ObjectExpression = ObjectExpression; - var ObjectPattern = (function () { - function ObjectPattern(properties) { - this.type = syntax_1.Syntax.ObjectPattern; - this.properties = properties; - } - return ObjectPattern; - }()); - exports.ObjectPattern = ObjectPattern; - var Property = (function () { - function Property(kind, key, computed, value, method, shorthand) { - this.type = syntax_1.Syntax.Property; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.method = method; - this.shorthand = shorthand; - } - return Property; - }()); - exports.Property = Property; - var RegexLiteral = (function () { - function RegexLiteral(value, raw, pattern, flags) { - this.type = syntax_1.Syntax.Literal; - this.value = value; - this.raw = raw; - this.regex = { pattern: pattern, flags: flags }; - } - return RegexLiteral; - }()); - exports.RegexLiteral = RegexLiteral; - var RestElement = (function () { - function RestElement(argument) { - this.type = syntax_1.Syntax.RestElement; - this.argument = argument; - } - return RestElement; - }()); - exports.RestElement = RestElement; - var ReturnStatement = (function () { - function ReturnStatement(argument) { - this.type = syntax_1.Syntax.ReturnStatement; - this.argument = argument; - } - return ReturnStatement; - }()); - exports.ReturnStatement = ReturnStatement; - var Script = (function () { - function Script(body) { - this.type = syntax_1.Syntax.Program; - this.body = body; - this.sourceType = 'script'; - } - return Script; - }()); - exports.Script = Script; - var SequenceExpression = (function () { - function SequenceExpression(expressions) { - this.type = syntax_1.Syntax.SequenceExpression; - this.expressions = expressions; - } - return SequenceExpression; - }()); - exports.SequenceExpression = SequenceExpression; - var SpreadElement = (function () { - function SpreadElement(argument) { - this.type = syntax_1.Syntax.SpreadElement; - this.argument = argument; - } - return SpreadElement; - }()); - exports.SpreadElement = SpreadElement; - var StaticMemberExpression = (function () { - function StaticMemberExpression(object, property) { - this.type = syntax_1.Syntax.MemberExpression; - this.computed = false; - this.object = object; - this.property = property; - } - return StaticMemberExpression; - }()); - exports.StaticMemberExpression = StaticMemberExpression; - var Super = (function () { - function Super() { - this.type = syntax_1.Syntax.Super; - } - return Super; - }()); - exports.Super = Super; - var SwitchCase = (function () { - function SwitchCase(test, consequent) { - this.type = syntax_1.Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - } - return SwitchCase; - }()); - exports.SwitchCase = SwitchCase; - var SwitchStatement = (function () { - function SwitchStatement(discriminant, cases) { - this.type = syntax_1.Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - } - return SwitchStatement; - }()); - exports.SwitchStatement = SwitchStatement; - var TaggedTemplateExpression = (function () { - function TaggedTemplateExpression(tag, quasi) { - this.type = syntax_1.Syntax.TaggedTemplateExpression; - this.tag = tag; - this.quasi = quasi; - } - return TaggedTemplateExpression; - }()); - exports.TaggedTemplateExpression = TaggedTemplateExpression; - var TemplateElement = (function () { - function TemplateElement(value, tail) { - this.type = syntax_1.Syntax.TemplateElement; - this.value = value; - this.tail = tail; - } - return TemplateElement; - }()); - exports.TemplateElement = TemplateElement; - var TemplateLiteral = (function () { - function TemplateLiteral(quasis, expressions) { - this.type = syntax_1.Syntax.TemplateLiteral; - this.quasis = quasis; - this.expressions = expressions; - } - return TemplateLiteral; - }()); - exports.TemplateLiteral = TemplateLiteral; - var ThisExpression = (function () { - function ThisExpression() { - this.type = syntax_1.Syntax.ThisExpression; - } - return ThisExpression; - }()); - exports.ThisExpression = ThisExpression; - var ThrowStatement = (function () { - function ThrowStatement(argument) { - this.type = syntax_1.Syntax.ThrowStatement; - this.argument = argument; - } - return ThrowStatement; - }()); - exports.ThrowStatement = ThrowStatement; - var TryStatement = (function () { - function TryStatement(block, handler, finalizer) { - this.type = syntax_1.Syntax.TryStatement; - this.block = block; - this.handler = handler; - this.finalizer = finalizer; - } - return TryStatement; - }()); - exports.TryStatement = TryStatement; - var UnaryExpression = (function () { - function UnaryExpression(operator, argument) { - this.type = syntax_1.Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - } - return UnaryExpression; - }()); - exports.UnaryExpression = UnaryExpression; - var UpdateExpression = (function () { - function UpdateExpression(operator, argument, prefix) { - this.type = syntax_1.Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = prefix; - } - return UpdateExpression; - }()); - exports.UpdateExpression = UpdateExpression; - var VariableDeclaration = (function () { - function VariableDeclaration(declarations, kind) { - this.type = syntax_1.Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - } - return VariableDeclaration; - }()); - exports.VariableDeclaration = VariableDeclaration; - var VariableDeclarator = (function () { - function VariableDeclarator(id, init) { - this.type = syntax_1.Syntax.VariableDeclarator; - this.id = id; - this.init = init; - } - return VariableDeclarator; - }()); - exports.VariableDeclarator = VariableDeclarator; - var WhileStatement = (function () { - function WhileStatement(test, body) { - this.type = syntax_1.Syntax.WhileStatement; - this.test = test; - this.body = body; - } - return WhileStatement; - }()); - exports.WhileStatement = WhileStatement; - var WithStatement = (function () { - function WithStatement(object, body) { - this.type = syntax_1.Syntax.WithStatement; - this.object = object; - this.body = body; - } - return WithStatement; - }()); - exports.WithStatement = WithStatement; - var YieldExpression = (function () { - function YieldExpression(argument, delegate) { - this.type = syntax_1.Syntax.YieldExpression; - this.argument = argument; - this.delegate = delegate; - } - return YieldExpression; - }()); - exports.YieldExpression = YieldExpression; - - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var error_handler_1 = __webpack_require__(10); - var messages_1 = __webpack_require__(11); - var Node = __webpack_require__(7); - var scanner_1 = __webpack_require__(12); - var syntax_1 = __webpack_require__(2); - var token_1 = __webpack_require__(13); - var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; - var Parser = (function () { - function Parser(code, options, delegate) { - if (options === void 0) { options = {}; } - this.config = { - range: (typeof options.range === 'boolean') && options.range, - loc: (typeof options.loc === 'boolean') && options.loc, - source: null, - tokens: (typeof options.tokens === 'boolean') && options.tokens, - comment: (typeof options.comment === 'boolean') && options.comment, - tolerant: (typeof options.tolerant === 'boolean') && options.tolerant - }; - if (this.config.loc && options.source && options.source !== null) { - this.config.source = String(options.source); - } - this.delegate = delegate; - this.errorHandler = new error_handler_1.ErrorHandler(); - this.errorHandler.tolerant = this.config.tolerant; - this.scanner = new scanner_1.Scanner(code, this.errorHandler); - this.scanner.trackComment = this.config.comment; - this.operatorPrecedence = { - ')': 0, - ';': 0, - ',': 0, - '=': 0, - ']': 0, - '||': 1, - '&&': 2, - '|': 3, - '^': 4, - '&': 5, - '==': 6, - '!=': 6, - '===': 6, - '!==': 6, - '<': 7, - '>': 7, - '<=': 7, - '>=': 7, - '<<': 8, - '>>': 8, - '>>>': 8, - '+': 9, - '-': 9, - '*': 11, - '/': 11, - '%': 11 - }; - this.lookahead = { - type: 2 /* EOF */, - value: '', - lineNumber: this.scanner.lineNumber, - lineStart: 0, - start: 0, - end: 0 - }; - this.hasLineTerminator = false; - this.context = { - isModule: false, - await: false, - allowIn: true, - allowStrictDirective: true, - allowYield: true, - firstCoverInitializedNameError: null, - isAssignmentTarget: false, - isBindingElement: false, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - labelSet: {}, - strict: false - }; - this.tokens = []; - this.startMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.lastMarker = { - index: 0, - line: this.scanner.lineNumber, - column: 0 - }; - this.nextToken(); - this.lastMarker = { - index: this.scanner.index, - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - }; - } - Parser.prototype.throwError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - throw this.errorHandler.createError(index, line, column, msg); - }; - Parser.prototype.tolerateError = function (messageFormat) { - var values = []; - for (var _i = 1; _i < arguments.length; _i++) { - values[_i - 1] = arguments[_i]; - } - var args = Array.prototype.slice.call(arguments, 1); - var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { - assert_1.assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - }); - var index = this.lastMarker.index; - var line = this.scanner.lineNumber; - var column = this.lastMarker.column + 1; - this.errorHandler.tolerateError(index, line, column, msg); - }; - // Throw an exception because of the token. - Parser.prototype.unexpectedTokenError = function (token, message) { - var msg = message || messages_1.Messages.UnexpectedToken; - var value; - if (token) { - if (!message) { - msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : - (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : - (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : - (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : - (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : - messages_1.Messages.UnexpectedToken; - if (token.type === 4 /* Keyword */) { - if (this.scanner.isFutureReservedWord(token.value)) { - msg = messages_1.Messages.UnexpectedReserved; - } - else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { - msg = messages_1.Messages.StrictReservedWord; - } - } - } - value = token.value; - } - else { - value = 'ILLEGAL'; - } - msg = msg.replace('%0', value); - if (token && typeof token.lineNumber === 'number') { - var index = token.start; - var line = token.lineNumber; - var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; - var column = token.start - lastMarkerLineStart + 1; - return this.errorHandler.createError(index, line, column, msg); - } - else { - var index = this.lastMarker.index; - var line = this.lastMarker.line; - var column = this.lastMarker.column + 1; - return this.errorHandler.createError(index, line, column, msg); - } - }; - Parser.prototype.throwUnexpectedToken = function (token, message) { - throw this.unexpectedTokenError(token, message); - }; - Parser.prototype.tolerateUnexpectedToken = function (token, message) { - this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); - }; - Parser.prototype.collectComments = function () { - if (!this.config.comment) { - this.scanner.scanComments(); - } - else { - var comments = this.scanner.scanComments(); - if (comments.length > 0 && this.delegate) { - for (var i = 0; i < comments.length; ++i) { - var e = comments[i]; - var node = void 0; - node = { - type: e.multiLine ? 'BlockComment' : 'LineComment', - value: this.scanner.source.slice(e.slice[0], e.slice[1]) - }; - if (this.config.range) { - node.range = e.range; - } - if (this.config.loc) { - node.loc = e.loc; - } - var metadata = { - start: { - line: e.loc.start.line, - column: e.loc.start.column, - offset: e.range[0] - }, - end: { - line: e.loc.end.line, - column: e.loc.end.column, - offset: e.range[1] - } - }; - this.delegate(node, metadata); - } - } - } - }; - // From internal representation to an external structure - Parser.prototype.getTokenRaw = function (token) { - return this.scanner.source.slice(token.start, token.end); - }; - Parser.prototype.convertToken = function (token) { - var t = { - type: token_1.TokenName[token.type], - value: this.getTokenRaw(token) - }; - if (this.config.range) { - t.range = [token.start, token.end]; - } - if (this.config.loc) { - t.loc = { - start: { - line: this.startMarker.line, - column: this.startMarker.column - }, - end: { - line: this.scanner.lineNumber, - column: this.scanner.index - this.scanner.lineStart - } - }; - } - if (token.type === 9 /* RegularExpression */) { - var pattern = token.pattern; - var flags = token.flags; - t.regex = { pattern: pattern, flags: flags }; - } - return t; - }; - Parser.prototype.nextToken = function () { - var token = this.lookahead; - this.lastMarker.index = this.scanner.index; - this.lastMarker.line = this.scanner.lineNumber; - this.lastMarker.column = this.scanner.index - this.scanner.lineStart; - this.collectComments(); - if (this.scanner.index !== this.startMarker.index) { - this.startMarker.index = this.scanner.index; - this.startMarker.line = this.scanner.lineNumber; - this.startMarker.column = this.scanner.index - this.scanner.lineStart; - } - var next = this.scanner.lex(); - this.hasLineTerminator = (token.lineNumber !== next.lineNumber); - if (next && this.context.strict && next.type === 3 /* Identifier */) { - if (this.scanner.isStrictModeReservedWord(next.value)) { - next.type = 4 /* Keyword */; - } - } - this.lookahead = next; - if (this.config.tokens && next.type !== 2 /* EOF */) { - this.tokens.push(this.convertToken(next)); - } - return token; - }; - Parser.prototype.nextRegexToken = function () { - this.collectComments(); - var token = this.scanner.scanRegExp(); - if (this.config.tokens) { - // Pop the previous token, '/' or '/=' - // This is added from the lookahead token. - this.tokens.pop(); - this.tokens.push(this.convertToken(token)); - } - // Prime the next lookahead. - this.lookahead = token; - this.nextToken(); - return token; - }; - Parser.prototype.createNode = function () { - return { - index: this.startMarker.index, - line: this.startMarker.line, - column: this.startMarker.column - }; - }; - Parser.prototype.startNode = function (token, lastLineStart) { - if (lastLineStart === void 0) { lastLineStart = 0; } - var column = token.start - token.lineStart; - var line = token.lineNumber; - if (column < 0) { - column += lastLineStart; - line--; - } - return { - index: token.start, - line: line, - column: column - }; - }; - Parser.prototype.finalize = function (marker, node) { - if (this.config.range) { - node.range = [marker.index, this.lastMarker.index]; - } - if (this.config.loc) { - node.loc = { - start: { - line: marker.line, - column: marker.column, - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column - } - }; - if (this.config.source) { - node.loc.source = this.config.source; - } - } - if (this.delegate) { - var metadata = { - start: { - line: marker.line, - column: marker.column, - offset: marker.index - }, - end: { - line: this.lastMarker.line, - column: this.lastMarker.column, - offset: this.lastMarker.index - } - }; - this.delegate(node, metadata); - } - return node; - }; - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - Parser.prototype.expect = function (value) { - var token = this.nextToken(); - if (token.type !== 7 /* Punctuator */ || token.value !== value) { - this.throwUnexpectedToken(token); - } - }; - // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). - Parser.prototype.expectCommaSeparator = function () { - if (this.config.tolerant) { - var token = this.lookahead; - if (token.type === 7 /* Punctuator */ && token.value === ',') { - this.nextToken(); - } - else if (token.type === 7 /* Punctuator */ && token.value === ';') { - this.nextToken(); - this.tolerateUnexpectedToken(token); - } - else { - this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); - } - } - else { - this.expect(','); - } - }; - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - Parser.prototype.expectKeyword = function (keyword) { - var token = this.nextToken(); - if (token.type !== 4 /* Keyword */ || token.value !== keyword) { - this.throwUnexpectedToken(token); - } - }; - // Return true if the next token matches the specified punctuator. - Parser.prototype.match = function (value) { - return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; - }; - // Return true if the next token matches the specified keyword - Parser.prototype.matchKeyword = function (keyword) { - return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; - }; - // Return true if the next token matches the specified contextual keyword - // (where an identifier is sometimes a keyword depending on the context) - Parser.prototype.matchContextualKeyword = function (keyword) { - return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; - }; - // Return true if the next token is an assignment operator - Parser.prototype.matchAssign = function () { - if (this.lookahead.type !== 7 /* Punctuator */) { - return false; - } - var op = this.lookahead.value; - return op === '=' || - op === '*=' || - op === '**=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - }; - // Cover grammar support. - // - // When an assignment expression position starts with an left parenthesis, the determination of the type - // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) - // or the first comma. This situation also defers the determination of all the expressions nested in the pair. - // - // There are three productions that can be parsed in a parentheses pair that needs to be determined - // after the outermost pair is closed. They are: - // - // 1. AssignmentExpression - // 2. BindingElements - // 3. AssignmentTargets - // - // In order to avoid exponential backtracking, we use two flags to denote if the production can be - // binding element or assignment target. - // - // The three productions have the relationship: - // - // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression - // - // with a single exception that CoverInitializedName when used directly in an Expression, generates - // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the - // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. - // - // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not - // effect the current flags. This means the production the parser parses is only used as an expression. Therefore - // the CoverInitializedName check is conducted. - // - // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates - // the flags outside of the parser. This means the production the parser parses is used as a part of a potential - // pattern. The CoverInitializedName check is deferred. - Parser.prototype.isolateCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - if (this.context.firstCoverInitializedNameError !== null) { - this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); - } - this.context.isBindingElement = previousIsBindingElement; - this.context.isAssignmentTarget = previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; - return result; - }; - Parser.prototype.inheritCoverGrammar = function (parseFunction) { - var previousIsBindingElement = this.context.isBindingElement; - var previousIsAssignmentTarget = this.context.isAssignmentTarget; - var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; - this.context.isBindingElement = true; - this.context.isAssignmentTarget = true; - this.context.firstCoverInitializedNameError = null; - var result = parseFunction.call(this); - this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; - this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; - this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; - return result; - }; - Parser.prototype.consumeSemicolon = function () { - if (this.match(';')) { - this.nextToken(); - } - else if (!this.hasLineTerminator) { - if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { - this.throwUnexpectedToken(this.lookahead); - } - this.lastMarker.index = this.startMarker.index; - this.lastMarker.line = this.startMarker.line; - this.lastMarker.column = this.startMarker.column; - } - }; - // https://tc39.github.io/ecma262/#sec-primary-expression - Parser.prototype.parsePrimaryExpression = function () { - var node = this.createNode(); - var expr; - var token, raw; - switch (this.lookahead.type) { - case 3 /* Identifier */: - if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { - this.tolerateUnexpectedToken(this.lookahead); - } - expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); - break; - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - if (this.context.strict && this.lookahead.octal) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 1 /* BooleanLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); - break; - case 5 /* NullLiteral */: - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - token = this.nextToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.Literal(null, raw)); - break; - case 10 /* Template */: - expr = this.parseTemplateLiteral(); - break; - case 7 /* Punctuator */: - switch (this.lookahead.value) { - case '(': - this.context.isBindingElement = false; - expr = this.inheritCoverGrammar(this.parseGroupExpression); - break; - case '[': - expr = this.inheritCoverGrammar(this.parseArrayInitializer); - break; - case '{': - expr = this.inheritCoverGrammar(this.parseObjectInitializer); - break; - case '/': - case '/=': - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.scanner.index = this.startMarker.index; - token = this.nextRegexToken(); - raw = this.getTokenRaw(token); - expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - break; - case 4 /* Keyword */: - if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseIdentifierName(); - } - else if (!this.context.strict && this.matchKeyword('let')) { - expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); - } - else { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - if (this.matchKeyword('function')) { - expr = this.parseFunctionExpression(); - } - else if (this.matchKeyword('this')) { - this.nextToken(); - expr = this.finalize(node, new Node.ThisExpression()); - } - else if (this.matchKeyword('class')) { - expr = this.parseClassExpression(); - } - else { - expr = this.throwUnexpectedToken(this.nextToken()); - } - } - break; - default: - expr = this.throwUnexpectedToken(this.nextToken()); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-array-initializer - Parser.prototype.parseSpreadElement = function () { - var node = this.createNode(); - this.expect('...'); - var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); - return this.finalize(node, new Node.SpreadElement(arg)); - }; - Parser.prototype.parseArrayInitializer = function () { - var node = this.createNode(); - var elements = []; - this.expect('['); - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else if (this.match('...')) { - var element = this.parseSpreadElement(); - if (!this.match(']')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - this.expect(','); - } - elements.push(element); - } - else { - elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayExpression(elements)); - }; - // https://tc39.github.io/ecma262/#sec-object-initializer - Parser.prototype.parsePropertyMethod = function (params) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = params.simple; - var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); - if (this.context.strict && params.firstRestricted) { - this.tolerateUnexpectedToken(params.firstRestricted, params.message); - } - if (this.context.strict && params.stricted) { - this.tolerateUnexpectedToken(params.stricted, params.message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - return body; - }; - Parser.prototype.parsePropertyMethodFunction = function () { - var isGenerator = false; - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - Parser.prototype.parsePropertyMethodAsyncFunction = function () { - var node = this.createNode(); - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = false; - this.context.await = true; - var params = this.parseFormalParameters(); - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); - }; - Parser.prototype.parseObjectPropertyKey = function () { - var node = this.createNode(); - var token = this.nextToken(); - var key; - switch (token.type) { - case 8 /* StringLiteral */: - case 6 /* NumericLiteral */: - if (this.context.strict && token.octal) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); - } - var raw = this.getTokenRaw(token); - key = this.finalize(node, new Node.Literal(token.value, raw)); - break; - case 3 /* Identifier */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 4 /* Keyword */: - key = this.finalize(node, new Node.Identifier(token.value)); - break; - case 7 /* Punctuator */: - if (token.value === '[') { - key = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.expect(']'); - } - else { - key = this.throwUnexpectedToken(token); - } - break; - default: - key = this.throwUnexpectedToken(token); - } - return key; - }; - Parser.prototype.isPropertyKey = function (key, value) { - return (key.type === syntax_1.Syntax.Identifier && key.name === value) || - (key.type === syntax_1.Syntax.Literal && key.value === value); - }; - Parser.prototype.parseObjectProperty = function (hasProto) { - var node = this.createNode(); - var token = this.lookahead; - var kind; - var key = null; - var value = null; - var computed = false; - var method = false; - var shorthand = false; - var isAsync = false; - if (token.type === 3 /* Identifier */) { - var id = token.value; - this.nextToken(); - computed = this.match('['); - isAsync = !this.hasLineTerminator && (id === 'async') && - !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); - key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); - } - else if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - else { - if (!key) { - this.throwUnexpectedToken(this.lookahead); - } - kind = 'init'; - if (this.match(':') && !isAsync) { - if (!computed && this.isPropertyKey(key, '__proto__')) { - if (hasProto.value) { - this.tolerateError(messages_1.Messages.DuplicateProtoProperty); - } - hasProto.value = true; - } - this.nextToken(); - value = this.inheritCoverGrammar(this.parseAssignmentExpression); - } - else if (this.match('(')) { - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - else if (token.type === 3 /* Identifier */) { - var id = this.finalize(node, new Node.Identifier(token.value)); - if (this.match('=')) { - this.context.firstCoverInitializedNameError = this.lookahead; - this.nextToken(); - shorthand = true; - var init = this.isolateCoverGrammar(this.parseAssignmentExpression); - value = this.finalize(node, new Node.AssignmentPattern(id, init)); - } - else { - shorthand = true; - value = id; - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectInitializer = function () { - var node = this.createNode(); - this.expect('{'); - var properties = []; - var hasProto = { value: false }; - while (!this.match('}')) { - properties.push(this.parseObjectProperty(hasProto)); - if (!this.match('}')) { - this.expectCommaSeparator(); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectExpression(properties)); - }; - // https://tc39.github.io/ecma262/#sec-template-literals - Parser.prototype.parseTemplateHead = function () { - assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateElement = function () { - if (this.lookahead.type !== 10 /* Template */) { - this.throwUnexpectedToken(); - } - var node = this.createNode(); - var token = this.nextToken(); - var raw = token.value; - var cooked = token.cooked; - return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); - }; - Parser.prototype.parseTemplateLiteral = function () { - var node = this.createNode(); - var expressions = []; - var quasis = []; - var quasi = this.parseTemplateHead(); - quasis.push(quasi); - while (!quasi.tail) { - expressions.push(this.parseExpression()); - quasi = this.parseTemplateElement(); - quasis.push(quasi); - } - return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); - }; - // https://tc39.github.io/ecma262/#sec-grouping-operator - Parser.prototype.reinterpretExpressionAsPattern = function (expr) { - switch (expr.type) { - case syntax_1.Syntax.Identifier: - case syntax_1.Syntax.MemberExpression: - case syntax_1.Syntax.RestElement: - case syntax_1.Syntax.AssignmentPattern: - break; - case syntax_1.Syntax.SpreadElement: - expr.type = syntax_1.Syntax.RestElement; - this.reinterpretExpressionAsPattern(expr.argument); - break; - case syntax_1.Syntax.ArrayExpression: - expr.type = syntax_1.Syntax.ArrayPattern; - for (var i = 0; i < expr.elements.length; i++) { - if (expr.elements[i] !== null) { - this.reinterpretExpressionAsPattern(expr.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectExpression: - expr.type = syntax_1.Syntax.ObjectPattern; - for (var i = 0; i < expr.properties.length; i++) { - this.reinterpretExpressionAsPattern(expr.properties[i].value); - } - break; - case syntax_1.Syntax.AssignmentExpression: - expr.type = syntax_1.Syntax.AssignmentPattern; - delete expr.operator; - this.reinterpretExpressionAsPattern(expr.left); - break; - default: - // Allow other node type for tolerant parsing. - break; - } - }; - Parser.prototype.parseGroupExpression = function () { - var expr; - this.expect('('); - if (this.match(')')) { - this.nextToken(); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [], - async: false - }; - } - else { - var startToken = this.lookahead; - var params = []; - if (this.match('...')) { - expr = this.parseRestElement(params); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - else { - var arrow = false; - this.context.isBindingElement = true; - expr = this.inheritCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - this.context.isAssignmentTarget = false; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - if (this.match(')')) { - this.nextToken(); - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else if (this.match('...')) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - expressions.push(this.parseRestElement(params)); - this.expect(')'); - if (!this.match('=>')) { - this.expect('=>'); - } - this.context.isBindingElement = false; - for (var i = 0; i < expressions.length; i++) { - this.reinterpretExpressionAsPattern(expressions[i]); - } - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: expressions, - async: false - }; - } - else { - expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); - } - if (arrow) { - break; - } - } - if (!arrow) { - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - } - if (!arrow) { - this.expect(')'); - if (this.match('=>')) { - if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { - arrow = true; - expr = { - type: ArrowParameterPlaceHolder, - params: [expr], - async: false - }; - } - if (!arrow) { - if (!this.context.isBindingElement) { - this.throwUnexpectedToken(this.lookahead); - } - if (expr.type === syntax_1.Syntax.SequenceExpression) { - for (var i = 0; i < expr.expressions.length; i++) { - this.reinterpretExpressionAsPattern(expr.expressions[i]); - } - } - else { - this.reinterpretExpressionAsPattern(expr); - } - var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); - expr = { - type: ArrowParameterPlaceHolder, - params: parameters, - async: false - }; - } - } - this.context.isBindingElement = false; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions - Parser.prototype.parseArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAssignmentExpression); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.isIdentifierName = function (token) { - return token.type === 3 /* Identifier */ || - token.type === 4 /* Keyword */ || - token.type === 1 /* BooleanLiteral */ || - token.type === 5 /* NullLiteral */; - }; - Parser.prototype.parseIdentifierName = function () { - var node = this.createNode(); - var token = this.nextToken(); - if (!this.isIdentifierName(token)) { - this.throwUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseNewExpression = function () { - var node = this.createNode(); - var id = this.parseIdentifierName(); - assert_1.assert(id.name === 'new', 'New expression must start with `new`'); - var expr; - if (this.match('.')) { - this.nextToken(); - if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { - var property = this.parseIdentifierName(); - expr = new Node.MetaProperty(id, property); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); - var args = this.match('(') ? this.parseArguments() : []; - expr = new Node.NewExpression(callee, args); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return this.finalize(node, expr); - }; - Parser.prototype.parseAsyncArgument = function () { - var arg = this.parseAssignmentExpression(); - this.context.firstCoverInitializedNameError = null; - return arg; - }; - Parser.prototype.parseAsyncArguments = function () { - this.expect('('); - var args = []; - if (!this.match(')')) { - while (true) { - var expr = this.match('...') ? this.parseSpreadElement() : - this.isolateCoverGrammar(this.parseAsyncArgument); - args.push(expr); - if (this.match(')')) { - break; - } - this.expectCommaSeparator(); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return args; - }; - Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { - var startToken = this.lookahead; - var maybeAsync = this.matchContextualKeyword('async'); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var expr; - if (this.matchKeyword('super') && this.context.inFunctionBody) { - expr = this.createNode(); - this.nextToken(); - expr = this.finalize(expr, new Node.Super()); - if (!this.match('(') && !this.match('.') && !this.match('[')) { - this.throwUnexpectedToken(this.lookahead); - } - } - else { - expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - } - while (true) { - if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); - } - else if (this.match('(')) { - var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); - this.context.isBindingElement = false; - this.context.isAssignmentTarget = false; - var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); - expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); - if (asyncArrow && this.match('=>')) { - for (var i = 0; i < args.length; ++i) { - this.reinterpretExpressionAsPattern(args[i]); - } - expr = { - type: ArrowParameterPlaceHolder, - params: args, - async: true - }; - } - } - else if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - this.context.allowIn = previousAllowIn; - return expr; - }; - Parser.prototype.parseSuper = function () { - var node = this.createNode(); - this.expectKeyword('super'); - if (!this.match('[') && !this.match('.')) { - this.throwUnexpectedToken(this.lookahead); - } - return this.finalize(node, new Node.Super()); - }; - Parser.prototype.parseLeftHandSideExpression = function () { - assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); - var node = this.startNode(this.lookahead); - var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : - this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); - while (true) { - if (this.match('[')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('['); - var property = this.isolateCoverGrammar(this.parseExpression); - this.expect(']'); - expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); - } - else if (this.match('.')) { - this.context.isBindingElement = false; - this.context.isAssignmentTarget = true; - this.expect('.'); - var property = this.parseIdentifierName(); - expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); - } - else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { - var quasi = this.parseTemplateLiteral(); - expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); - } - else { - break; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-update-expressions - Parser.prototype.parseUpdateExpression = function () { - var expr; - var startToken = this.lookahead; - if (this.match('++') || this.match('--')) { - var node = this.startNode(startToken); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPrefix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - var prefix = true; - expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { - if (this.match('++') || this.match('--')) { - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { - this.tolerateError(messages_1.Messages.StrictLHSPostfix); - } - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var operator = this.nextToken().value; - var prefix = false; - expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-unary-operators - Parser.prototype.parseAwaitExpression = function () { - var node = this.createNode(); - this.nextToken(); - var argument = this.parseUnaryExpression(); - return this.finalize(node, new Node.AwaitExpression(argument)); - }; - Parser.prototype.parseUnaryExpression = function () { - var expr; - if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || - this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { - var node = this.startNode(this.lookahead); - var token = this.nextToken(); - expr = this.inheritCoverGrammar(this.parseUnaryExpression); - expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); - if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { - this.tolerateError(messages_1.Messages.StrictDelete); - } - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else if (this.context.await && this.matchContextualKeyword('await')) { - expr = this.parseAwaitExpression(); - } - else { - expr = this.parseUpdateExpression(); - } - return expr; - }; - Parser.prototype.parseExponentiationExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseUnaryExpression); - if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-exp-operator - // https://tc39.github.io/ecma262/#sec-multiplicative-operators - // https://tc39.github.io/ecma262/#sec-additive-operators - // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators - // https://tc39.github.io/ecma262/#sec-relational-operators - // https://tc39.github.io/ecma262/#sec-equality-operators - // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators - // https://tc39.github.io/ecma262/#sec-binary-logical-operators - Parser.prototype.binaryPrecedence = function (token) { - var op = token.value; - var precedence; - if (token.type === 7 /* Punctuator */) { - precedence = this.operatorPrecedence[op] || 0; - } - else if (token.type === 4 /* Keyword */) { - precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; - } - else { - precedence = 0; - } - return precedence; - }; - Parser.prototype.parseBinaryExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); - var token = this.lookahead; - var prec = this.binaryPrecedence(token); - if (prec > 0) { - this.nextToken(); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var markers = [startToken, this.lookahead]; - var left = expr; - var right = this.isolateCoverGrammar(this.parseExponentiationExpression); - var stack = [left, token.value, right]; - var precedences = [prec]; - while (true) { - prec = this.binaryPrecedence(this.lookahead); - if (prec <= 0) { - break; - } - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { - right = stack.pop(); - var operator = stack.pop(); - precedences.pop(); - left = stack.pop(); - markers.pop(); - var node = this.startNode(markers[markers.length - 1]); - stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); - } - // Shift. - stack.push(this.nextToken().value); - precedences.push(prec); - markers.push(this.lookahead); - stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); - } - // Final reduce to clean-up the stack. - var i = stack.length - 1; - expr = stack[i]; - var lastMarker = markers.pop(); - while (i > 1) { - var marker = markers.pop(); - var lastLineStart = lastMarker && lastMarker.lineStart; - var node = this.startNode(marker, lastLineStart); - var operator = stack[i - 1]; - expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); - i -= 2; - lastMarker = marker; - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-conditional-operator - Parser.prototype.parseConditionalExpression = function () { - var startToken = this.lookahead; - var expr = this.inheritCoverGrammar(this.parseBinaryExpression); - if (this.match('?')) { - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - this.expect(':'); - var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-assignment-operators - Parser.prototype.checkPatternParam = function (options, param) { - switch (param.type) { - case syntax_1.Syntax.Identifier: - this.validateParam(options, param, param.name); - break; - case syntax_1.Syntax.RestElement: - this.checkPatternParam(options, param.argument); - break; - case syntax_1.Syntax.AssignmentPattern: - this.checkPatternParam(options, param.left); - break; - case syntax_1.Syntax.ArrayPattern: - for (var i = 0; i < param.elements.length; i++) { - if (param.elements[i] !== null) { - this.checkPatternParam(options, param.elements[i]); - } - } - break; - case syntax_1.Syntax.ObjectPattern: - for (var i = 0; i < param.properties.length; i++) { - this.checkPatternParam(options, param.properties[i].value); - } - break; - default: - break; - } - options.simple = options.simple && (param instanceof Node.Identifier); - }; - Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { - var params = [expr]; - var options; - var asyncArrow = false; - switch (expr.type) { - case syntax_1.Syntax.Identifier: - break; - case ArrowParameterPlaceHolder: - params = expr.params; - asyncArrow = expr.async; - break; - default: - return null; - } - options = { - simple: true, - paramSet: {} - }; - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.AssignmentPattern) { - if (param.right.type === syntax_1.Syntax.YieldExpression) { - if (param.right.argument) { - this.throwUnexpectedToken(this.lookahead); - } - param.right.type = syntax_1.Syntax.Identifier; - param.right.name = 'yield'; - delete param.right.argument; - delete param.right.delegate; - } - } - else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { - this.throwUnexpectedToken(this.lookahead); - } - this.checkPatternParam(options, param); - params[i] = param; - } - if (this.context.strict || !this.context.allowYield) { - for (var i = 0; i < params.length; ++i) { - var param = params[i]; - if (param.type === syntax_1.Syntax.YieldExpression) { - this.throwUnexpectedToken(this.lookahead); - } - } - } - if (options.message === messages_1.Messages.StrictParamDupe) { - var token = this.context.strict ? options.stricted : options.firstRestricted; - this.throwUnexpectedToken(token, options.message); - } - return { - simple: options.simple, - params: params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.parseAssignmentExpression = function () { - var expr; - if (!this.context.allowYield && this.matchKeyword('yield')) { - expr = this.parseYieldExpression(); - } - else { - var startToken = this.lookahead; - var token = startToken; - expr = this.parseConditionalExpression(); - if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { - if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { - var arg = this.parsePrimaryExpression(); - this.reinterpretExpressionAsPattern(arg); - expr = { - type: ArrowParameterPlaceHolder, - params: [arg], - async: true - }; - } - } - if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { - // https://tc39.github.io/ecma262/#sec-arrow-function-definitions - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - var isAsync = expr.async; - var list = this.reinterpretAsCoverFormalsList(expr); - if (list) { - if (this.hasLineTerminator) { - this.tolerateUnexpectedToken(this.lookahead); - } - this.context.firstCoverInitializedNameError = null; - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = list.simple; - var previousAllowYield = this.context.allowYield; - var previousAwait = this.context.await; - this.context.allowYield = true; - this.context.await = isAsync; - var node = this.startNode(startToken); - this.expect('=>'); - var body = void 0; - if (this.match('{')) { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = true; - body = this.parseFunctionSourceElements(); - this.context.allowIn = previousAllowIn; - } - else { - body = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - var expression = body.type !== syntax_1.Syntax.BlockStatement; - if (this.context.strict && list.firstRestricted) { - this.throwUnexpectedToken(list.firstRestricted, list.message); - } - if (this.context.strict && list.stricted) { - this.tolerateUnexpectedToken(list.stricted, list.message); - } - expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : - this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.allowYield = previousAllowYield; - this.context.await = previousAwait; - } - } - else { - if (this.matchAssign()) { - if (!this.context.isAssignmentTarget) { - this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); - } - if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { - var id = expr; - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); - } - if (this.scanner.isStrictModeReservedWord(id.name)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - } - if (!this.match('=')) { - this.context.isAssignmentTarget = false; - this.context.isBindingElement = false; - } - else { - this.reinterpretExpressionAsPattern(expr); - } - token = this.nextToken(); - var operator = token.value; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); - this.context.firstCoverInitializedNameError = null; - } - } - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-comma-operator - Parser.prototype.parseExpression = function () { - var startToken = this.lookahead; - var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); - if (this.match(',')) { - var expressions = []; - expressions.push(expr); - while (this.lookahead.type !== 2 /* EOF */) { - if (!this.match(',')) { - break; - } - this.nextToken(); - expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); - } - return expr; - }; - // https://tc39.github.io/ecma262/#sec-block - Parser.prototype.parseStatementListItem = function () { - var statement; - this.context.isAssignmentTarget = true; - this.context.isBindingElement = true; - if (this.lookahead.type === 4 /* Keyword */) { - switch (this.lookahead.value) { - case 'export': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); - } - statement = this.parseExportDeclaration(); - break; - case 'import': - if (!this.context.isModule) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); - } - statement = this.parseImportDeclaration(); - break; - case 'const': - statement = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'class': - statement = this.parseClassDeclaration(); - break; - case 'let': - statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); - break; - default: - statement = this.parseStatement(); - break; - } - } - else { - statement = this.parseStatement(); - } - return statement; - }; - Parser.prototype.parseBlock = function () { - var node = this.createNode(); - this.expect('{'); - var block = []; - while (true) { - if (this.match('}')) { - break; - } - block.push(this.parseStatementListItem()); - } - this.expect('}'); - return this.finalize(node, new Node.BlockStatement(block)); - }; - // https://tc39.github.io/ecma262/#sec-let-and-const-declarations - Parser.prototype.parseLexicalBinding = function (kind, options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, kind); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (kind === 'const') { - if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else { - this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); - } - } - } - else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { - this.expect('='); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseBindingList = function (kind, options) { - var list = [this.parseLexicalBinding(kind, options)]; - while (this.match(',')) { - this.nextToken(); - list.push(this.parseLexicalBinding(kind, options)); - } - return list; - }; - Parser.prototype.isLexicalDeclaration = function () { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - return (next.type === 3 /* Identifier */) || - (next.type === 7 /* Punctuator */ && next.value === '[') || - (next.type === 7 /* Punctuator */ && next.value === '{') || - (next.type === 4 /* Keyword */ && next.value === 'let') || - (next.type === 4 /* Keyword */ && next.value === 'yield'); - }; - Parser.prototype.parseLexicalDeclaration = function (options) { - var node = this.createNode(); - var kind = this.nextToken().value; - assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); - var declarations = this.parseBindingList(kind, options); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); - }; - // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns - Parser.prototype.parseBindingRestElement = function (params, kind) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params, kind); - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseArrayPattern = function (params, kind) { - var node = this.createNode(); - this.expect('['); - var elements = []; - while (!this.match(']')) { - if (this.match(',')) { - this.nextToken(); - elements.push(null); - } - else { - if (this.match('...')) { - elements.push(this.parseBindingRestElement(params, kind)); - break; - } - else { - elements.push(this.parsePatternWithDefault(params, kind)); - } - if (!this.match(']')) { - this.expect(','); - } - } - } - this.expect(']'); - return this.finalize(node, new Node.ArrayPattern(elements)); - }; - Parser.prototype.parsePropertyPattern = function (params, kind) { - var node = this.createNode(); - var computed = false; - var shorthand = false; - var method = false; - var key; - var value; - if (this.lookahead.type === 3 /* Identifier */) { - var keyToken = this.lookahead; - key = this.parseVariableIdentifier(); - var init = this.finalize(node, new Node.Identifier(keyToken.value)); - if (this.match('=')) { - params.push(keyToken); - shorthand = true; - this.nextToken(); - var expr = this.parseAssignmentExpression(); - value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); - } - else if (!this.match(':')) { - params.push(keyToken); - shorthand = true; - value = init; - } - else { - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.expect(':'); - value = this.parsePatternWithDefault(params, kind); - } - return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); - }; - Parser.prototype.parseObjectPattern = function (params, kind) { - var node = this.createNode(); - var properties = []; - this.expect('{'); - while (!this.match('}')) { - properties.push(this.parsePropertyPattern(params, kind)); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return this.finalize(node, new Node.ObjectPattern(properties)); - }; - Parser.prototype.parsePattern = function (params, kind) { - var pattern; - if (this.match('[')) { - pattern = this.parseArrayPattern(params, kind); - } - else if (this.match('{')) { - pattern = this.parseObjectPattern(params, kind); - } - else { - if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { - this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); - } - params.push(this.lookahead); - pattern = this.parseVariableIdentifier(kind); - } - return pattern; - }; - Parser.prototype.parsePatternWithDefault = function (params, kind) { - var startToken = this.lookahead; - var pattern = this.parsePattern(params, kind); - if (this.match('=')) { - this.nextToken(); - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var right = this.isolateCoverGrammar(this.parseAssignmentExpression); - this.context.allowYield = previousAllowYield; - pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); - } - return pattern; - }; - // https://tc39.github.io/ecma262/#sec-variable-statement - Parser.prototype.parseVariableIdentifier = function (kind) { - var node = this.createNode(); - var token = this.nextToken(); - if (token.type === 4 /* Keyword */ && token.value === 'yield') { - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else if (!this.context.allowYield) { - this.throwUnexpectedToken(token); - } - } - else if (token.type !== 3 /* Identifier */) { - if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); - } - else { - if (this.context.strict || token.value !== 'let' || kind !== 'var') { - this.throwUnexpectedToken(token); - } - } - } - else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { - this.tolerateUnexpectedToken(token); - } - return this.finalize(node, new Node.Identifier(token.value)); - }; - Parser.prototype.parseVariableDeclaration = function (options) { - var node = this.createNode(); - var params = []; - var id = this.parsePattern(params, 'var'); - if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(id.name)) { - this.tolerateError(messages_1.Messages.StrictVarName); - } - } - var init = null; - if (this.match('=')) { - this.nextToken(); - init = this.isolateCoverGrammar(this.parseAssignmentExpression); - } - else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { - this.expect('='); - } - return this.finalize(node, new Node.VariableDeclarator(id, init)); - }; - Parser.prototype.parseVariableDeclarationList = function (options) { - var opt = { inFor: options.inFor }; - var list = []; - list.push(this.parseVariableDeclaration(opt)); - while (this.match(',')) { - this.nextToken(); - list.push(this.parseVariableDeclaration(opt)); - } - return list; - }; - Parser.prototype.parseVariableStatement = function () { - var node = this.createNode(); - this.expectKeyword('var'); - var declarations = this.parseVariableDeclarationList({ inFor: false }); - this.consumeSemicolon(); - return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); - }; - // https://tc39.github.io/ecma262/#sec-empty-statement - Parser.prototype.parseEmptyStatement = function () { - var node = this.createNode(); - this.expect(';'); - return this.finalize(node, new Node.EmptyStatement()); - }; - // https://tc39.github.io/ecma262/#sec-expression-statement - Parser.prototype.parseExpressionStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ExpressionStatement(expr)); - }; - // https://tc39.github.io/ecma262/#sec-if-statement - Parser.prototype.parseIfClause = function () { - if (this.context.strict && this.matchKeyword('function')) { - this.tolerateError(messages_1.Messages.StrictFunction); - } - return this.parseStatement(); - }; - Parser.prototype.parseIfStatement = function () { - var node = this.createNode(); - var consequent; - var alternate = null; - this.expectKeyword('if'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - consequent = this.parseIfClause(); - if (this.matchKeyword('else')) { - this.nextToken(); - alternate = this.parseIfClause(); - } - } - return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); - }; - // https://tc39.github.io/ecma262/#sec-do-while-statement - Parser.prototype.parseDoWhileStatement = function () { - var node = this.createNode(); - this.expectKeyword('do'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - var body = this.parseStatement(); - this.context.inIteration = previousInIteration; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - } - else { - this.expect(')'); - if (this.match(';')) { - this.nextToken(); - } - } - return this.finalize(node, new Node.DoWhileStatement(body, test)); - }; - // https://tc39.github.io/ecma262/#sec-while-statement - Parser.prototype.parseWhileStatement = function () { - var node = this.createNode(); - var body; - this.expectKeyword('while'); - this.expect('('); - var test = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.parseStatement(); - this.context.inIteration = previousInIteration; - } - return this.finalize(node, new Node.WhileStatement(test, body)); - }; - // https://tc39.github.io/ecma262/#sec-for-statement - // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements - Parser.prototype.parseForStatement = function () { - var init = null; - var test = null; - var update = null; - var forIn = true; - var left, right; - var node = this.createNode(); - this.expectKeyword('for'); - this.expect('('); - if (this.match(';')) { - this.nextToken(); - } - else { - if (this.matchKeyword('var')) { - init = this.createNode(); - this.nextToken(); - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseVariableDeclarationList({ inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && this.matchKeyword('in')) { - var decl = declarations[0]; - if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { - this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); - } - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); - this.expect(';'); - } - } - else if (this.matchKeyword('const') || this.matchKeyword('let')) { - init = this.createNode(); - var kind = this.nextToken().value; - if (!this.context.strict && this.lookahead.value === 'in') { - init = this.finalize(init, new Node.Identifier(kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else { - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - var declarations = this.parseBindingList(kind, { inFor: true }); - this.context.allowIn = previousAllowIn; - if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseExpression(); - init = null; - } - else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - this.nextToken(); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - this.consumeSemicolon(); - init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); - } - } - } - else { - var initStartToken = this.lookahead; - var previousAllowIn = this.context.allowIn; - this.context.allowIn = false; - init = this.inheritCoverGrammar(this.parseAssignmentExpression); - this.context.allowIn = previousAllowIn; - if (this.matchKeyword('in')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForIn); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseExpression(); - init = null; - } - else if (this.matchContextualKeyword('of')) { - if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { - this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); - } - this.nextToken(); - this.reinterpretExpressionAsPattern(init); - left = init; - right = this.parseAssignmentExpression(); - init = null; - forIn = false; - } - else { - if (this.match(',')) { - var initSeq = [init]; - while (this.match(',')) { - this.nextToken(); - initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); - } - init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); - } - this.expect(';'); - } - } - } - if (typeof left === 'undefined') { - if (!this.match(';')) { - test = this.parseExpression(); - } - this.expect(';'); - if (!this.match(')')) { - update = this.parseExpression(); - } - } - var body; - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - var previousInIteration = this.context.inIteration; - this.context.inIteration = true; - body = this.isolateCoverGrammar(this.parseStatement); - this.context.inIteration = previousInIteration; - } - return (typeof left === 'undefined') ? - this.finalize(node, new Node.ForStatement(init, test, update, body)) : - forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : - this.finalize(node, new Node.ForOfStatement(left, right, body)); - }; - // https://tc39.github.io/ecma262/#sec-continue-statement - Parser.prototype.parseContinueStatement = function () { - var node = this.createNode(); - this.expectKeyword('continue'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - label = id; - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration) { - this.throwError(messages_1.Messages.IllegalContinue); - } - return this.finalize(node, new Node.ContinueStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-break-statement - Parser.prototype.parseBreakStatement = function () { - var node = this.createNode(); - this.expectKeyword('break'); - var label = null; - if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { - var id = this.parseVariableIdentifier(); - var key = '$' + id.name; - if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.UnknownLabel, id.name); - } - label = id; - } - this.consumeSemicolon(); - if (label === null && !this.context.inIteration && !this.context.inSwitch) { - this.throwError(messages_1.Messages.IllegalBreak); - } - return this.finalize(node, new Node.BreakStatement(label)); - }; - // https://tc39.github.io/ecma262/#sec-return-statement - Parser.prototype.parseReturnStatement = function () { - if (!this.context.inFunctionBody) { - this.tolerateError(messages_1.Messages.IllegalReturn); - } - var node = this.createNode(); - this.expectKeyword('return'); - var hasArgument = (!this.match(';') && !this.match('}') && - !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || - this.lookahead.type === 8 /* StringLiteral */ || - this.lookahead.type === 10 /* Template */; - var argument = hasArgument ? this.parseExpression() : null; - this.consumeSemicolon(); - return this.finalize(node, new Node.ReturnStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-with-statement - Parser.prototype.parseWithStatement = function () { - if (this.context.strict) { - this.tolerateError(messages_1.Messages.StrictModeWith); - } - var node = this.createNode(); - var body; - this.expectKeyword('with'); - this.expect('('); - var object = this.parseExpression(); - if (!this.match(')') && this.config.tolerant) { - this.tolerateUnexpectedToken(this.nextToken()); - body = this.finalize(this.createNode(), new Node.EmptyStatement()); - } - else { - this.expect(')'); - body = this.parseStatement(); - } - return this.finalize(node, new Node.WithStatement(object, body)); - }; - // https://tc39.github.io/ecma262/#sec-switch-statement - Parser.prototype.parseSwitchCase = function () { - var node = this.createNode(); - var test; - if (this.matchKeyword('default')) { - this.nextToken(); - test = null; - } - else { - this.expectKeyword('case'); - test = this.parseExpression(); - } - this.expect(':'); - var consequent = []; - while (true) { - if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { - break; - } - consequent.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.SwitchCase(test, consequent)); - }; - Parser.prototype.parseSwitchStatement = function () { - var node = this.createNode(); - this.expectKeyword('switch'); - this.expect('('); - var discriminant = this.parseExpression(); - this.expect(')'); - var previousInSwitch = this.context.inSwitch; - this.context.inSwitch = true; - var cases = []; - var defaultFound = false; - this.expect('{'); - while (true) { - if (this.match('}')) { - break; - } - var clause = this.parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - this.expect('}'); - this.context.inSwitch = previousInSwitch; - return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); - }; - // https://tc39.github.io/ecma262/#sec-labelled-statements - Parser.prototype.parseLabelledStatement = function () { - var node = this.createNode(); - var expr = this.parseExpression(); - var statement; - if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { - this.nextToken(); - var id = expr; - var key = '$' + id.name; - if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { - this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); - } - this.context.labelSet[key] = true; - var body = void 0; - if (this.matchKeyword('class')) { - this.tolerateUnexpectedToken(this.lookahead); - body = this.parseClassDeclaration(); - } - else if (this.matchKeyword('function')) { - var token = this.lookahead; - var declaration = this.parseFunctionDeclaration(); - if (this.context.strict) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); - } - else if (declaration.generator) { - this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); - } - body = declaration; - } - else { - body = this.parseStatement(); - } - delete this.context.labelSet[key]; - statement = new Node.LabeledStatement(id, body); - } - else { - this.consumeSemicolon(); - statement = new Node.ExpressionStatement(expr); - } - return this.finalize(node, statement); - }; - // https://tc39.github.io/ecma262/#sec-throw-statement - Parser.prototype.parseThrowStatement = function () { - var node = this.createNode(); - this.expectKeyword('throw'); - if (this.hasLineTerminator) { - this.throwError(messages_1.Messages.NewlineAfterThrow); - } - var argument = this.parseExpression(); - this.consumeSemicolon(); - return this.finalize(node, new Node.ThrowStatement(argument)); - }; - // https://tc39.github.io/ecma262/#sec-try-statement - Parser.prototype.parseCatchClause = function () { - var node = this.createNode(); - this.expectKeyword('catch'); - this.expect('('); - if (this.match(')')) { - this.throwUnexpectedToken(this.lookahead); - } - var params = []; - var param = this.parsePattern(params); - var paramMap = {}; - for (var i = 0; i < params.length; i++) { - var key = '$' + params[i].value; - if (Object.prototype.hasOwnProperty.call(paramMap, key)) { - this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); - } - paramMap[key] = true; - } - if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { - if (this.scanner.isRestrictedWord(param.name)) { - this.tolerateError(messages_1.Messages.StrictCatchVariable); - } - } - this.expect(')'); - var body = this.parseBlock(); - return this.finalize(node, new Node.CatchClause(param, body)); - }; - Parser.prototype.parseFinallyClause = function () { - this.expectKeyword('finally'); - return this.parseBlock(); - }; - Parser.prototype.parseTryStatement = function () { - var node = this.createNode(); - this.expectKeyword('try'); - var block = this.parseBlock(); - var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; - var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; - if (!handler && !finalizer) { - this.throwError(messages_1.Messages.NoCatchOrFinally); - } - return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); - }; - // https://tc39.github.io/ecma262/#sec-debugger-statement - Parser.prototype.parseDebuggerStatement = function () { - var node = this.createNode(); - this.expectKeyword('debugger'); - this.consumeSemicolon(); - return this.finalize(node, new Node.DebuggerStatement()); - }; - // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations - Parser.prototype.parseStatement = function () { - var statement; - switch (this.lookahead.type) { - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* Template */: - case 9 /* RegularExpression */: - statement = this.parseExpressionStatement(); - break; - case 7 /* Punctuator */: - var value = this.lookahead.value; - if (value === '{') { - statement = this.parseBlock(); - } - else if (value === '(') { - statement = this.parseExpressionStatement(); - } - else if (value === ';') { - statement = this.parseEmptyStatement(); - } - else { - statement = this.parseExpressionStatement(); - } - break; - case 3 /* Identifier */: - statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); - break; - case 4 /* Keyword */: - switch (this.lookahead.value) { - case 'break': - statement = this.parseBreakStatement(); - break; - case 'continue': - statement = this.parseContinueStatement(); - break; - case 'debugger': - statement = this.parseDebuggerStatement(); - break; - case 'do': - statement = this.parseDoWhileStatement(); - break; - case 'for': - statement = this.parseForStatement(); - break; - case 'function': - statement = this.parseFunctionDeclaration(); - break; - case 'if': - statement = this.parseIfStatement(); - break; - case 'return': - statement = this.parseReturnStatement(); - break; - case 'switch': - statement = this.parseSwitchStatement(); - break; - case 'throw': - statement = this.parseThrowStatement(); - break; - case 'try': - statement = this.parseTryStatement(); - break; - case 'var': - statement = this.parseVariableStatement(); - break; - case 'while': - statement = this.parseWhileStatement(); - break; - case 'with': - statement = this.parseWithStatement(); - break; - default: - statement = this.parseExpressionStatement(); - break; - } - break; - default: - statement = this.throwUnexpectedToken(this.lookahead); - } - return statement; - }; - // https://tc39.github.io/ecma262/#sec-function-definitions - Parser.prototype.parseFunctionSourceElements = function () { - var node = this.createNode(); - this.expect('{'); - var body = this.parseDirectivePrologues(); - var previousLabelSet = this.context.labelSet; - var previousInIteration = this.context.inIteration; - var previousInSwitch = this.context.inSwitch; - var previousInFunctionBody = this.context.inFunctionBody; - this.context.labelSet = {}; - this.context.inIteration = false; - this.context.inSwitch = false; - this.context.inFunctionBody = true; - while (this.lookahead.type !== 2 /* EOF */) { - if (this.match('}')) { - break; - } - body.push(this.parseStatementListItem()); - } - this.expect('}'); - this.context.labelSet = previousLabelSet; - this.context.inIteration = previousInIteration; - this.context.inSwitch = previousInSwitch; - this.context.inFunctionBody = previousInFunctionBody; - return this.finalize(node, new Node.BlockStatement(body)); - }; - Parser.prototype.validateParam = function (options, param, name) { - var key = '$' + name; - if (this.context.strict) { - if (this.scanner.isRestrictedWord(name)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - else if (!options.firstRestricted) { - if (this.scanner.isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictParamName; - } - else if (this.scanner.isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = messages_1.Messages.StrictReservedWord; - } - else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = messages_1.Messages.StrictParamDupe; - } - } - /* istanbul ignore next */ - if (typeof Object.defineProperty === 'function') { - Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); - } - else { - options.paramSet[key] = true; - } - }; - Parser.prototype.parseRestElement = function (params) { - var node = this.createNode(); - this.expect('...'); - var arg = this.parsePattern(params); - if (this.match('=')) { - this.throwError(messages_1.Messages.DefaultRestParameter); - } - if (!this.match(')')) { - this.throwError(messages_1.Messages.ParameterAfterRestParameter); - } - return this.finalize(node, new Node.RestElement(arg)); - }; - Parser.prototype.parseFormalParameter = function (options) { - var params = []; - var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); - for (var i = 0; i < params.length; i++) { - this.validateParam(options, params[i], params[i].value); - } - options.simple = options.simple && (param instanceof Node.Identifier); - options.params.push(param); - }; - Parser.prototype.parseFormalParameters = function (firstRestricted) { - var options; - options = { - simple: true, - params: [], - firstRestricted: firstRestricted - }; - this.expect('('); - if (!this.match(')')) { - options.paramSet = {}; - while (this.lookahead.type !== 2 /* EOF */) { - this.parseFormalParameter(options); - if (this.match(')')) { - break; - } - this.expect(','); - if (this.match(')')) { - break; - } - } - } - this.expect(')'); - return { - simple: options.simple, - params: options.params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - }; - Parser.prototype.matchAsyncFunction = function () { - var match = this.matchContextualKeyword('async'); - if (match) { - var state = this.scanner.saveState(); - this.scanner.scanComments(); - var next = this.scanner.lex(); - this.scanner.restoreState(state); - match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); - } - return match; - }; - Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted = null; - if (!identifierIsOptional || !this.match('(')) { - var token = this.lookahead; - id = this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : - this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); - }; - Parser.prototype.parseFunctionExpression = function () { - var node = this.createNode(); - var isAsync = this.matchContextualKeyword('async'); - if (isAsync) { - this.nextToken(); - } - this.expectKeyword('function'); - var isGenerator = isAsync ? false : this.match('*'); - if (isGenerator) { - this.nextToken(); - } - var message; - var id = null; - var firstRestricted; - var previousAllowAwait = this.context.await; - var previousAllowYield = this.context.allowYield; - this.context.await = isAsync; - this.context.allowYield = !isGenerator; - if (!this.match('(')) { - var token = this.lookahead; - id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); - if (this.context.strict) { - if (this.scanner.isRestrictedWord(token.value)) { - this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); - } - } - else { - if (this.scanner.isRestrictedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictFunctionName; - } - else if (this.scanner.isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = messages_1.Messages.StrictReservedWord; - } - } - } - var formalParameters = this.parseFormalParameters(firstRestricted); - var params = formalParameters.params; - var stricted = formalParameters.stricted; - firstRestricted = formalParameters.firstRestricted; - if (formalParameters.message) { - message = formalParameters.message; - } - var previousStrict = this.context.strict; - var previousAllowStrictDirective = this.context.allowStrictDirective; - this.context.allowStrictDirective = formalParameters.simple; - var body = this.parseFunctionSourceElements(); - if (this.context.strict && firstRestricted) { - this.throwUnexpectedToken(firstRestricted, message); - } - if (this.context.strict && stricted) { - this.tolerateUnexpectedToken(stricted, message); - } - this.context.strict = previousStrict; - this.context.allowStrictDirective = previousAllowStrictDirective; - this.context.await = previousAllowAwait; - this.context.allowYield = previousAllowYield; - return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : - this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive - Parser.prototype.parseDirective = function () { - var token = this.lookahead; - var node = this.createNode(); - var expr = this.parseExpression(); - var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; - this.consumeSemicolon(); - return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); - }; - Parser.prototype.parseDirectivePrologues = function () { - var firstRestricted = null; - var body = []; - while (true) { - var token = this.lookahead; - if (token.type !== 8 /* StringLiteral */) { - break; - } - var statement = this.parseDirective(); - body.push(statement); - var directive = statement.directive; - if (typeof directive !== 'string') { - break; - } - if (directive === 'use strict') { - this.context.strict = true; - if (firstRestricted) { - this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); - } - if (!this.context.allowStrictDirective) { - this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); - } - } - else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - return body; - }; - // https://tc39.github.io/ecma262/#sec-method-definitions - Parser.prototype.qualifiedPropertyName = function (token) { - switch (token.type) { - case 3 /* Identifier */: - case 8 /* StringLiteral */: - case 1 /* BooleanLiteral */: - case 5 /* NullLiteral */: - case 6 /* NumericLiteral */: - case 4 /* Keyword */: - return true; - case 7 /* Punctuator */: - return token.value === '['; - default: - break; - } - return false; - }; - Parser.prototype.parseGetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length > 0) { - this.tolerateError(messages_1.Messages.BadGetterArity); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseSetterMethod = function () { - var node = this.createNode(); - var isGenerator = false; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = !isGenerator; - var formalParameters = this.parseFormalParameters(); - if (formalParameters.params.length !== 1) { - this.tolerateError(messages_1.Messages.BadSetterArity); - } - else if (formalParameters.params[0] instanceof Node.RestElement) { - this.tolerateError(messages_1.Messages.BadSetterRestParameter); - } - var method = this.parsePropertyMethod(formalParameters); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); - }; - Parser.prototype.parseGeneratorMethod = function () { - var node = this.createNode(); - var isGenerator = true; - var previousAllowYield = this.context.allowYield; - this.context.allowYield = true; - var params = this.parseFormalParameters(); - this.context.allowYield = false; - var method = this.parsePropertyMethod(params); - this.context.allowYield = previousAllowYield; - return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); - }; - // https://tc39.github.io/ecma262/#sec-generator-function-definitions - Parser.prototype.isStartOfExpression = function () { - var start = true; - var value = this.lookahead.value; - switch (this.lookahead.type) { - case 7 /* Punctuator */: - start = (value === '[') || (value === '(') || (value === '{') || - (value === '+') || (value === '-') || - (value === '!') || (value === '~') || - (value === '++') || (value === '--') || - (value === '/') || (value === '/='); // regular expression literal - break; - case 4 /* Keyword */: - start = (value === 'class') || (value === 'delete') || - (value === 'function') || (value === 'let') || (value === 'new') || - (value === 'super') || (value === 'this') || (value === 'typeof') || - (value === 'void') || (value === 'yield'); - break; - default: - break; - } - return start; - }; - Parser.prototype.parseYieldExpression = function () { - var node = this.createNode(); - this.expectKeyword('yield'); - var argument = null; - var delegate = false; - if (!this.hasLineTerminator) { - var previousAllowYield = this.context.allowYield; - this.context.allowYield = false; - delegate = this.match('*'); - if (delegate) { - this.nextToken(); - argument = this.parseAssignmentExpression(); - } - else if (this.isStartOfExpression()) { - argument = this.parseAssignmentExpression(); - } - this.context.allowYield = previousAllowYield; - } - return this.finalize(node, new Node.YieldExpression(argument, delegate)); - }; - // https://tc39.github.io/ecma262/#sec-class-definitions - Parser.prototype.parseClassElement = function (hasConstructor) { - var token = this.lookahead; - var node = this.createNode(); - var kind = ''; - var key = null; - var value = null; - var computed = false; - var method = false; - var isStatic = false; - var isAsync = false; - if (this.match('*')) { - this.nextToken(); - } - else { - computed = this.match('['); - key = this.parseObjectPropertyKey(); - var id = key; - if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { - token = this.lookahead; - isStatic = true; - computed = this.match('['); - if (this.match('*')) { - this.nextToken(); - } - else { - key = this.parseObjectPropertyKey(); - } - } - if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { - var punctuator = this.lookahead.value; - if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { - isAsync = true; - token = this.lookahead; - key = this.parseObjectPropertyKey(); - if (token.type === 3 /* Identifier */ && token.value === 'constructor') { - this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); - } - } - } - } - var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); - if (token.type === 3 /* Identifier */) { - if (token.value === 'get' && lookaheadPropertyKey) { - kind = 'get'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - this.context.allowYield = false; - value = this.parseGetterMethod(); - } - else if (token.value === 'set' && lookaheadPropertyKey) { - kind = 'set'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseSetterMethod(); - } - } - else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { - kind = 'init'; - computed = this.match('['); - key = this.parseObjectPropertyKey(); - value = this.parseGeneratorMethod(); - method = true; - } - if (!kind && key && this.match('(')) { - kind = 'init'; - value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); - method = true; - } - if (!kind) { - this.throwUnexpectedToken(this.lookahead); - } - if (kind === 'init') { - kind = 'method'; - } - if (!computed) { - if (isStatic && this.isPropertyKey(key, 'prototype')) { - this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); - } - if (!isStatic && this.isPropertyKey(key, 'constructor')) { - if (kind !== 'method' || !method || (value && value.generator)) { - this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); - } - if (hasConstructor.value) { - this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); - } - else { - hasConstructor.value = true; - } - kind = 'constructor'; - } - } - return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); - }; - Parser.prototype.parseClassElementList = function () { - var body = []; - var hasConstructor = { value: false }; - this.expect('{'); - while (!this.match('}')) { - if (this.match(';')) { - this.nextToken(); - } - else { - body.push(this.parseClassElement(hasConstructor)); - } - } - this.expect('}'); - return body; - }; - Parser.prototype.parseClassBody = function () { - var node = this.createNode(); - var elementList = this.parseClassElementList(); - return this.finalize(node, new Node.ClassBody(elementList)); - }; - Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); - }; - Parser.prototype.parseClassExpression = function () { - var node = this.createNode(); - var previousStrict = this.context.strict; - this.context.strict = true; - this.expectKeyword('class'); - var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; - var superClass = null; - if (this.matchKeyword('extends')) { - this.nextToken(); - superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); - } - var classBody = this.parseClassBody(); - this.context.strict = previousStrict; - return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); - }; - // https://tc39.github.io/ecma262/#sec-scripts - // https://tc39.github.io/ecma262/#sec-modules - Parser.prototype.parseModule = function () { - this.context.strict = true; - this.context.isModule = true; - this.scanner.isModule = true; - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Module(body)); - }; - Parser.prototype.parseScript = function () { - var node = this.createNode(); - var body = this.parseDirectivePrologues(); - while (this.lookahead.type !== 2 /* EOF */) { - body.push(this.parseStatementListItem()); - } - return this.finalize(node, new Node.Script(body)); - }; - // https://tc39.github.io/ecma262/#sec-imports - Parser.prototype.parseModuleSpecifier = function () { - var node = this.createNode(); - if (this.lookahead.type !== 8 /* StringLiteral */) { - this.throwError(messages_1.Messages.InvalidModuleSpecifier); - } - var token = this.nextToken(); - var raw = this.getTokenRaw(token); - return this.finalize(node, new Node.Literal(token.value, raw)); - }; - // import {} ...; - Parser.prototype.parseImportSpecifier = function () { - var node = this.createNode(); - var imported; - var local; - if (this.lookahead.type === 3 /* Identifier */) { - imported = this.parseVariableIdentifier(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - } - else { - imported = this.parseIdentifierName(); - local = imported; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - local = this.parseVariableIdentifier(); - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - } - return this.finalize(node, new Node.ImportSpecifier(local, imported)); - }; - // {foo, bar as bas} - Parser.prototype.parseNamedImports = function () { - this.expect('{'); - var specifiers = []; - while (!this.match('}')) { - specifiers.push(this.parseImportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - return specifiers; - }; - // import ...; - Parser.prototype.parseImportDefaultSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportDefaultSpecifier(local)); - }; - // import <* as foo> ...; - Parser.prototype.parseImportNamespaceSpecifier = function () { - var node = this.createNode(); - this.expect('*'); - if (!this.matchContextualKeyword('as')) { - this.throwError(messages_1.Messages.NoAsAfterImportNamespace); - } - this.nextToken(); - var local = this.parseIdentifierName(); - return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); - }; - Parser.prototype.parseImportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalImportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('import'); - var src; - var specifiers = []; - if (this.lookahead.type === 8 /* StringLiteral */) { - // import 'foo'; - src = this.parseModuleSpecifier(); - } - else { - if (this.match('{')) { - // import {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else if (this.match('*')) { - // import * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { - // import foo - specifiers.push(this.parseImportDefaultSpecifier()); - if (this.match(',')) { - this.nextToken(); - if (this.match('*')) { - // import foo, * as foo - specifiers.push(this.parseImportNamespaceSpecifier()); - } - else if (this.match('{')) { - // import foo, {bar} - specifiers = specifiers.concat(this.parseNamedImports()); - } - else { - this.throwUnexpectedToken(this.lookahead); - } - } - } - else { - this.throwUnexpectedToken(this.nextToken()); - } - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - src = this.parseModuleSpecifier(); - } - this.consumeSemicolon(); - return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); - }; - // https://tc39.github.io/ecma262/#sec-exports - Parser.prototype.parseExportSpecifier = function () { - var node = this.createNode(); - var local = this.parseIdentifierName(); - var exported = local; - if (this.matchContextualKeyword('as')) { - this.nextToken(); - exported = this.parseIdentifierName(); - } - return this.finalize(node, new Node.ExportSpecifier(local, exported)); - }; - Parser.prototype.parseExportDeclaration = function () { - if (this.context.inFunctionBody) { - this.throwError(messages_1.Messages.IllegalExportDeclaration); - } - var node = this.createNode(); - this.expectKeyword('export'); - var exportDeclaration; - if (this.matchKeyword('default')) { - // export default ... - this.nextToken(); - if (this.matchKeyword('function')) { - // export default function foo () {} - // export default function () {} - var declaration = this.parseFunctionDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchKeyword('class')) { - // export default class foo {} - var declaration = this.parseClassDeclaration(true); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else if (this.matchContextualKeyword('async')) { - // export default async function f () {} - // export default async function () {} - // export default async x => x - var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - else { - if (this.matchContextualKeyword('from')) { - this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); - } - // export default {}; - // export default []; - // export default (1 + 2); - var declaration = this.match('{') ? this.parseObjectInitializer() : - this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); - } - } - else if (this.match('*')) { - // export * from 'foo'; - this.nextToken(); - if (!this.matchContextualKeyword('from')) { - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - this.nextToken(); - var src = this.parseModuleSpecifier(); - this.consumeSemicolon(); - exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); - } - else if (this.lookahead.type === 4 /* Keyword */) { - // export var f = 1; - var declaration = void 0; - switch (this.lookahead.value) { - case 'let': - case 'const': - declaration = this.parseLexicalDeclaration({ inFor: false }); - break; - case 'var': - case 'class': - case 'function': - declaration = this.parseStatementListItem(); - break; - default: - this.throwUnexpectedToken(this.lookahead); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else if (this.matchAsyncFunction()) { - var declaration = this.parseFunctionDeclaration(); - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); - } - else { - var specifiers = []; - var source = null; - var isExportFromIdentifier = false; - this.expect('{'); - while (!this.match('}')) { - isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); - specifiers.push(this.parseExportSpecifier()); - if (!this.match('}')) { - this.expect(','); - } - } - this.expect('}'); - if (this.matchContextualKeyword('from')) { - // export {default} from 'foo'; - // export {foo} from 'foo'; - this.nextToken(); - source = this.parseModuleSpecifier(); - this.consumeSemicolon(); - } - else if (isExportFromIdentifier) { - // export {default}; // missing fromClause - var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; - this.throwError(message, this.lookahead.value); - } - else { - // export {foo}; - this.consumeSemicolon(); - } - exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); - } - return exportDeclaration; - }; - return Parser; - }()); - exports.Parser = Parser; - - -/***/ }, -/* 9 */ -/***/ function(module, exports) { - - "use strict"; - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - Object.defineProperty(exports, "__esModule", { value: true }); - function assert(condition, message) { - /* istanbul ignore if */ - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - exports.assert = assert; - - -/***/ }, -/* 10 */ -/***/ function(module, exports) { - - "use strict"; - /* tslint:disable:max-classes-per-file */ - Object.defineProperty(exports, "__esModule", { value: true }); - var ErrorHandler = (function () { - function ErrorHandler() { - this.errors = []; - this.tolerant = false; - } - ErrorHandler.prototype.recordError = function (error) { - this.errors.push(error); - }; - ErrorHandler.prototype.tolerate = function (error) { - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - ErrorHandler.prototype.constructError = function (msg, column) { - var error = new Error(msg); - try { - throw error; - } - catch (base) { - /* istanbul ignore else */ - if (Object.create && Object.defineProperty) { - error = Object.create(base); - Object.defineProperty(error, 'column', { value: column }); - } - } - /* istanbul ignore next */ - return error; - }; - ErrorHandler.prototype.createError = function (index, line, col, description) { - var msg = 'Line ' + line + ': ' + description; - var error = this.constructError(msg, col); - error.index = index; - error.lineNumber = line; - error.description = description; - return error; - }; - ErrorHandler.prototype.throwError = function (index, line, col, description) { - throw this.createError(index, line, col, description); - }; - ErrorHandler.prototype.tolerateError = function (index, line, col, description) { - var error = this.createError(index, line, col, description); - if (this.tolerant) { - this.recordError(error); - } - else { - throw error; - } - }; - return ErrorHandler; - }()); - exports.ErrorHandler = ErrorHandler; - - -/***/ }, -/* 11 */ -/***/ function(module, exports) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - // Error messages should be identical to V8. - exports.Messages = { - BadGetterArity: 'Getter must not have any formal parameters', - BadSetterArity: 'Setter must have exactly one formal parameter', - BadSetterRestParameter: 'Setter function argument must not be a rest parameter', - ConstructorIsAsync: 'Class constructor may not be an async method', - ConstructorSpecialMethod: 'Class constructor may not be an accessor', - DeclarationMissingInitializer: 'Missing initializer in %0 declaration', - DefaultRestParameter: 'Unexpected token =', - DuplicateBinding: 'Duplicate binding %0', - DuplicateConstructor: 'A class may only have one constructor', - DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', - ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', - GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', - IllegalBreak: 'Illegal break statement', - IllegalContinue: 'Illegal continue statement', - IllegalExportDeclaration: 'Unexpected token', - IllegalImportDeclaration: 'Unexpected token', - IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', - IllegalReturn: 'Illegal return statement', - InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', - InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', - InvalidModuleSpecifier: 'Unexpected token', - InvalidRegExp: 'Invalid regular expression', - LetInLexicalBinding: 'let is disallowed as a lexically bound name', - MissingFromClause: 'Unexpected token', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NewlineAfterThrow: 'Illegal newline after throw', - NoAsAfterImportNamespace: 'Unexpected token', - NoCatchOrFinally: 'Missing catch or finally after try', - ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', - Redeclaration: '%0 \'%1\' has already been declared', - StaticPrototype: 'Classes may not have static property named prototype', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', - UnexpectedEOS: 'Unexpected end of input', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedNumber: 'Unexpected number', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedString: 'Unexpected string', - UnexpectedTemplate: 'Unexpected quasi %0', - UnexpectedToken: 'Unexpected token %0', - UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', - UnknownLabel: 'Undefined label \'%0\'', - UnterminatedRegExp: 'Invalid regular expression: missing /' - }; - - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - var assert_1 = __webpack_require__(9); - var character_1 = __webpack_require__(4); - var messages_1 = __webpack_require__(11); - function hexValue(ch) { - return '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - function octalValue(ch) { - return '01234567'.indexOf(ch); - } - var Scanner = (function () { - function Scanner(code, handler) { - this.source = code; - this.errorHandler = handler; - this.trackComment = false; - this.isModule = false; - this.length = code.length; - this.index = 0; - this.lineNumber = (code.length > 0) ? 1 : 0; - this.lineStart = 0; - this.curlyStack = []; - } - Scanner.prototype.saveState = function () { - return { - index: this.index, - lineNumber: this.lineNumber, - lineStart: this.lineStart - }; - }; - Scanner.prototype.restoreState = function (state) { - this.index = state.index; - this.lineNumber = state.lineNumber; - this.lineStart = state.lineStart; - }; - Scanner.prototype.eof = function () { - return this.index >= this.length; - }; - Scanner.prototype.throwUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - Scanner.prototype.tolerateUnexpectedToken = function (message) { - if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } - this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); - }; - // https://tc39.github.io/ecma262/#sec-comments - Scanner.prototype.skipSingleLineComment = function (offset) { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - offset; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - offset - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - ++this.index; - if (character_1.Character.isLineTerminator(ch)) { - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - 1 - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index - 1], - range: [start, this.index - 1], - loc: loc - }; - comments.push(entry); - } - if (ch === 13 && this.source.charCodeAt(this.index) === 10) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - return comments; - } - } - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: false, - slice: [start + offset, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - }; - Scanner.prototype.skipMultiLineComment = function () { - var comments = []; - var start, loc; - if (this.trackComment) { - comments = []; - start = this.index - 2; - loc = { - start: { - line: this.lineNumber, - column: this.index - this.lineStart - 2 - }, - end: {} - }; - } - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isLineTerminator(ch)) { - if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - ++this.index; - this.lineStart = this.index; - } - else if (ch === 0x2A) { - // Block comment ends with '*/'. - if (this.source.charCodeAt(this.index + 1) === 0x2F) { - this.index += 2; - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index - 2], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - return comments; - } - ++this.index; - } - else { - ++this.index; - } - } - // Ran off the end of the file - the whole thing is a comment - if (this.trackComment) { - loc.end = { - line: this.lineNumber, - column: this.index - this.lineStart - }; - var entry = { - multiLine: true, - slice: [start + 2, this.index], - range: [start, this.index], - loc: loc - }; - comments.push(entry); - } - this.tolerateUnexpectedToken(); - return comments; - }; - Scanner.prototype.scanComments = function () { - var comments; - if (this.trackComment) { - comments = []; - } - var start = (this.index === 0); - while (!this.eof()) { - var ch = this.source.charCodeAt(this.index); - if (character_1.Character.isWhiteSpace(ch)) { - ++this.index; - } - else if (character_1.Character.isLineTerminator(ch)) { - ++this.index; - if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { - ++this.index; - } - ++this.lineNumber; - this.lineStart = this.index; - start = true; - } - else if (ch === 0x2F) { - ch = this.source.charCodeAt(this.index + 1); - if (ch === 0x2F) { - this.index += 2; - var comment = this.skipSingleLineComment(2); - if (this.trackComment) { - comments = comments.concat(comment); - } - start = true; - } - else if (ch === 0x2A) { - this.index += 2; - var comment = this.skipMultiLineComment(); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (start && ch === 0x2D) { - // U+003E is '>' - if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { - // '-->' is a single-line comment - this.index += 3; - var comment = this.skipSingleLineComment(3); - if (this.trackComment) { - comments = comments.concat(comment); - } - } - else { - break; - } - } - else if (ch === 0x3C && !this.isModule) { - if (this.source.slice(this.index + 1, this.index + 4) === '!--') { - this.index += 4; // ` +[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 09e257e..09dde64 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 125c971..baeab42 100644 --- a/node_modules/glob-parent/package.json +++ b/node_modules/glob-parent/package.json @@ -1,6 +1,6 @@ { "name": "glob-parent", - "version": "5.1.2", + "version": "6.0.2", "description": "Extract the non-magic parent path from a glob string.", "author": "Gulp Team (https://gulpjs.com/)", "contributors": [ @@ -10,7 +10,7 @@ "repository": "gulpjs/glob-parent", "license": "ISC", "engines": { - "node": ">= 6" + "node": ">=10.13.0" }, "main": "index.js", "files": [ @@ -20,20 +20,26 @@ "scripts": { "lint": "eslint .", "pretest": "npm run lint", - "test": "nyc mocha --async-only", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "test": "nyc mocha --async-only" }, "dependencies": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" }, "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" + "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", diff --git a/node_modules/ignore/CHANGELOG.md b/node_modules/ignore/CHANGELOG.md deleted file mode 100644 index 2b25013..0000000 --- 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 c4d8230..50d8882 --- 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 -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. +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). + +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 be9d5f8..970631e 100644 --- a/node_modules/ignore/index.d.ts +++ b/node_modules/ignore/index.d.ts @@ -1,16 +1,17 @@ -interface Ignore { +type Pathname = string + +interface TestResult { + ignored: boolean + unignored: boolean +} + +export interface Ignore { /** - * Adds a rule rules to the current manager. - * @param {string | Ignore} pattern - * @returns IgnoreBase - */ - add(pattern: string | Ignore): 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 { +export 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 62c5cf7..c559806 --- 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,15 @@ 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 = [ + + [ + // remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ @@ -50,14 +82,14 @@ const DEFAULT_REPLACER_PREFIX = [ // (a \ ) -> (a ) /\\?\s+$/, match => match.indexOf('\\') === 0 - ? ' ' - : '' + ? SPACE + : EMPTY ], // replace (\ ) with ' ' [ /\\\s/g, - () => ' ' + () => SPACE ], // Escape metacharacters @@ -78,19 +110,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 +147,8 @@ const DEFAULT_REPLACER_PREFIX = [ // '**/foo' <-> 'foo' () => '^(?:.*\\/)?' - ] -] + ], -const DEFAULT_REPLACER_SUFFIX = [ // starting [ // there will be no leading '/' @@ -135,11 +156,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 +187,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,27 +203,96 @@ 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 + } + ], + + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + + [ + // '\\\\' -> '\\' + /\\\\/g, + () => 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, + (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 => /\/$/.test(match) + // foo/ will not match 'foo' + ? `${match}$` + // foo matches 'foo' and 'foo/' + : `${match}(?=$|\\/$)` ], // trailing wildcard [ /(\^|\\\/)?\\\*$/, - (match, p1) => { + (_, p1) => { const prefix = p1 // '\^': - // '/*' does not match '' + // '/*' does not match EMPTY // '/*' does not match everything // '\\\/': @@ -207,96 +306,56 @@ const DEFAULT_REPLACER_SUFFIX = [ return `${prefix}(?=$|\\/$)` } ], - - [ - // unescape - /\\\\\\/g, - () => '\\' - ] -] - -const POSITIVE_REPLACERS = [ - ...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/' - match => `${match}(?=$|\\/)` - ], - - ...DEFAULT_REPLACER_SUFFIX -] - -const NEGATIVE_REPLACERS = [ - ...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` - [ - /(?:[^*])$/, - match => `${match}(?=$|\\/$)` - ], - - ...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 +368,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 - } + ) } -class IgnoreBase { +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 +} + +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 + _addPattern (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules) + this._added = true + return + } + + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase) + this._added = true + this._rules.push(rule) + } + } + + // @param {Array | string | Ignore} pattern 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. @@ -362,41 +475,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 + + // @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 + _testOne (path, checkUnignored) { + let ignored = false + let unignored = false + + this._rules.forEach(rule => { + const {negative} = rule + if ( + unignored === negative && ignored !== unignored + || negative && !ignored && !unignored && !checkUnignored + ) { + return + } + + const matched = rule.regex.test(path) + + if (matched) { + ignored = !negative + unignored = negative + } + }) + + return { + ignored, + unignored } } - filter (paths) { - return make_array(paths).filter(path => this._filter(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) } - createFilter () { - return path => this._filter(path) - } - - ignores (path) { - return !this._filter(path) - } - - // @returns `Boolean` true if the `path` is NOT ignored - _filter (path, slices) { - if (!path) { - return false - } - - if (path in this._cache) { - return this._cache[path] + _t (path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path] } if (!slices) { @@ -407,37 +548,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) - - // Or only test the path - : this._test(path) + ? parent + : this._testOne(path, checkUnignored) } - // @returns {Boolean} true if a file is NOT ignored - _test (path) { - // Explicitly define variable type by setting matched to `0` - let matched = 0 + ignores (path) { + return this._test(path, this._ignoreCache, false).ignored + } - 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) - } - }) + createFilter () { + return path => !this.ignores(path) + } - return !matched + filter (paths) { + return makeArray(paths).filter(this.createFilter()) + } + + // @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 +609,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 14f377d..e970471 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,25 @@ 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 = [[ +// remove BOM +// TODO: +// Other similar zero-width characters? +/^\uFEFF/, function () { + return EMPTY; +}], // > 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 +107,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 +133,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 +187,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}[^\\/]*`; -}], - -// trailing wildcard -[/(\^|\\\/)?\\\*$/, function (match, p1) { - var prefix = p1 - // '\^': - // '/*' does not match '' - // '/*' does not match everything - - // '\\\/': - // 'abc/*' does not match 'abc/' - ? `${p1}[^/]+` - - // 'a*' matches 'a' - // 'a*' matches 'aa' - : '[^/]*'; - - return `${prefix}(?=$|\\/$)`; +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 -/\\\\\\/g, function () { - return '\\'; -}]]; - -var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ - -// 'f' -// matches -// - /f(end) -// - /f/ -// - (start)f(end) -// - (start)f/ -// doesn't match -// - oof -// - foo -// pseudo: -// -> (^|/)f(/|$) +// 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 `${match}(?=$|\\/)`; -}]], DEFAULT_REPLACER_SUFFIX); + return /\/$/.test(match) + // foo/ will not match 'foo' + ? "".concat(match, "$") // foo matches 'foo' and 'foo/' + : "".concat(match, "(?=$|\\/$)"); +}], +// trailing wildcard +[/(\^|\\\/)?\\\*$/, function (_, p1) { + var prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything -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); + // '\\\/': + // 'abc/*' does not match 'abc/' + ? "".concat(p1, "[^/]+") // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + return "".concat(prefix, "(?=$|\\/$)"); +}]]; // 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,76 +314,67 @@ 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, '#'); - - var regex = make_regex(pattern, negative, ignorecase); - - return { - origin, - pattern, - negative, - regex - }; + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); + var regex = makeRegex(pattern, ignoreCase); + return new IgnoreRule(origin, pattern, negative, regex); }; - -var IgnoreBase = function () { - function IgnoreBase() { - 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; - define(this, KEY_IGNORE, true); - this._initCache(); +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); } - _createClass(IgnoreBase, [{ - key: '_initCache', + // 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)) { + var r = '`path.relative()`d'; + return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError); + } + return true; +}; +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 === 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(Ignore, [{ + key: "_initCache", value: function _initCache() { - this._cache = Object.create(null); - } - - // @param {Array.|string|Ignore} pattern - - }, { - 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); - - // Some rules have just added to the ignore, - // making the behavior changed. - if (this._added) { - this._initCache(); - } - - return this; - } - - // legacy - - }, { - key: 'addPattern', - value: function addPattern(pattern) { - return this.add(pattern); + this._ignoreCache = Object.create(null); + this._testCache = Object.create(null); } }, { - key: '_addPattern', + key: "_addPattern", value: function _addPattern(pattern) { // #32 if (pattern && pattern[KEY_IGNORE]) { @@ -354,113 +382,164 @@ var IgnoreBase = function () { this._added = true; return; } - if (checkPattern(pattern)) { - var rule = createRule(pattern, this._ignorecase); + var rule = createRule(pattern, this._ignoreCase); this._added = true; this._rules.push(rule); } } - }, { - key: 'filter', - value: function filter(paths) { - var _this = this; - return make_array(paths).filter(function (path) { - return _this._filter(path); - }); + // @param {Array | string | Ignore} pattern + }, { + key: "add", + value: function 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. + if (this._added) { + this._initCache(); + } + return this; } - }, { - key: 'createFilter', - value: function createFilter() { - var _this2 = this; - return function (path) { - return _this2._filter(path); + // legacy + }, { + key: "addPattern", + value: function addPattern(pattern) { + return this.add(pattern); + } + + // | ignored : unignored + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + + // @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; + key: "_t", + value: function _t(path, cache, checkUnignored, slices) { + if (path in cache) { + return cache[path]; } - - if (path in this._cache) { - return this._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); + } + }, { + 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()); } - // @returns {Boolean} true if a file is NOT ignored - + // @returns {TestResult} }, { - 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); - } - }); - - return !matched; + 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 8cb1b78..edc78d3 100644 --- a/node_modules/ignore/package.json +++ b/node_modules/ignore/package.json @@ -1,7 +1,7 @@ { "name": "ignore", - "version": "4.0.6", - "description": "Ignore is a manager and filter for .gitignore rules.", + "version": "5.3.1", + "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", "files": [ "legacy.js", "index.js", @@ -9,15 +9,22 @@ "LICENSE-MIT" ], "scripts": { - "prepublish": "npm run build", + "prepublishOnly": "npm run build", "build": "babel -o legacy.js index.js", "test:lint": "eslint .", - "test:tsc": "tsc ./test/ts/simple.ts", - "test:git": "tap test/git-check-ignore.js", - "test:ignore": "tap test/ignore.js --coverage", - "test-no-cov": "npm run test:lint && npm run test:tsc && tap test/*.js --coverage", - "test": "npm run test-no-cov", - "posttest": "tap --coverage-report=html && codecov" + "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", @@ -44,19 +51,21 @@ "url": "https://github.com/kaelzhang/node-ignore/issues" }, "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", + "@babel/cli": "^7.22.9", + "@babel/core": "^7.22.9", + "@babel/preset-env": "^7.22.9", + "codecov": "^3.8.2", + "debug": "^4.3.4", + "eslint": "^8.46.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.28.0", + "mkdirp": "^3.0.1", + "pre-suf": "^1.1.1", + "rimraf": "^5.0.1", "spawn-sync": "^2.0.0", - "tap": "^12.0.1", - "tmp": "0.0.33", - "typescript": "^3.0.1" + "tap": "^16.3.9", + "tmp": "0.2.1", + "typescript": "^5.1.6" }, "engines": { "node": ">= 4" diff --git a/node_modules/js-yaml/CHANGELOG.md b/node_modules/js-yaml/CHANGELOG.md index b4baa4e..ff2375e 100644 --- a/node_modules/js-yaml/CHANGELOG.md +++ b/node_modules/js-yaml/CHANGELOG.md @@ -6,6 +6,64 @@ 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). @@ -484,7 +542,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - First public release -[3.14.1]: https://github.com/nodeca/js-yaml/compare/3.14.0...3.14.1 +[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 diff --git a/node_modules/js-yaml/README.md b/node_modules/js-yaml/README.md index 246e563..3cbc4bd 100644 --- a/node_modules/js-yaml/README.md +++ b/node_modules/js-yaml/README.md @@ -1,7 +1,7 @@ JS-YAML - YAML 1.2 parser / writer for JavaScript ================================================= -[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) +[![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/)__ @@ -46,38 +46,12 @@ Optional arguments: ``` -### Bundled YAML library for browsers - -``` html - - - - -``` - -Browser support was done mostly for the online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - -Notes: - -1. We have no resources to support browserified version. Don't expect it to be - well tested. Don't expect fast fixes if something goes wrong there. -2. `!!js/function` in browser bundle will not work by default. If you really need - it - load `esprima` parser first (via amd or directly). -3. `!!bin` in browser will return `Array`, because browsers do not support - node.js `Buffer` and adding Buffer shims is completely useless on practice. - - API --- Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. +your own tags), see [examples](https://github.com/nodeca/js-yaml/tree/master/examples) +for more info. ``` javascript const yaml = require('js-yaml'); @@ -85,7 +59,7 @@ const fs = require('fs'); // Get document, or throw exception on error try { - const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + const doc = yaml.load(fs.readFileSync('/home/ixti/example.yml', 'utf8')); console.log(doc); } catch (e) { console.log(e); @@ -93,11 +67,11 @@ try { ``` -### safeLoad (string [ , options ]) +### load (string [ , options ]) -**Recommended loading way.** Parses `string` as single YAML document. Returns either a -plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does -not support regexps, functions and undefined. This method is safe for untrusted data. +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: @@ -105,17 +79,14 @@ options: error/warning messages. - `onWarning` _(default: null)_ - function to call on warning messages. Loader will call this function with an instance of `YAMLException` for each warning. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. +- `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_SAFE_SCHEMA` - all supported YAML types, without unsafe ones - (`!!js/undefined`, `!!js/regexp` and `!!js/function`): - http://yaml.org/type/ - - `DEFAULT_FULL_SCHEMA` - all supported YAML types. + - `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 @@ -127,43 +98,23 @@ It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. The core schema also has no such restrictions. It allows binary notation for integers. -### load (string [ , options ]) +### loadAll (string [, iterator] [, options ]) -**Use with care with untrusted sources**. The same as `safeLoad()` but uses -`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: -`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you -must additionally validate object structure to avoid injections: - -``` javascript -const untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; - -// I'm just converting that string, what could possibly go wrong? -require('js-yaml').load(untrusted_code) + '' -``` - - -### safeLoadAll (string [, iterator] [, options ]) - -Same as `safeLoad()`, but understands multi-document sources. Applies +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.safeLoadAll(data, function (doc) { +yaml.loadAll(data, function (doc) { console.log(doc); }); ``` -### loadAll (string [, iterator] [ , options ]) +### dump (object [ , options ]) -Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. - - -### safeDump (object [ , options ]) - -Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +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`. @@ -173,17 +124,20 @@ options: - `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 +- `flowLevel` _(default: -1)_ - specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere - `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. +- `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. +- `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 @@ -198,7 +152,7 @@ output is shown on the right side after `=>` (default setting) or `->`: !!int "binary" -> "0b1", "0b101010", "0b1110001111010" - "octal" -> "01", "052", "016172" + "octal" -> "0o1", "0o52", "0o16172" "decimal" => "1", "42", "7290" "hexadecimal" -> "0x1", "0x2A", "0x1C7A" @@ -216,7 +170,7 @@ output is shown on the right side after `=>` (default setting) or `->`: Example: ``` javascript -safeDump (object, { +dump(object, { 'styles': { '!!null': 'canonical' // dump null as ~ }, @@ -224,15 +178,10 @@ safeDump (object, { }); ``` -### dump (object [ , options ]) - -Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). - - Supported YAML types -------------------- -The list of standard YAML tags and corresponding JavaScipt types. See also +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/). @@ -253,11 +202,9 @@ The list of standard YAML tags and corresponding JavaScipt types. See also **JavaScript-specific tags** -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` +See [js-yaml-js-types](https://github.com/nodeca/js-yaml-js-types) for +extra types. + Caveats ------- diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js index e79186b..a182f1a 100755 --- a/node_modules/js-yaml/bin/js-yaml.js +++ b/node_modules/js-yaml/bin/js-yaml.js @@ -6,16 +6,9 @@ /*eslint-disable no-console*/ -// stdlib -var fs = require('fs'); - - -// 3rd-party +var fs = require('fs'); var argparse = require('argparse'); - - -// internal -var yaml = require('..'); +var yaml = require('..'); //////////////////////////////////////////////////////////////////////////////// @@ -23,42 +16,43 @@ var yaml = require('..'); var cli = new argparse.ArgumentParser({ prog: 'js-yaml', - version: require('../package.json').version, - addHelp: true + add_help: true }); +cli.add_argument('-v', '--version', { + action: 'version', + version: require('../package.json').version +}); -cli.addArgument([ '-c', '--compact' ], { +cli.add_argument('-c', '--compact', { help: 'Display errors in compact mode', - action: 'storeTrue' + action: 'store_true' }); - // deprecated (not needed after we removed output colors) // option suppressed, but not completely removed for compatibility -cli.addArgument([ '-j', '--to-json' ], { - help: argparse.Const.SUPPRESS, +cli.add_argument('-j', '--to-json', { + help: argparse.SUPPRESS, dest: 'json', - action: 'storeTrue' + action: 'store_true' }); - -cli.addArgument([ '-t', '--trace' ], { +cli.add_argument('-t', '--trace', { help: 'Show stack trace on error', - action: 'storeTrue' + action: 'store_true' }); -cli.addArgument([ 'file' ], { +cli.add_argument('file', { help: 'File to read, utf-8 encoded without BOM', nargs: '?', - defaultValue: '-' + default: '-' }); //////////////////////////////////////////////////////////////////////////////// -var options = cli.parseArgs(); +var options = cli.parse_args(); //////////////////////////////////////////////////////////////////////////////// diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js index 7878320..4cc0ddf 100644 --- a/node_modules/js-yaml/dist/js-yaml.js +++ b/node_modules/js-yaml/dist/js-yaml.js @@ -1,2331 +1,2493 @@ -/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; + if (exception.mark.name) { + where += 'in "' + exception.mark.name + '" '; } - result[tag] = style; + where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')'; + + if (!compact && exception.mark.snippet) { + where += '\n\n' + exception.mark.snippet; + } + + return message + ' ' + where; } - return result; -} -function encodeHex(character) { - var string, handle, length; + function YAMLException$1(reason, mark) { + // Super constructor + Error.call(this); - string = character.toString(16).toUpperCase(); + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = formatError(this, false); - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.noArrayIndent = options['noArrayIndent'] || false; - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); } 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; + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; } } - return false; -} -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} + // Inherit from Error + YAMLException$1.prototype = Object.create(Error.prototype); + YAMLException$1.prototype.constructor = YAMLException$1; -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} -// [34] ns-char ::= nb-char - s-white -// [27] nb-char ::= c-printable - b-char - c-byte-order-mark -// [26] b-char ::= b-line-feed | b-carriage-return -// [24] b-line-feed ::= #xA /* LF */ -// [25] b-carriage-return ::= #xD /* CR */ -// [3] c-byte-order-mark ::= #xFEFF -function isNsChar(c) { - return isPrintable(c) && !isWhitespace(c) - // byte-order-mark - && c !== 0xFEFF - // b-char - && c !== CHAR_CARRIAGE_RETURN - && c !== CHAR_LINE_FEED; -} + YAMLException$1.prototype.toString = function toString(compact) { + return this.name + ': ' + formatError(this, compact); + }; -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c, prev) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - // /* An ns-char preceding */ "#" - && c !== CHAR_COLON - && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); -} -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_EQUALS - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} + var exception = YAMLException$1; -// Determines whether block indentation indicator is required. -function needIndentIndicator(string) { - var leadingSpaceRe = /^\n* /; - return leadingSpaceRe.test(string); -} + // 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; -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; + if (position - lineStart > maxHalfLength) { + head = ' ... '; + lineStart = position - maxHalfLength + head.length; + } -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char, prev_char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); + if (lineEnd - position > maxHalfLength) { + tail = ' ...'; + lineEnd = position + maxHalfLength - tail.length; + } - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; + 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; } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; + + 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; } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (indentPerLevel > 9 && needIndentIndicator(string)) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} + }); -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } + result[newIndex] = currentType; + }); - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; + return result; } - 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; + function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {}, + multi: { + scalar: [], + sequence: [], + mapping: [], + fallback: [] + } + }, index, length; - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; + function collectType(type) { + if (type.multi) { + result.multi[type.kind].push(type); + result.multi['fallback'].push(type); } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - - pairBuffer = ''; - if (index !== 0) pairBuffer += ', '; - - if (state.condenseFlow) pairBuffer += '"'; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; + result[type.kind][type.tag] = result['fallback'][type.tag] = type; } } - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); } + return result; + } - 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 += ':'; + 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 { - pairBuffer += ': '; + throw new exception('Schema.extend argument should be a Type, [ Type ], ' + + 'or a schema definition ({ implicit: [...], explicit: [...] })'); } - pairBuffer += state.dump; + 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.'); + } - // Both key and value are valid. - _result += pairBuffer; + 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')); } - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} + function constructYamlNull() { + return null; + } -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; + function isNull(object) { + return object === null; + } - typeList = explicit ? state.explicitTypes : state.implicitTypes; + 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' + }); - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; + function resolveYamlBoolean(data) { + if (data === null) return false; - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { + var max = data.length; - state.tag = explicit ? type.tag : '?'; + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); + } - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; + function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; + } - 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'); + 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; } - - state.dump = _result; + return hasDigits && ch !== '_'; } - return true; - } - } - return false; -} + if (ch === 'x') { + // base 16 + index++; -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, arrayLevel, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, arrayLevel, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + 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 !== '_'; } } - } -} -function dump(input, options) { - options = options || {}; + // base 10 (except 0) - var state = new State(options); + // value should not start with `_`; + if (ch === '_') return false; - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; - -},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - -},{}],5:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function _class(obj) { return Object.prototype.toString.call(obj); } - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isDecCode(data.charCodeAt(index))) { + return false; } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); + hasDigits = true; } - state.result += _result; - } -} + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; -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'); + return true; } - sourceKeys = Object.keys(source); + function constructYamlInteger(data) { + var value = data, sign = 1, ch; - 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; + 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 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; + function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); + } - // 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); + 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' ] + } + }); - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) { - throwError(state, 'nested arrays are not supported inside keys'); + 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'; } - - if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { - keyNode[index] = '[object Object]'; + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; } - } - } - - // 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 if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); + } else if (common.isNegativeZero(object)) { + return '-0.0'; } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; + + 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; } - 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'); + function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); } - state.line += 1; - state.lineStart = state.position; -} + var float = new type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' + }); -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); + var json = failsafe.extend({ + implicit: [ + _null, + bool, + int, + float + ] + }); - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } + var core = json; - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } + 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 - if (is_EOL(ch)) { - readLineBreak(state); + 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 - 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/* ` */) { + 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; } - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); + function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; + 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)); } } - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - while (ch !== 0) { - if (ch === 0x3A/* : */) { + 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)) { - 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; + return false; } } - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = 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); } - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; } - 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/* ' */) { + state.kind = _kind; + state.result = _result; return false; } - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; + function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); + 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/* ' */) { - captureStart = state.position; + 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; - } 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'); } - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} + function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; + ch = state.input.charCodeAt(state.position); - ch = state.input.charCodeAt(state.position); + if (ch !== 0x22/* " */) { + return false; + } - if (ch !== 0x22/* " */) { - return false; - } + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; - 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]; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); state.position++; + return true; - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; - } else { - throwError(state, 'expected hexadecimal character'); + } 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'); } - state.result += charFromCodepoint(hexResult); + captureStart = captureEnd = state.position; - 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 { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; state.position++; - skipSeparationSpace(state, true, nodeIndent); + captureEnd = state.position; } } - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); + 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 ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; } else { - _result.push(keyNode); + return false; } - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; } - } - 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'); + 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 ','"); } - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); } - - 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; + _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); - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + ch = state.input.charCodeAt(state.position); - if (state.line === _line) { - 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; + } - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); + 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'); } - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); + } 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'); + } - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } 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); + 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 = false; - keyTag = state.tag; - keyNode = state.result; + 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 an implicit mapping pair; a colon is missed'); + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); } else { state.tag = _tag; state.anchor = _anchor; return true; // Keep the result of `composeNode`. } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. } - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; + _keyLine = state.line; + _keyLineStart = state.lineStart; + _keyPos = state.position; } - } - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); } + + 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); } - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); + 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; } - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } + function readAlias(state) { + var _position, alias, + ch; - if (isVerbatim) { - state.tag = tagName; + ch = state.input.charCodeAt(state.position); - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; + if (ch !== 0x2A/* * */) return false; - } 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); - } + _position = 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; - } + 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; } - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { + function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { indentStatus = 1; @@ -2334,65 +2496,85 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } 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; + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; } - - } 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 { + allowBlockCollections = false; } } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } - } - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { + 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. // @@ -2415,1575 +2597,1278 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact break; } } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; + } 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.result` updated in resolver if matched + 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.result = type.construct(state.result, state.tag); if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; } - 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; -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); - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); - 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)); + if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } - if (is_EOL(ch)) 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); } - directiveArgs.push(state.input.slice(_position, 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 + '"'); + } } - 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/* . */) { + 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); - } - 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'; + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); } - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); + 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'); } - } - var state = new State(input, options); + state.documents.push(state.result); - var nullpos = input.indexOf('\0'); + if (state.position === state.lineStart && testDocumentSeparator(state)) { - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, 'null byte is not allowed in input'); - } - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - var documents = loadDocuments(input, options); - - if (typeof iterator !== 'function') { - return documents; - } - - for (var index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, iterator, options) { - if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; - -},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - -},{"./common":2}],7:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - -},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); - -},{"../schema":7,"./json":12}],9:[function(require,module,exports){ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); - -},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); - -},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); - -},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); - -},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - -},{"./exception":4}],14:[function(require,module,exports){ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); + return; } - bits = (bits << 6) | map.indexOf(input.charAt(idx)); + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } } - // Dump tail - tailbits = (max % 4) * 6; + function loadDocuments(input, options) { + input = String(input); + options = options || {}; - 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); - } + if (input.length !== 0) { - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } } - bits = (bits << 8) + object[idx]; + 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; } - // Dump tail - tail = max % 3; + function loadAll$1(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } - 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]; + 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]); + } } - return result; -} -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} + function load$1(input, options) { + var documents = loadDocuments(input, options); -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); + 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'); + } -},{"../type":13}],15:[function(require,module,exports){ -'use strict'; -var Type = require('../type'); + var loadAll_1 = loadAll$1; + var load_1 = load$1; -function resolveYamlBoolean(data) { - if (data === null) return false; + var loader = { + loadAll: loadAll_1, + load: load_1 + }; - var max = data.length; + /*eslint-disable no-use-before-define*/ - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); -},{"../type":13}],16:[function(require,module,exports){ -'use strict'; + var _toString = Object.prototype.toString; + var _hasOwnProperty = Object.prototype.hasOwnProperty; -var common = require('../common'); -var Type = require('../type'); + 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 YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); + var ESCAPE_SEQUENCES = {}; -function resolveYamlFloat(data) { - if (data === null) return false; + 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; + } + } - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { return false; } - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); + // [33] s-white ::= s-space | s-tab + function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; } - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; + // 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); } - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - -},{"../common":2,"../type":13}],17:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; + // [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; } - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; + // [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 ':[^ ]' + } - // base 2, base 8, base 16 + // 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; + } - if (ch === 'b') { - // base 2 - index++; + // 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; + } - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; + // 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 hasDigits && ch !== '_'; } + return first; + } + // Determines whether block indentation indicator is required. + function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); + } - if (ch === 'x') { - // base 16 - index++; + var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; + // 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; } - return hasDigits && ch !== '_'; + } 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; } - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; + 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; } - return hasDigits && ch !== '_'; - } - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; + // 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); } - hasDigits = true; + + return result.slice(1); // drop extra \n joiner } - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; + // Escapes a double-quoted string. + function escapeString(string) { + var result = ''; + var char = 0; + var escapeSeq; - // if !base60 - done; - if (ch !== ':') return true; + for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) { + char = codePointAt(string, i); + escapeSeq = ESCAPE_SEQUENCES[char]; - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} + if (!escapeSeq && isPrintable(char)) { + result += string[i]; + if (char >= 0x10000) result += string[i + 1]; + } else { + result += escapeSeq || encodeHex(char); + } + } -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); + return result; } - ch = value[0]; + function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length, + value; - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; + 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 + ']'; } - if (value === '0') return 0; + function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length, + value; - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); + 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. } - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); + function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; - value = 0; - base = 1; + for (index = 0, length = objectKeyList.length; index < length; index += 1) { - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); + pairBuffer = ''; + if (_result !== '') pairBuffer += ', '; - return sign * value; + 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 + '}'; } - return sign * parseInt(value, 10); -} + function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} + // 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'); + } -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] + 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. } -}); -},{"../common":2,"../type":13}],18:[function(require,module,exports){ -'use strict'; + function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; -var esprima; + typeList = explicit ? state.explicitTypes : state.implicitTypes; -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /* eslint-disable no-redeclare */ - /* global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; -var Type = require('../../type'); + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { -function resolveJavascriptFunction(data) { - if (data === null) return false; + if (explicit) { + if (type.multi && type.representName) { + state.tag = type.representName(object); + } else { + state.tag = type.tag; + } + } else { + state.tag = '?'; + } - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; + 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; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); } - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); + function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; - body = ast.body[0].expression.body.range; + inspectNode(object, objects, duplicatesIndexes); - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - -},{"../../type":13}],19:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); } - return true; -} + function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; + 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); - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - -},{"../../type":13}],20:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - -},{"../../type":13}],21:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); - -},{"../type":13}],22:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - -},{"../type":13}],23:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],24:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } } } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; } - return true; -} + function dump$1(input, options) { + options = options || {}; -function constructYamlOmap(data) { - return data !== null ? data : []; -} + var state = new State(options); -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); + if (!state.noRefs) getDuplicateReferences(input, state); -},{"../type":13}],25:[function(require,module,exports){ -'use strict'; + var value = input; -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); - -},{"../type":13}],26:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); - -},{"../type":13}],27:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; + if (state.replacer) { + value = state.replacer.call({ '': value }, '', value); } + + if (writeNode(state, 0, value, true, true)) return state.dump + '\n'; + + return ''; } - return true; -} + var dump_1 = dump$1; -function constructYamlSet(data) { - return data !== null ? data : {}; -} + var dumper = { + dump: dump_1 + }; -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - -},{"../type":13}],28:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); - -},{"../type":13}],29:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); + 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.'); + }; } - // match: [4] hour [5] minute [6] second [7] fraction - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); + 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; - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } + // 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 + }; - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + // Removed functions from JS-YAML 3.0.x + var safeLoad = renamed('safeLoad', 'load'); + var safeLoadAll = renamed('safeLoadAll', 'loadAll'); + var safeDump = renamed('safeDump', 'dump'); - 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; - } + 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 + }; - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + 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; - if (delta) date.setTime(date.getTime() - delta); + Object.defineProperty(exports, '__esModule', { value: true }); - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - -},{"../type":13}],"/":[function(require,module,exports){ -'use strict'; - - -var yaml = require('./lib/js-yaml.js'); - - -module.exports = yaml; - -},{"./lib/js-yaml.js":1}]},{},[])("/") -}); +}))); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js index 1b6ecc1..bdd8eef 100644 --- a/node_modules/js-yaml/dist/js-yaml.min.js +++ b/node_modules/js-yaml/dist/js-yaml.min.js @@ -1 +1,2 @@ -/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function i(r,o,a){function s(t,e){if(!o[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n"+z(r,i.indent)+J(U(function(t,n){var e,i=/(\n+)([^\n]*)/g,r=function(){var e=-1!==(e=t.indexOf("\n"))?e:t.length;return i.lastIndex=e,Q(t.slice(0,e),n)}(),o="\n"===t[0]||" "===t[0];for(;e=i.exec(t);){var a=e[1],s=e[2];e=" "===s[0],r+=a+(o||e||""===s?"":"\n")+Q(s,n),o=e}return r}(r,t),e));case G:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+o+'" style');i=r.represent[o](t,o)}e.dump=i}return 1}}function ee(e,t,n,i,r,o){e.tag=null,e.dump=n,X(e,n,!1)||X(e,n,!0);var a=l.call(e.dump);i=i&&(e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return 1}function te(e,t){var n,i,r=[],o=[];for(!function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o>10),56320+(c-65536&1023)),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else S(u)?(L(e,n,i,!0),B(e,Y(e,!1,t)),n=i=e.position):e.position===e.lineStart&&R(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}}function K(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&O(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,P(e,t,x,!1,!0),a.push(e.result),Y(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)N(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt)&&(P(e,t,A,!0,r)&&(m?d=e.result:h=e.result),m||(U(e,l,p,f,d,h,o,a),f=d=h=null),Y(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndentc&&(c=e.lineIndent),S(p))u++;else{if(e.lineIndent=t){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(L(e,r,o,!1),B(e,e.line-s),r=o=e.position,a=!1),I(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}if(L(e,r,o,!1),e.result)return 1;e.kind=l,e.result=p}}(e,i,g===n)&&(d=!0,null===e.tag&&(e.tag="?")):(d=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(d=s&&K(e,r))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&N(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||d}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new F(e,t),e=e.indexOf("\0");for(-1!==e&&(n.position=e,N(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.positiont/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t="";return this.name&&(t+='in "'+this.name+'" '),t+="at line "+(this.line+1)+", column "+(this.column+1),e||(e=this.getSnippet())&&(t+=":\n"+e),t},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var r=e("./common"),o=e("./exception"),a=e("./type");function s(e,t,i){var r=[];return e.include.forEach(function(e){i=s(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function c(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=s(this,"implicit",[]),this.compiledExplicit=s(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),o.push(r>>8&255),o.push(255&r)),r=r<<6|i.indexOf(t.charAt(a));return 0==(e=n%4*6)?(o.push(r>>16&255),o.push(r>>8&255),o.push(255&r)):18==e?(o.push(r>>10&255),o.push(r>>2&255)):12==e&&o.push(r>>4&255),s?s.from?s.from(o):new s(o):o},predicate:function(e){return s&&s.isBuffer(e)},represent:function(e){for(var t,n="",i=0,r=e.length,o=c,a=0;a>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return e=e.toString(10),o.test(e)?e.replace("e",".e"):e},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;al&&(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 */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (map === null) return {}; - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if (tag.slice(0, 2) === '!!') { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - type = schema.compiledTypeMap['fallback'][tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.noArrayIndent = options['noArrayIndent'] || false; - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - this.noRefs = options['noRefs'] || false; - this.noCompatMode = options['noCompatMode'] || false; - this.condenseFlow = options['condenseFlow'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -// Indents every line in a string. Empty lines (\n only) are not indented. -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - - if (line.length && line !== '\n') result += ind; - - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -// [33] s-white ::= s-space | s-tab -function isWhitespace(c) { - return c === CHAR_SPACE || c === CHAR_TAB; -} - -// Returns true if the character can be printed without escaping. -// From YAML 1.2: "any allowed characters known to be non-printable -// should also be escaped. [However,] This isn’t mandatory" -// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. -function isPrintable(c) { - return (0x00020 <= c && c <= 0x00007E) - || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) - || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) - || (0x10000 <= c && c <= 0x10FFFF); -} - -// [34] ns-char ::= nb-char - s-white -// [27] nb-char ::= c-printable - b-char - c-byte-order-mark -// [26] b-char ::= b-line-feed | b-carriage-return -// [24] b-line-feed ::= #xA /* LF */ -// [25] b-carriage-return ::= #xD /* CR */ -// [3] c-byte-order-mark ::= #xFEFF -function isNsChar(c) { - return isPrintable(c) && !isWhitespace(c) - // byte-order-mark - && c !== 0xFEFF - // b-char - && c !== CHAR_CARRIAGE_RETURN - && c !== CHAR_LINE_FEED; -} - -// Simplified test for values allowed after the first character in plain style. -function isPlainSafe(c, prev) { - // Uses a subset of nb-char - c-flow-indicator - ":" - "#" - // where nb-char ::= c-printable - b-char - c-byte-order-mark. - return isPrintable(c) && c !== 0xFEFF - // - c-flow-indicator - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // - ":" - "#" - // /* An ns-char preceding */ "#" - && c !== CHAR_COLON - && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); -} - -// Simplified test for values allowed as the first character in plain style. -function isPlainSafeFirst(c) { - // Uses a subset of ns-char - c-indicator - // where ns-char = nb-char - s-white. - return isPrintable(c) && c !== 0xFEFF - && !isWhitespace(c) // - s-white - // - (c-indicator ::= - // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” - && c !== CHAR_MINUS - && c !== CHAR_QUESTION - && c !== CHAR_COLON - && c !== CHAR_COMMA - && c !== CHAR_LEFT_SQUARE_BRACKET - && c !== CHAR_RIGHT_SQUARE_BRACKET - && c !== CHAR_LEFT_CURLY_BRACKET - && c !== CHAR_RIGHT_CURLY_BRACKET - // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” - && c !== CHAR_SHARP - && c !== CHAR_AMPERSAND - && c !== CHAR_ASTERISK - && c !== CHAR_EXCLAMATION - && c !== CHAR_VERTICAL_LINE - && c !== CHAR_EQUALS - && c !== CHAR_GREATER_THAN - && c !== CHAR_SINGLE_QUOTE - && c !== CHAR_DOUBLE_QUOTE - // | “%” | “@” | “`”) - && c !== CHAR_PERCENT - && c !== CHAR_COMMERCIAL_AT - && c !== CHAR_GRAVE_ACCENT; -} - -// Determines whether block indentation indicator is required. -function needIndentIndicator(string) { - var leadingSpaceRe = /^\n* /; - return leadingSpaceRe.test(string); -} - -var STYLE_PLAIN = 1, - STYLE_SINGLE = 2, - STYLE_LITERAL = 3, - STYLE_FOLDED = 4, - STYLE_DOUBLE = 5; - -// Determines which scalar styles are possible and returns the preferred style. -// lineWidth = -1 => no limit. -// Pre-conditions: str.length > 0. -// Post-conditions: -// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. -// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). -// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). -function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { - var i; - var char, prev_char; - var hasLineBreak = false; - var hasFoldableLine = false; // only checked if shouldTrackWidth - var shouldTrackWidth = lineWidth !== -1; - var previousLineBreak = -1; // count the first line correctly - var plain = isPlainSafeFirst(string.charCodeAt(0)) - && !isWhitespace(string.charCodeAt(string.length - 1)); - - if (singleLineOnly) { - // Case: no block styles. - // Check for disallowed characters to rule out plain and single. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); - } - } else { - // Case: block styles permitted. - for (i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - if (char === CHAR_LINE_FEED) { - hasLineBreak = true; - // Check if any line can be folded. - if (shouldTrackWidth) { - hasFoldableLine = hasFoldableLine || - // Foldable line = too long, and not more-indented. - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' '); - previousLineBreak = i; - } - } else if (!isPrintable(char)) { - return STYLE_DOUBLE; - } - prev_char = i > 0 ? string.charCodeAt(i - 1) : null; - plain = plain && isPlainSafe(char, prev_char); - } - // in case the end is missing a \n - hasFoldableLine = hasFoldableLine || (shouldTrackWidth && - (i - previousLineBreak - 1 > lineWidth && - string[previousLineBreak + 1] !== ' ')); - } - // Although every style can represent \n without escaping, prefer block styles - // for multiline, since they're more readable and they don't add empty lines. - // Also prefer folding a super-long line. - if (!hasLineBreak && !hasFoldableLine) { - // Strings interpretable as another type have to be quoted; - // e.g. the string 'true' vs. the boolean true. - return plain && !testAmbiguousType(string) - ? STYLE_PLAIN : STYLE_SINGLE; - } - // Edge case: block indentation indicator can only have one digit. - if (indentPerLevel > 9 && needIndentIndicator(string)) { - return STYLE_DOUBLE; - } - // At this point we know block styles are valid. - // Prefer literal style unless we want to fold. - return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; -} - -// Note: line breaking/folding is implemented for only the folded style. -// NB. We drop the last trailing newline (if any) of a returned block scalar -// since the dumper adds its own newline. This always works: -// • No ending newline => unaffected; already using strip "-" chomping. -// • Ending newline => removed then restored. -// Importantly, this keeps the "+" chomp indicator from gaining an extra line. -function writeScalar(state, string, level, iskey) { - state.dump = (function () { - if (string.length === 0) { - return "''"; - } - if (!state.noCompatMode && - DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { - return "'" + string + "'"; - } - - var indent = state.indent * Math.max(1, level); // no 0-indent scalars - // As indentation gets deeper, let the width decrease monotonically - // to the lower bound min(state.lineWidth, 40). - // Note that this implies - // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. - // state.lineWidth > 40 + state.indent: width decreases until the lower bound. - // This behaves better than a constant minimum width which disallows narrower options, - // or an indent threshold which causes the width to suddenly increase. - var lineWidth = state.lineWidth === -1 - ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); - - // Without knowing if keys are implicit/explicit, assume implicit for safety. - var singleLineOnly = iskey - // No block styles in flow mode. - || (state.flowLevel > -1 && level >= state.flowLevel); - function testAmbiguity(string) { - return testImplicitResolving(state, string); - } - - switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { - case STYLE_PLAIN: - return string; - case STYLE_SINGLE: - return "'" + string.replace(/'/g, "''") + "'"; - case STYLE_LITERAL: - return '|' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(string, indent)); - case STYLE_FOLDED: - return '>' + blockHeader(string, state.indent) - + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); - case STYLE_DOUBLE: - return '"' + escapeString(string, lineWidth) + '"'; - default: - throw new YAMLException('impossible error: invalid scalar style'); - } - }()); -} - -// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. -function blockHeader(string, indentPerLevel) { - var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; - - // note the special case: the string '\n' counts as a "trailing" empty line. - var clip = string[string.length - 1] === '\n'; - var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); - var chomp = keep ? '+' : (clip ? '' : '-'); - - return indentIndicator + chomp + '\n'; -} - -// (See the note for writeScalar.) -function dropEndingNewline(string) { - return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; -} - -// Note: a long line without a suitable break point will exceed the width limit. -// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. -function foldString(string, width) { - // In folded style, $k$ consecutive newlines output as $k+1$ newlines— - // unless they're before or after a more-indented line, or at the very - // beginning or end, in which case $k$ maps to $k$. - // Therefore, parse each chunk as newline(s) followed by a content line. - var lineRe = /(\n+)([^\n]*)/g; - - // first line (possibly an empty line) - var result = (function () { - var nextLF = string.indexOf('\n'); - nextLF = nextLF !== -1 ? nextLF : string.length; - lineRe.lastIndex = nextLF; - return foldLine(string.slice(0, nextLF), width); - }()); - // If we haven't reached the first content line yet, don't add an extra \n. - var prevMoreIndented = string[0] === '\n' || string[0] === ' '; - var moreIndented; - - // rest of the lines - var match; - while ((match = lineRe.exec(string))) { - var prefix = match[1], line = match[2]; - moreIndented = (line[0] === ' '); - result += prefix - + (!prevMoreIndented && !moreIndented && line !== '' - ? '\n' : '') - + foldLine(line, width); - prevMoreIndented = moreIndented; - } - - return result; -} - -// Greedy line breaking. -// Picks the longest line under the limit each time, -// otherwise settles for the shortest line over the limit. -// NB. More-indented lines *cannot* be folded, as that would add an extra \n. -function foldLine(line, width) { - if (line === '' || line[0] === ' ') return line; - - // Since a more-indented line adds a \n, breaks can't be followed by a space. - var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. - var match; - // start is an inclusive index. end, curr, and next are exclusive. - var start = 0, end, curr = 0, next = 0; - var result = ''; - - // Invariants: 0 <= start <= length-1. - // 0 <= curr <= next <= max(0, length-2). curr - start <= width. - // Inside the loop: - // A match implies length >= 2, so curr and next are <= length-2. - while ((match = breakRe.exec(line))) { - next = match.index; - // maintain invariant: curr - start <= width - if (next - start > width) { - end = (curr > start) ? curr : next; // derive end <= length-2 - result += '\n' + line.slice(start, end); - // skip the space that was output as \n - start = end + 1; // derive start <= length-1 - } - curr = next; - } - - // By the invariants, start <= length-1, so there is something left over. - // It is either the whole string or a part starting from non-whitespace. - result += '\n'; - // Insert a break if the remainder is too long and there is a break available. - if (line.length - start > width && curr > start) { - result += line.slice(start, curr) + '\n' + line.slice(curr + 1); - } else { - result += line.slice(start); - } - - return result.slice(1); // drop extra \n joiner -} - -// Escapes a double-quoted string. -function escapeString(string) { - var result = ''; - var char, nextChar; - var escapeSeq; - - for (var i = 0; i < string.length; i++) { - char = string.charCodeAt(i); - // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). - if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { - nextChar = string.charCodeAt(i + 1); - if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { - // Combine the surrogate pair and store it escaped. - result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); - // Advance index one extra since we already used that char here. - i++; continue; - } - } - escapeSeq = ESCAPE_SEQUENCES[char]; - result += !escapeSeq && isPrintable(char) - ? string[i] - : escapeSeq || encodeHex(char); - } - - return result; -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || index !== 0) { - _result += generateNextLine(state, level); - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - _result += '-'; - } else { - _result += '- '; - } - - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - - pairBuffer = ''; - if (index !== 0) pairBuffer += ', '; - - if (state.condenseFlow) pairBuffer += '"'; - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) pairBuffer += '? '; - - pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || index !== 0) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (state.tag !== null && state.tag !== '?') || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if (_toString.call(type.represent) === '[object Function]') { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (state.flowLevel < 0 || state.flowLevel > level); - } - - var objectOrArray = type === '[object Object]' || type === '[object Array]', - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if (type === '[object Object]') { - if (block && (Object.keys(state.dump).length !== 0)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object Array]') { - var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; - if (block && (state.dump.length !== 0)) { - writeBlockSequence(state, arrayLevel, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, arrayLevel, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if (type === '[object String]') { - if (state.tag !== '?') { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) return false; - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (state.tag !== null && state.tag !== '?') { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (object !== null && typeof object === 'object') { - index = objects.indexOf(object); - if (index !== -1) { - if (duplicatesIndexes.indexOf(index) === -1) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - if (!state.noRefs) getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index b744a1e..0000000 --- a/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,43 +0,0 @@ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index d7484a5..0000000 --- a/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1644 +0,0 @@ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function _class(obj) { return Object.prototype.toString.call(obj); } - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - // The output is a plain object here, so keys can only be strings. - // We need to convert keyNode to a string, but doing so can hang the process - // (deeply nested arrays that explode exponentially using aliases). - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) { - throwError(state, 'nested arrays are not supported inside keys'); - } - - if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { - keyNode[index] = '[object Object]'; - } - } - } - - // Avoid code execution in load() via toString property - // (still use its own toString for arrays, timestamps, - // and whatever user schema extensions happen to have @@toStringTag) - if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { - keyNode = '[object Object]'; - } - - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!_hasOwnProperty.call(state.anchorMap, alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only automatically assigned to plain scalars. - // - // We only need to check kind conformity in case user explicitly assigns '?' - // tag, for example like this: "! [0]" - // - if (state.result !== null && state.kind !== 'scalar') { - throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); - } - - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - var nullpos = input.indexOf('\0'); - - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, 'null byte is not allowed in input'); - } - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - var documents = loadDocuments(input, options); - - if (typeof iterator !== 'function') { - return documents; - } - - for (var index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, iterator, options) { - if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index 47b265c..0000000 --- a/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; diff --git a/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ca7cf47..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return exclude.indexOf(index) === -1; - }); -} - - -function compileMap(/* lists... */) { - var result = { - scalar: {}, - sequence: {}, - mapping: {}, - fallback: {} - }, index, length; - - function collectType(type) { - result[type.kind][type.tag] = result['fallback'][type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && type.loadKind !== 'scalar') { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; diff --git a/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/js-yaml/lib/js-yaml/schema/core.js deleted file mode 100644 index 206daab..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/core.js +++ /dev/null @@ -1,18 +0,0 @@ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js deleted file mode 100644 index a55ef42..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +++ /dev/null @@ -1,25 +0,0 @@ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js deleted file mode 100644 index 11d89bb..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +++ /dev/null @@ -1,28 +0,0 @@ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js deleted file mode 100644 index b7a33eb..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +++ /dev/null @@ -1,17 +0,0 @@ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/js-yaml/lib/js-yaml/schema/json.js deleted file mode 100644 index 5be3dbf..0000000 --- a/node_modules/js-yaml/lib/js-yaml/schema/json.js +++ /dev/null @@ -1,25 +0,0 @@ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index 90b702a..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (map !== null) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; diff --git a/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 10b1875..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,138 +0,0 @@ -'use strict'; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = _require('buffer').Buffer; -} catch (__) {} - -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index cb77459..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index 127671b..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index ba61c5f..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 8fab8c4..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = _require('esprima'); -} catch (_) { - /* eslint-disable no-redeclare */ - /* global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 43fa470..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 95b5569..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index f327bee..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index ae08a86..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 6874daa..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index b2b5323..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 74b5240..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index be8f77f..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index f885a32..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 27acc10..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 8fa9c58..0000000 --- a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json index 0d23667..17574da 100644 --- a/node_modules/js-yaml/package.json +++ b/node_modules/js-yaml/package.json @@ -1,6 +1,6 @@ { "name": "js-yaml", - "version": "3.14.1", + "version": "4.1.0", "description": "YAML 1.2 parser and serializer", "keywords": [ "yaml", @@ -8,7 +8,6 @@ "serializer", "pyyaml" ], - "homepage": "https://github.com/nodeca/js-yaml", "author": "Vladimir Zapparov ", "contributors": [ "Aleksey V Zapparov (http://www.ixti.net/)", @@ -26,24 +25,42 @@ "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": "^1.0.7", - "esprima": "^4.0.0" + "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", - "browserify": "^16.2.2", "codemirror": "^5.13.4", "eslint": "^7.0.0", - "fast-check": "^1.24.2", - "istanbul": "^0.4.5", - "mocha": "^7.1.2", - "uglify-js": "^3.0.1" - }, - "scripts": { - "test": "make test" + "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/lint-staged/README.md b/node_modules/lint-staged/README.md index a76c39c..0182607 100644 --- a/node_modules/lint-staged/README.md +++ b/node_modules/lint-staged/README.md @@ -1,4 +1,8 @@ -# 🚫💩 lint-staged [![Test & Release](https://github.com/okonet/lint-staged/actions/workflows/push.yml/badge.svg)](https://github.com/okonet/lint-staged/actions/workflows/push.yml) [![Publish](https://github.com/okonet/lint-staged/actions/workflows/tag.yml/badge.svg)](https://github.com/okonet/lint-staged/actions/workflows/tag.yml) [![npm version](https://badge.fury.io/js/lint-staged.svg)](https://badge.fury.io/js/lint-staged) [![Codecov](https://codecov.io/gh/okonet/lint-staged/branch/master/graph/badge.svg)](https://codecov.io/gh/okonet/lint-staged) +# 🚫💩 lint-staged + +[![npm version](https://badge.fury.io/js/lint-staged.svg)](https://badge.fury.io/js/lint-staged) + +--- Run linters against staged git files and don't let :poop: slip into your code base! @@ -236,17 +240,9 @@ Another example in which tasks make edits to files and globs match multiple file ```json { - "*.css": [ - "stylelint --fix", - "prettier --write" - ], - "*.{js,jsx}": [ - "eslint --fix", - "prettier --write" - ], - "!(*.css|*.js|*.jsx)": [ - "prettier --write" - ] + "*.css": ["stylelint --fix", "prettier --write"], + "*.{js,jsx}": ["eslint --fix", "prettier --write"], + "!(*.css|*.js|*.jsx)": ["prettier --write"] } ``` @@ -489,8 +485,7 @@ All examples assume you've already set up lint-staged in the `package.json` file In `.husky/pre-commit` ```shell -#!/usr/bin/env sh -. "$(dirname "$0")/_/husky.sh" +# .husky/pre-commit npx lint-staged ``` @@ -696,9 +691,6 @@ If updating Git doesn't help, you can try to manually redirect the output in you ```shell # .husky/pre-commit -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi npx lint-staged diff --git a/node_modules/lint-staged/bin/lint-staged.js b/node_modules/lint-staged/bin/lint-staged.js index def46bf..0ae0b34 100755 --- a/node_modules/lint-staged/bin/lint-staged.js +++ b/node_modules/lint-staged/bin/lint-staged.js @@ -128,7 +128,7 @@ const options = { verbose: !!cliOptions.verbose, } -debugLog('Options parsed from command-line:', options) +debugLog('Options parsed from command-line: %o', options) if (options.configPath === '-') { delete options.configPath diff --git a/node_modules/lint-staged/lib/chunkFiles.js b/node_modules/lint-staged/lib/chunkFiles.js index 3e5a20c..6462afd 100644 --- a/node_modules/lint-staged/lib/chunkFiles.js +++ b/node_modules/lint-staged/lib/chunkFiles.js @@ -31,7 +31,7 @@ const chunkArray = (arr, chunkCount) => { * @param {Array} opts.files * @param {String} [opts.baseDir] The optional base directory to resolve relative paths. * @param {number} [opts.maxArgLength] the maximum argument string length - * @param {Boolean} [opts.relative] whether files are relative to `gitDir` or should be resolved as absolute + * @param {Boolean} [opts.relative] whether files are relative to `topLevelDir` or should be resolved as absolute * @returns {Array>} */ export const chunkFiles = ({ files, baseDir, maxArgLength = null, relative = false }) => { diff --git a/node_modules/lint-staged/lib/generateTasks.js b/node_modules/lint-staged/lib/generateTasks.js index 0d6b501..49fb153 100644 --- a/node_modules/lint-staged/lib/generateTasks.js +++ b/node_modules/lint-staged/lib/generateTasks.js @@ -13,9 +13,8 @@ const debugLog = debug('lint-staged:generateTasks') * @param {object} options * @param {Object} [options.config] - Task configuration * @param {Object} [options.cwd] - Current working directory - * @param {boolean} [options.gitDir] - Git root directory * @param {boolean} [options.files] - Staged filepaths - * @param {boolean} [options.relative] - Whether filepaths to should be relative to gitDir + * @param {boolean} [options.relative] - Whether filepaths to should be relative to cwd */ export const generateTasks = ({ config, cwd = process.cwd(), files, relative = false }) => { debugLog('Generating linter tasks') diff --git a/node_modules/lint-staged/lib/gitWorkflow.js b/node_modules/lint-staged/lib/gitWorkflow.js index 88c3513..1a8fe62 100644 --- a/node_modules/lint-staged/lib/gitWorkflow.js +++ b/node_modules/lint-staged/lib/gitWorkflow.js @@ -66,11 +66,11 @@ const handleError = (error, ctx, symbol) => { } export class GitWorkflow { - constructor({ allowEmpty, gitConfigDir, gitDir, matchedFileChunks, diff, diffFilter }) { - this.execGit = (args, options = {}) => execGit(args, { ...options, cwd: gitDir }) + constructor({ allowEmpty, gitConfigDir, topLevelDir, matchedFileChunks, diff, diffFilter }) { + this.execGit = (args, options = {}) => execGit(args, { ...options, cwd: topLevelDir }) this.deletedFiles = [] this.gitConfigDir = gitConfigDir - this.gitDir = gitDir + this.topLevelDir = topLevelDir this.diff = diff this.diffFilter = diffFilter this.allowEmpty = allowEmpty @@ -116,7 +116,7 @@ export class GitWorkflow { const deletedFiles = lsFiles .split('\n') .filter(Boolean) - .map((file) => path.resolve(this.gitDir, file)) + .map((file) => path.resolve(this.topLevelDir, file)) debugLog('Found deleted files:', deletedFiles) return deletedFiles } diff --git a/node_modules/lint-staged/lib/index.js b/node_modules/lint-staged/lib/index.js index d9b3f26..adea074 100644 --- a/node_modules/lint-staged/lib/index.js +++ b/node_modules/lint-staged/lib/index.js @@ -1,5 +1,6 @@ import debug from 'debug' +import { execGit } from './execGit.js' import { PREVENTED_EMPTY_COMMIT, GIT_ERROR, @@ -82,11 +83,8 @@ const lintStaged = async ( } = {}, logger = console ) => { - await validateOptions({ cwd, shell }, logger) - - // Unset GIT_LITERAL_PATHSPECS to not mess with path interpretation - debugLog('Unset GIT_LITERAL_PATHSPECS (was `%s`)', process.env.GIT_LITERAL_PATHSPECS) - delete process.env.GIT_LITERAL_PATHSPECS + const gitVersion = await execGit(['version', '--build-options'], { cwd }) + debugLog('%s', gitVersion) const options = { allowEmpty, @@ -106,6 +104,12 @@ const lintStaged = async ( verbose, } + await validateOptions(options, logger) + + // Unset GIT_LITERAL_PATHSPECS to not mess with path interpretation + debugLog('Unset GIT_LITERAL_PATHSPECS (was `%s`)', process.env.GIT_LITERAL_PATHSPECS) + delete process.env.GIT_LITERAL_PATHSPECS + try { const ctx = await runAll(options, logger) debugLog('Tasks were executed successfully!') diff --git a/node_modules/lint-staged/lib/makeCmdTasks.js b/node_modules/lint-staged/lib/makeCmdTasks.js index 218964d..4b42beb 100644 --- a/node_modules/lint-staged/lib/makeCmdTasks.js +++ b/node_modules/lint-staged/lib/makeCmdTasks.js @@ -12,11 +12,11 @@ const debugLog = debug('lint-staged:makeCmdTasks') * @param {Array|string|Function} options.commands * @param {string} options.cwd * @param {Array} options.files - * @param {string} options.gitDir + * @param {string} options.topLevelDir * @param {Boolean} shell * @param {Boolean} verbose */ -export const makeCmdTasks = async ({ commands, cwd, files, gitDir, shell, verbose }) => { +export const makeCmdTasks = async ({ commands, cwd, files, topLevelDir, shell, verbose }) => { debugLog('Creating listr tasks for commands %o', commands) const commandArray = Array.isArray(commands) ? commands : [commands] const cmdTasks = [] @@ -43,7 +43,7 @@ export const makeCmdTasks = async ({ commands, cwd, files, gitDir, shell, verbos ) } - const task = resolveTaskFn({ command, cwd, files, gitDir, isFn, shell, verbose }) + const task = resolveTaskFn({ command, cwd, files, topLevelDir, isFn, shell, verbose }) cmdTasks.push({ title: command, command, task }) } } diff --git a/node_modules/lint-staged/lib/resolveGitRepo.js b/node_modules/lint-staged/lib/resolveGitRepo.js index 4dce4c0..2c2f458 100644 --- a/node_modules/lint-staged/lib/resolveGitRepo.js +++ b/node_modules/lint-staged/lib/resolveGitRepo.js @@ -1,3 +1,5 @@ +import path from 'node:path' + import debug from 'debug' import { execGit } from './execGit.js' @@ -6,8 +8,38 @@ import { normalizePath } from './normalizePath.js' const debugLog = debug('lint-staged:resolveGitRepo') /** - * Resolve git directory and possible submodule paths + * Resolve .git directory relative to repo top-level directory + * + * @example ".git" */ +const resolveRelativeGitDir = async (cwd = process.cwd()) => { + /** + * Absolute repo top-level directory + * + * @example Git on macOS + * "/Users/iiro/Documents/git/lint-staged" + * + * @example Git for Windows + * "C:\Users\iiro\Documents\git\lint-staged" + * + * @example Git installed with MSYS2, this doesn't work when used as CWD with Node.js child_process + * "/c/Users/iiro/Documents/git/lint-staged" + */ + const topLevelPromise = execGit(['rev-parse', '--show-toplevel'], { cwd }) + + /** + * Absolute .git directory, similar to top-level + * + * @example "/Users/iiro/Documents/git/lint-staged/.git" + */ + const absoluteGitDirPromise = execGit(['rev-parse', '--absolute-git-dir'], { cwd }) + + const [topLevel, absoluteGitDir] = await Promise.all([topLevelPromise, absoluteGitDirPromise]) + + return path.relative(topLevel, absoluteGitDir) +} + +/** Resolve git directory and possible submodule paths */ export const resolveGitRepo = async (cwd = process.cwd()) => { try { debugLog('Resolving git repo from `%s`', cwd) @@ -18,15 +50,17 @@ export const resolveGitRepo = async (cwd = process.cwd()) => { debugLog('Unset GIT_WORK_TREE (was `%s`)', process.env.GIT_WORK_TREE) delete process.env.GIT_WORK_TREE - const gitDir = normalizePath(await execGit(['rev-parse', '--show-toplevel'], { cwd })) - debugLog('Resolved git directory to be `%s`', gitDir) + const relativeTopLevelDir = await execGit(['rev-parse', '--show-cdup'], { cwd }) + const topLevelDir = normalizePath(path.join(cwd, relativeTopLevelDir)) + debugLog('Resolved git repository top-level directory to be `%s`', topLevelDir) - const gitConfigDir = normalizePath(await execGit(['rev-parse', '--absolute-git-dir'], { cwd })) + const relativeGitConfigDir = await resolveRelativeGitDir(cwd) + const gitConfigDir = normalizePath(path.join(topLevelDir, relativeGitConfigDir)) debugLog('Resolved git config directory to be `%s`', gitConfigDir) - return { gitDir, gitConfigDir } + return { topLevelDir, gitConfigDir } } catch (error) { debugLog('Failed to resolve git repo with error:', error) - return { error, gitDir: null, gitConfigDir: null } + return { error, topLevelDir: null, gitConfigDir: null } } } diff --git a/node_modules/lint-staged/lib/resolveTaskFn.js b/node_modules/lint-staged/lib/resolveTaskFn.js index 084e8d3..2de825e 100644 --- a/node_modules/lint-staged/lib/resolveTaskFn.js +++ b/node_modules/lint-staged/lib/resolveTaskFn.js @@ -125,7 +125,7 @@ const makeErr = (command, result, ctx) => { * @param {Object} options * @param {string} options.command — Linter task * @param {string} [options.cwd] - * @param {String} options.gitDir - Current git repo path + * @param {String} options.topLevelDir - Current git repo top-level path * @param {Boolean} options.isFn - Whether the linter task is a function * @param {Array} options.files — Filepaths to run the linter task against * @param {Boolean} [options.shell] — Whether to skip parsing linter task for better shell support @@ -136,7 +136,7 @@ export const resolveTaskFn = ({ command, cwd = process.cwd(), files, - gitDir, + topLevelDir, isFn, shell = false, verbose = false, @@ -146,9 +146,9 @@ export const resolveTaskFn = ({ debugLog('args:', args) const execaOptions = { - // Only use gitDir as CWD if we are using the git binary + // Only use topLevelDir as CWD if we are using the git binary // e.g `npm` should run tasks in the actual CWD - cwd: /^git(\.exe)?/i.test(cmd) ? gitDir : cwd, + cwd: /^git(\.exe)?/i.test(cmd) ? topLevelDir : cwd, preferLocal: true, reject: false, shell, diff --git a/node_modules/lint-staged/lib/runAll.js b/node_modules/lint-staged/lib/runAll.js index b4d1003..a8817f6 100644 --- a/node_modules/lint-staged/lib/runAll.js +++ b/node_modules/lint-staged/lib/runAll.js @@ -94,8 +94,8 @@ export const runAll = async ( const ctx = getInitialState({ quiet }) - const { gitDir, gitConfigDir } = await resolveGitRepo(cwd) - if (!gitDir) { + const { topLevelDir, gitConfigDir } = await resolveGitRepo(cwd) + if (!topLevelDir) { if (!quiet) ctx.output.push(NOT_GIT_REPO) ctx.errors.add(GitRepoError) throw createError(ctx) @@ -103,7 +103,7 @@ export const runAll = async ( // Test whether we have any commits or not. // Stashing must be disabled with no initial commit. - const hasInitialCommit = await execGit(['log', '-1'], { cwd: gitDir }) + const hasInitialCommit = await execGit(['log', '-1'], { cwd: topLevelDir }) .then(() => true) .catch(() => false) @@ -119,7 +119,7 @@ export const runAll = async ( logger.warn(skippingHidePartiallyStaged(hasInitialCommit && stash, diff)) } - const files = await getStagedFiles({ cwd: gitDir, diff, diffFilter }) + const files = await getStagedFiles({ cwd: topLevelDir, diff, diffFilter }) if (!files) { if (!quiet) ctx.output.push(FAILED_GET_STAGED_FILES) ctx.errors.add(GetStagedFilesError) @@ -133,7 +133,7 @@ export const runAll = async ( return ctx } - const foundConfigs = await searchConfigs({ configObject, configPath, cwd, gitDir }, logger) + const foundConfigs = await searchConfigs({ configObject, configPath, cwd, topLevelDir }, logger) const numberOfConfigs = Object.keys(foundConfigs).length // Throw if no configurations were found @@ -169,7 +169,7 @@ export const runAll = async ( for (const [configPath, { config, files }] of Object.entries(filesByConfig)) { const configName = configPath ? normalizePath(path.relative(cwd, configPath)) : 'Config object' - const stagedFileChunks = chunkFiles({ baseDir: gitDir, files, maxArgLength, relative }) + const stagedFileChunks = chunkFiles({ baseDir: topLevelDir, files, maxArgLength, relative }) // Use actual cwd if it's specified, or there's only a single config file. // Otherwise use the directory of the config file for each config group, @@ -188,7 +188,7 @@ export const runAll = async ( commands: task.commands, cwd: groupCwd, files: task.fileList, - gitDir, + topLevelDir, shell, verbose, }).then((subTasks) => { @@ -262,7 +262,7 @@ export const runAll = async ( // Chunk matched files for better Windows compatibility const matchedFileChunks = chunkFiles({ - // matched files are relative to `cwd`, not `gitDir`, when `relative` is used + // matched files are relative to `cwd`, not `topLevelDir`, when `relative` is used baseDir: cwd, files: Array.from(matchedFiles), maxArgLength, @@ -272,7 +272,7 @@ export const runAll = async ( const git = new GitWorkflow({ allowEmpty, gitConfigDir, - gitDir, + topLevelDir, matchedFileChunks, diff, diffFilter, diff --git a/node_modules/lint-staged/lib/searchConfigs.js b/node_modules/lint-staged/lib/searchConfigs.js index deee7ad..fd719b8 100644 --- a/node_modules/lint-staged/lib/searchConfigs.js +++ b/node_modules/lint-staged/lib/searchConfigs.js @@ -35,7 +35,7 @@ const isInsideDirectory = (dir) => (file) => file.startsWith(normalizePath(dir)) * @returns {Promise<{ [key: string]: { config: *, files: string[] } }>} found configs with filepath as key, and config as value */ export const searchConfigs = async ( - { configObject, configPath, cwd = process.cwd(), gitDir = cwd }, + { configObject, configPath, cwd = process.cwd(), topLevelDir = cwd }, logger ) => { debugLog('Searching for configuration files...') @@ -59,9 +59,11 @@ export const searchConfigs = async ( const [cachedFilesWithStatus, otherFilesWithStatus] = await Promise.all([ /** Get all possible config files known to git */ - execGit(EXEC_GIT, { cwd: gitDir }).then(parseGitZOutput), + execGit(EXEC_GIT, { cwd: topLevelDir }).then(parseGitZOutput), /** Get all possible config files from uncommitted files */ - execGit([...EXEC_GIT, '--others', '--exclude-standard'], { cwd: gitDir }).then(parseGitZOutput), + execGit([...EXEC_GIT, '--others', '--exclude-standard'], { cwd: topLevelDir }).then( + parseGitZOutput + ), ]) /** Sort possible config files so that deepest is first */ @@ -74,7 +76,7 @@ export const searchConfigs = async ( */ (line) => (line.startsWith('S ') ? [] : [line.replace(/^[HSMRCK?U] /, '')]) ) .filter(filterPossibleConfigFiles) - .map((file) => normalizePath(path.join(gitDir, file))) + .map((file) => normalizePath(path.join(topLevelDir, file))) .filter(isInsideDirectory(cwd)) .sort(sortDeepestParth) diff --git a/node_modules/lint-staged/lib/validateOptions.js b/node_modules/lint-staged/lib/validateOptions.js index a97e60c..f2a0a2a 100644 --- a/node_modules/lint-staged/lib/validateOptions.js +++ b/node_modules/lint-staged/lib/validateOptions.js @@ -26,6 +26,7 @@ export const validateOptions = async (options = {}, logger) => { const resolved = path.resolve(options.cwd) await fs.access(resolved, constants.F_OK) } catch (error) { + debugLog('Failed to validate options: %o', options) logger.error(invalidOption('cwd', options.cwd, error.message)) throw InvalidOptionsError } @@ -36,10 +37,11 @@ export const validateOptions = async (options = {}, logger) => { try { await fs.access(options.shell, constants.X_OK) } catch (error) { + debugLog('Failed to validate options: %o', options) logger.error(invalidOption('shell', options.shell, error.message)) throw InvalidOptionsError } } - debugLog('Validated options!') + debugLog('Validated options: %o', options) } diff --git a/node_modules/lint-staged/package.json b/node_modules/lint-staged/package.json index 4e43917..04b1c21 100644 --- a/node_modules/lint-staged/package.json +++ b/node_modules/lint-staged/package.json @@ -1,9 +1,9 @@ { "name": "lint-staged", - "version": "15.2.7", + "version": "15.2.8", "description": "Lint files staged by git", "license": "MIT", - "repository": "https://github.com/okonet/lint-staged", + "repository": "https://github.com/lint-staged/lint-staged", "author": "Andrey Okonetchnikov ", "maintainers": [ "Lufty Wiranda ", @@ -38,18 +38,18 @@ "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.4", + "debug": "~4.3.6", "execa": "~8.0.1", - "lilconfig": "~3.1.1", - "listr2": "~8.2.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", "micromatch": "~4.0.7", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.4.2" + "yaml": "~2.5.0" }, "devDependencies": { "@changesets/changelog-github": "0.5.0", - "@changesets/cli": "2.27.3", + "@changesets/cli": "2.27.7", "@commitlint/cli": "19.3.0", "@commitlint/config-conventional": "19.2.2", "consolemock": "1.1.0", @@ -58,12 +58,12 @@ "eslint-config-prettier": "9.1.0", "eslint-plugin-import": "2.29.1", "eslint-plugin-node": "11.1.0", - "eslint-plugin-prettier": "5.1.3", - "husky": "9.0.11", + "eslint-plugin-prettier": "5.2.1", + "husky": "9.1.4", "jest": "29.7.0", "jest-snapshot-serializer-ansi": "2.1.0", "mock-stdin": "1.0.0", - "prettier": "3.2.5" + "prettier": "3.3.3" }, "keywords": [ "lint", diff --git a/node_modules/lodash.truncate/LICENSE b/node_modules/lodash.truncate/LICENSE deleted file mode 100644 index e0c69d5..0000000 --- a/node_modules/lodash.truncate/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/node_modules/lodash.truncate/README.md b/node_modules/lodash.truncate/README.md deleted file mode 100644 index a2936e9..0000000 --- a/node_modules/lodash.truncate/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.truncate v4.4.2 - -The [lodash](https://lodash.com/) method `_.truncate` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.truncate -``` - -In Node.js: -```js -var truncate = require('lodash.truncate'); -``` - -See the [documentation](https://lodash.com/docs#truncate) or [package source](https://github.com/lodash/lodash/blob/4.4.2-npm-packages/lodash.truncate) for more details. diff --git a/node_modules/lodash.truncate/index.js b/node_modules/lodash.truncate/index.js deleted file mode 100644 index 4f5449e..0000000 --- a/node_modules/lodash.truncate/index.js +++ /dev/null @@ -1,632 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as default options for `_.truncate`. */ -var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var regexpTag = '[object RegExp]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; - -/** - * Gets the size of an ASCII `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ -var asciiSize = baseProperty('length'); - -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * The base implementation of `_.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); - }; -} - -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - return hasUnicode(string) - ? unicodeSize(string) - : asciiSize(string); -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} - -/** - * Gets the size of a Unicode `string`. - * - * @private - * @param {string} string The string inspect. - * @returns {number} Returns the string size. - */ -function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - result++; - } - return result; -} - -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.isRegExp` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - */ -function baseIsRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; -} - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ -var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** - * Truncates `string` if it's longer than the given maximum string length. - * The last characters of the truncated string are replaced with the omission - * string which defaults to "...". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to truncate. - * @param {Object} [options={}] The options object. - * @param {number} [options.length=30] The maximum string length. - * @param {string} [options.omission='...'] The string to indicate text is omitted. - * @param {RegExp|string} [options.separator] The separator pattern to truncate to. - * @returns {string} Returns the truncated string. - * @example - * - * _.truncate('hi-diddly-ho there, neighborino'); - * // => 'hi-diddly-ho there, neighbo...' - * - * _.truncate('hi-diddly-ho there, neighborino', { - * 'length': 24, - * 'separator': ' ' - * }); - * // => 'hi-diddly-ho there,...' - * - * _.truncate('hi-diddly-ho there, neighborino', { - * 'length': 24, - * 'separator': /,? +/ - * }); - * // => 'hi-diddly-ho there...' - * - * _.truncate('hi-diddly-ho there, neighborino', { - * 'omission': ' [...]' - * }); - * // => 'hi-diddly-ho there, neig [...]' - */ -function truncate(string, options) { - var length = DEFAULT_TRUNC_LENGTH, - omission = DEFAULT_TRUNC_OMISSION; - - if (isObject(options)) { - var separator = 'separator' in options ? options.separator : separator; - length = 'length' in options ? toInteger(options.length) : length; - omission = 'omission' in options ? baseToString(options.omission) : omission; - } - string = toString(string); - - var strLength = string.length; - if (hasUnicode(string)) { - var strSymbols = stringToArray(string); - strLength = strSymbols.length; - } - if (length >= strLength) { - return string; - } - var end = length - stringSize(omission); - if (end < 1) { - return omission; - } - var result = strSymbols - ? castSlice(strSymbols, 0, end).join('') - : string.slice(0, end); - - if (separator === undefined) { - return result + omission; - } - if (strSymbols) { - end += (result.length - end); - } - if (isRegExp(separator)) { - if (string.slice(end).search(separator)) { - var match, - substring = result; - - if (!separator.global) { - separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); - } - separator.lastIndex = 0; - while ((match = separator.exec(substring))) { - var newEnd = match.index; - } - result = result.slice(0, newEnd === undefined ? end : newEnd); - } - } else if (string.indexOf(baseToString(separator), end) != end) { - var index = result.lastIndexOf(separator); - if (index > -1) { - result = result.slice(0, index); - } - } - return result + omission; -} - -module.exports = truncate; diff --git a/node_modules/lodash.truncate/package.json b/node_modules/lodash.truncate/package.json deleted file mode 100644 index 2e2bd53..0000000 --- a/node_modules/lodash.truncate/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "lodash.truncate", - "version": "4.4.2", - "description": "The lodash method `_.truncate` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": "lodash-modularized, truncate", - "author": "John-David Dalton (http://allyoucanleet.com/)", - "contributors": [ - "John-David Dalton (http://allyoucanleet.com/)", - "Blaine Bublitz (https://github.com/phated)", - "Mathias Bynens (https://mathiasbynens.be/)" - ], - "repository": "lodash/lodash", - "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" } -} diff --git a/node_modules/ms/index.js b/node_modules/ms/index.js index c4498bc..ea734fb 100644 --- a/node_modules/ms/index.js +++ b/node_modules/ms/index.js @@ -23,7 +23,7 @@ var y = d * 365.25; * @api public */ -module.exports = function(val, options) { +module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { diff --git a/node_modules/ms/license.md b/node_modules/ms/license.md index 69b6125..fa5d39b 100644 --- a/node_modules/ms/license.md +++ b/node_modules/ms/license.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Zeit, Inc. +Copyright (c) 2020 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/ms/package.json b/node_modules/ms/package.json index eea666e..4997189 100644 --- a/node_modules/ms/package.json +++ b/node_modules/ms/package.json @@ -1,8 +1,8 @@ { "name": "ms", - "version": "2.1.2", + "version": "2.1.3", "description": "Tiny millisecond conversion utility", - "repository": "zeit/ms", + "repository": "vercel/ms", "main": "./index", "files": [ "index.js" @@ -28,10 +28,11 @@ }, "license": "MIT", "devDependencies": { - "eslint": "4.12.1", + "eslint": "4.18.2", "expect.js": "0.3.1", "husky": "0.14.3", "lint-staged": "5.0.0", - "mocha": "4.0.1" + "mocha": "4.0.1", + "prettier": "2.0.5" } } diff --git a/node_modules/ms/readme.md b/node_modules/ms/readme.md index 9a1996b..0fc1abb 100644 --- a/node_modules/ms/readme.md +++ b/node_modules/ms/readme.md @@ -1,7 +1,6 @@ # ms -[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) -[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) +![CI](https://github.com/vercel/ms/workflows/CI/badge.svg) Use this package to easily convert various time formats to milliseconds. diff --git a/node_modules/progress/CHANGELOG.md b/node_modules/progress/CHANGELOG.md deleted file mode 100644 index d9be0aa..0000000 --- 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 4608b39..0000000 --- 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 f933be1..0000000 --- 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 6d4271a..0000000 --- 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 4449dd3..0000000 --- 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 8eb0740..0000000 --- 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 bb81fa0..0000000 --- a/node_modules/progress/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "progress", - "version": "2.0.3", - "description": "Flexible ascii progress bar", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-progress" - }, - "keywords": [ - "cli", - "progress" - ], - "author": "TJ Holowaychuk ", - "contributors": [ - "Christoffer Hallas ", - "Jordan Scales ", - "Andrew Rhyne ", - "Marco Brack " - ], - "dependencies": {}, - "main": "./index.js", - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT" -} diff --git a/node_modules/regexpp/README.md b/node_modules/regexpp/README.md deleted file mode 100644 index a5e2e14..0000000 --- a/node_modules/regexpp/README.md +++ /dev/null @@ -1,178 +0,0 @@ -# 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) - -A regular expression parser for ECMAScript. - -## 💿 Installation - -```bash -$ npm install regexpp -``` - -- require Node.js 8 or newer. - -## 📖 Usage - -```ts -import { - AST, - RegExpParser, - RegExpValidator, - RegExpVisitor, - parseRegExpLiteral, - validateRegExpLiteral, - visitRegExpAST -} from "regexpp" -``` - -### parseRegExpLiteral(source, options?) - -Parse a given regular expression literal then make AST object. - -This is equivalent to `new RegExpParser(options).parseLiteral(source)`. - -- **Parameters:** - - `source` (`string | RegExp`) The source code to parse. - - `options?` ([`RegExpParser.Options`]) The options to parse. -- **Return:** - - The AST of the regular expression. - -### validateRegExpLiteral(source, options?) - -Validate a given regular expression literal. - -This is equivalent to `new RegExpValidator(options).validateLiteral(source)`. - -- **Parameters:** - - `source` (`string`) The source code to validate. - - `options?` ([`RegExpValidator.Options`]) The options to validate. - -### visitRegExpAST(ast, handlers) - -Visit each node of a given AST. - -This is equivalent to `new RegExpVisitor(handlers).visit(ast)`. - -- **Parameters:** - - `ast` ([`AST.Node`]) The AST to visit. - - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. - -### RegExpParser - -#### new RegExpParser(options?) - -- **Parameters:** - - `options?` ([`RegExpParser.Options`]) The options to parse. - -#### parser.parseLiteral(source, start?, end?) - -Parse a regular expression literal. - -- **Parameters:** - - `source` (`string`) The source code to parse. E.g. `"/abc/g"`. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. -- **Return:** - - The AST of the regular expression. - -#### parser.parsePattern(source, start?, end?, uFlag?) - -Parse a regular expression pattern. - -- **Parameters:** - - `source` (`string`) The source code to parse. E.g. `"abc"`. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. - - `uFlag?` (`boolean`) The flag to enable Unicode mode. -- **Return:** - - The AST of the regular expression pattern. - -#### parser.parseFlags(source, start?, end?) - -Parse a regular expression flags. - -- **Parameters:** - - `source` (`string`) The source code to parse. E.g. `"gim"`. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. -- **Return:** - - The AST of the regular expression flags. - -### RegExpValidator - -#### new RegExpValidator(options) - -- **Parameters:** - - `options` ([`RegExpValidator.Options`]) The options to validate. - -#### validator.validateLiteral(source, start, end) - -Validate a regular expression literal. - -- **Parameters:** - - `source` (`string`) The source code to validate. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. - -#### validator.validatePattern(source, start, end, uFlag) - -Validate a regular expression pattern. - -- **Parameters:** - - `source` (`string`) The source code to validate. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. - - `uFlag?` (`boolean`) The flag to enable Unicode mode. - -#### validator.validateFlags(source, start, end) - -Validate a regular expression flags. - -- **Parameters:** - - `source` (`string`) The source code to validate. - - `start?` (`number`) The start index in the source code. Default is `0`. - - `end?` (`number`) The end index in the source code. Default is `source.length`. - -### RegExpVisitor - -#### new RegExpVisitor(handlers) - -- **Parameters:** - - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. - -#### visitor.visit(ast) - -Validate a regular expression literal. - -- **Parameters:** - - `ast` ([`AST.Node`]) The AST to visit. - -## 📰 Changelog - -- [GitHub Releases](https://github.com/mysticatea/regexpp/releases) - -## 🍻 Contributing - -Welcome contributing! - -Please use GitHub's Issues/PRs. - -### Development Tools - -- `npm test` runs tests and measures coverage. -- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`. -- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`. -- `npm run lint` runs ESLint. -- `npm run update:test` updates test fixtures. -- `npm run update:ids` updates `src/unicode/ids.ts`. -- `npm run watch` runs tests with `--watch` option. - -[`AST.Node`]: src/ast.ts#L4 -[`RegExpParser.Options`]: src/parser.ts#L539 -[`RegExpValidator.Options`]: src/validator.ts#L127 -[`RegExpVisitor.Handlers`]: src/visitor.ts#L204 diff --git a/node_modules/regexpp/index.d.ts b/node_modules/regexpp/index.d.ts deleted file mode 100644 index ae359cf..0000000 --- a/node_modules/regexpp/index.d.ts +++ /dev/null @@ -1,248 +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; - hasIndices: 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, 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: "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 | 2021 | 2022; -} - diff --git a/node_modules/regexpp/index.js b/node_modules/regexpp/index.js deleted file mode 100644 index cd0e165..0000000 --- a/node_modules/regexpp/index.js +++ /dev/null @@ -1,2096 +0,0 @@ -/*! @author Toru Nagashima */ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - - - -var ast = /*#__PURE__*/Object.freeze({ - -}); - -let largeIdStartRanges = undefined; -let largeIdContinueRanges = undefined; -function isIdStart(cp) { - if (cp < 0x41) - return false; - if (cp < 0x5b) - return true; - if (cp < 0x61) - return false; - if (cp < 0x7b) - return true; - return isLargeIdStart(cp); -} -function isIdContinue(cp) { - if (cp < 0x30) - return false; - if (cp < 0x3a) - return true; - if (cp < 0x41) - return false; - if (cp < 0x5b) - return true; - if (cp === 0x5f) - return true; - if (cp < 0x61) - return false; - if (cp < 0x7b) - return true; - return isLargeIdStart(cp) || isLargeIdContinue(cp); -} -function isLargeIdStart(cp) { - return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); -} -function isLargeIdContinue(cp) { - return isInRange(cp, largeIdContinueRanges || - (largeIdContinueRanges = initLargeIdContinueRanges())); -} -function initLargeIdStartRanges() { - 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 1i k 2 h 1p 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 6 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 x 0 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 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 c 2 3 f h f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 6 1k t e 1 b 17 r z 16 2 b z 3 8 8 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 1a 2 1a 2 3o 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t g70 4 wc 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 1g 3 8 17 c 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f 4d 8m a l b 7 49 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 2z k s m d 1g 24 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 2d 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 6e 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 z 1k 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 5a 0 28 pl 2v 32 i 5f 24d tq 34i g6 6nu fs 8 u 36 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 6wo 7y 1e 2 i 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 1th 18 b 6 h 0 aa 17 105 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 wyl z 378 c 65 3 4g1 f 5rk 2e8 f1 15v 3t6"); -} -function initLargeIdContinueRanges() { - 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 3c e 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 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 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 96 3 ewa 9 3r 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 43r 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 7a 6 a 9 bn d 15j 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; - while (l < r) { - i = ((l + r) / 2) | 0; - min = ranges[2 * i]; - max = ranges[2 * i + 1]; - if (cp < min) { - r = i; - } - else if (cp > max) { - l = i + 1; - } - else { - return true; - } - } - return false; -} -function restoreRanges(data) { - let last = 0; - return data.split(" ").map(s => (last += parseInt(s, 36) | 0)); -} - -class DataSet { - constructor(raw2018, raw2019, raw2020, raw2021) { - this._raw2018 = raw2018; - this._raw2019 = raw2019; - this._raw2020 = raw2020; - this._raw2021 = raw2021; - } - get es2018() { - return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); - } - get es2019() { - return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); - } - get es2020() { - return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); - } - get es2021() { - return (this._set2021 || (this._set2021 = new Set(this._raw2021.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", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"); -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); - } - if (scNameSet.has(name)) { - return ((version >= 2018 && scValueSets.es2018.has(value)) || - (version >= 2019 && scValueSets.es2019.has(value)) || - (version >= 2020 && scValueSets.es2020.has(value)) || - (version >= 2021 && scValueSets.es2021.has(value))); - } - return false; -} -function isValidLoneUnicodeProperty(version, value) { - return ((version >= 2018 && binPropertySets.es2018.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; -function isLatinLetter(code) { - return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); -} -function isDecimalDigit(code) { - return code >= DigitZero && code <= DigitNine; -} -function isOctalDigit(code) { - return code >= DigitZero && code <= DigitSeven; -} -function isHexDigit(code) { - return ((code >= DigitZero && code <= DigitNine) || - (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); -} -function isLineTerminator(code) { - return (code === LineFeed || - code === CarriageReturn || - code === LineSeparator || - code === ParagraphSeparator); -} -function isValidUnicode(code) { - return code >= MinCodePoint && code <= MaxCodePoint; -} -function digitToInt(code) { - if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { - return code - LatinSmallLetterA + 10; - } - if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { - return code - LatinCapitalLetterA + 10; - } - return code - DigitZero; -} -function isLeadSurrogate(code) { - return code >= 0xd800 && code <= 0xdbff; -} -function isTrailSurrogate(code) { - return code >= 0xdc00 && code <= 0xdfff; -} -function combineSurrogatePair(lead, trail) { - return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; -} - -const legacyImpl = { - at(s, end, i) { - return i < end ? s.charCodeAt(i) : -1; - }, - width(c) { - return 1; - }, -}; -const unicodeImpl = { - at(s, end, i) { - return i < end ? s.codePointAt(i) : -1; - }, - width(c) { - return c > 0xffff ? 2 : 1; - }, -}; -class Reader { - constructor() { - this._impl = legacyImpl; - this._s = ""; - this._i = 0; - this._end = 0; - this._cp1 = -1; - this._w1 = 1; - this._cp2 = -1; - this._w2 = 1; - this._cp3 = -1; - this._w3 = 1; - this._cp4 = -1; - } - get source() { - return this._s; - } - get index() { - return this._i; - } - get currentCodePoint() { - return this._cp1; - } - get nextCodePoint() { - return this._cp2; - } - get nextCodePoint2() { - return this._cp3; - } - get nextCodePoint3() { - return this._cp4; - } - reset(source, start, end, uFlag) { - this._impl = uFlag ? unicodeImpl : legacyImpl; - this._s = source; - this._end = end; - this.rewind(start); - } - rewind(index) { - const impl = this._impl; - this._i = index; - this._cp1 = impl.at(this._s, this._end, index); - this._w1 = impl.width(this._cp1); - this._cp2 = impl.at(this._s, this._end, index + this._w1); - this._w2 = impl.width(this._cp2); - this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); - this._w3 = impl.width(this._cp3); - this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); - } - advance() { - if (this._cp1 !== -1) { - const impl = this._impl; - this._i += this._w1; - this._cp1 = this._cp2; - this._w1 = this._w2; - this._cp2 = this._cp3; - this._w2 = impl.width(this._cp2); - this._cp3 = this._cp4; - this._w3 = impl.width(this._cp3); - this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); - } - } - eat(cp) { - if (this._cp1 === cp) { - this.advance(); - return true; - } - return false; - } - eat2(cp1, cp2) { - if (this._cp1 === cp1 && this._cp2 === cp2) { - this.advance(); - this.advance(); - return true; - } - return false; - } - eat3(cp1, cp2, cp3) { - if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { - this.advance(); - this.advance(); - this.advance(); - return true; - } - return false; - } -} - -class RegExpSyntaxError extends SyntaxError { - constructor(source, uFlag, index, message) { - if (source) { - if (!source.startsWith("/")) { - source = `/${source}/${uFlag ? "u" : ""}`; - } - source = `: ${source}`; - } - super(`Invalid regular expression${source}: ${message}`); - this.index = index; - } -} - -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); -} -function isRegExpIdentifierStart(cp) { - return isIdStart(cp) || cp === DollarSign || cp === LowLine; -} -function isRegExpIdentifierPart(cp) { - return (isIdContinue(cp) || - cp === DollarSign || - cp === LowLine || - cp === ZeroWidthNonJoiner || - cp === ZeroWidthJoiner); -} -function isUnicodePropertyNameCharacter(cp) { - return isLatinLetter(cp) || cp === LowLine; -} -function isUnicodePropertyValueCharacter(cp) { - return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); -} -class RegExpValidator { - constructor(options) { - this._reader = new Reader(); - this._uFlag = false; - this._nFlag = false; - this._lastIntValue = 0; - this._lastMinValue = 0; - this._lastMaxValue = 0; - this._lastStrValue = ""; - this._lastKeyValue = ""; - this._lastValValue = ""; - this._lastAssertionIsQuantifiable = false; - this._numCapturingParens = 0; - this._groupNames = new Set(); - this._backreferenceNames = new Set(); - this._options = 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)) { - const flagStart = this.index; - const uFlag = source.includes("u", flagStart); - this.validateFlags(source, flagStart, end); - this.validatePattern(source, start + 1, flagStart - 1, uFlag); - } - else if (start >= end) { - this.raise("Empty"); - } - else { - const c = String.fromCodePoint(this.currentCodePoint); - this.raise(`Unexpected character '${c}'`); - } - this.onLiteralLeave(start, end); - } - validateFlags(source, start = 0, end = source.length) { - const existingFlags = new Set(); - let global = false; - let ignoreCase = false; - let multiline = false; - 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) { - global = true; - } - else if (flag === LatinSmallLetterI) { - ignoreCase = true; - } - else if (flag === LatinSmallLetterM) { - multiline = true; - } - else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { - unicode = true; - } - else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { - sticky = true; - } - else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { - dotAll = true; - } - else if (flag === LatinSmallLetterD && this.ecmaVersion >= 2022) { - hasIndices = true; - } - else { - this.raise(`Invalid flag '${source[i]}'`); - } - } - this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); - } - validatePattern(source, start = 0, end = source.length, uFlag = false) { - this._uFlag = uFlag && this.ecmaVersion >= 2015; - this._nFlag = uFlag && this.ecmaVersion >= 2018; - this.reset(source, start, end); - this.consumePattern(); - if (!this._nFlag && - this.ecmaVersion >= 2018 && - this._groupNames.size > 0) { - this._nFlag = true; - this.rewind(start); - this.consumePattern(); - } - } - get strict() { - return Boolean(this._options.strict || this._uFlag); - } - get ecmaVersion() { - return this._options.ecmaVersion || 2022; - } - onLiteralEnter(start) { - if (this._options.onLiteralEnter) { - this._options.onLiteralEnter(start); - } - } - onLiteralLeave(start, end) { - if (this._options.onLiteralLeave) { - this._options.onLiteralLeave(start, end); - } - } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) { - if (this._options.onFlags) { - this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); - } - } - onPatternEnter(start) { - if (this._options.onPatternEnter) { - this._options.onPatternEnter(start); - } - } - onPatternLeave(start, end) { - if (this._options.onPatternLeave) { - this._options.onPatternLeave(start, end); - } - } - onDisjunctionEnter(start) { - if (this._options.onDisjunctionEnter) { - this._options.onDisjunctionEnter(start); - } - } - onDisjunctionLeave(start, end) { - if (this._options.onDisjunctionLeave) { - this._options.onDisjunctionLeave(start, end); - } - } - onAlternativeEnter(start, index) { - if (this._options.onAlternativeEnter) { - this._options.onAlternativeEnter(start, index); - } - } - onAlternativeLeave(start, end, index) { - if (this._options.onAlternativeLeave) { - this._options.onAlternativeLeave(start, end, index); - } - } - onGroupEnter(start) { - if (this._options.onGroupEnter) { - this._options.onGroupEnter(start); - } - } - onGroupLeave(start, end) { - if (this._options.onGroupLeave) { - this._options.onGroupLeave(start, end); - } - } - onCapturingGroupEnter(start, name) { - if (this._options.onCapturingGroupEnter) { - this._options.onCapturingGroupEnter(start, name); - } - } - onCapturingGroupLeave(start, end, name) { - if (this._options.onCapturingGroupLeave) { - this._options.onCapturingGroupLeave(start, end, name); - } - } - onQuantifier(start, end, min, max, greedy) { - if (this._options.onQuantifier) { - this._options.onQuantifier(start, end, min, max, greedy); - } - } - onLookaroundAssertionEnter(start, kind, negate) { - if (this._options.onLookaroundAssertionEnter) { - this._options.onLookaroundAssertionEnter(start, kind, negate); - } - } - onLookaroundAssertionLeave(start, end, kind, negate) { - if (this._options.onLookaroundAssertionLeave) { - this._options.onLookaroundAssertionLeave(start, end, kind, negate); - } - } - onEdgeAssertion(start, end, kind) { - if (this._options.onEdgeAssertion) { - this._options.onEdgeAssertion(start, end, kind); - } - } - onWordBoundaryAssertion(start, end, kind, negate) { - if (this._options.onWordBoundaryAssertion) { - this._options.onWordBoundaryAssertion(start, end, kind, negate); - } - } - onAnyCharacterSet(start, end, kind) { - if (this._options.onAnyCharacterSet) { - this._options.onAnyCharacterSet(start, end, kind); - } - } - onEscapeCharacterSet(start, end, kind, negate) { - if (this._options.onEscapeCharacterSet) { - this._options.onEscapeCharacterSet(start, end, kind, negate); - } - } - onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { - if (this._options.onUnicodePropertyCharacterSet) { - this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); - } - } - onCharacter(start, end, value) { - if (this._options.onCharacter) { - this._options.onCharacter(start, end, value); - } - } - onBackreference(start, end, ref) { - if (this._options.onBackreference) { - this._options.onBackreference(start, end, ref); - } - } - onCharacterClassEnter(start, negate) { - if (this._options.onCharacterClassEnter) { - this._options.onCharacterClassEnter(start, negate); - } - } - onCharacterClassLeave(start, end, negate) { - if (this._options.onCharacterClassLeave) { - this._options.onCharacterClassLeave(start, end, negate); - } - } - onCharacterClassRange(start, end, min, max) { - if (this._options.onCharacterClassRange) { - this._options.onCharacterClassRange(start, end, min, max); - } - } - get source() { - return this._reader.source; - } - get index() { - return this._reader.index; - } - get currentCodePoint() { - return this._reader.currentCodePoint; - } - get nextCodePoint() { - return this._reader.nextCodePoint; - } - get nextCodePoint2() { - return this._reader.nextCodePoint2; - } - get nextCodePoint3() { - return this._reader.nextCodePoint3; - } - reset(source, start, end) { - this._reader.reset(source, start, end, this._uFlag); - } - rewind(index) { - this._reader.rewind(index); - } - advance() { - this._reader.advance(); - } - eat(cp) { - return this._reader.eat(cp); - } - eat2(cp1, cp2) { - return this._reader.eat2(cp1, cp2); - } - eat3(cp1, cp2, cp3) { - return this._reader.eat3(cp1, cp2, cp3); - } - raise(message) { - throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); - } - eatRegExpBody() { - const start = this.index; - let inClass = false; - let escaped = false; - for (;;) { - const cp = this.currentCodePoint; - if (cp === -1 || isLineTerminator(cp)) { - const kind = inClass ? "character class" : "regular expression"; - this.raise(`Unterminated ${kind}`); - } - if (escaped) { - escaped = false; - } - else if (cp === ReverseSolidus) { - escaped = true; - } - else if (cp === LeftSquareBracket) { - inClass = true; - } - else if (cp === RightSquareBracket) { - inClass = false; - } - else if ((cp === Solidus && !inClass) || - (cp === Asterisk && this.index === start)) { - break; - } - this.advance(); - } - return this.index !== start; - } - consumePattern() { - const start = this.index; - this._numCapturingParens = this.countCapturingParens(); - this._groupNames.clear(); - this._backreferenceNames.clear(); - this.onPatternEnter(start); - this.consumeDisjunction(); - const cp = this.currentCodePoint; - if (this.currentCodePoint !== -1) { - if (cp === RightParenthesis) { - this.raise("Unmatched ')'"); - } - if (cp === ReverseSolidus) { - this.raise("\\ at end of pattern"); - } - if (cp === RightSquareBracket || cp === RightCurlyBracket) { - this.raise("Lone quantifier brackets"); - } - const c = String.fromCodePoint(cp); - this.raise(`Unexpected character '${c}'`); - } - for (const name of this._backreferenceNames) { - if (!this._groupNames.has(name)) { - this.raise("Invalid named capture referenced"); - } - } - this.onPatternLeave(start, this.index); - } - countCapturingParens() { - const start = this.index; - let inClass = false; - let escaped = false; - let count = 0; - let cp = 0; - while ((cp = this.currentCodePoint) !== -1) { - if (escaped) { - escaped = false; - } - else if (cp === ReverseSolidus) { - escaped = true; - } - else if (cp === LeftSquareBracket) { - inClass = true; - } - else if (cp === RightSquareBracket) { - inClass = false; - } - else if (cp === LeftParenthesis && - !inClass && - (this.nextCodePoint !== QuestionMark || - (this.nextCodePoint2 === LessThanSign && - this.nextCodePoint3 !== EqualsSign && - this.nextCodePoint3 !== ExclamationMark))) { - count += 1; - } - this.advance(); - } - this.rewind(start); - return count; - } - consumeDisjunction() { - const start = this.index; - let i = 0; - this.onDisjunctionEnter(start); - do { - this.consumeAlternative(i++); - } while (this.eat(VerticalLine)); - if (this.consumeQuantifier(true)) { - this.raise("Nothing to repeat"); - } - if (this.eat(LeftCurlyBracket)) { - this.raise("Lone quantifier brackets"); - } - this.onDisjunctionLeave(start, this.index); - } - consumeAlternative(i) { - const start = this.index; - this.onAlternativeEnter(start, i); - while (this.currentCodePoint !== -1 && this.consumeTerm()) { - } - this.onAlternativeLeave(start, this.index, i); - } - consumeTerm() { - if (this._uFlag || this.strict) { - return (this.consumeAssertion() || - (this.consumeAtom() && this.consumeOptionalQuantifier())); - } - return ((this.consumeAssertion() && - (!this._lastAssertionIsQuantifiable || - this.consumeOptionalQuantifier())) || - (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); - } - consumeOptionalQuantifier() { - this.consumeQuantifier(); - return true; - } - consumeAssertion() { - const start = this.index; - this._lastAssertionIsQuantifiable = false; - if (this.eat(CircumflexAccent)) { - this.onEdgeAssertion(start, this.index, "start"); - return true; - } - if (this.eat(DollarSign)) { - this.onEdgeAssertion(start, this.index, "end"); - return true; - } - if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { - this.onWordBoundaryAssertion(start, this.index, "word", true); - return true; - } - if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { - this.onWordBoundaryAssertion(start, this.index, "word", false); - return true; - } - if (this.eat2(LeftParenthesis, QuestionMark)) { - const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); - let negate = false; - if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { - const kind = lookbehind ? "lookbehind" : "lookahead"; - this.onLookaroundAssertionEnter(start, kind, negate); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; - this.onLookaroundAssertionLeave(start, this.index, kind, negate); - return true; - } - this.rewind(start); - } - return false; - } - consumeQuantifier(noConsume = false) { - const start = this.index; - let min = 0; - let max = 0; - let greedy = false; - if (this.eat(Asterisk)) { - min = 0; - max = Number.POSITIVE_INFINITY; - } - else if (this.eat(PlusSign)) { - min = 1; - max = Number.POSITIVE_INFINITY; - } - else if (this.eat(QuestionMark)) { - min = 0; - max = 1; - } - else if (this.eatBracedQuantifier(noConsume)) { - min = this._lastMinValue; - max = this._lastMaxValue; - } - else { - return false; - } - greedy = !this.eat(QuestionMark); - if (!noConsume) { - this.onQuantifier(start, this.index, min, max, greedy); - } - return true; - } - eatBracedQuantifier(noError) { - const start = this.index; - if (this.eat(LeftCurlyBracket)) { - this._lastMinValue = 0; - this._lastMaxValue = Number.POSITIVE_INFINITY; - if (this.eatDecimalDigits()) { - this._lastMinValue = this._lastMaxValue = this._lastIntValue; - if (this.eat(Comma)) { - this._lastMaxValue = this.eatDecimalDigits() - ? this._lastIntValue - : Number.POSITIVE_INFINITY; - } - if (this.eat(RightCurlyBracket)) { - if (!noError && this._lastMaxValue < this._lastMinValue) { - this.raise("numbers out of order in {} quantifier"); - } - return true; - } - } - if (!noError && (this._uFlag || this.strict)) { - this.raise("Incomplete quantifier"); - } - this.rewind(start); - } - return false; - } - consumeAtom() { - return (this.consumePatternCharacter() || - this.consumeDot() || - this.consumeReverseSolidusAtomEscape() || - this.consumeCharacterClass() || - this.consumeUncapturingGroup() || - this.consumeCapturingGroup()); - } - consumeDot() { - if (this.eat(FullStop)) { - this.onAnyCharacterSet(this.index - 1, this.index, "any"); - return true; - } - return false; - } - consumeReverseSolidusAtomEscape() { - const start = this.index; - if (this.eat(ReverseSolidus)) { - if (this.consumeAtomEscape()) { - return true; - } - this.rewind(start); - } - return false; - } - consumeUncapturingGroup() { - const start = this.index; - if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { - this.onGroupEnter(start); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this.onGroupLeave(start, this.index); - return true; - } - return false; - } - consumeCapturingGroup() { - const start = this.index; - if (this.eat(LeftParenthesis)) { - let name = null; - if (this.ecmaVersion >= 2018) { - if (this.consumeGroupSpecifier()) { - name = this._lastStrValue; - } - } - else if (this.currentCodePoint === QuestionMark) { - this.raise("Invalid group"); - } - this.onCapturingGroupEnter(start, name); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this.onCapturingGroupLeave(start, this.index, name); - return true; - } - return false; - } - consumeExtendedAtom() { - return (this.consumeDot() || - this.consumeReverseSolidusAtomEscape() || - this.consumeReverseSolidusFollowedByC() || - this.consumeCharacterClass() || - this.consumeUncapturingGroup() || - this.consumeCapturingGroup() || - this.consumeInvalidBracedQuantifier() || - this.consumeExtendedPatternCharacter()); - } - consumeReverseSolidusFollowedByC() { - const start = this.index; - if (this.currentCodePoint === ReverseSolidus && - this.nextCodePoint === LatinSmallLetterC) { - this._lastIntValue = this.currentCodePoint; - this.advance(); - this.onCharacter(start, this.index, ReverseSolidus); - return true; - } - return false; - } - consumeInvalidBracedQuantifier() { - if (this.eatBracedQuantifier(true)) { - this.raise("Nothing to repeat"); - } - return false; - } - consumePatternCharacter() { - const start = this.index; - const cp = this.currentCodePoint; - if (cp !== -1 && !isSyntaxCharacter(cp)) { - this.advance(); - this.onCharacter(start, this.index, cp); - return true; - } - return false; - } - consumeExtendedPatternCharacter() { - 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) { - this.advance(); - this.onCharacter(start, this.index, cp); - return true; - } - return false; - } - consumeGroupSpecifier() { - if (this.eat(QuestionMark)) { - if (this.eatGroupName()) { - if (!this._groupNames.has(this._lastStrValue)) { - this._groupNames.add(this._lastStrValue); - return true; - } - this.raise("Duplicate capture group name"); - } - this.raise("Invalid group"); - } - return false; - } - consumeAtomEscape() { - if (this.consumeBackreference() || - this.consumeCharacterClassEscape() || - this.consumeCharacterEscape() || - (this._nFlag && this.consumeKGroupName())) { - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - return false; - } - consumeBackreference() { - const start = this.index; - if (this.eatDecimalEscape()) { - const n = this._lastIntValue; - if (n <= this._numCapturingParens) { - this.onBackreference(start - 1, this.index, n); - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - consumeCharacterClassEscape() { - const start = this.index; - if (this.eat(LatinSmallLetterD)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "digit", false); - return true; - } - if (this.eat(LatinCapitalLetterD)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "digit", true); - return true; - } - if (this.eat(LatinSmallLetterS)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "space", false); - return true; - } - if (this.eat(LatinCapitalLetterS)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "space", true); - return true; - } - if (this.eat(LatinSmallLetterW)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "word", false); - return true; - } - if (this.eat(LatinCapitalLetterW)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "word", true); - return true; - } - let negate = false; - if (this._uFlag && - this.ecmaVersion >= 2018 && - (this.eat(LatinSmallLetterP) || - (negate = this.eat(LatinCapitalLetterP)))) { - this._lastIntValue = -1; - if (this.eat(LeftCurlyBracket) && - this.eatUnicodePropertyValueExpression() && - this.eat(RightCurlyBracket)) { - this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); - return true; - } - this.raise("Invalid property name"); - } - return false; - } - consumeCharacterEscape() { - const start = this.index; - if (this.eatControlEscape() || - this.eatCControlLetter() || - this.eatZero() || - this.eatHexEscapeSequence() || - this.eatRegExpUnicodeEscapeSequence() || - (!this.strict && - !this._uFlag && - this.eatLegacyOctalEscapeSequence()) || - this.eatIdentityEscape()) { - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - return false; - } - consumeKGroupName() { - const start = this.index; - if (this.eat(LatinSmallLetterK)) { - if (this.eatGroupName()) { - const groupName = this._lastStrValue; - this._backreferenceNames.add(groupName); - this.onBackreference(start - 1, this.index, groupName); - return true; - } - this.raise("Invalid named reference"); - } - return false; - } - consumeCharacterClass() { - const start = this.index; - if (this.eat(LeftSquareBracket)) { - const negate = this.eat(CircumflexAccent); - this.onCharacterClassEnter(start, negate); - this.consumeClassRanges(); - if (!this.eat(RightSquareBracket)) { - this.raise("Unterminated character class"); - } - this.onCharacterClassLeave(start, this.index, negate); - return true; - } - return false; - } - consumeClassRanges() { - const strict = this.strict || this._uFlag; - for (;;) { - const rangeStart = this.index; - if (!this.consumeClassAtom()) { - break; - } - const min = this._lastIntValue; - if (!this.eat(HyphenMinus)) { - continue; - } - this.onCharacter(this.index - 1, this.index, HyphenMinus); - if (!this.consumeClassAtom()) { - break; - } - const max = this._lastIntValue; - if (min === -1 || max === -1) { - if (strict) { - this.raise("Invalid character class"); - } - continue; - } - if (min > max) { - this.raise("Range out of order in character class"); - } - this.onCharacterClassRange(rangeStart, this.index, min, max); - } - } - consumeClassAtom() { - const start = this.index; - const cp = this.currentCodePoint; - if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { - this.advance(); - this._lastIntValue = cp; - this.onCharacter(start, this.index, this._lastIntValue); - return true; - } - if (this.eat(ReverseSolidus)) { - if (this.consumeClassEscape()) { - return true; - } - if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { - this._lastIntValue = ReverseSolidus; - this.onCharacter(start, this.index, this._lastIntValue); - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - consumeClassEscape() { - const start = this.index; - if (this.eat(LatinSmallLetterB)) { - this._lastIntValue = Backspace; - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - if (this._uFlag && this.eat(HyphenMinus)) { - this._lastIntValue = HyphenMinus; - 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.advance(); - this.advance(); - this._lastIntValue = cp % 0x20; - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); - } - eatGroupName() { - if (this.eat(LessThanSign)) { - if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { - return true; - } - this.raise("Invalid capture group name"); - } - return false; - } - eatRegExpIdentifierName() { - if (this.eatRegExpIdentifierStart()) { - this._lastStrValue = String.fromCodePoint(this._lastIntValue); - while (this.eatRegExpIdentifierPart()) { - this._lastStrValue += String.fromCodePoint(this._lastIntValue); - } - return true; - } - return false; - } - eatRegExpIdentifierStart() { - const start = this.index; - const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; - let cp = this.currentCodePoint; - this.advance(); - if (cp === ReverseSolidus && - this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { - cp = this._lastIntValue; - } - else if (forceUFlag && - isLeadSurrogate(cp) && - isTrailSurrogate(this.currentCodePoint)) { - cp = combineSurrogatePair(cp, this.currentCodePoint); - this.advance(); - } - if (isRegExpIdentifierStart(cp)) { - this._lastIntValue = cp; - return true; - } - if (this.index !== start) { - this.rewind(start); - } - return false; - } - eatRegExpIdentifierPart() { - const start = this.index; - const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; - let cp = this.currentCodePoint; - this.advance(); - if (cp === ReverseSolidus && - this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { - cp = this._lastIntValue; - } - else if (forceUFlag && - isLeadSurrogate(cp) && - isTrailSurrogate(this.currentCodePoint)) { - cp = combineSurrogatePair(cp, this.currentCodePoint); - this.advance(); - } - if (isRegExpIdentifierPart(cp)) { - this._lastIntValue = cp; - return true; - } - if (this.index !== start) { - this.rewind(start); - } - return false; - } - eatCControlLetter() { - const start = this.index; - if (this.eat(LatinSmallLetterC)) { - if (this.eatControlLetter()) { - return true; - } - this.rewind(start); - } - return false; - } - eatZero() { - if (this.currentCodePoint === DigitZero && - !isDecimalDigit(this.nextCodePoint)) { - this._lastIntValue = 0; - this.advance(); - return true; - } - return false; - } - eatControlEscape() { - if (this.eat(LatinSmallLetterF)) { - this._lastIntValue = FormFeed; - return true; - } - if (this.eat(LatinSmallLetterN)) { - this._lastIntValue = LineFeed; - return true; - } - if (this.eat(LatinSmallLetterR)) { - this._lastIntValue = CarriageReturn; - return true; - } - if (this.eat(LatinSmallLetterT)) { - this._lastIntValue = CharacterTabulation; - return true; - } - if (this.eat(LatinSmallLetterV)) { - this._lastIntValue = LineTabulation; - return true; - } - return false; - } - eatControlLetter() { - const cp = this.currentCodePoint; - if (isLatinLetter(cp)) { - this.advance(); - this._lastIntValue = cp % 0x20; - return true; - } - return false; - } - eatRegExpUnicodeEscapeSequence(forceUFlag = false) { - const start = this.index; - const uFlag = forceUFlag || this._uFlag; - if (this.eat(LatinSmallLetterU)) { - if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || - this.eatFixedHexDigits(4) || - (uFlag && this.eatRegExpUnicodeCodePointEscape())) { - return true; - } - if (this.strict || uFlag) { - this.raise("Invalid unicode escape"); - } - this.rewind(start); - } - return false; - } - eatRegExpUnicodeSurrogatePairEscape() { - const start = this.index; - if (this.eatFixedHexDigits(4)) { - const lead = this._lastIntValue; - if (isLeadSurrogate(lead) && - this.eat(ReverseSolidus) && - this.eat(LatinSmallLetterU) && - this.eatFixedHexDigits(4)) { - const trail = this._lastIntValue; - if (isTrailSurrogate(trail)) { - this._lastIntValue = combineSurrogatePair(lead, trail); - return true; - } - } - this.rewind(start); - } - return false; - } - eatRegExpUnicodeCodePointEscape() { - const start = this.index; - if (this.eat(LeftCurlyBracket) && - this.eatHexDigits() && - this.eat(RightCurlyBracket) && - isValidUnicode(this._lastIntValue)) { - return true; - } - this.rewind(start); - return false; - } - eatIdentityEscape() { - const cp = this.currentCodePoint; - if (this.isValidIdentityEscape(cp)) { - this._lastIntValue = cp; - this.advance(); - return true; - } - return false; - } - isValidIdentityEscape(cp) { - if (cp === -1) { - return false; - } - if (this._uFlag) { - return isSyntaxCharacter(cp) || cp === Solidus; - } - if (this.strict) { - return !isIdContinue(cp); - } - if (this._nFlag) { - return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); - } - return cp !== LatinSmallLetterC; - } - eatDecimalEscape() { - this._lastIntValue = 0; - let cp = this.currentCodePoint; - if (cp >= DigitOne && cp <= DigitNine) { - do { - this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); - this.advance(); - } while ((cp = this.currentCodePoint) >= DigitZero && - cp <= DigitNine); - return true; - } - return false; - } - eatUnicodePropertyValueExpression() { - const start = this.index; - if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { - this._lastKeyValue = this._lastStrValue; - if (this.eatUnicodePropertyValue()) { - this._lastValValue = this._lastStrValue; - if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { - return true; - } - this.raise("Invalid property name"); - } - } - this.rewind(start); - if (this.eatLoneUnicodePropertyNameOrValue()) { - const nameOrValue = this._lastStrValue; - if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { - this._lastKeyValue = "General_Category"; - this._lastValValue = nameOrValue; - return true; - } - if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { - this._lastKeyValue = nameOrValue; - this._lastValValue = ""; - return true; - } - this.raise("Invalid property name"); - } - return false; - } - eatUnicodePropertyName() { - this._lastStrValue = ""; - while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { - this._lastStrValue += String.fromCodePoint(this.currentCodePoint); - this.advance(); - } - return this._lastStrValue !== ""; - } - eatUnicodePropertyValue() { - this._lastStrValue = ""; - while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { - this._lastStrValue += String.fromCodePoint(this.currentCodePoint); - this.advance(); - } - return this._lastStrValue !== ""; - } - eatLoneUnicodePropertyNameOrValue() { - return this.eatUnicodePropertyValue(); - } - eatHexEscapeSequence() { - const start = this.index; - if (this.eat(LatinSmallLetterX)) { - if (this.eatFixedHexDigits(2)) { - return true; - } - if (this._uFlag || this.strict) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - eatDecimalDigits() { - const start = this.index; - this._lastIntValue = 0; - while (isDecimalDigit(this.currentCodePoint)) { - this._lastIntValue = - 10 * this._lastIntValue + digitToInt(this.currentCodePoint); - this.advance(); - } - return this.index !== start; - } - eatHexDigits() { - const start = this.index; - this._lastIntValue = 0; - while (isHexDigit(this.currentCodePoint)) { - this._lastIntValue = - 16 * this._lastIntValue + digitToInt(this.currentCodePoint); - this.advance(); - } - return this.index !== start; - } - eatLegacyOctalEscapeSequence() { - if (this.eatOctalDigit()) { - const n1 = this._lastIntValue; - if (this.eatOctalDigit()) { - const n2 = this._lastIntValue; - if (n1 <= 3 && this.eatOctalDigit()) { - this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; - } - else { - this._lastIntValue = n1 * 8 + n2; - } - } - else { - this._lastIntValue = n1; - } - return true; - } - return false; - } - eatOctalDigit() { - const cp = this.currentCodePoint; - if (isOctalDigit(cp)) { - this.advance(); - this._lastIntValue = cp - DigitZero; - return true; - } - this._lastIntValue = 0; - return false; - } - eatFixedHexDigits(length) { - const start = this.index; - this._lastIntValue = 0; - for (let i = 0; i < length; ++i) { - const cp = this.currentCodePoint; - if (!isHexDigit(cp)) { - this.rewind(start); - return false; - } - this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); - this.advance(); - } - return true; - } -} - -const DummyPattern = {}; -const DummyFlags = {}; -const DummyCapturingGroup = {}; -class RegExpParserState { - constructor(options) { - this._node = DummyPattern; - this._flags = DummyFlags; - this._backreferences = []; - this._capturingGroups = []; - this.source = ""; - this.strict = Boolean(options && options.strict); - this.ecmaVersion = (options && options.ecmaVersion) || 2022; - } - get pattern() { - if (this._node.type !== "Pattern") { - throw new Error("UnknownError"); - } - return this._node; - } - get flags() { - if (this._flags.type !== "Flags") { - throw new Error("UnknownError"); - } - return this._flags; - } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) { - this._flags = { - type: "Flags", - parent: null, - start, - end, - raw: this.source.slice(start, end), - global, - ignoreCase, - multiline, - unicode, - sticky, - dotAll, - hasIndices, - }; - } - onPatternEnter(start) { - this._node = { - type: "Pattern", - parent: null, - start, - end: start, - raw: "", - alternatives: [], - }; - this._backreferences.length = 0; - this._capturingGroups.length = 0; - } - onPatternLeave(start, end) { - this._node.end = end; - this._node.raw = this.source.slice(start, end); - for (const reference of this._backreferences) { - const ref = reference.ref; - const group = typeof ref === "number" - ? this._capturingGroups[ref - 1] - : this._capturingGroups.find(g => g.name === ref); - reference.resolved = group; - group.references.push(reference); - } - } - onAlternativeEnter(start) { - const parent = this._node; - if (parent.type !== "Assertion" && - parent.type !== "CapturingGroup" && - parent.type !== "Group" && - parent.type !== "Pattern") { - throw new Error("UnknownError"); - } - this._node = { - type: "Alternative", - parent, - start, - end: start, - raw: "", - elements: [], - }; - parent.alternatives.push(this._node); - } - onAlternativeLeave(start, end) { - const node = this._node; - if (node.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onGroupEnter(start) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "Group", - parent, - start, - end: start, - raw: "", - alternatives: [], - }; - parent.elements.push(this._node); - } - onGroupLeave(start, end) { - const node = this._node; - if (node.type !== "Group" || node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onCapturingGroupEnter(start, name) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "CapturingGroup", - parent, - start, - end: start, - raw: "", - name, - alternatives: [], - references: [], - }; - parent.elements.push(this._node); - this._capturingGroups.push(this._node); - } - onCapturingGroupLeave(start, end) { - const node = this._node; - if (node.type !== "CapturingGroup" || - node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onQuantifier(start, end, min, max, greedy) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const element = parent.elements.pop(); - if (element == null || - element.type === "Quantifier" || - (element.type === "Assertion" && element.kind !== "lookahead")) { - throw new Error("UnknownError"); - } - const node = { - type: "Quantifier", - parent, - start: element.start, - end, - raw: this.source.slice(element.start, end), - min, - max, - greedy, - element, - }; - parent.elements.push(node); - element.parent = node; - } - onLookaroundAssertionEnter(start, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const node = (this._node = { - type: "Assertion", - parent, - start, - end: start, - raw: "", - kind, - negate, - alternatives: [], - }); - parent.elements.push(node); - } - onLookaroundAssertionLeave(start, end) { - const node = this._node; - if (node.type !== "Assertion" || node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onEdgeAssertion(start, end, kind) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Assertion", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - }); - } - onWordBoundaryAssertion(start, end, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Assertion", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - negate, - }); - } - onAnyCharacterSet(start, end, kind) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - }); - } - onEscapeCharacterSet(start, end, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - negate, - }); - } - onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - key, - value, - negate, - }); - } - onCharacter(start, end, value) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Character", - parent, - start, - end, - raw: this.source.slice(start, end), - value, - }); - } - onBackreference(start, end, ref) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const node = { - type: "Backreference", - parent, - start, - end, - raw: this.source.slice(start, end), - ref, - resolved: DummyCapturingGroup, - }; - parent.elements.push(node); - this._backreferences.push(node); - } - onCharacterClassEnter(start, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "CharacterClass", - parent, - start, - end: start, - raw: "", - negate, - elements: [], - }; - parent.elements.push(this._node); - } - onCharacterClassLeave(start, end) { - const node = this._node; - if (node.type !== "CharacterClass" || - node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onCharacterClassRange(start, end) { - const parent = this._node; - if (parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - const elements = parent.elements; - const max = elements.pop(); - const hyphen = elements.pop(); - const min = elements.pop(); - if (!min || - !max || - !hyphen || - min.type !== "Character" || - max.type !== "Character" || - hyphen.type !== "Character" || - hyphen.value !== HyphenMinus) { - throw new Error("UnknownError"); - } - const node = { - type: "CharacterClassRange", - parent, - start, - end, - raw: this.source.slice(start, end), - min, - max, - }; - min.parent = node; - max.parent = node; - elements.push(node); - } -} -class RegExpParser { - constructor(options) { - this._state = new RegExpParserState(options); - this._validator = new RegExpValidator(this._state); - } - parseLiteral(source, start = 0, end = source.length) { - this._state.source = source; - this._validator.validateLiteral(source, start, end); - const pattern = this._state.pattern; - const flags = this._state.flags; - const literal = { - type: "RegExpLiteral", - parent: null, - start, - end, - raw: source, - pattern, - flags, - }; - pattern.parent = literal; - flags.parent = literal; - return literal; - } - parseFlags(source, start = 0, end = source.length) { - this._state.source = source; - this._validator.validateFlags(source, start, end); - return this._state.flags; - } - parsePattern(source, start = 0, end = source.length, uFlag = false) { - this._state.source = source; - this._validator.validatePattern(source, start, end, uFlag); - return this._state.pattern; - } -} - -class RegExpVisitor { - constructor(handlers) { - this._handlers = handlers; - } - visit(node) { - switch (node.type) { - case "Alternative": - this.visitAlternative(node); - break; - case "Assertion": - this.visitAssertion(node); - break; - case "Backreference": - this.visitBackreference(node); - break; - case "CapturingGroup": - this.visitCapturingGroup(node); - break; - case "Character": - this.visitCharacter(node); - break; - case "CharacterClass": - this.visitCharacterClass(node); - break; - case "CharacterClassRange": - this.visitCharacterClassRange(node); - break; - case "CharacterSet": - this.visitCharacterSet(node); - break; - case "Flags": - this.visitFlags(node); - break; - case "Group": - this.visitGroup(node); - break; - case "Pattern": - this.visitPattern(node); - break; - case "Quantifier": - this.visitQuantifier(node); - break; - case "RegExpLiteral": - this.visitRegExpLiteral(node); - break; - default: - throw new Error(`Unknown type: ${node.type}`); - } - } - visitAlternative(node) { - if (this._handlers.onAlternativeEnter) { - this._handlers.onAlternativeEnter(node); - } - node.elements.forEach(this.visit, this); - if (this._handlers.onAlternativeLeave) { - this._handlers.onAlternativeLeave(node); - } - } - visitAssertion(node) { - if (this._handlers.onAssertionEnter) { - this._handlers.onAssertionEnter(node); - } - if (node.kind === "lookahead" || node.kind === "lookbehind") { - node.alternatives.forEach(this.visit, this); - } - if (this._handlers.onAssertionLeave) { - this._handlers.onAssertionLeave(node); - } - } - visitBackreference(node) { - if (this._handlers.onBackreferenceEnter) { - this._handlers.onBackreferenceEnter(node); - } - if (this._handlers.onBackreferenceLeave) { - this._handlers.onBackreferenceLeave(node); - } - } - visitCapturingGroup(node) { - if (this._handlers.onCapturingGroupEnter) { - this._handlers.onCapturingGroupEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onCapturingGroupLeave) { - this._handlers.onCapturingGroupLeave(node); - } - } - visitCharacter(node) { - if (this._handlers.onCharacterEnter) { - this._handlers.onCharacterEnter(node); - } - if (this._handlers.onCharacterLeave) { - this._handlers.onCharacterLeave(node); - } - } - visitCharacterClass(node) { - if (this._handlers.onCharacterClassEnter) { - this._handlers.onCharacterClassEnter(node); - } - node.elements.forEach(this.visit, this); - if (this._handlers.onCharacterClassLeave) { - this._handlers.onCharacterClassLeave(node); - } - } - visitCharacterClassRange(node) { - if (this._handlers.onCharacterClassRangeEnter) { - this._handlers.onCharacterClassRangeEnter(node); - } - this.visitCharacter(node.min); - this.visitCharacter(node.max); - if (this._handlers.onCharacterClassRangeLeave) { - this._handlers.onCharacterClassRangeLeave(node); - } - } - visitCharacterSet(node) { - if (this._handlers.onCharacterSetEnter) { - this._handlers.onCharacterSetEnter(node); - } - if (this._handlers.onCharacterSetLeave) { - this._handlers.onCharacterSetLeave(node); - } - } - visitFlags(node) { - if (this._handlers.onFlagsEnter) { - this._handlers.onFlagsEnter(node); - } - if (this._handlers.onFlagsLeave) { - this._handlers.onFlagsLeave(node); - } - } - visitGroup(node) { - if (this._handlers.onGroupEnter) { - this._handlers.onGroupEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onGroupLeave) { - this._handlers.onGroupLeave(node); - } - } - visitPattern(node) { - if (this._handlers.onPatternEnter) { - this._handlers.onPatternEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onPatternLeave) { - this._handlers.onPatternLeave(node); - } - } - visitQuantifier(node) { - if (this._handlers.onQuantifierEnter) { - this._handlers.onQuantifierEnter(node); - } - this.visit(node.element); - if (this._handlers.onQuantifierLeave) { - this._handlers.onQuantifierLeave(node); - } - } - visitRegExpLiteral(node) { - if (this._handlers.onRegExpLiteralEnter) { - this._handlers.onRegExpLiteralEnter(node); - } - this.visitPattern(node.pattern); - this.visitFlags(node.flags); - if (this._handlers.onRegExpLiteralLeave) { - this._handlers.onRegExpLiteralLeave(node); - } - } -} - -function parseRegExpLiteral(source, options) { - return new RegExpParser(options).parseLiteral(String(source)); -} -function validateRegExpLiteral(source, options) { - return new RegExpValidator(options).validateLiteral(source); -} -function visitRegExpAST(node, handlers) { - new RegExpVisitor(handlers).visit(node); -} - -exports.AST = ast; -exports.RegExpParser = RegExpParser; -exports.RegExpValidator = RegExpValidator; -exports.parseRegExpLiteral = parseRegExpLiteral; -exports.validateRegExpLiteral = validateRegExpLiteral; -exports.visitRegExpAST = visitRegExpAST; -//# sourceMappingURL=index.js.map diff --git a/node_modules/regexpp/index.js.map b/node_modules/regexpp/index.js.map deleted file mode 100644 index db15135..0000000 --- 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.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\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,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IAC1B,OAAO,cAAc,CAAC,EAAE,CAAC,IAAI,iBAAiB,CAAC,EAAE,CAAC,CAAA;CACrD;AAED,SAAS,cAAc,CAAC,EAAU;IAC9B,OAAO,SAAS,CACZ,EAAE,EACF,kBAAkB,KAAK,kBAAkB,GAAG,sBAAsB,EAAE,CAAC,CACxE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AAC,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/index.mjs b/node_modules/regexpp/index.mjs deleted file mode 100644 index bc1f59c..0000000 --- a/node_modules/regexpp/index.mjs +++ /dev/null @@ -1,2087 +0,0 @@ -/*! @author Toru Nagashima */ - - -var ast = /*#__PURE__*/Object.freeze({ - -}); - -let largeIdStartRanges = undefined; -let largeIdContinueRanges = undefined; -function isIdStart(cp) { - if (cp < 0x41) - return false; - if (cp < 0x5b) - return true; - if (cp < 0x61) - return false; - if (cp < 0x7b) - return true; - return isLargeIdStart(cp); -} -function isIdContinue(cp) { - if (cp < 0x30) - return false; - if (cp < 0x3a) - return true; - if (cp < 0x41) - return false; - if (cp < 0x5b) - return true; - if (cp === 0x5f) - return true; - if (cp < 0x61) - return false; - if (cp < 0x7b) - return true; - return isLargeIdStart(cp) || isLargeIdContinue(cp); -} -function isLargeIdStart(cp) { - return isInRange(cp, largeIdStartRanges || (largeIdStartRanges = initLargeIdStartRanges())); -} -function isLargeIdContinue(cp) { - return isInRange(cp, largeIdContinueRanges || - (largeIdContinueRanges = initLargeIdContinueRanges())); -} -function initLargeIdStartRanges() { - 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 1i k 2 h 1p 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 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b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f 4d 8m a l b 7 49 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 2z k s m d 1g 24 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 2d 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 6e 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 z 1k 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 5a 0 28 pl 2v 32 i 5f 24d tq 34i g6 6nu fs 8 u 36 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 6wo 7y 1e 2 i 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 1th 18 b 6 h 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 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 4a a 4w 2 1i e w 9 g 3 1a a 1i 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 4h 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 ewa 9 3r 4 1o 6 q 9 s6 0 2 1i 8 3 2a 0 c 1 f58 1 43r 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 7a 6 a 9 bn d 15j 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; - while (l < r) { - i = ((l + r) / 2) | 0; - min = ranges[2 * i]; - max = ranges[2 * i + 1]; - if (cp < min) { - r = i; - } - else if (cp > max) { - l = i + 1; - } - else { - return true; - } - } - return false; -} -function restoreRanges(data) { - let last = 0; - return data.split(" ").map(s => (last += parseInt(s, 36) | 0)); -} - -class DataSet { - constructor(raw2018, raw2019, raw2020, raw2021) { - this._raw2018 = raw2018; - this._raw2019 = raw2019; - this._raw2020 = raw2020; - this._raw2021 = raw2021; - } - get es2018() { - return (this._set2018 || (this._set2018 = new Set(this._raw2018.split(" ")))); - } - get es2019() { - return (this._set2019 || (this._set2019 = new Set(this._raw2019.split(" ")))); - } - get es2020() { - return (this._set2020 || (this._set2020 = new Set(this._raw2020.split(" ")))); - } - get es2021() { - return (this._set2021 || (this._set2021 = new Set(this._raw2021.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", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi"); -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); - } - if (scNameSet.has(name)) { - return ((version >= 2018 && scValueSets.es2018.has(value)) || - (version >= 2019 && scValueSets.es2019.has(value)) || - (version >= 2020 && scValueSets.es2020.has(value)) || - (version >= 2021 && scValueSets.es2021.has(value))); - } - return false; -} -function isValidLoneUnicodeProperty(version, value) { - return ((version >= 2018 && binPropertySets.es2018.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; -function isLatinLetter(code) { - return ((code >= LatinCapitalLetterA && code <= LatinCapitalLetterZ) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterZ)); -} -function isDecimalDigit(code) { - return code >= DigitZero && code <= DigitNine; -} -function isOctalDigit(code) { - return code >= DigitZero && code <= DigitSeven; -} -function isHexDigit(code) { - return ((code >= DigitZero && code <= DigitNine) || - (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) || - (code >= LatinSmallLetterA && code <= LatinSmallLetterF)); -} -function isLineTerminator(code) { - return (code === LineFeed || - code === CarriageReturn || - code === LineSeparator || - code === ParagraphSeparator); -} -function isValidUnicode(code) { - return code >= MinCodePoint && code <= MaxCodePoint; -} -function digitToInt(code) { - if (code >= LatinSmallLetterA && code <= LatinSmallLetterF) { - return code - LatinSmallLetterA + 10; - } - if (code >= LatinCapitalLetterA && code <= LatinCapitalLetterF) { - return code - LatinCapitalLetterA + 10; - } - return code - DigitZero; -} -function isLeadSurrogate(code) { - return code >= 0xd800 && code <= 0xdbff; -} -function isTrailSurrogate(code) { - return code >= 0xdc00 && code <= 0xdfff; -} -function combineSurrogatePair(lead, trail) { - return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000; -} - -const legacyImpl = { - at(s, end, i) { - return i < end ? s.charCodeAt(i) : -1; - }, - width(c) { - return 1; - }, -}; -const unicodeImpl = { - at(s, end, i) { - return i < end ? s.codePointAt(i) : -1; - }, - width(c) { - return c > 0xffff ? 2 : 1; - }, -}; -class Reader { - constructor() { - this._impl = legacyImpl; - this._s = ""; - this._i = 0; - this._end = 0; - this._cp1 = -1; - this._w1 = 1; - this._cp2 = -1; - this._w2 = 1; - this._cp3 = -1; - this._w3 = 1; - this._cp4 = -1; - } - get source() { - return this._s; - } - get index() { - return this._i; - } - get currentCodePoint() { - return this._cp1; - } - get nextCodePoint() { - return this._cp2; - } - get nextCodePoint2() { - return this._cp3; - } - get nextCodePoint3() { - return this._cp4; - } - reset(source, start, end, uFlag) { - this._impl = uFlag ? unicodeImpl : legacyImpl; - this._s = source; - this._end = end; - this.rewind(start); - } - rewind(index) { - const impl = this._impl; - this._i = index; - this._cp1 = impl.at(this._s, this._end, index); - this._w1 = impl.width(this._cp1); - this._cp2 = impl.at(this._s, this._end, index + this._w1); - this._w2 = impl.width(this._cp2); - this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2); - this._w3 = impl.width(this._cp3); - this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3); - } - advance() { - if (this._cp1 !== -1) { - const impl = this._impl; - this._i += this._w1; - this._cp1 = this._cp2; - this._w1 = this._w2; - this._cp2 = this._cp3; - this._w2 = impl.width(this._cp2); - this._cp3 = this._cp4; - this._w3 = impl.width(this._cp3); - this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3); - } - } - eat(cp) { - if (this._cp1 === cp) { - this.advance(); - return true; - } - return false; - } - eat2(cp1, cp2) { - if (this._cp1 === cp1 && this._cp2 === cp2) { - this.advance(); - this.advance(); - return true; - } - return false; - } - eat3(cp1, cp2, cp3) { - if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) { - this.advance(); - this.advance(); - this.advance(); - return true; - } - return false; - } -} - -class RegExpSyntaxError extends SyntaxError { - constructor(source, uFlag, index, message) { - if (source) { - if (!source.startsWith("/")) { - source = `/${source}/${uFlag ? "u" : ""}`; - } - source = `: ${source}`; - } - super(`Invalid regular expression${source}: ${message}`); - this.index = index; - } -} - -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); -} -function isRegExpIdentifierStart(cp) { - return isIdStart(cp) || cp === DollarSign || cp === LowLine; -} -function isRegExpIdentifierPart(cp) { - return (isIdContinue(cp) || - cp === DollarSign || - cp === LowLine || - cp === ZeroWidthNonJoiner || - cp === ZeroWidthJoiner); -} -function isUnicodePropertyNameCharacter(cp) { - return isLatinLetter(cp) || cp === LowLine; -} -function isUnicodePropertyValueCharacter(cp) { - return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp); -} -class RegExpValidator { - constructor(options) { - this._reader = new Reader(); - this._uFlag = false; - this._nFlag = false; - this._lastIntValue = 0; - this._lastMinValue = 0; - this._lastMaxValue = 0; - this._lastStrValue = ""; - this._lastKeyValue = ""; - this._lastValValue = ""; - this._lastAssertionIsQuantifiable = false; - this._numCapturingParens = 0; - this._groupNames = new Set(); - this._backreferenceNames = new Set(); - this._options = 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)) { - const flagStart = this.index; - const uFlag = source.includes("u", flagStart); - this.validateFlags(source, flagStart, end); - this.validatePattern(source, start + 1, flagStart - 1, uFlag); - } - else if (start >= end) { - this.raise("Empty"); - } - else { - const c = String.fromCodePoint(this.currentCodePoint); - this.raise(`Unexpected character '${c}'`); - } - this.onLiteralLeave(start, end); - } - validateFlags(source, start = 0, end = source.length) { - const existingFlags = new Set(); - let global = false; - let ignoreCase = false; - let multiline = false; - 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) { - global = true; - } - else if (flag === LatinSmallLetterI) { - ignoreCase = true; - } - else if (flag === LatinSmallLetterM) { - multiline = true; - } - else if (flag === LatinSmallLetterU && this.ecmaVersion >= 2015) { - unicode = true; - } - else if (flag === LatinSmallLetterY && this.ecmaVersion >= 2015) { - sticky = true; - } - else if (flag === LatinSmallLetterS && this.ecmaVersion >= 2018) { - dotAll = true; - } - else if (flag === LatinSmallLetterD && this.ecmaVersion >= 2022) { - hasIndices = true; - } - else { - this.raise(`Invalid flag '${source[i]}'`); - } - } - this.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); - } - validatePattern(source, start = 0, end = source.length, uFlag = false) { - this._uFlag = uFlag && this.ecmaVersion >= 2015; - this._nFlag = uFlag && this.ecmaVersion >= 2018; - this.reset(source, start, end); - this.consumePattern(); - if (!this._nFlag && - this.ecmaVersion >= 2018 && - this._groupNames.size > 0) { - this._nFlag = true; - this.rewind(start); - this.consumePattern(); - } - } - get strict() { - return Boolean(this._options.strict || this._uFlag); - } - get ecmaVersion() { - return this._options.ecmaVersion || 2022; - } - onLiteralEnter(start) { - if (this._options.onLiteralEnter) { - this._options.onLiteralEnter(start); - } - } - onLiteralLeave(start, end) { - if (this._options.onLiteralLeave) { - this._options.onLiteralLeave(start, end); - } - } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) { - if (this._options.onFlags) { - this._options.onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices); - } - } - onPatternEnter(start) { - if (this._options.onPatternEnter) { - this._options.onPatternEnter(start); - } - } - onPatternLeave(start, end) { - if (this._options.onPatternLeave) { - this._options.onPatternLeave(start, end); - } - } - onDisjunctionEnter(start) { - if (this._options.onDisjunctionEnter) { - this._options.onDisjunctionEnter(start); - } - } - onDisjunctionLeave(start, end) { - if (this._options.onDisjunctionLeave) { - this._options.onDisjunctionLeave(start, end); - } - } - onAlternativeEnter(start, index) { - if (this._options.onAlternativeEnter) { - this._options.onAlternativeEnter(start, index); - } - } - onAlternativeLeave(start, end, index) { - if (this._options.onAlternativeLeave) { - this._options.onAlternativeLeave(start, end, index); - } - } - onGroupEnter(start) { - if (this._options.onGroupEnter) { - this._options.onGroupEnter(start); - } - } - onGroupLeave(start, end) { - if (this._options.onGroupLeave) { - this._options.onGroupLeave(start, end); - } - } - onCapturingGroupEnter(start, name) { - if (this._options.onCapturingGroupEnter) { - this._options.onCapturingGroupEnter(start, name); - } - } - onCapturingGroupLeave(start, end, name) { - if (this._options.onCapturingGroupLeave) { - this._options.onCapturingGroupLeave(start, end, name); - } - } - onQuantifier(start, end, min, max, greedy) { - if (this._options.onQuantifier) { - this._options.onQuantifier(start, end, min, max, greedy); - } - } - onLookaroundAssertionEnter(start, kind, negate) { - if (this._options.onLookaroundAssertionEnter) { - this._options.onLookaroundAssertionEnter(start, kind, negate); - } - } - onLookaroundAssertionLeave(start, end, kind, negate) { - if (this._options.onLookaroundAssertionLeave) { - this._options.onLookaroundAssertionLeave(start, end, kind, negate); - } - } - onEdgeAssertion(start, end, kind) { - if (this._options.onEdgeAssertion) { - this._options.onEdgeAssertion(start, end, kind); - } - } - onWordBoundaryAssertion(start, end, kind, negate) { - if (this._options.onWordBoundaryAssertion) { - this._options.onWordBoundaryAssertion(start, end, kind, negate); - } - } - onAnyCharacterSet(start, end, kind) { - if (this._options.onAnyCharacterSet) { - this._options.onAnyCharacterSet(start, end, kind); - } - } - onEscapeCharacterSet(start, end, kind, negate) { - if (this._options.onEscapeCharacterSet) { - this._options.onEscapeCharacterSet(start, end, kind, negate); - } - } - onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { - if (this._options.onUnicodePropertyCharacterSet) { - this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate); - } - } - onCharacter(start, end, value) { - if (this._options.onCharacter) { - this._options.onCharacter(start, end, value); - } - } - onBackreference(start, end, ref) { - if (this._options.onBackreference) { - this._options.onBackreference(start, end, ref); - } - } - onCharacterClassEnter(start, negate) { - if (this._options.onCharacterClassEnter) { - this._options.onCharacterClassEnter(start, negate); - } - } - onCharacterClassLeave(start, end, negate) { - if (this._options.onCharacterClassLeave) { - this._options.onCharacterClassLeave(start, end, negate); - } - } - onCharacterClassRange(start, end, min, max) { - if (this._options.onCharacterClassRange) { - this._options.onCharacterClassRange(start, end, min, max); - } - } - get source() { - return this._reader.source; - } - get index() { - return this._reader.index; - } - get currentCodePoint() { - return this._reader.currentCodePoint; - } - get nextCodePoint() { - return this._reader.nextCodePoint; - } - get nextCodePoint2() { - return this._reader.nextCodePoint2; - } - get nextCodePoint3() { - return this._reader.nextCodePoint3; - } - reset(source, start, end) { - this._reader.reset(source, start, end, this._uFlag); - } - rewind(index) { - this._reader.rewind(index); - } - advance() { - this._reader.advance(); - } - eat(cp) { - return this._reader.eat(cp); - } - eat2(cp1, cp2) { - return this._reader.eat2(cp1, cp2); - } - eat3(cp1, cp2, cp3) { - return this._reader.eat3(cp1, cp2, cp3); - } - raise(message) { - throw new RegExpSyntaxError(this.source, this._uFlag, this.index, message); - } - eatRegExpBody() { - const start = this.index; - let inClass = false; - let escaped = false; - for (;;) { - const cp = this.currentCodePoint; - if (cp === -1 || isLineTerminator(cp)) { - const kind = inClass ? "character class" : "regular expression"; - this.raise(`Unterminated ${kind}`); - } - if (escaped) { - escaped = false; - } - else if (cp === ReverseSolidus) { - escaped = true; - } - else if (cp === LeftSquareBracket) { - inClass = true; - } - else if (cp === RightSquareBracket) { - inClass = false; - } - else if ((cp === Solidus && !inClass) || - (cp === Asterisk && this.index === start)) { - break; - } - this.advance(); - } - return this.index !== start; - } - consumePattern() { - const start = this.index; - this._numCapturingParens = this.countCapturingParens(); - this._groupNames.clear(); - this._backreferenceNames.clear(); - this.onPatternEnter(start); - this.consumeDisjunction(); - const cp = this.currentCodePoint; - if (this.currentCodePoint !== -1) { - if (cp === RightParenthesis) { - this.raise("Unmatched ')'"); - } - if (cp === ReverseSolidus) { - this.raise("\\ at end of pattern"); - } - if (cp === RightSquareBracket || cp === RightCurlyBracket) { - this.raise("Lone quantifier brackets"); - } - const c = String.fromCodePoint(cp); - this.raise(`Unexpected character '${c}'`); - } - for (const name of this._backreferenceNames) { - if (!this._groupNames.has(name)) { - this.raise("Invalid named capture referenced"); - } - } - this.onPatternLeave(start, this.index); - } - countCapturingParens() { - const start = this.index; - let inClass = false; - let escaped = false; - let count = 0; - let cp = 0; - while ((cp = this.currentCodePoint) !== -1) { - if (escaped) { - escaped = false; - } - else if (cp === ReverseSolidus) { - escaped = true; - } - else if (cp === LeftSquareBracket) { - inClass = true; - } - else if (cp === RightSquareBracket) { - inClass = false; - } - else if (cp === LeftParenthesis && - !inClass && - (this.nextCodePoint !== QuestionMark || - (this.nextCodePoint2 === LessThanSign && - this.nextCodePoint3 !== EqualsSign && - this.nextCodePoint3 !== ExclamationMark))) { - count += 1; - } - this.advance(); - } - this.rewind(start); - return count; - } - consumeDisjunction() { - const start = this.index; - let i = 0; - this.onDisjunctionEnter(start); - do { - this.consumeAlternative(i++); - } while (this.eat(VerticalLine)); - if (this.consumeQuantifier(true)) { - this.raise("Nothing to repeat"); - } - if (this.eat(LeftCurlyBracket)) { - this.raise("Lone quantifier brackets"); - } - this.onDisjunctionLeave(start, this.index); - } - consumeAlternative(i) { - const start = this.index; - this.onAlternativeEnter(start, i); - while (this.currentCodePoint !== -1 && this.consumeTerm()) { - } - this.onAlternativeLeave(start, this.index, i); - } - consumeTerm() { - if (this._uFlag || this.strict) { - return (this.consumeAssertion() || - (this.consumeAtom() && this.consumeOptionalQuantifier())); - } - return ((this.consumeAssertion() && - (!this._lastAssertionIsQuantifiable || - this.consumeOptionalQuantifier())) || - (this.consumeExtendedAtom() && this.consumeOptionalQuantifier())); - } - consumeOptionalQuantifier() { - this.consumeQuantifier(); - return true; - } - consumeAssertion() { - const start = this.index; - this._lastAssertionIsQuantifiable = false; - if (this.eat(CircumflexAccent)) { - this.onEdgeAssertion(start, this.index, "start"); - return true; - } - if (this.eat(DollarSign)) { - this.onEdgeAssertion(start, this.index, "end"); - return true; - } - if (this.eat2(ReverseSolidus, LatinCapitalLetterB)) { - this.onWordBoundaryAssertion(start, this.index, "word", true); - return true; - } - if (this.eat2(ReverseSolidus, LatinSmallLetterB)) { - this.onWordBoundaryAssertion(start, this.index, "word", false); - return true; - } - if (this.eat2(LeftParenthesis, QuestionMark)) { - const lookbehind = this.ecmaVersion >= 2018 && this.eat(LessThanSign); - let negate = false; - if (this.eat(EqualsSign) || (negate = this.eat(ExclamationMark))) { - const kind = lookbehind ? "lookbehind" : "lookahead"; - this.onLookaroundAssertionEnter(start, kind, negate); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this._lastAssertionIsQuantifiable = !lookbehind && !this.strict; - this.onLookaroundAssertionLeave(start, this.index, kind, negate); - return true; - } - this.rewind(start); - } - return false; - } - consumeQuantifier(noConsume = false) { - const start = this.index; - let min = 0; - let max = 0; - let greedy = false; - if (this.eat(Asterisk)) { - min = 0; - max = Number.POSITIVE_INFINITY; - } - else if (this.eat(PlusSign)) { - min = 1; - max = Number.POSITIVE_INFINITY; - } - else if (this.eat(QuestionMark)) { - min = 0; - max = 1; - } - else if (this.eatBracedQuantifier(noConsume)) { - min = this._lastMinValue; - max = this._lastMaxValue; - } - else { - return false; - } - greedy = !this.eat(QuestionMark); - if (!noConsume) { - this.onQuantifier(start, this.index, min, max, greedy); - } - return true; - } - eatBracedQuantifier(noError) { - const start = this.index; - if (this.eat(LeftCurlyBracket)) { - this._lastMinValue = 0; - this._lastMaxValue = Number.POSITIVE_INFINITY; - if (this.eatDecimalDigits()) { - this._lastMinValue = this._lastMaxValue = this._lastIntValue; - if (this.eat(Comma)) { - this._lastMaxValue = this.eatDecimalDigits() - ? this._lastIntValue - : Number.POSITIVE_INFINITY; - } - if (this.eat(RightCurlyBracket)) { - if (!noError && this._lastMaxValue < this._lastMinValue) { - this.raise("numbers out of order in {} quantifier"); - } - return true; - } - } - if (!noError && (this._uFlag || this.strict)) { - this.raise("Incomplete quantifier"); - } - this.rewind(start); - } - return false; - } - consumeAtom() { - return (this.consumePatternCharacter() || - this.consumeDot() || - this.consumeReverseSolidusAtomEscape() || - this.consumeCharacterClass() || - this.consumeUncapturingGroup() || - this.consumeCapturingGroup()); - } - consumeDot() { - if (this.eat(FullStop)) { - this.onAnyCharacterSet(this.index - 1, this.index, "any"); - return true; - } - return false; - } - consumeReverseSolidusAtomEscape() { - const start = this.index; - if (this.eat(ReverseSolidus)) { - if (this.consumeAtomEscape()) { - return true; - } - this.rewind(start); - } - return false; - } - consumeUncapturingGroup() { - const start = this.index; - if (this.eat3(LeftParenthesis, QuestionMark, Colon)) { - this.onGroupEnter(start); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this.onGroupLeave(start, this.index); - return true; - } - return false; - } - consumeCapturingGroup() { - const start = this.index; - if (this.eat(LeftParenthesis)) { - let name = null; - if (this.ecmaVersion >= 2018) { - if (this.consumeGroupSpecifier()) { - name = this._lastStrValue; - } - } - else if (this.currentCodePoint === QuestionMark) { - this.raise("Invalid group"); - } - this.onCapturingGroupEnter(start, name); - this.consumeDisjunction(); - if (!this.eat(RightParenthesis)) { - this.raise("Unterminated group"); - } - this.onCapturingGroupLeave(start, this.index, name); - return true; - } - return false; - } - consumeExtendedAtom() { - return (this.consumeDot() || - this.consumeReverseSolidusAtomEscape() || - this.consumeReverseSolidusFollowedByC() || - this.consumeCharacterClass() || - this.consumeUncapturingGroup() || - this.consumeCapturingGroup() || - this.consumeInvalidBracedQuantifier() || - this.consumeExtendedPatternCharacter()); - } - consumeReverseSolidusFollowedByC() { - const start = this.index; - if (this.currentCodePoint === ReverseSolidus && - this.nextCodePoint === LatinSmallLetterC) { - this._lastIntValue = this.currentCodePoint; - this.advance(); - this.onCharacter(start, this.index, ReverseSolidus); - return true; - } - return false; - } - consumeInvalidBracedQuantifier() { - if (this.eatBracedQuantifier(true)) { - this.raise("Nothing to repeat"); - } - return false; - } - consumePatternCharacter() { - const start = this.index; - const cp = this.currentCodePoint; - if (cp !== -1 && !isSyntaxCharacter(cp)) { - this.advance(); - this.onCharacter(start, this.index, cp); - return true; - } - return false; - } - consumeExtendedPatternCharacter() { - 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) { - this.advance(); - this.onCharacter(start, this.index, cp); - return true; - } - return false; - } - consumeGroupSpecifier() { - if (this.eat(QuestionMark)) { - if (this.eatGroupName()) { - if (!this._groupNames.has(this._lastStrValue)) { - this._groupNames.add(this._lastStrValue); - return true; - } - this.raise("Duplicate capture group name"); - } - this.raise("Invalid group"); - } - return false; - } - consumeAtomEscape() { - if (this.consumeBackreference() || - this.consumeCharacterClassEscape() || - this.consumeCharacterEscape() || - (this._nFlag && this.consumeKGroupName())) { - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - return false; - } - consumeBackreference() { - const start = this.index; - if (this.eatDecimalEscape()) { - const n = this._lastIntValue; - if (n <= this._numCapturingParens) { - this.onBackreference(start - 1, this.index, n); - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - consumeCharacterClassEscape() { - const start = this.index; - if (this.eat(LatinSmallLetterD)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "digit", false); - return true; - } - if (this.eat(LatinCapitalLetterD)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "digit", true); - return true; - } - if (this.eat(LatinSmallLetterS)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "space", false); - return true; - } - if (this.eat(LatinCapitalLetterS)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "space", true); - return true; - } - if (this.eat(LatinSmallLetterW)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "word", false); - return true; - } - if (this.eat(LatinCapitalLetterW)) { - this._lastIntValue = -1; - this.onEscapeCharacterSet(start - 1, this.index, "word", true); - return true; - } - let negate = false; - if (this._uFlag && - this.ecmaVersion >= 2018 && - (this.eat(LatinSmallLetterP) || - (negate = this.eat(LatinCapitalLetterP)))) { - this._lastIntValue = -1; - if (this.eat(LeftCurlyBracket) && - this.eatUnicodePropertyValueExpression() && - this.eat(RightCurlyBracket)) { - this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", this._lastKeyValue, this._lastValValue || null, negate); - return true; - } - this.raise("Invalid property name"); - } - return false; - } - consumeCharacterEscape() { - const start = this.index; - if (this.eatControlEscape() || - this.eatCControlLetter() || - this.eatZero() || - this.eatHexEscapeSequence() || - this.eatRegExpUnicodeEscapeSequence() || - (!this.strict && - !this._uFlag && - this.eatLegacyOctalEscapeSequence()) || - this.eatIdentityEscape()) { - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - return false; - } - consumeKGroupName() { - const start = this.index; - if (this.eat(LatinSmallLetterK)) { - if (this.eatGroupName()) { - const groupName = this._lastStrValue; - this._backreferenceNames.add(groupName); - this.onBackreference(start - 1, this.index, groupName); - return true; - } - this.raise("Invalid named reference"); - } - return false; - } - consumeCharacterClass() { - const start = this.index; - if (this.eat(LeftSquareBracket)) { - const negate = this.eat(CircumflexAccent); - this.onCharacterClassEnter(start, negate); - this.consumeClassRanges(); - if (!this.eat(RightSquareBracket)) { - this.raise("Unterminated character class"); - } - this.onCharacterClassLeave(start, this.index, negate); - return true; - } - return false; - } - consumeClassRanges() { - const strict = this.strict || this._uFlag; - for (;;) { - const rangeStart = this.index; - if (!this.consumeClassAtom()) { - break; - } - const min = this._lastIntValue; - if (!this.eat(HyphenMinus)) { - continue; - } - this.onCharacter(this.index - 1, this.index, HyphenMinus); - if (!this.consumeClassAtom()) { - break; - } - const max = this._lastIntValue; - if (min === -1 || max === -1) { - if (strict) { - this.raise("Invalid character class"); - } - continue; - } - if (min > max) { - this.raise("Range out of order in character class"); - } - this.onCharacterClassRange(rangeStart, this.index, min, max); - } - } - consumeClassAtom() { - const start = this.index; - const cp = this.currentCodePoint; - if (cp !== -1 && cp !== ReverseSolidus && cp !== RightSquareBracket) { - this.advance(); - this._lastIntValue = cp; - this.onCharacter(start, this.index, this._lastIntValue); - return true; - } - if (this.eat(ReverseSolidus)) { - if (this.consumeClassEscape()) { - return true; - } - if (!this.strict && this.currentCodePoint === LatinSmallLetterC) { - this._lastIntValue = ReverseSolidus; - this.onCharacter(start, this.index, this._lastIntValue); - return true; - } - if (this.strict || this._uFlag) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - consumeClassEscape() { - const start = this.index; - if (this.eat(LatinSmallLetterB)) { - this._lastIntValue = Backspace; - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - if (this._uFlag && this.eat(HyphenMinus)) { - this._lastIntValue = HyphenMinus; - 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.advance(); - this.advance(); - this._lastIntValue = cp % 0x20; - this.onCharacter(start - 1, this.index, this._lastIntValue); - return true; - } - return (this.consumeCharacterClassEscape() || this.consumeCharacterEscape()); - } - eatGroupName() { - if (this.eat(LessThanSign)) { - if (this.eatRegExpIdentifierName() && this.eat(GreaterThanSign)) { - return true; - } - this.raise("Invalid capture group name"); - } - return false; - } - eatRegExpIdentifierName() { - if (this.eatRegExpIdentifierStart()) { - this._lastStrValue = String.fromCodePoint(this._lastIntValue); - while (this.eatRegExpIdentifierPart()) { - this._lastStrValue += String.fromCodePoint(this._lastIntValue); - } - return true; - } - return false; - } - eatRegExpIdentifierStart() { - const start = this.index; - const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; - let cp = this.currentCodePoint; - this.advance(); - if (cp === ReverseSolidus && - this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { - cp = this._lastIntValue; - } - else if (forceUFlag && - isLeadSurrogate(cp) && - isTrailSurrogate(this.currentCodePoint)) { - cp = combineSurrogatePair(cp, this.currentCodePoint); - this.advance(); - } - if (isRegExpIdentifierStart(cp)) { - this._lastIntValue = cp; - return true; - } - if (this.index !== start) { - this.rewind(start); - } - return false; - } - eatRegExpIdentifierPart() { - const start = this.index; - const forceUFlag = !this._uFlag && this.ecmaVersion >= 2020; - let cp = this.currentCodePoint; - this.advance(); - if (cp === ReverseSolidus && - this.eatRegExpUnicodeEscapeSequence(forceUFlag)) { - cp = this._lastIntValue; - } - else if (forceUFlag && - isLeadSurrogate(cp) && - isTrailSurrogate(this.currentCodePoint)) { - cp = combineSurrogatePair(cp, this.currentCodePoint); - this.advance(); - } - if (isRegExpIdentifierPart(cp)) { - this._lastIntValue = cp; - return true; - } - if (this.index !== start) { - this.rewind(start); - } - return false; - } - eatCControlLetter() { - const start = this.index; - if (this.eat(LatinSmallLetterC)) { - if (this.eatControlLetter()) { - return true; - } - this.rewind(start); - } - return false; - } - eatZero() { - if (this.currentCodePoint === DigitZero && - !isDecimalDigit(this.nextCodePoint)) { - this._lastIntValue = 0; - this.advance(); - return true; - } - return false; - } - eatControlEscape() { - if (this.eat(LatinSmallLetterF)) { - this._lastIntValue = FormFeed; - return true; - } - if (this.eat(LatinSmallLetterN)) { - this._lastIntValue = LineFeed; - return true; - } - if (this.eat(LatinSmallLetterR)) { - this._lastIntValue = CarriageReturn; - return true; - } - if (this.eat(LatinSmallLetterT)) { - this._lastIntValue = CharacterTabulation; - return true; - } - if (this.eat(LatinSmallLetterV)) { - this._lastIntValue = LineTabulation; - return true; - } - return false; - } - eatControlLetter() { - const cp = this.currentCodePoint; - if (isLatinLetter(cp)) { - this.advance(); - this._lastIntValue = cp % 0x20; - return true; - } - return false; - } - eatRegExpUnicodeEscapeSequence(forceUFlag = false) { - const start = this.index; - const uFlag = forceUFlag || this._uFlag; - if (this.eat(LatinSmallLetterU)) { - if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) || - this.eatFixedHexDigits(4) || - (uFlag && this.eatRegExpUnicodeCodePointEscape())) { - return true; - } - if (this.strict || uFlag) { - this.raise("Invalid unicode escape"); - } - this.rewind(start); - } - return false; - } - eatRegExpUnicodeSurrogatePairEscape() { - const start = this.index; - if (this.eatFixedHexDigits(4)) { - const lead = this._lastIntValue; - if (isLeadSurrogate(lead) && - this.eat(ReverseSolidus) && - this.eat(LatinSmallLetterU) && - this.eatFixedHexDigits(4)) { - const trail = this._lastIntValue; - if (isTrailSurrogate(trail)) { - this._lastIntValue = combineSurrogatePair(lead, trail); - return true; - } - } - this.rewind(start); - } - return false; - } - eatRegExpUnicodeCodePointEscape() { - const start = this.index; - if (this.eat(LeftCurlyBracket) && - this.eatHexDigits() && - this.eat(RightCurlyBracket) && - isValidUnicode(this._lastIntValue)) { - return true; - } - this.rewind(start); - return false; - } - eatIdentityEscape() { - const cp = this.currentCodePoint; - if (this.isValidIdentityEscape(cp)) { - this._lastIntValue = cp; - this.advance(); - return true; - } - return false; - } - isValidIdentityEscape(cp) { - if (cp === -1) { - return false; - } - if (this._uFlag) { - return isSyntaxCharacter(cp) || cp === Solidus; - } - if (this.strict) { - return !isIdContinue(cp); - } - if (this._nFlag) { - return !(cp === LatinSmallLetterC || cp === LatinSmallLetterK); - } - return cp !== LatinSmallLetterC; - } - eatDecimalEscape() { - this._lastIntValue = 0; - let cp = this.currentCodePoint; - if (cp >= DigitOne && cp <= DigitNine) { - do { - this._lastIntValue = 10 * this._lastIntValue + (cp - DigitZero); - this.advance(); - } while ((cp = this.currentCodePoint) >= DigitZero && - cp <= DigitNine); - return true; - } - return false; - } - eatUnicodePropertyValueExpression() { - const start = this.index; - if (this.eatUnicodePropertyName() && this.eat(EqualsSign)) { - this._lastKeyValue = this._lastStrValue; - if (this.eatUnicodePropertyValue()) { - this._lastValValue = this._lastStrValue; - if (isValidUnicodeProperty(this.ecmaVersion, this._lastKeyValue, this._lastValValue)) { - return true; - } - this.raise("Invalid property name"); - } - } - this.rewind(start); - if (this.eatLoneUnicodePropertyNameOrValue()) { - const nameOrValue = this._lastStrValue; - if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) { - this._lastKeyValue = "General_Category"; - this._lastValValue = nameOrValue; - return true; - } - if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) { - this._lastKeyValue = nameOrValue; - this._lastValValue = ""; - return true; - } - this.raise("Invalid property name"); - } - return false; - } - eatUnicodePropertyName() { - this._lastStrValue = ""; - while (isUnicodePropertyNameCharacter(this.currentCodePoint)) { - this._lastStrValue += String.fromCodePoint(this.currentCodePoint); - this.advance(); - } - return this._lastStrValue !== ""; - } - eatUnicodePropertyValue() { - this._lastStrValue = ""; - while (isUnicodePropertyValueCharacter(this.currentCodePoint)) { - this._lastStrValue += String.fromCodePoint(this.currentCodePoint); - this.advance(); - } - return this._lastStrValue !== ""; - } - eatLoneUnicodePropertyNameOrValue() { - return this.eatUnicodePropertyValue(); - } - eatHexEscapeSequence() { - const start = this.index; - if (this.eat(LatinSmallLetterX)) { - if (this.eatFixedHexDigits(2)) { - return true; - } - if (this._uFlag || this.strict) { - this.raise("Invalid escape"); - } - this.rewind(start); - } - return false; - } - eatDecimalDigits() { - const start = this.index; - this._lastIntValue = 0; - while (isDecimalDigit(this.currentCodePoint)) { - this._lastIntValue = - 10 * this._lastIntValue + digitToInt(this.currentCodePoint); - this.advance(); - } - return this.index !== start; - } - eatHexDigits() { - const start = this.index; - this._lastIntValue = 0; - while (isHexDigit(this.currentCodePoint)) { - this._lastIntValue = - 16 * this._lastIntValue + digitToInt(this.currentCodePoint); - this.advance(); - } - return this.index !== start; - } - eatLegacyOctalEscapeSequence() { - if (this.eatOctalDigit()) { - const n1 = this._lastIntValue; - if (this.eatOctalDigit()) { - const n2 = this._lastIntValue; - if (n1 <= 3 && this.eatOctalDigit()) { - this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue; - } - else { - this._lastIntValue = n1 * 8 + n2; - } - } - else { - this._lastIntValue = n1; - } - return true; - } - return false; - } - eatOctalDigit() { - const cp = this.currentCodePoint; - if (isOctalDigit(cp)) { - this.advance(); - this._lastIntValue = cp - DigitZero; - return true; - } - this._lastIntValue = 0; - return false; - } - eatFixedHexDigits(length) { - const start = this.index; - this._lastIntValue = 0; - for (let i = 0; i < length; ++i) { - const cp = this.currentCodePoint; - if (!isHexDigit(cp)) { - this.rewind(start); - return false; - } - this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp); - this.advance(); - } - return true; - } -} - -const DummyPattern = {}; -const DummyFlags = {}; -const DummyCapturingGroup = {}; -class RegExpParserState { - constructor(options) { - this._node = DummyPattern; - this._flags = DummyFlags; - this._backreferences = []; - this._capturingGroups = []; - this.source = ""; - this.strict = Boolean(options && options.strict); - this.ecmaVersion = (options && options.ecmaVersion) || 2022; - } - get pattern() { - if (this._node.type !== "Pattern") { - throw new Error("UnknownError"); - } - return this._node; - } - get flags() { - if (this._flags.type !== "Flags") { - throw new Error("UnknownError"); - } - return this._flags; - } - onFlags(start, end, global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices) { - this._flags = { - type: "Flags", - parent: null, - start, - end, - raw: this.source.slice(start, end), - global, - ignoreCase, - multiline, - unicode, - sticky, - dotAll, - hasIndices, - }; - } - onPatternEnter(start) { - this._node = { - type: "Pattern", - parent: null, - start, - end: start, - raw: "", - alternatives: [], - }; - this._backreferences.length = 0; - this._capturingGroups.length = 0; - } - onPatternLeave(start, end) { - this._node.end = end; - this._node.raw = this.source.slice(start, end); - for (const reference of this._backreferences) { - const ref = reference.ref; - const group = typeof ref === "number" - ? this._capturingGroups[ref - 1] - : this._capturingGroups.find(g => g.name === ref); - reference.resolved = group; - group.references.push(reference); - } - } - onAlternativeEnter(start) { - const parent = this._node; - if (parent.type !== "Assertion" && - parent.type !== "CapturingGroup" && - parent.type !== "Group" && - parent.type !== "Pattern") { - throw new Error("UnknownError"); - } - this._node = { - type: "Alternative", - parent, - start, - end: start, - raw: "", - elements: [], - }; - parent.alternatives.push(this._node); - } - onAlternativeLeave(start, end) { - const node = this._node; - if (node.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onGroupEnter(start) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "Group", - parent, - start, - end: start, - raw: "", - alternatives: [], - }; - parent.elements.push(this._node); - } - onGroupLeave(start, end) { - const node = this._node; - if (node.type !== "Group" || node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onCapturingGroupEnter(start, name) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "CapturingGroup", - parent, - start, - end: start, - raw: "", - name, - alternatives: [], - references: [], - }; - parent.elements.push(this._node); - this._capturingGroups.push(this._node); - } - onCapturingGroupLeave(start, end) { - const node = this._node; - if (node.type !== "CapturingGroup" || - node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onQuantifier(start, end, min, max, greedy) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const element = parent.elements.pop(); - if (element == null || - element.type === "Quantifier" || - (element.type === "Assertion" && element.kind !== "lookahead")) { - throw new Error("UnknownError"); - } - const node = { - type: "Quantifier", - parent, - start: element.start, - end, - raw: this.source.slice(element.start, end), - min, - max, - greedy, - element, - }; - parent.elements.push(node); - element.parent = node; - } - onLookaroundAssertionEnter(start, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const node = (this._node = { - type: "Assertion", - parent, - start, - end: start, - raw: "", - kind, - negate, - alternatives: [], - }); - parent.elements.push(node); - } - onLookaroundAssertionLeave(start, end) { - const node = this._node; - if (node.type !== "Assertion" || node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onEdgeAssertion(start, end, kind) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Assertion", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - }); - } - onWordBoundaryAssertion(start, end, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Assertion", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - negate, - }); - } - onAnyCharacterSet(start, end, kind) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - }); - } - onEscapeCharacterSet(start, end, kind, negate) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - negate, - }); - } - onUnicodePropertyCharacterSet(start, end, kind, key, value, negate) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "CharacterSet", - parent, - start, - end, - raw: this.source.slice(start, end), - kind, - key, - value, - negate, - }); - } - onCharacter(start, end, value) { - const parent = this._node; - if (parent.type !== "Alternative" && parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - parent.elements.push({ - type: "Character", - parent, - start, - end, - raw: this.source.slice(start, end), - value, - }); - } - onBackreference(start, end, ref) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - const node = { - type: "Backreference", - parent, - start, - end, - raw: this.source.slice(start, end), - ref, - resolved: DummyCapturingGroup, - }; - parent.elements.push(node); - this._backreferences.push(node); - } - onCharacterClassEnter(start, negate) { - const parent = this._node; - if (parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - this._node = { - type: "CharacterClass", - parent, - start, - end: start, - raw: "", - negate, - elements: [], - }; - parent.elements.push(this._node); - } - onCharacterClassLeave(start, end) { - const node = this._node; - if (node.type !== "CharacterClass" || - node.parent.type !== "Alternative") { - throw new Error("UnknownError"); - } - node.end = end; - node.raw = this.source.slice(start, end); - this._node = node.parent; - } - onCharacterClassRange(start, end) { - const parent = this._node; - if (parent.type !== "CharacterClass") { - throw new Error("UnknownError"); - } - const elements = parent.elements; - const max = elements.pop(); - const hyphen = elements.pop(); - const min = elements.pop(); - if (!min || - !max || - !hyphen || - min.type !== "Character" || - max.type !== "Character" || - hyphen.type !== "Character" || - hyphen.value !== HyphenMinus) { - throw new Error("UnknownError"); - } - const node = { - type: "CharacterClassRange", - parent, - start, - end, - raw: this.source.slice(start, end), - min, - max, - }; - min.parent = node; - max.parent = node; - elements.push(node); - } -} -class RegExpParser { - constructor(options) { - this._state = new RegExpParserState(options); - this._validator = new RegExpValidator(this._state); - } - parseLiteral(source, start = 0, end = source.length) { - this._state.source = source; - this._validator.validateLiteral(source, start, end); - const pattern = this._state.pattern; - const flags = this._state.flags; - const literal = { - type: "RegExpLiteral", - parent: null, - start, - end, - raw: source, - pattern, - flags, - }; - pattern.parent = literal; - flags.parent = literal; - return literal; - } - parseFlags(source, start = 0, end = source.length) { - this._state.source = source; - this._validator.validateFlags(source, start, end); - return this._state.flags; - } - parsePattern(source, start = 0, end = source.length, uFlag = false) { - this._state.source = source; - this._validator.validatePattern(source, start, end, uFlag); - return this._state.pattern; - } -} - -class RegExpVisitor { - constructor(handlers) { - this._handlers = handlers; - } - visit(node) { - switch (node.type) { - case "Alternative": - this.visitAlternative(node); - break; - case "Assertion": - this.visitAssertion(node); - break; - case "Backreference": - this.visitBackreference(node); - break; - case "CapturingGroup": - this.visitCapturingGroup(node); - break; - case "Character": - this.visitCharacter(node); - break; - case "CharacterClass": - this.visitCharacterClass(node); - break; - case "CharacterClassRange": - this.visitCharacterClassRange(node); - break; - case "CharacterSet": - this.visitCharacterSet(node); - break; - case "Flags": - this.visitFlags(node); - break; - case "Group": - this.visitGroup(node); - break; - case "Pattern": - this.visitPattern(node); - break; - case "Quantifier": - this.visitQuantifier(node); - break; - case "RegExpLiteral": - this.visitRegExpLiteral(node); - break; - default: - throw new Error(`Unknown type: ${node.type}`); - } - } - visitAlternative(node) { - if (this._handlers.onAlternativeEnter) { - this._handlers.onAlternativeEnter(node); - } - node.elements.forEach(this.visit, this); - if (this._handlers.onAlternativeLeave) { - this._handlers.onAlternativeLeave(node); - } - } - visitAssertion(node) { - if (this._handlers.onAssertionEnter) { - this._handlers.onAssertionEnter(node); - } - if (node.kind === "lookahead" || node.kind === "lookbehind") { - node.alternatives.forEach(this.visit, this); - } - if (this._handlers.onAssertionLeave) { - this._handlers.onAssertionLeave(node); - } - } - visitBackreference(node) { - if (this._handlers.onBackreferenceEnter) { - this._handlers.onBackreferenceEnter(node); - } - if (this._handlers.onBackreferenceLeave) { - this._handlers.onBackreferenceLeave(node); - } - } - visitCapturingGroup(node) { - if (this._handlers.onCapturingGroupEnter) { - this._handlers.onCapturingGroupEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onCapturingGroupLeave) { - this._handlers.onCapturingGroupLeave(node); - } - } - visitCharacter(node) { - if (this._handlers.onCharacterEnter) { - this._handlers.onCharacterEnter(node); - } - if (this._handlers.onCharacterLeave) { - this._handlers.onCharacterLeave(node); - } - } - visitCharacterClass(node) { - if (this._handlers.onCharacterClassEnter) { - this._handlers.onCharacterClassEnter(node); - } - node.elements.forEach(this.visit, this); - if (this._handlers.onCharacterClassLeave) { - this._handlers.onCharacterClassLeave(node); - } - } - visitCharacterClassRange(node) { - if (this._handlers.onCharacterClassRangeEnter) { - this._handlers.onCharacterClassRangeEnter(node); - } - this.visitCharacter(node.min); - this.visitCharacter(node.max); - if (this._handlers.onCharacterClassRangeLeave) { - this._handlers.onCharacterClassRangeLeave(node); - } - } - visitCharacterSet(node) { - if (this._handlers.onCharacterSetEnter) { - this._handlers.onCharacterSetEnter(node); - } - if (this._handlers.onCharacterSetLeave) { - this._handlers.onCharacterSetLeave(node); - } - } - visitFlags(node) { - if (this._handlers.onFlagsEnter) { - this._handlers.onFlagsEnter(node); - } - if (this._handlers.onFlagsLeave) { - this._handlers.onFlagsLeave(node); - } - } - visitGroup(node) { - if (this._handlers.onGroupEnter) { - this._handlers.onGroupEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onGroupLeave) { - this._handlers.onGroupLeave(node); - } - } - visitPattern(node) { - if (this._handlers.onPatternEnter) { - this._handlers.onPatternEnter(node); - } - node.alternatives.forEach(this.visit, this); - if (this._handlers.onPatternLeave) { - this._handlers.onPatternLeave(node); - } - } - visitQuantifier(node) { - if (this._handlers.onQuantifierEnter) { - this._handlers.onQuantifierEnter(node); - } - this.visit(node.element); - if (this._handlers.onQuantifierLeave) { - this._handlers.onQuantifierLeave(node); - } - } - visitRegExpLiteral(node) { - if (this._handlers.onRegExpLiteralEnter) { - this._handlers.onRegExpLiteralEnter(node); - } - this.visitPattern(node.pattern); - this.visitFlags(node.flags); - if (this._handlers.onRegExpLiteralLeave) { - this._handlers.onRegExpLiteralLeave(node); - } - } -} - -function parseRegExpLiteral(source, options) { - return new RegExpParser(options).parseLiteral(String(source)); -} -function validateRegExpLiteral(source, options) { - return new RegExpValidator(options).validateLiteral(source); -} -function visitRegExpAST(node, handlers) { - new RegExpVisitor(handlers).visit(node); -} - -export { ast as AST, RegExpParser, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST }; -//# sourceMappingURL=index.mjs.map diff --git a/node_modules/regexpp/index.mjs.map b/node_modules/regexpp/index.mjs.map deleted file mode 100644 index 4263dfa..0000000 --- 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.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\ids.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\properties.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\unicode\\src\\unicode\\index.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\reader.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\regexp-syntax-error.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\validator.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\parser.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\dev\\regexpp\\.temp\\src\\visitor.ts"},{"errno":-4058,"code":"ENOENT","syscall":"open","path":"C:\\Users\\t-nagashima.MSS\\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,CAAA;IAC1B,IAAI,EAA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AI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3B,IAAI,IAAI,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 92dadd8..0000000 --- a/node_modules/regexpp/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "regexpp", - "version": "3.2.0", - "description": "Regular expression parser for ECMAScript.", - "engines": { - "node": ">=8" - }, - "main": "index", - "files": [ - "index.*" - ], - "exports": { - ".": { - "import": "./index.mjs", - "default": "./index.js" - }, - "./package.json": "./package.json" - }, - "dependencies": {}, - "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" - }, - "scripts": { - "prebuild": "npm run -s clean", - "build": "run-s build:*", - "build:tsc": "tsc --module es2015", - "build:rollup": "rollup -c", - "build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts", - "clean": "rimraf .temp index.*", - "codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov", - "lint": "eslint scripts src test --ext .ts", - "pretest": "run-s build lint", - "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", - "version": "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" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/regexpp.git" - }, - "keywords": [ - "regexp", - "regular", - "expression", - "parser", - "validator", - "ast", - "abstract", - "syntax", - "tree", - "ecmascript", - "es2015", - "es2016", - "es2017", - "es2018", - "es2019", - "es2020", - "annexB" - ], - "author": "Toru Nagashima (https://github.com/mysticatea)", - "license": "MIT", - "bugs": { - "url": "https://github.com/mysticatea/regexpp/issues" - }, - "homepage": "https://github.com/mysticatea/regexpp#readme", - "funding": "https://github.com/sponsors/mysticatea" -} diff --git a/node_modules/require-from-string/index.js b/node_modules/require-from-string/index.js deleted file mode 100644 index cb5595f..0000000 --- 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 1aeb74f..0000000 --- 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 800d46e..0000000 --- a/node_modules/require-from-string/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "require-from-string", - "version": "2.0.2", - "description": "Require module from string", - "license": "MIT", - "repository": "floatdrop/require-from-string", - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "" - ], - "dependencies": {}, - "devDependencies": { - "mocha": "*" - } -} diff --git a/node_modules/require-from-string/readme.md b/node_modules/require-from-string/readme.md deleted file mode 100644 index 88b3236..0000000 --- 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/sprintf-js/.npmignore b/node_modules/sprintf-js/.npmignore deleted file mode 100644 index 096746c..0000000 --- a/node_modules/sprintf-js/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ \ No newline at end of file diff --git a/node_modules/sprintf-js/LICENSE b/node_modules/sprintf-js/LICENSE deleted file mode 100644 index 663ac52..0000000 --- a/node_modules/sprintf-js/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2007-2014, Alexandru Marasteanu -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 this software 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 AUTHORS OR COPYRIGHT HOLDERS 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/sprintf-js/README.md b/node_modules/sprintf-js/README.md deleted file mode 100644 index 8386356..0000000 --- a/node_modules/sprintf-js/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# sprintf.js -**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. - -Its prototype is simple: - - string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) - -The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: - -* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. -* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. -* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. -* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. -* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. -* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. -* A type specifier that can be any of: - * `%` — yields a literal `%` character - * `b` — yields an integer as a binary number - * `c` — yields an integer as the character with that ASCII value - * `d` or `i` — yields an integer as a signed decimal number - * `e` — yields a float using scientific notation - * `u` — yields an integer as an unsigned decimal number - * `f` — yields a float as is; see notes on precision above - * `g` — yields a float as is; see notes on precision above - * `o` — yields an integer as an octal number - * `s` — yields a string as is - * `x` — yields an integer as a hexadecimal number (lower-case) - * `X` — yields an integer as a hexadecimal number (upper-case) - * `j` — yields a JavaScript object or array as a JSON encoded string - -## JavaScript `vsprintf` -`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: - - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -## Argument swapping -You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") -And, of course, you can repeat the placeholders without having to increase the number of arguments. - -## Named arguments -Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: - - var user = { - name: "Dolly" - } - sprintf("Hello %(name)s", user) // Hello Dolly -Keywords in replacement fields can be optionally followed by any number of keywords or indexes: - - var users = [ - {name: "Dolly"}, - {name: "Molly"}, - {name: "Polly"} - ] - sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly -Note: mixing positional and named placeholders is not (yet) supported - -## Computed values -You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. - - sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 - sprintf("Current date and time: %s", function() { return new Date().toString() }) - -# AngularJS -You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. - -# Installation - -## Via Bower - - bower install sprintf - -## Or as a node.js module - - npm install sprintf-js - -### Usage - - var sprintf = require("sprintf-js").sprintf, - vsprintf = require("sprintf-js").vsprintf - - sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") - vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) - -# License - -**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/node_modules/sprintf-js/bower.json b/node_modules/sprintf-js/bower.json deleted file mode 100644 index d90a759..0000000 --- a/node_modules/sprintf-js/bower.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "sprintf", - "description": "JavaScript sprintf implementation", - "version": "1.0.3", - "main": "src/sprintf.js", - "license": "BSD-3-Clause-Clear", - "keywords": ["sprintf", "string", "formatting"], - "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], - "homepage": "https://github.com/alexei/sprintf.js", - "repository": { - "type": "git", - "url": "git://github.com/alexei/sprintf.js.git" - } -} diff --git a/node_modules/sprintf-js/demo/angular.html b/node_modules/sprintf-js/demo/angular.html deleted file mode 100644 index 3559efd..0000000 --- a/node_modules/sprintf-js/demo/angular.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - -
{{ "%+010d"|sprintf:-123 }}
-
{{ "%+010d"|vsprintf:[-123] }}
-
{{ "%+010d"|fmt:-123 }}
-
{{ "%+010d"|vfmt:[-123] }}
-
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
-
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
- - - - diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js b/node_modules/sprintf-js/dist/angular-sprintf.min.js deleted file mode 100644 index dbaf744..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); -//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/node_modules/sprintf-js/dist/angular-sprintf.min.js.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/angular-sprintf.min.map b/node_modules/sprintf-js/dist/angular-sprintf.min.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/sprintf-js/dist/angular-sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js b/node_modules/sprintf-js/dist/sprintf.min.js deleted file mode 100644 index dc61e51..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.js.map b/node_modules/sprintf-js/dist/sprintf.min.js.map deleted file mode 100644 index 369dbaf..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAA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QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/dist/sprintf.min.map b/node_modules/sprintf-js/dist/sprintf.min.map deleted file mode 100644 index ee011aa..0000000 --- a/node_modules/sprintf-js/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0C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,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/node_modules/sprintf-js/gruntfile.js b/node_modules/sprintf-js/gruntfile.js deleted file mode 100644 index 246e1c3..0000000 --- a/node_modules/sprintf-js/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/node_modules/sprintf-js/package.json b/node_modules/sprintf-js/package.json deleted file mode 100644 index 75f7eca..0000000 --- a/node_modules/sprintf-js/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "sprintf-js", - "version": "1.0.3", - "description": "JavaScript sprintf implementation", - "author": "Alexandru Marasteanu (http://alexei.ro/)", - "main": "src/sprintf.js", - "scripts": { - "test": "mocha test/test.js" - }, - "repository": { - "type": "git", - "url": "https://github.com/alexei/sprintf.js.git" - }, - "license": "BSD-3-Clause", - "readmeFilename": "README.md", - "devDependencies": { - "mocha": "*", - "grunt": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-uglify": "*" - } -} diff --git a/node_modules/sprintf-js/src/angular-sprintf.js b/node_modules/sprintf-js/src/angular-sprintf.js deleted file mode 100644 index 9c69123..0000000 --- a/node_modules/sprintf-js/src/angular-sprintf.js +++ /dev/null @@ -1,18 +0,0 @@ -angular. - module("sprintf", []). - filter("sprintf", function() { - return function() { - return sprintf.apply(null, arguments) - } - }). - filter("fmt", ["$filter", function($filter) { - return $filter("sprintf") - }]). - filter("vsprintf", function() { - return function(format, argv) { - return vsprintf(format, argv) - } - }). - filter("vfmt", ["$filter", function($filter) { - return $filter("vsprintf") - }]) diff --git a/node_modules/sprintf-js/src/sprintf.js b/node_modules/sprintf-js/src/sprintf.js deleted file mode 100644 index c0fc7c0..0000000 --- a/node_modules/sprintf-js/src/sprintf.js +++ /dev/null @@ -1,208 +0,0 @@ -(function(window) { - var re = { - not_string: /[^s]/, - number: /[diefg]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[\+\-]/ - } - - function sprintf() { - var key = arguments[0], cache = sprintf.cache - if (!(cache[key] && cache.hasOwnProperty(key))) { - cache[key] = sprintf.parse(key) - } - return sprintf.format.call(null, cache[key], arguments) - } - - sprintf.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]) - if (node_type === "string") { - output[output.length] = parse_tree[i] - } - else if (node_type === "array") { - match = parse_tree[i] // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor] - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) - } - arg = arg[match[2][k]] - } - } - else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - - if (get_type(arg) == "function") { - arg = arg() - } - - if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { - throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) - } - - if (re.number.test(match[8])) { - is_positive = arg >= 0 - } - - switch (match[8]) { - case "b": - arg = arg.toString(2) - break - case "c": - arg = String.fromCharCode(arg) - break - case "d": - case "i": - arg = parseInt(arg, 10) - break - case "j": - arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) - break - case "e": - arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() - break - case "f": - arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) - break - case "g": - arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) - break - case "o": - arg = arg.toString(8) - break - case "s": - arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) - break - case "u": - arg = arg >>> 0 - break - case "x": - arg = arg.toString(16) - break - case "X": - arg = arg.toString(16).toUpperCase() - break - } - if (re.json.test(match[8])) { - output[output.length] = arg - } - else { - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") - } - else { - sign = "" - } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) - } - } - } - return output.join("") - } - - sprintf.cache = {} - - sprintf.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = match[0] - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = "%" - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - } - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") - } - parse_tree[parse_tree.length] = match - } - else { - throw new SyntaxError("[sprintf] unexpected placeholder") - } - _fmt = _fmt.substring(match[0].length) - } - return parse_tree - } - - var vsprintf = function(fmt, argv, _argv) { - _argv = (argv || []).slice(0) - _argv.splice(0, 0, fmt) - return sprintf.apply(null, _argv) - } - - /** - * helpers - */ - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() - } - - function str_repeat(input, multiplier) { - return Array(multiplier + 1).join(input) - } - - /** - * export to either browser or node.js - */ - if (typeof exports !== "undefined") { - exports.sprintf = sprintf - exports.vsprintf = vsprintf - } - else { - window.sprintf = sprintf - window.vsprintf = vsprintf - - if (typeof define === "function" && define.amd) { - define(function() { - return { - sprintf: sprintf, - vsprintf: vsprintf - } - }) - } - } -})(typeof window === "undefined" ? this : window); diff --git a/node_modules/sprintf-js/test/test.js b/node_modules/sprintf-js/test/test.js deleted file mode 100644 index 6f57b25..0000000 --- a/node_modules/sprintf-js/test/test.js +++ /dev/null @@ -1,82 +0,0 @@ -var assert = require("assert"), - sprintfjs = require("../src/sprintf.js"), - sprintf = sprintfjs.sprintf, - vsprintf = sprintfjs.vsprintf - -describe("sprintfjs", function() { - var pi = 3.141592653589793 - - it("should return formated strings for simple placeholders", function() { - assert.equal("%", sprintf("%%")) - assert.equal("10", sprintf("%b", 2)) - assert.equal("A", sprintf("%c", 65)) - assert.equal("2", sprintf("%d", 2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("2", sprintf("%d", "2")) - assert.equal("2", sprintf("%i", "2")) - assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) - assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) - assert.equal("2e+0", sprintf("%e", 2)) - assert.equal("2", sprintf("%u", 2)) - assert.equal("4294967294", sprintf("%u", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("3.141592653589793", sprintf("%g", pi)) - assert.equal("10", sprintf("%o", 8)) - assert.equal("%s", sprintf("%s", "%s")) - assert.equal("ff", sprintf("%x", 255)) - assert.equal("FF", sprintf("%X", 255)) - assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) - assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) - }) - - it("should return formated strings for complex placeholders", function() { - // sign - assert.equal("2", sprintf("%d", 2)) - assert.equal("-2", sprintf("%d", -2)) - assert.equal("+2", sprintf("%+d", 2)) - assert.equal("-2", sprintf("%+d", -2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("-2", sprintf("%i", -2)) - assert.equal("+2", sprintf("%+i", 2)) - assert.equal("-2", sprintf("%+i", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("-2.2", sprintf("%f", -2.2)) - assert.equal("+2.2", sprintf("%+f", 2.2)) - assert.equal("-2.2", sprintf("%+f", -2.2)) - assert.equal("-2.3", sprintf("%+.1f", -2.34)) - assert.equal("-0.0", sprintf("%+.1f", -0.01)) - assert.equal("3.14159", sprintf("%.6g", pi)) - assert.equal("3.14", sprintf("%.3g", pi)) - assert.equal("3", sprintf("%.1g", pi)) - assert.equal("-000000123", sprintf("%+010d", -123)) - assert.equal("______-123", sprintf("%+'_10d", -123)) - assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) - - // padding - assert.equal("-0002", sprintf("%05d", -2)) - assert.equal("-0002", sprintf("%05i", -2)) - assert.equal(" <", sprintf("%5s", "<")) - assert.equal("0000<", sprintf("%05s", "<")) - assert.equal("____<", sprintf("%'_5s", "<")) - assert.equal("> ", sprintf("%-5s", ">")) - assert.equal(">0000", sprintf("%0-5s", ">")) - assert.equal(">____", sprintf("%'_-5s", ">")) - assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) - assert.equal("1234", sprintf("%02u", 1234)) - assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) - assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) - assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) - assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) - - // precision - assert.equal("2.3", sprintf("%.1f", 2.345)) - assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) - assert.equal(" x", sprintf("%5.1s", "xxxxxx")) - - }) - - it("should return formated strings for callbacks", function() { - assert.equal("foobar", sprintf("%s", function() { return "foobar" })) - assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... - }) -}) diff --git a/node_modules/table/LICENSE b/node_modules/table/LICENSE deleted file mode 100644 index 6c41d45..0000000 --- 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 a0f5147..0000000 --- a/node_modules/table/README.md +++ /dev/null @@ -1,837 +0,0 @@ - -# Table - -> Produces a string that represents array data in a text table. - -[![Github action status](https://github.com/gajus/table/actions/workflows/main.yml/badge.svg)](https://github.com/gajus/table/actions) -[![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) - * [API](#table-api) - * [table](#table-api-table-1) - * [createStream](#table-api-createstream) - * [getBorderCharacters](#table-api-getbordercharacters) - - -![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 - -```js -import { table } from 'table'; - -// Using commonjs? -// const { table } = require('table'); - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -console.log(table(data)); -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════╧════╝ - -``` - - - -## API - - -### table - -Returns the string in the table format - -**Parameters:** -- **_data_:** The data to display - - Type: `any[][]` - - Required: `true` - -- **_config_:** Table configuration - - Type: `object` - - Required: `false` - - -##### config.border - -Type: `{ [type: string]: string }`\ -Default: `honeywell` [template](#getbordercharacters) - -Custom borders. The keys are any of: -- `topLeft`, `topRight`, `topBody`,`topJoin` -- `bottomLeft`, `bottomRight`, `bottomBody`, `bottomJoin` -- `joinLeft`, `joinRight`, `joinBody`, `joinJoin` -- `bodyLeft`, `bodyRight`, `bodyJoin` -- `headerJoin` - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - border: { - topBody: `─`, - topJoin: `┬`, - topLeft: `┌`, - topRight: `┐`, - - bottomBody: `─`, - bottomJoin: `┴`, - bottomLeft: `└`, - bottomRight: `┘`, - - bodyLeft: `│`, - bodyRight: `│`, - bodyJoin: `│`, - - joinBody: `─`, - joinLeft: `├`, - joinRight: `┤`, - joinJoin: `┼` - } -}; - -console.log(table(data, config)); -``` - -``` -┌────┬────┬────┐ -│ 0A │ 0B │ 0C │ -├────┼────┼────┤ -│ 1A │ 1B │ 1C │ -├────┼────┼────┤ -│ 2A │ 2B │ 2C │ -└────┴────┴────┘ -``` - - -##### config.drawVerticalLine - -Type: `(lineIndex: number, columnCount: number) => boolean`\ -Default: `() => true` - -It is used to tell whether to draw a vertical line. This callback is called for each vertical border of the table. -If the table has `n` columns, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ['3A', '3B', '3C'], - ['4A', '4B', '4C'] -]; - -const config = { - drawVerticalLine: (lineIndex, columnCount) => { - return lineIndex === 0 || lineIndex === columnCount; - } -}; - -console.log(table(data, config)); - -``` - -``` -╔════════════╗ -║ 0A 0B 0C ║ -╟────────────╢ -║ 1A 1B 1C ║ -╟────────────╢ -║ 2A 2B 2C ║ -╟────────────╢ -║ 3A 3B 3C ║ -╟────────────╢ -║ 4A 4B 4C ║ -╚════════════╝ - -``` - - -##### config.drawHorizontalLine - -Type: `(lineIndex: number, rowCount: number) => boolean`\ -Default: `() => true` - -It is used to tell whether to draw a horizontal line. This callback is called for each horizontal border of the table. -If the table has `n` rows, then the `index` parameter is alternatively received all numbers in range `[0, n]` inclusively. -If the table has `n` rows and contains the header, then the range will be `[0, n+1]` inclusively. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ['3A', '3B', '3C'], - ['4A', '4B', '4C'] -]; - -const config = { - drawHorizontalLine: (lineIndex, rowCount) => { - return lineIndex === 0 || lineIndex === 1 || lineIndex === rowCount - 1 || lineIndex === rowCount; - } -}; - -console.log(table(data, config)); - -``` - -``` -╔════╤════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────┼────╢ -║ 1A │ 1B │ 1C ║ -║ 2A │ 2B │ 2C ║ -║ 3A │ 3B │ 3C ║ -╟────┼────┼────╢ -║ 4A │ 4B │ 4C ║ -╚════╧════╧════╝ - -``` - - -##### config.singleLine - -Type: `boolean`\ -Default: `false` - -If `true`, horizontal lines inside the table are not drawn. This option also overrides the `config.drawHorizontalLine` if specified. - -```js -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 -}; - -console.log(table(data, config)); -``` - -``` -╔═════════════╤═════╤══════════╤═══════╤════════╤══════════════╤═══════════════════╗ -║ -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 ║ -╚═════════════╧═════╧══════════╧═══════╧════════╧══════════════╧═══════════════════╝ -``` - - - -##### config.columns - -Type: `Column[] | { [columnIndex: number]: Column }` - -Column specific configurations. - - -###### config.columns[*].width - -Type: `number`\ -Default: the maximum cell widths of the column - -Column width (excluding the paddings). - -```js - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - columns: { - 1: { width: 10 } - } -}; - -console.log(table(data, config)); -``` - -``` -╔════╤════════════╤════╗ -║ 0A │ 0B │ 0C ║ -╟────┼────────────┼────╢ -║ 1A │ 1B │ 1C ║ -╟────┼────────────┼────╢ -║ 2A │ 2B │ 2C ║ -╚════╧════════════╧════╝ -``` - - -###### config.columns[*].alignment - -Type: `'center' | 'justify' | 'left' | 'right'`\ -Default: `'left'` - -Cell content horizontal alignment - -```js -const data = [ - ['0A', '0B', '0C', '0D 0E 0F'], - ['1A', '1B', '1C', '1D 1E 1F'], - ['2A', '2B', '2C', '2D 2E 2F'], -]; - -const config = { - columnDefault: { - width: 10, - }, - columns: [ - { alignment: 'left' }, - { alignment: 'center' }, - { alignment: 'right' }, - { alignment: 'justify' } - ], -}; - -console.log(table(data, config)); -``` - -``` -╔════════════╤════════════╤════════════╤════════════╗ -║ 0A │ 0B │ 0C │ 0D 0E 0F ║ -╟────────────┼────────────┼────────────┼────────────╢ -║ 1A │ 1B │ 1C │ 1D 1E 1F ║ -╟────────────┼────────────┼────────────┼────────────╢ -║ 2A │ 2B │ 2C │ 2D 2E 2F ║ -╚════════════╧════════════╧════════════╧════════════╝ -``` - - -###### config.columns[*].verticalAlignment - -Type: `'top' | 'middle' | 'bottom'`\ -Default: `'top'` - -Cell content vertical alignment - -```js -const data = [ - ['A', 'B', 'C', 'DEF'], -]; - -const config = { - columnDefault: { - width: 1, - }, - columns: [ - { verticalAlignment: 'top' }, - { verticalAlignment: 'middle' }, - { verticalAlignment: 'bottom' }, - ], -}; - -console.log(table(data, config)); -``` - -``` -╔═══╤═══╤═══╤═══╗ -║ A │ │ │ D ║ -║ │ B │ │ E ║ -║ │ │ C │ F ║ -╚═══╧═══╧═══╧═══╝ -``` - - -###### config.columns[*].paddingLeft - -Type: `number`\ -Default: `1` - -The number of whitespaces used to pad the content on the left. - - -###### config.columns[*].paddingRight - -Type: `number`\ -Default: `1` - -The number of whitespaces used to pad the content on the right. - -The `paddingLeft` and `paddingRight` options do not count on the column width. So the column has `width = 5`, `paddingLeft = 2` and `paddingRight = 2` will have the total width is `9`. - - -```js -const data = [ - ['0A', 'AABBCC', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - columns: [ - { - paddingLeft: 3 - }, - { - width: 2, - paddingRight: 3 - } - ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════╤══════╤════╗ -║ 0A │ AA │ 0C ║ -║ │ BB │ ║ -║ │ CC │ ║ -╟──────┼──────┼────╢ -║ 1A │ 1B │ 1C ║ -╟──────┼──────┼────╢ -║ 2A │ 2B │ 2C ║ -╚══════╧══════╧════╝ -``` - - -###### config.columns[*].truncate - -Type: `number`\ -Default: `Infinity` - -The number of characters is which the content will be truncated. -To handle a content that overflows the container width, `table` package implements [text wrapping](#config.columns[*].wrapWord). However, sometimes you may want to truncate content that is too long to be displayed in the table. - -```js -const data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -const config = { - columns: [ - { - width: 20, - truncate: 100 - } - ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor si ║ -║ t amet, consectetur ║ -║ adipiscing elit. Pha ║ -║ sellus pulvinar nibh ║ -║ sed mauris convall… ║ -╚══════════════════════╝ -``` - - -###### config.columns[*].wrapWord - -Type: `boolean`\ -Default: `false` - -The `table` package implements auto text wrapping, i.e., text that has the width greater than the container width will be separated into multiple lines at the nearest space or one of the special characters: `\|/_.,;-`. - -When `wrapWord` is `false`: - -```js -const data = [ - ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] -]; - -const config = { - columns: [ { width: 20 } ] -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════╗ -║ 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`: - -``` -╔══════════════════════╗ -║ Lorem ipsum dolor ║ -║ sit amet, ║ -║ consectetur ║ -║ adipiscing elit. ║ -║ Phasellus pulvinar ║ -║ nibh sed mauris ║ -║ convallis dapibus. ║ -║ Nunc venenatis ║ -║ tempus nulla sit ║ -║ amet viverra. ║ -╚══════════════════════╝ - -``` - - - -##### config.columnDefault - -Type: `Column`\ -Default: `{}` - -The default configuration for all columns. Column-specific settings will overwrite the default values. - - - -##### config.header - -Type: `object` - -Header configuration. - -*Deprecated in favor of the new spanning cells API.* - -The header configuration inherits the most of the column's, except: -- `content` **{string}**: the header content. -- `width:` calculate based on the content width automatically. -- `alignment:` `center` be default. -- `verticalAlignment:` is not supported. -- `config.border.topJoin` will be `config.border.topBody` for prettier. - -```js -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'], - ]; - -const config = { - columnDefault: { - width: 10, - }, - header: { - alignment: 'center', - content: 'THE HEADER\nThis is the table about something', - }, -} - -console.log(table(data, config)); -``` - -``` -╔══════════════════════════════════════╗ -║ THE HEADER ║ -║ This is the table about something ║ -╟────────────┬────────────┬────────────╢ -║ 0A │ 0B │ 0C ║ -╟────────────┼────────────┼────────────╢ -║ 1A │ 1B │ 1C ║ -╟────────────┼────────────┼────────────╢ -║ 2A │ 2B │ 2C ║ -╚════════════╧════════════╧════════════╝ -``` - - - -##### config.spanningCells - -Type: `SpanningCellConfig[]` - -Spanning cells configuration. - -The configuration should be straightforward: just specify an array of minimal cell configurations including the position of top-left cell -and the number of columns and/or rows will be expanded from it. - -The content of overlap cells will be ignored to make the `data` shape be consistent. - -By default, the configuration of column that the top-left cell belongs to will be applied to the whole spanning cell, except: -* The `width` will be summed up of all spanning columns. -* The `paddingRight` will be received from the right-most column intentionally. - -Advances customized column-like styles can be configurable to each spanning cell to overwrite the default behavior. - -```js -const data = [ - ['Test Coverage Report', '', '', '', '', ''], - ['Module', 'Component', 'Test Cases', 'Failures', 'Durations', 'Success Rate'], - ['Services', 'User', '50', '30', '3m 7s', '60.0%'], - ['', 'Payment', '100', '80', '7m 15s', '80.0%'], - ['Subtotal', '', '150', '110', '10m 22s', '73.3%'], - ['Controllers', 'User', '24', '18', '1m 30s', '75.0%'], - ['', 'Payment', '30', '24', '50s', '80.0%'], - ['Subtotal', '', '54', '42', '2m 20s', '77.8%'], - ['Total', '', '204', '152', '12m 42s', '74.5%'], -]; - -const config = { - columns: [ - { alignment: 'center', width: 12 }, - { alignment: 'center', width: 10 }, - { alignment: 'right' }, - { alignment: 'right' }, - { alignment: 'right' }, - { alignment: 'right' } - ], - spanningCells: [ - { col: 0, row: 0, colSpan: 6 }, - { col: 0, row: 2, rowSpan: 2, verticalAlignment: 'middle'}, - { col: 0, row: 4, colSpan: 2, alignment: 'right'}, - { col: 0, row: 5, rowSpan: 2, verticalAlignment: 'middle'}, - { col: 0, row: 7, colSpan: 2, alignment: 'right' }, - { col: 0, row: 8, colSpan: 2, alignment: 'right' } - ], -}; - -console.log(table(data, config)); -``` - -``` -╔══════════════════════════════════════════════════════════════════════════════╗ -║ Test Coverage Report ║ -╟──────────────┬────────────┬────────────┬──────────┬───────────┬──────────────╢ -║ Module │ Component │ Test Cases │ Failures │ Durations │ Success Rate ║ -╟──────────────┼────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ User │ 50 │ 30 │ 3m 7s │ 60.0% ║ -║ Services ├────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ Payment │ 100 │ 80 │ 7m 15s │ 80.0% ║ -╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Subtotal │ 150 │ 110 │ 10m 22s │ 73.3% ║ -╟──────────────┬────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ User │ 24 │ 18 │ 1m 30s │ 75.0% ║ -║ Controllers ├────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ │ Payment │ 30 │ 24 │ 50s │ 80.0% ║ -╟──────────────┴────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Subtotal │ 54 │ 42 │ 2m 20s │ 77.8% ║ -╟───────────────────────────┼────────────┼──────────┼───────────┼──────────────╢ -║ Total │ 204 │ 152 │ 12m 42s │ 74.5% ║ -╚═══════════════════════════╧════════════╧══════════╧═══════════╧══════════════╝ -``` - - - -### createStream - -`table` package exports `createStream` function used to draw a table and append rows. - -**Parameter:** - - _**config:**_ the same as `table`'s, except `config.columnDefault.width` and `config.columnCount` must be provided. - - -```js -import { createStream } from 'table'; - -const config = { - columnDefault: { - width: 50 - }, - columnCount: 1 -}; - -const stream = createStream(config); - -setInterval(() => { - stream.write([new Date()]); -}, 500); -``` - -![Streaming current date.](./.README/api/stream/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'; - -const config = { - columnDefault: { - width: 50 - }, - columnCount: 3, - columns: [ - { - width: 10, - alignment: 'right' - }, - { alignment: 'center' }, - { width: 10 } - - ] -}; - -const stream = createStream(config); - -let i = 0; - -setInterval(() => { - let random; - - random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); - - stream.write([i++, new Date(), random]); -}, 500); -``` - -![Streaming random data.](./.README/api/stream/streaming-random.gif) - - - -### getBorderCharacters - -**Parameter:** - - **_template_** - - Type: `'honeywell' | 'norc' | 'ramac' | 'void'` - - Required: `true` - -You can load one of the predefined border templates using `getBorderCharacters` function. - -```js -import { table, getBorderCharacters } from 'table'; - -const data = [ - ['0A', '0B', '0C'], - ['1A', '1B', '1C'], - ['2A', '2B', '2C'] -]; - -const config = { - border: getBorderCharacters(`name of the template`) -}; - -console.log(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 "borderless 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 pleasant to the eye table, reset the padding and remove the joining rows, e.g. - -```js - -const output = table(data, { - border: getBorderCharacters('void'), - columnDefault: { - paddingLeft: 0, - paddingRight: 1 - }, - drawHorizontalLine: () => false - } -); - -console.log(output); -``` - -``` -0A 0B 0C -1A 1B 1C -2A 2B 2C -``` - diff --git a/node_modules/table/dist/src/alignSpanningCell.d.ts b/node_modules/table/dist/src/alignSpanningCell.d.ts deleted file mode 100644 index a1b6e29..0000000 --- a/node_modules/table/dist/src/alignSpanningCell.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellContext } from './spanningCellManager'; -import type { RangeConfig } from './types/internal'; -/** - * Fill content into all cells in range in order to calculate total height - */ -export declare const wrapRangeContent: (rangeConfig: RangeConfig, rangeWidth: number, context: SpanningCellContext) => string[]; -export declare const alignVerticalRangeContent: (range: RangeConfig, content: string[], context: SpanningCellContext) => string[]; diff --git a/node_modules/table/dist/src/alignSpanningCell.js b/node_modules/table/dist/src/alignSpanningCell.js deleted file mode 100644 index de2ec77..0000000 --- a/node_modules/table/dist/src/alignSpanningCell.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignVerticalRangeContent = exports.wrapRangeContent = void 0; -const string_width_1 = __importDefault(require("string-width")); -const alignString_1 = require("./alignString"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const wrapCell_1 = require("./wrapCell"); -/** - * Fill content into all cells in range in order to calculate total height - */ -const wrapRangeContent = (rangeConfig, rangeWidth, context) => { - const { topLeft, paddingRight, paddingLeft, truncate, wrapWord, alignment } = rangeConfig; - const originalContent = context.rows[topLeft.row][topLeft.col]; - const contentWidth = rangeWidth - paddingLeft - paddingRight; - return (0, wrapCell_1.wrapCell)((0, truncateTableData_1.truncateString)(originalContent, truncate), contentWidth, wrapWord).map((line) => { - const alignedLine = (0, alignString_1.alignString)(line, contentWidth, alignment); - return (0, padTableData_1.padString)(alignedLine, paddingLeft, paddingRight); - }); -}; -exports.wrapRangeContent = wrapRangeContent; -const alignVerticalRangeContent = (range, content, context) => { - const { rows, drawHorizontalLine, rowHeights } = context; - const { topLeft, bottomRight, verticalAlignment } = range; - // They are empty before calculateRowHeights function run - if (rowHeights.length === 0) { - return []; - } - const totalCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, bottomRight.row + 1)); - const totalBorderHeight = bottomRight.row - topLeft.row; - const hiddenHorizontalBorderCount = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { - return !drawHorizontalLine(horizontalBorderIndex, rows.length); - }).length; - const availableRangeHeight = totalCellHeight + totalBorderHeight - hiddenHorizontalBorderCount; - return (0, mapDataUsingRowHeights_1.padCellVertically)(content, availableRangeHeight, verticalAlignment).map((line) => { - if (line.length === 0) { - return ' '.repeat((0, string_width_1.default)(content[0])); - } - return line; - }); -}; -exports.alignVerticalRangeContent = alignVerticalRangeContent; -//# sourceMappingURL=alignSpanningCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignSpanningCell.js.map b/node_modules/table/dist/src/alignSpanningCell.js.map deleted file mode 100644 index 9d44671..0000000 --- a/node_modules/table/dist/src/alignSpanningCell.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignSpanningCell.js","sourceRoot":"","sources":["../../src/alignSpanningCell.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AACvC,+CAEuB;AACvB,qEAEkC;AAClC,iDAEwB;AAIxB,2DAE6B;AAI7B,mCAEiB;AACjB,yCAEoB;AAEpB;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,WAAwB,EAAE,UAAkB,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AAM,2BAA2B,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,EAAE;QAC9G,OAAO,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,MAAM,oBAAoB,GAAG,eAAe,GAAG,iBAAiB,GAAG,2BAA2B,CAAC;IAE/F,OAAO,IAAA,0CAAiB,EAAC,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,GAAG,CAAC,MAAM,CAAC,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAxBW,QAAA,yBAAyB,6BAwBpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.d.ts b/node_modules/table/dist/src/alignString.d.ts deleted file mode 100644 index 459fa7e..0000000 --- a/node_modules/table/dist/src/alignString.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Alignment } from './types/api'; -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - */ -export declare const alignString: (subject: string, containerWidth: number, alignment: Alignment) => string; diff --git a/node_modules/table/dist/src/alignString.js b/node_modules/table/dist/src/alignString.js deleted file mode 100644 index a15231a..0000000 --- a/node_modules/table/dist/src/alignString.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignString = void 0; -const string_width_1 = __importDefault(require("string-width")); -const utils_1 = require("./utils"); -const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); -}; -const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; -}; -const alignCenter = (subject, width) => { - return ' '.repeat(Math.floor(width / 2)) + subject + ' '.repeat(Math.ceil(width / 2)); -}; -const alignJustify = (subject, width) => { - const spaceSequenceCount = (0, utils_1.countSpaceSequence)(subject); - if (spaceSequenceCount === 0) { - return alignLeft(subject, width); - } - const addingSpaces = (0, utils_1.distributeUnevenly)(width, spaceSequenceCount); - if (Math.max(...addingSpaces) > 3) { - return alignLeft(subject, width); - } - let spaceSequenceIndex = 0; - return subject.replace(/\s+/g, (groupSpace) => { - return groupSpace + ' '.repeat(addingSpaces[spaceSequenceIndex++]); - }); -}; -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - */ -const alignString = (subject, containerWidth, alignment) => { - const subjectWidth = (0, string_width_1.default)(subject); - if (subjectWidth === containerWidth) { - return subject; - } - if (subjectWidth > containerWidth) { - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - const availableWidth = containerWidth - subjectWidth; - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - if (alignment === 'justify') { - return alignJustify(subject, availableWidth); - } - return alignCenter(subject, availableWidth); -}; -exports.alignString = alignString; -//# sourceMappingURL=alignString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignString.js.map b/node_modules/table/dist/src/alignString.js.map deleted file mode 100644 index 8324952..0000000 --- a/node_modules/table/dist/src/alignString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignString.js","sourceRoot":"","sources":["../../src/alignString.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAIvC,mCAEiB;AAEjB,MAAM,SAAS,GAAG,CAAC,OAAe,EAAE,KAAa,EAAU,EAAE;IAC3D,OAAO,OAAO,GAAG,GAAG,CAAC,MAA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IACnG,MAAM,YAAY,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;IAE1C,IAAI,YAAY,KAAK,cAAc,EAAE;QACnC,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,YAAY,GAAG,cAAc,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;KAC9F;IAED,IAAI,YAAY,KAAK,CAAC,EAAE;QACtB,OAAO,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;KACnC;IAED,MAAM,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;IAErD,IAAI,SAAS,KAAK,MAAM,EAAE;QACxB,OAAO,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC3C;IAED,IAAI,SAAS,KAAK,OAAO,EAAE;QACzB,OAAO,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC5C;IAED,IAAI,SAAS,KAAK,SAAS,EAAE;QAC3B,OAAO,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC9C;IAED,OAAO,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC,CAAC;AA9BW,QAAA,WAAW,eA8BtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.d.ts b/node_modules/table/dist/src/alignTableData.d.ts deleted file mode 100644 index 73314d8..0000000 --- a/node_modules/table/dist/src/alignTableData.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -export declare const alignTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/alignTableData.js b/node_modules/table/dist/src/alignTableData.js deleted file mode 100644 index 942cb3b..0000000 --- a/node_modules/table/dist/src/alignTableData.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.alignTableData = void 0; -const alignString_1 = require("./alignString"); -const alignTableData = (rows, config) => { - return rows.map((row, rowIndex) => { - return row.map((cell, cellIndex) => { - var _a; - const { width, alignment } = config.columns[cellIndex]; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }, { mapped: true }); - if (containingRange) { - return cell; - } - return (0, alignString_1.alignString)(cell, width, alignment); - }); - }); -}; -exports.alignTableData = alignTableData; -//# sourceMappingURL=alignTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/alignTableData.js.map b/node_modules/table/dist/src/alignTableData.js.map deleted file mode 100644 index c7a9ba3..0000000 --- a/node_modules/table/dist/src/alignTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"alignTableData.js","sourceRoot":"","sources":["../../src/alignTableData.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAMhB,MAAM,cAAc,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACjC,MAAM,EAAC,KAAK,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAErD,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,OAAO,IAAA,yBAAW,EAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,cAAc,kBAczB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.d.ts b/node_modules/table/dist/src/calculateCellHeight.d.ts deleted file mode 100644 index 76fd7f1..0000000 --- a/node_modules/table/dist/src/calculateCellHeight.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Calculates height of cell content in regard to its width and word wrapping. - */ -export declare const calculateCellHeight: (value: string, columnWidth: number, useWrapWord?: boolean) => number; diff --git a/node_modules/table/dist/src/calculateCellHeight.js b/node_modules/table/dist/src/calculateCellHeight.js deleted file mode 100644 index 010c41f..0000000 --- a/node_modules/table/dist/src/calculateCellHeight.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateCellHeight = void 0; -const wrapCell_1 = require("./wrapCell"); -/** - * Calculates height of cell content in regard to its width and word wrapping. - */ -const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { - return (0, wrapCell_1.wrapCell)(value, columnWidth, useWrapWord).length; -}; -exports.calculateCellHeight = calculateCellHeight; -//# sourceMappingURL=calculateCellHeight.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateCellHeight.js.map b/node_modules/table/dist/src/calculateCellHeight.js.map deleted file mode 100644 index 61af121..0000000 --- a/node_modules/table/dist/src/calculateCellHeight.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateCellHeight.js","sourceRoot":"","sources":["../../src/calculateCellHeight.ts"],"names":[],"mappings":";;;AAAA,yCAEoB;AAEpB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,WAAW,GAAG,KAAK,EAAU,EAAE;IACrG,OAAO,IAAA,mBAAQ,EAAC,KAAK,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts b/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts deleted file mode 100644 index d1de524..0000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { Row, Cell } from './types/internal'; -export declare const calculateMaximumCellWidth: (cell: Cell) => number; -/** - * Produces an array of values that describe the largest value length (width) in every column. - */ -export declare const calculateMaximumColumnWidths: (rows: Row[], spanningCellConfigs?: SpanningCellConfig[]) => number[]; diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js b/node_modules/table/dist/src/calculateMaximumColumnWidths.js deleted file mode 100644 index 5b677ed..0000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateMaximumColumnWidths = exports.calculateMaximumCellWidth = void 0; -const string_width_1 = __importDefault(require("string-width")); -const utils_1 = require("./utils"); -const calculateMaximumCellWidth = (cell) => { - return Math.max(...cell.split('\n').map(string_width_1.default)); -}; -exports.calculateMaximumCellWidth = calculateMaximumCellWidth; -/** - * Produces an array of values that describe the largest value length (width) in every column. - */ -const calculateMaximumColumnWidths = (rows, spanningCellConfigs = []) => { - const columnWidths = new Array(rows[0].length).fill(0); - const rangeCoordinates = spanningCellConfigs.map(utils_1.calculateRangeCoordinate); - const isSpanningCell = (rowIndex, columnIndex) => { - return rangeCoordinates.some((rangeCoordinate) => { - return (0, utils_1.isCellInRange)({ col: columnIndex, - row: rowIndex }, rangeCoordinate); - }); - }; - rows.forEach((row, rowIndex) => { - row.forEach((cell, cellIndex) => { - if (isSpanningCell(rowIndex, cellIndex)) { - return; - } - columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], (0, exports.calculateMaximumCellWidth)(cell)); - }); - }); - return columnWidths; -}; -exports.calculateMaximumColumnWidths = calculateMaximumColumnWidths; -//# sourceMappingURL=calculateMaximumColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map b/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map deleted file mode 100644 index 5cb01fc..0000000 --- a/node_modules/table/dist/src/calculateMaximumColumnWidths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateMaximumColumnWidths.js","sourceRoot":"","sources":["../../src/calculateMaximumColumnWidths.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAuC;AAQvC,mCAEiB;AAEV,MAAM,yBAAyB,GAAG,CAAC,IAAU,EAAU,EAAE;IAC9D,OAAO,IAAI,CAAC,GAAG,CACb,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,sBAAW,CAAC,CACrC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;AAEF;;GAEG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAW,EAAE,sBAA4C,EAAE,EAAY,EAAE;IACpH,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAC3E,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAW,EAAE;QACxE,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,EAAE;YAC/C,OAAO,IAAA,qBAAa,EAAC,EAAC,GAAG,EAAE,WAAW;gBACpC,GAAG,EAAE,QAAQ,EAAC,EAAE,eAAe,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;QAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YAC9B,IAAI,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE;gBACvC,OAAO;aACR;YACD,YAAY,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,IAAA,iCAAyB,EAAC,IAAI,CAAC,CAAC,CAAC;QAC/F,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AApBW,QAAA,4BAA4B,gCAoBvC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts b/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts deleted file mode 100644 index f16bb54..0000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableConfig } from './types/internal'; -export declare const calculateOutputColumnWidths: (config: TableConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js b/node_modules/table/dist/src/calculateOutputColumnWidths.js deleted file mode 100644 index 7a41929..0000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateOutputColumnWidths = void 0; -const calculateOutputColumnWidths = (config) => { - return config.columns.map((col) => { - return col.paddingLeft + col.width + col.paddingRight; - }); -}; -exports.calculateOutputColumnWidths = calculateOutputColumnWidths; -//# sourceMappingURL=calculateOutputColumnWidths.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateOutputColumnWidths.js.map b/node_modules/table/dist/src/calculateOutputColumnWidths.js.map deleted file mode 100644 index dafe774..0000000 --- a/node_modules/table/dist/src/calculateOutputColumnWidths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateOutputColumnWidths.js","sourceRoot":"","sources":["../../src/calculateOutputColumnWidths.ts"],"names":[],"mappings":";;;AAIO,MAAM,2BAA2B,GAAG,CAAC,MAAmB,EAAY,EAAE;IAC3E,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,OAAO,GAAG,CAAC,WAAW,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,2BAA2B,+BAItC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.d.ts b/node_modules/table/dist/src/calculateRowHeights.d.ts deleted file mode 100644 index 27c9183..0000000 --- a/node_modules/table/dist/src/calculateRowHeights.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -/** - * Produces an array of values that describe the largest value length (height) in every row. - */ -export declare const calculateRowHeights: (rows: Row[], config: BaseConfig) => number[]; diff --git a/node_modules/table/dist/src/calculateRowHeights.js b/node_modules/table/dist/src/calculateRowHeights.js deleted file mode 100644 index 72ec05a..0000000 --- a/node_modules/table/dist/src/calculateRowHeights.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateRowHeights = void 0; -const calculateCellHeight_1 = require("./calculateCellHeight"); -const utils_1 = require("./utils"); -/** - * Produces an array of values that describe the largest value length (height) in every row. - */ -const calculateRowHeights = (rows, config) => { - const rowHeights = []; - for (const [rowIndex, row] of rows.entries()) { - let rowHeight = 1; - row.forEach((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }); - if (!containingRange) { - const cellHeight = (0, calculateCellHeight_1.calculateCellHeight)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); - rowHeight = Math.max(rowHeight, cellHeight); - return; - } - const { topLeft, bottomRight, height } = containingRange; - // bottom-most cell of a range needs to contain all remain lines of spanning cells - if (rowIndex === bottomRight.row) { - const totalOccupiedSpanningCellHeight = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row)); - const totalHorizontalBorderHeight = bottomRight.row - topLeft.row; - const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, bottomRight.row).filter((horizontalBorderIndex) => { - var _a; - /* istanbul ignore next */ - return !((_a = config.drawHorizontalLine) === null || _a === void 0 ? void 0 : _a.call(config, horizontalBorderIndex, rows.length)); - }).length; - const cellHeight = height - totalOccupiedSpanningCellHeight - totalHorizontalBorderHeight + totalHiddenHorizontalBorderHeight; - rowHeight = Math.max(rowHeight, cellHeight); - } - // otherwise, just depend on other sibling cell heights in the row - }); - rowHeights.push(rowHeight); - } - return rowHeights; -}; -exports.calculateRowHeights = calculateRowHeights; -//# sourceMappingURL=calculateRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateRowHeights.js.map b/node_modules/table/dist/src/calculateRowHeights.js.map deleted file mode 100644 index 1a7a2d9..0000000 --- a/node_modules/table/dist/src/calculateRowHeights.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateRowHeights.js","sourceRoot":"","sources":["../../src/calculateRowHeights.ts"],"names":[],"mappings":";;;AAAA,+DAE+B;AAK/B,mCAGiB;AAEjB;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAY,EAAE;IAC/E,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE;QAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YAC9B,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;YAElB,IAAI,CAAC,eAAe,EAAE;gBACpB,MAA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9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts b/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts deleted file mode 100644 index 8a2820d..0000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellParameters } from './spanningCellManager'; -import type { RangeConfig } from './types/internal'; -export declare const calculateSpanningCellWidth: (rangeConfig: RangeConfig, dependencies: SpanningCellParameters) => number; diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js b/node_modules/table/dist/src/calculateSpanningCellWidth.js deleted file mode 100644 index fc8866c..0000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateSpanningCellWidth = void 0; -const utils_1 = require("./utils"); -const calculateSpanningCellWidth = (rangeConfig, dependencies) => { - const { columnsConfig, drawVerticalLine } = dependencies; - const { topLeft, bottomRight } = rangeConfig; - const totalWidth = (0, utils_1.sumArray)(columnsConfig.slice(topLeft.col, bottomRight.col + 1).map(({ width }) => { - return width; - })); - const totalPadding = topLeft.col === bottomRight.col ? - columnsConfig[topLeft.col].paddingRight + - columnsConfig[bottomRight.col].paddingLeft : - (0, utils_1.sumArray)(columnsConfig - .slice(topLeft.col, bottomRight.col + 1) - .map(({ paddingLeft, paddingRight }) => { - return paddingLeft + paddingRight; - })); - const totalBorderWidths = bottomRight.col - topLeft.col; - const totalHiddenVerticalBorders = (0, utils_1.sequence)(topLeft.col + 1, bottomRight.col).filter((verticalBorderIndex) => { - return !drawVerticalLine(verticalBorderIndex, columnsConfig.length); - }).length; - return totalWidth + totalPadding + totalBorderWidths - totalHiddenVerticalBorders; -}; -exports.calculateSpanningCellWidth = calculateSpanningCellWidth; -//# sourceMappingURL=calculateSpanningCellWidth.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/calculateSpanningCellWidth.js.map b/node_modules/table/dist/src/calculateSpanningCellWidth.js.map deleted file mode 100644 index b0de977..0000000 --- a/node_modules/table/dist/src/calculateSpanningCellWidth.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calculateSpanningCellWidth.js","sourceRoot":"","sources":["../../src/calculateSpanningCellWidth.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,0BAA0B,GAAG,CAAC,WAAwB,EAAE,YAAoC,EAAU,EAAE;IACnH,MAAM,EAAC,aAAa,EAAE,gBAAgB,EAAC,GAAG,YAAY,CAAC;IACvD,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,WAAW,CAAC;IAE3C,MAAM,UAAU,GAAG,IAAA,gBAAQ,EACzB,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;QACpE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY;YACvC,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;QAC5C,IAAA,gBAAQ,EACN,aAAa;aACV,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC;aACvC,GAAG,CAAC,CAAC,EAAC,WAAW,EAAE,YAAY,EAAC,EAAE,EAAE;YACnC,OAAO,WAAW,GAAG,YAAY,CAAC;QACpC,CAAC,CAAC,CACL,CAAC;IACN,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExD,MAAM,0BAA0B,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,GAAG,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,EAAE;QAC3G,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEV,OAAO,UAAU,GAAG,YAAY,GAAG,iBAAiB,GAAG,0BAA0B,CAAC;AACpF,CAAC,CAAC;AA5BW,QAAA,0BAA0B,8BA4BrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.d.ts b/node_modules/table/dist/src/createStream.d.ts deleted file mode 100644 index 9c2df8e..0000000 --- a/node_modules/table/dist/src/createStream.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { StreamUserConfig, WritableStream } from './types/api'; -export declare const createStream: (userConfig: StreamUserConfig) => WritableStream; diff --git a/node_modules/table/dist/src/createStream.js b/node_modules/table/dist/src/createStream.js deleted file mode 100644 index d526161..0000000 --- a/node_modules/table/dist/src/createStream.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createStream = void 0; -const alignTableData_1 = require("./alignTableData"); -const calculateRowHeights_1 = require("./calculateRowHeights"); -const drawBorder_1 = require("./drawBorder"); -const drawRow_1 = require("./drawRow"); -const makeStreamConfig_1 = require("./makeStreamConfig"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const stringifyTableData_1 = require("./stringifyTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const prepareData = (data, config) => { - let rows = (0, stringifyTableData_1.stringifyTableData)(data); - rows = (0, truncateTableData_1.truncateTableData)(rows, (0, utils_1.extractTruncates)(config)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); - rows = (0, alignTableData_1.alignTableData)(rows, config); - rows = (0, padTableData_1.padTableData)(rows, config); - return rows; -}; -const create = (row, columnWidths, config) => { - const rows = prepareData([row], config); - const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config); - }).join(''); - let output; - output = ''; - output += (0, drawBorder_1.drawBorderTop)(columnWidths, config); - output += body; - output += (0, drawBorder_1.drawBorderBottom)(columnWidths, config); - output = output.trimEnd(); - process.stdout.write(output); -}; -const append = (row, columnWidths, config) => { - const rows = prepareData([row], config); - const body = rows.map((literalRow) => { - return (0, drawRow_1.drawRow)(literalRow, config); - }).join(''); - let output = ''; - const bottom = (0, drawBorder_1.drawBorderBottom)(columnWidths, config); - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - output += (0, drawBorder_1.drawBorderJoin)(columnWidths, config); - output += body; - output += bottom; - output = output.trimEnd(); - process.stdout.write(output); -}; -const createStream = (userConfig) => { - const config = (0, makeStreamConfig_1.makeStreamConfig)(userConfig); - const columnWidths = Object.values(config.columns).map((column) => { - return column.width + column.paddingLeft + column.paddingRight; - }); - let empty = true; - return { - write: (row) => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - if (empty) { - empty = false; - create(row, columnWidths, config); - } - else { - append(row, columnWidths, config); - } - }, - }; -}; -exports.createStream = createStream; -//# sourceMappingURL=createStream.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/createStream.js.map b/node_modules/table/dist/src/createStream.js.map deleted file mode 100644 index 7ec269c..0000000 --- a/node_modules/table/dist/src/createStream.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createStream.js","sourceRoot":"","sources":["../../src/createStream.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+DAE+B;AAC/B,6CAIsB;AACtB,uCAEmB;AACnB,yDAE4B;AAC5B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAQ7B,mCAEiB;AAEjB,MAAM,WAAW,GAAG,CAAC,IAAW,EAAE,MAAoB,EAA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;gBACrC,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;aAC1E;YAED,IAAI,KAAK,EAAE;gBACT,KAAK,GAAG,KAAK,CAAC;gBAEd,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;iBAAM;gBACL,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;aACnC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,YAAY,gBAwBvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.d.ts b/node_modules/table/dist/src/drawBorder.d.ts deleted file mode 100644 index 82b4dc5..0000000 --- a/node_modules/table/dist/src/drawBorder.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -import type { BorderConfig, DrawVerticalLine } from './types/api'; -import type { SeparatorGetter } from './types/internal'; -declare type Separator = { - readonly left: string; - readonly right: string; - readonly body: string; - readonly bodyJoinOuter?: string; - readonly bodyJoinInner?: string; - readonly join: string; - readonly joinUp?: string; - readonly joinDown?: string; - readonly joinLeft?: string; - readonly joinRight?: string; -}; -export declare const drawBorderSegments: (columnWidths: number[], parameters: Parameters[1]) => string[]; -export declare const createSeparatorGetter: (dependencies: Parameters[1]) => (verticalBorderIndex: number, columnCount: number) => string; -export declare const drawBorder: (columnWidths: number[], parameters: Omit & { - separator: Separator; -}) => string; -export declare const drawBorderTop: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare const drawBorderJoin: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare const drawBorderBottom: (columnWidths: number[], parameters: DrawBorderParameters) => string; -export declare type BorderGetterParameters = { - border: BorderConfig; - drawVerticalLine: DrawVerticalLine; - spanningCellManager?: SpanningCellManager; - rowCount?: number; -}; -export declare type DrawBorderParameters = Omit & { - horizontalBorderIndex?: number; -}; -export declare const createTableBorderGetter: (columnWidths: number[], parameters: BorderGetterParameters) => SeparatorGetter; -export {}; diff --git a/node_modules/table/dist/src/drawBorder.js b/node_modules/table/dist/src/drawBorder.js deleted file mode 100644 index 81ede50..0000000 --- a/node_modules/table/dist/src/drawBorder.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createTableBorderGetter = exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = exports.createSeparatorGetter = exports.drawBorderSegments = void 0; -const drawContent_1 = require("./drawContent"); -const drawBorderSegments = (columnWidths, parameters) => { - const { separator, horizontalBorderIndex, spanningCellManager } = parameters; - return columnWidths.map((columnWidth, columnIndex) => { - const normalSegment = separator.body.repeat(columnWidth); - if (horizontalBorderIndex === undefined) { - return normalSegment; - } - /* istanbul ignore next */ - const range = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: columnIndex, - row: horizontalBorderIndex }); - if (!range) { - return normalSegment; - } - const { topLeft } = range; - // draw border segments as usual for top border of spanning cell - if (horizontalBorderIndex === topLeft.row) { - return normalSegment; - } - // if for first column/row of spanning cell, just skip - if (columnIndex !== topLeft.col) { - return ''; - } - return range.extractBorderContent(horizontalBorderIndex); - }); -}; -exports.drawBorderSegments = drawBorderSegments; -const createSeparatorGetter = (dependencies) => { - const { separator, spanningCellManager, horizontalBorderIndex, rowCount } = dependencies; - // eslint-disable-next-line complexity - return (verticalBorderIndex, columnCount) => { - const inSameRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.inSameRange; - if (horizontalBorderIndex !== undefined && inSameRange) { - const topCell = { col: verticalBorderIndex, - row: horizontalBorderIndex - 1 }; - const leftCell = { col: verticalBorderIndex - 1, - row: horizontalBorderIndex }; - const oppositeCell = { col: verticalBorderIndex - 1, - row: horizontalBorderIndex - 1 }; - const currentCell = { col: verticalBorderIndex, - row: horizontalBorderIndex }; - const pairs = [ - [oppositeCell, topCell], - [topCell, currentCell], - [currentCell, leftCell], - [leftCell, oppositeCell], - ]; - // left side of horizontal border - if (verticalBorderIndex === 0) { - if (inSameRange(currentCell, topCell) && separator.bodyJoinOuter) { - return separator.bodyJoinOuter; - } - return separator.left; - } - // right side of horizontal border - if (verticalBorderIndex === columnCount) { - if (inSameRange(oppositeCell, leftCell) && separator.bodyJoinOuter) { - return separator.bodyJoinOuter; - } - return separator.right; - } - // top horizontal border - if (horizontalBorderIndex === 0) { - if (inSameRange(currentCell, leftCell)) { - return separator.body; - } - return separator.join; - } - // bottom horizontal border - if (horizontalBorderIndex === rowCount) { - if (inSameRange(topCell, oppositeCell)) { - return separator.body; - } - return separator.join; - } - const sameRangeCount = pairs.map((pair) => { - return inSameRange(...pair); - }).filter(Boolean).length; - // four cells are belongs to different spanning cells - if (sameRangeCount === 0) { - return separator.join; - } - // belong to one spanning cell - if (sameRangeCount === 4) { - return ''; - } - // belongs to two spanning cell - if (sameRangeCount === 2) { - if (inSameRange(...pairs[1]) && inSameRange(...pairs[3]) && separator.bodyJoinInner) { - return separator.bodyJoinInner; - } - return separator.body; - } - /* istanbul ignore next */ - if (sameRangeCount === 1) { - if (!separator.joinRight || !separator.joinLeft || !separator.joinUp || !separator.joinDown) { - throw new Error(`Can not get border separator for position [${horizontalBorderIndex}, ${verticalBorderIndex}]`); - } - if (inSameRange(...pairs[0])) { - return separator.joinDown; - } - if (inSameRange(...pairs[1])) { - return separator.joinLeft; - } - if (inSameRange(...pairs[2])) { - return separator.joinUp; - } - return separator.joinRight; - } - /* istanbul ignore next */ - throw new Error('Invalid case'); - } - if (verticalBorderIndex === 0) { - return separator.left; - } - if (verticalBorderIndex === columnCount) { - return separator.right; - } - return separator.join; - }; -}; -exports.createSeparatorGetter = createSeparatorGetter; -const drawBorder = (columnWidths, parameters) => { - const borderSegments = (0, exports.drawBorderSegments)(columnWidths, parameters); - const { drawVerticalLine, horizontalBorderIndex, spanningCellManager } = parameters; - return (0, drawContent_1.drawContent)({ - contents: borderSegments, - drawSeparator: drawVerticalLine, - elementType: 'border', - rowIndex: horizontalBorderIndex, - separatorGetter: (0, exports.createSeparatorGetter)(parameters), - spanningCellManager, - }) + '\n'; -}; -exports.drawBorder = drawBorder; -const drawBorderTop = (columnWidths, parameters) => { - const { border } = parameters; - const result = (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.topBody, - join: border.topJoin, - left: border.topLeft, - right: border.topRight, - }, - }); - if (result === '\n') { - return ''; - } - return result; -}; -exports.drawBorderTop = drawBorderTop; -const drawBorderJoin = (columnWidths, parameters) => { - const { border } = parameters; - return (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.joinBody, - bodyJoinInner: border.bodyJoin, - bodyJoinOuter: border.bodyLeft, - join: border.joinJoin, - joinDown: border.joinMiddleDown, - joinLeft: border.joinMiddleLeft, - joinRight: border.joinMiddleRight, - joinUp: border.joinMiddleUp, - left: border.joinLeft, - right: border.joinRight, - }, - }); -}; -exports.drawBorderJoin = drawBorderJoin; -const drawBorderBottom = (columnWidths, parameters) => { - const { border } = parameters; - return (0, exports.drawBorder)(columnWidths, { - ...parameters, - separator: { - body: border.bottomBody, - join: border.bottomJoin, - left: border.bottomLeft, - right: border.bottomRight, - }, - }); -}; -exports.drawBorderBottom = drawBorderBottom; -const createTableBorderGetter = (columnWidths, parameters) => { - return (index, size) => { - const drawBorderParameters = { ...parameters, - horizontalBorderIndex: index }; - if (index === 0) { - return (0, exports.drawBorderTop)(columnWidths, drawBorderParameters); - } - else if (index === size) { - return (0, exports.drawBorderBottom)(columnWidths, drawBorderParameters); - } - return (0, exports.drawBorderJoin)(columnWidths, drawBorderParameters); - }; -}; -exports.createTableBorderGetter = createTableBorderGetter; -//# sourceMappingURL=drawBorder.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawBorder.js.map b/node_modules/table/dist/src/drawBorder.js.map deleted file mode 100644 index c14af9b..0000000 --- a/node_modules/table/dist/src/drawBorder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawBorder.js","sourceRo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C,GAAG,UAAU,CAAC;IAE5B,OAAO,IAAA,kBAAU,EAAC,YAAY,EAAE;QAC9B,GAAG,UAAU;QACb,SAAS,EAAE;YACT,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,KAAK,EAAE,MAAM,CAAC,WAAW;SAC1B;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAZW,QAAA,gBAAgB,oBAY3B;AAaK,MAAM,uBAAuB,GAAG,CAAC,YAAsB,EAAE,UAAkC,EAAmB,EAAE;IACrH,OAAO,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;QACrC,MAAM,oBAAoB,GAAyB,EAAC,GAAG,UAAU;YAC/D,qBAAqB,EAAE,KAAK,EAAC,CAAC;QAEhC,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO,IAAA,qBAAa,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC1D;aAAM,IAAI,KAAK,KAAK,IAAI,EAAE;YACzB,OAAO,IAAA,wBAAgB,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;SAC7D;QAED,OAAO,IAAA,sBAAc,EAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,uBAAuB,2BAalC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.d.ts b/node_modules/table/dist/src/drawContent.d.ts deleted file mode 100644 index 3ac2f8c..0000000 --- a/node_modules/table/dist/src/drawContent.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -/** - * Shared function to draw horizontal borders, rows or the entire table - */ -declare type DrawContentParameters = { - contents: string[]; - drawSeparator: (index: number, size: number) => boolean; - separatorGetter: (index: number, size: number) => string; - spanningCellManager?: SpanningCellManager; - rowIndex?: number; - elementType?: 'border' | 'cell' | 'row'; -}; -export declare const drawContent: (parameters: DrawContentParameters) => string; -export {}; diff --git a/node_modules/table/dist/src/drawContent.js b/node_modules/table/dist/src/drawContent.js deleted file mode 100644 index 98d494e..0000000 --- a/node_modules/table/dist/src/drawContent.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawContent = void 0; -const drawContent = (parameters) => { - const { contents, separatorGetter, drawSeparator, spanningCellManager, rowIndex, elementType } = parameters; - const contentSize = contents.length; - const result = []; - if (drawSeparator(0, contentSize)) { - result.push(separatorGetter(0, contentSize)); - } - contents.forEach((content, contentIndex) => { - if (!elementType || elementType === 'border' || elementType === 'row') { - result.push(content); - } - if (elementType === 'cell' && rowIndex === undefined) { - result.push(content); - } - if (elementType === 'cell' && rowIndex !== undefined) { - /* istanbul ignore next */ - const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange({ col: contentIndex, - row: rowIndex }); - // when drawing content row, just add a cell when it is a normal cell - // or belongs to first column of spanning cell - if (!containingRange || contentIndex === containingRange.topLeft.col) { - result.push(content); - } - } - // Only append the middle separator if the content is not the last - if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) { - const separator = separatorGetter(contentIndex + 1, contentSize); - if (elementType === 'cell' && rowIndex !== undefined) { - const currentCell = { col: contentIndex + 1, - row: rowIndex }; - /* istanbul ignore next */ - const containingRange = spanningCellManager === null || spanningCellManager === void 0 ? void 0 : spanningCellManager.getContainingRange(currentCell); - if (!containingRange || containingRange.topLeft.col === currentCell.col) { - result.push(separator); - } - } - else { - result.push(separator); - } - } - }); - if (drawSeparator(contentSize, contentSize)) { - result.push(separatorGetter(contentSize, contentSize)); - } - return result.join(''); -}; -exports.drawContent = drawContent; -//# sourceMappingURL=drawContent.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawContent.js.map b/node_modules/table/dist/src/drawContent.js.map deleted file mode 100644 index 991c2a5..0000000 --- a/node_modules/table/dist/src/drawContent.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,GAAG,CAAC,GAAG,WAAW,IAAI,aAAa,CAAC,YAAY,GAAG,CAAC,EAAE,WAAW,CAAC,EAAE;YAClF,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,GAAG,CAAC,EAAE,WAAW,CAAC,CAAC;YAEjE,IAAI,WAAW,KAAK,MAAM,IAAI,QAAQ,KAAK,SAAS,EAAE;gBACpD,MAAM,WAAW,GAAoB,EAAC,GAAG,EAAE,YAAY,GAAG,CAAC;oBACzD,GAAG,EAAE,QAAQ,EAAC,CAAC;gBACjB,0BAA0B;gBAC1B,MAAM,eAAe,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;gBAC7E,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,EAAE;oBACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACxB;aACF;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;aACxB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;QAC3C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;KACxD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,CAAC,CAAC;AArDW,QAAA,WAAW,eAqDtB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.d.ts b/node_modules/table/dist/src/drawRow.d.ts deleted file mode 100644 index c0238a8..0000000 --- a/node_modules/table/dist/src/drawRow.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { SpanningCellManager } from './spanningCellManager'; -import type { DrawVerticalLine } from './types/api'; -import type { BodyBorderConfig, Row } from './types/internal'; -export declare type DrawRowConfig = { - border: BodyBorderConfig; - drawVerticalLine: DrawVerticalLine; - spanningCellManager?: SpanningCellManager; - rowIndex?: number; -}; -export declare const drawRow: (row: Row, config: DrawRowConfig) => string; diff --git a/node_modules/table/dist/src/drawRow.js b/node_modules/table/dist/src/drawRow.js deleted file mode 100644 index a86a279..0000000 --- a/node_modules/table/dist/src/drawRow.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawRow = void 0; -const drawContent_1 = require("./drawContent"); -const drawRow = (row, config) => { - const { border, drawVerticalLine, rowIndex, spanningCellManager } = config; - return (0, drawContent_1.drawContent)({ - contents: row, - drawSeparator: drawVerticalLine, - elementType: 'cell', - rowIndex, - separatorGetter: (index, columnCount) => { - if (index === 0) { - return border.bodyLeft; - } - if (index === columnCount) { - return border.bodyRight; - } - return border.bodyJoin; - }, - spanningCellManager, - }) + '\n'; -}; -exports.drawRow = drawRow; -//# sourceMappingURL=drawRow.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawRow.js.map b/node_modules/table/dist/src/drawRow.js.map deleted file mode 100644 index ca3c5bd..0000000 --- a/node_modules/table/dist/src/drawRow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawRow.js","sourceRoot":"","sources":["../../src/drawRow.ts"],"names":[],"mappings":";;;AAAA,+CAEuB;AAmBhB,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,MAAqB,EAAU,EAAE;IACjE,MAAM,EAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,mBAAmB,EAAC,GAAG,MAAM,CAAC;IAEzE,OAAO,IAAA,yBAAW,EAAC;QACjB,QAAQ,EAAE,GAAG;QACb,aAAa,EAAE,gBAAgB;QAC/B,WAAW,EAAE,MAAM;QACnB,QAAQ;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;YACtC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,MAAM,CAAC,QAAQ,CAAC;aACxB;YAED,IAAI,KAAK,KAAK,WAAW,EAAE;gBACzB,OAAO,MAAM,CAAC,SAAS,CAAC;aACzB;YAED,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,mBAAmB;KACpB,CAAC,GAAG,IAAI,CAAC;AACZ,CAAC,CAAC;AArBW,QAAA,OAAO,WAqBlB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.d.ts b/node_modules/table/dist/src/drawTable.d.ts deleted file mode 100644 index f234f30..0000000 --- a/node_modules/table/dist/src/drawTable.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableConfig, Row } from './types/internal'; -export declare const drawTable: (rows: Row[], outputColumnWidths: number[], rowHeights: number[], config: TableConfig) => string; diff --git a/node_modules/table/dist/src/drawTable.js b/node_modules/table/dist/src/drawTable.js deleted file mode 100644 index dab8f98..0000000 --- a/node_modules/table/dist/src/drawTable.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.drawTable = void 0; -const drawBorder_1 = require("./drawBorder"); -const drawContent_1 = require("./drawContent"); -const drawRow_1 = require("./drawRow"); -const utils_1 = require("./utils"); -const drawTable = (rows, outputColumnWidths, rowHeights, config) => { - const { drawHorizontalLine, singleLine, } = config; - const contents = (0, utils_1.groupBySizes)(rows, rowHeights).map((group, groupIndex) => { - return group.map((row) => { - return (0, drawRow_1.drawRow)(row, { ...config, - rowIndex: groupIndex }); - }).join(''); - }); - return (0, drawContent_1.drawContent)({ contents, - drawSeparator: (index, size) => { - // Top/bottom border - if (index === 0 || index === size) { - return drawHorizontalLine(index, size); - } - return !singleLine && drawHorizontalLine(index, size); - }, - elementType: 'row', - rowIndex: -1, - separatorGetter: (0, drawBorder_1.createTableBorderGetter)(outputColumnWidths, { ...config, - rowCount: contents.length }), - spanningCellManager: config.spanningCellManager }); -}; -exports.drawTable = drawTable; -//# sourceMappingURL=drawTable.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/drawTable.js.map b/node_modules/table/dist/src/drawTable.js.map deleted file mode 100644 index 882d6e3..0000000 --- a/node_modules/table/dist/src/drawTable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"drawTable.js","sourceRoot":"","sources":["../../src/drawTable.ts"],"names":[],"mappings":";;;AAAA,6CAEsB;AACtB,+CAEuB;AACvB,uCAEmB;AAInB,mCAEiB;AAEV,MAAM,SAAS,GAAG,CAAC,IAAW,EAAE,kBAA4B,EAAE,UAAoB,EAAE,MAAmB,EAAU,EAAE;IACxH,MAAM,EACJ,kBAAkB,EAClB,UAAU,GACX,GAAG,MAAM,CAAC;IAEX,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;QACxE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,OAAO,IAAA,iBAAO,EAAC,GAAG,EAAE,EAAC,GAAG,MAAM;gBAC5B,QAAQ,EAAE,UAAU,EAAC,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,yBAAW,EAAC,EAAC,QAAQ;QAC1B,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC7B,oBAAoB;YACpB,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE;gBACjC,OAAO,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;aACxC;YAED,OAAO,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;QACD,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,CAAC,CAAC;QACZ,eAAe,EAAE,IAAA,oCAAuB,EAAC,kBAAkB,EAAE,EAAC,GAAG,MAAM;YACrE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAC,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,EAAC,CAAC,CAAC;AACtD,CAAC,CAAC;AA3BW,QAAA,SAAS,aA2BpB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/generated/validators.d.ts b/node_modules/table/dist/src/generated/validators.d.ts deleted file mode 100644 index bec42e4..0000000 --- a/node_modules/table/dist/src/generated/validators.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare function validate43(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { - instancePath?: string | undefined; - parentData: any; - parentDataProperty: any; - rootData?: any; -}): boolean; -declare function validate86(data: any, { instancePath, parentData, parentDataProperty, rootData }?: { - instancePath?: string | undefined; - parentData: any; - parentDataProperty: any; - rootData?: any; -}): boolean; -export { validate43 as _config_json, validate86 as _streamConfig_json }; diff --git a/node_modules/table/dist/src/generated/validators.js b/node_modules/table/dist/src/generated/validators.js deleted file mode 100644 index 6e5fc66..0000000 --- a/node_modules/table/dist/src/generated/validators.js +++ /dev/null @@ -1,2694 +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" - }, - "header": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["content"], - "additionalProperties": false - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawVerticalLine": { - "typeof": "function" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - }, - "spanningCells": { - "type": "array", - "items": { - "type": "object", - "properties": { - "col": { - "type": "integer", - "minimum": 0 - }, - "row": { - "type": "integer", - "minimum": 0 - }, - "colSpan": { - "type": "integer", - "minimum": 1 - }, - "rowSpan": { - "type": "integer", - "minimum": 1 - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "shared.json#/definitions/verticalAlignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["row", "col"], - "additionalProperties": false - } - } - }, - "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" - }, - "headerJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - }, - "joinMiddleUp": { - "$ref": "#/definitions/border" - }, - "joinMiddleDown": { - "$ref": "#/definitions/border" - }, - "joinMiddleLeft": { - "$ref": "#/definitions/border" - }, - "joinMiddleRight": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false -}; -const func8 = Object.prototype.hasOwnProperty; -const schema16 = { - "type": "string" -}; -function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - validate46.errors = vErrors; - return errors === 0; -} -function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(func8.call(schema15.properties, key0))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.headerJoin !== undefined) { - if (!(validate46(data.headerJoin, { - instancePath: instancePath + "/headerJoin", - parentData: data, - parentDataProperty: "headerJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleUp !== undefined) { - if (!(validate46(data.joinMiddleUp, { - instancePath: instancePath + "/joinMiddleUp", - parentData: data, - parentDataProperty: "joinMiddleUp", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleDown !== undefined) { - if (!(validate46(data.joinMiddleDown, { - instancePath: instancePath + "/joinMiddleDown", - parentData: data, - parentDataProperty: "joinMiddleDown", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleLeft !== undefined) { - if (!(validate46(data.joinMiddleLeft, { - instancePath: instancePath + "/joinMiddleLeft", - parentData: data, - parentDataProperty: "joinMiddleLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleRight !== undefined) { - if (!(validate46(data.joinMiddleRight, { - instancePath: instancePath + "/joinMiddleRight", - parentData: data, - parentDataProperty: "joinMiddleRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate45.errors = vErrors; - return errors === 0; -} -const schema17 = { - "type": "string", - "enum": ["left", "right", "center", "justify"] -}; -const func0 = require("ajv/dist/runtime/equal").default; -function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema17.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate68.errors = vErrors; - return errors === 0; -} -const schema18 = { - "oneOf": [{ - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, { - "type": "array", - "items": { - "$ref": "#/definitions/column" - } - }] -}; -const pattern0 = new RegExp("^[0-9]+$", "u"); -const schema19 = { - "type": "object", - "properties": { - "alignment": { - "$ref": "#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "#/definitions/verticalAlignment" - }, - "width": { - "type": "integer", - "minimum": 1 - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "additionalProperties": false -}; -function validate72(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!((((data === "left") || (data === "right")) || (data === "center")) || (data === "justify"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema17.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate72.errors = vErrors; - return errors === 0; -} -const schema21 = { - "type": "string", - "enum": ["top", "middle", "bottom"] -}; -function validate74(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema21.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate74.errors = vErrors; - return errors === 0; -} -function validate71(data, { instancePath = "", 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 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate71.errors = vErrors; - return errors === 0; -} -function validate70(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs0 = errors; - let valid0 = false; - let passing0 = null; - const _errs1 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - instancePath, - schemaPath: "#/oneOf/0/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate71(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/oneOf/0/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - var _valid0 = _errs1 === errors; - if (_valid0) { - valid0 = true; - passing0 = 0; - } - const _errs5 = errors; - if (Array.isArray(data)) { - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - if (!(validate71(data[i0], { - instancePath: instancePath + "/" + i0, - parentData: data, - parentDataProperty: i0, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - else { - const err2 = { - instancePath, - schemaPath: "#/oneOf/1/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - var _valid0 = _errs5 === errors; - if (_valid0 && valid0) { - valid0 = false; - passing0 = [passing0, 1]; - } - else { - if (_valid0) { - valid0 = true; - passing0 = 1; - } - } - if (!valid0) { - const err3 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: { - passingSchemas: passing0 - }, - message: "must match exactly one schema in oneOf" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - else { - errors = _errs0; - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0; - } - else { - vErrors = null; - } - } - } - validate70.errors = vErrors; - return errors === 0; -} -function validate79(data, { instancePath = "", 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 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate79.errors = vErrors; - return errors === 0; -} -function validate84(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (typeof data !== "string") { - const err0 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (!(((data === "top") || (data === "middle")) || (data === "bottom"))) { - const err1 = { - instancePath, - schemaPath: "#/enum", - keyword: "enum", - params: { - allowedValues: schema21.enum - }, - message: "must be equal to one of the allowed values" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate84.errors = vErrors; - return errors === 0; -} -function validate43(data, { instancePath = "", 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 === "header")) || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawVerticalLine")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine")) || (key0 === "spanningCells"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate45(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); - errors = vErrors.length; - } - } - if (data.header !== undefined) { - let data1 = data.header; - if (data1 && typeof data1 == "object" && !Array.isArray(data1)) { - if (data1.content === undefined) { - const err1 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/required", - keyword: "required", - params: { - missingProperty: "content" - }, - message: "must have required property '" + "content" + "'" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - for (const key1 in data1) { - if (!((((((key1 === "content") || (key1 === "alignment")) || (key1 === "wrapWord")) || (key1 === "truncate")) || (key1 === "paddingLeft")) || (key1 === "paddingRight"))) { - const err2 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key1 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - if (data1.content !== undefined) { - if (typeof data1.content !== "string") { - const err3 = { - instancePath: instancePath + "/header/content", - schemaPath: "#/properties/header/properties/content/type", - keyword: "type", - params: { - type: "string" - }, - message: "must be string" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data1.alignment !== undefined) { - if (!(validate68(data1.alignment, { - instancePath: instancePath + "/header/alignment", - parentData: data1, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); - errors = vErrors.length; - } - } - if (data1.wrapWord !== undefined) { - if (typeof data1.wrapWord !== "boolean") { - const err4 = { - instancePath: instancePath + "/header/wrapWord", - schemaPath: "#/properties/header/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data1.truncate !== undefined) { - let data5 = data1.truncate; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/header/truncate", - schemaPath: "#/properties/header/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data1.paddingLeft !== undefined) { - let data6 = data1.paddingLeft; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/header/paddingLeft", - schemaPath: "#/properties/header/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - if (data1.paddingRight !== undefined) { - let data7 = data1.paddingRight; - if (!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))) { - const err7 = { - instancePath: instancePath + "/header/paddingRight", - schemaPath: "#/properties/header/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - } - } - else { - const err8 = { - instancePath: instancePath + "/header", - schemaPath: "#/properties/header/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err8]; - } - else { - vErrors.push(err8); - } - errors++; - } - } - if (data.columns !== undefined) { - if (!(validate70(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate79(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors); - errors = vErrors.length; - } - } - if (data.drawVerticalLine !== undefined) { - if (typeof data.drawVerticalLine != "function") { - const err9 = { - instancePath: instancePath + "/drawVerticalLine", - schemaPath: "#/properties/drawVerticalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err9]; - } - else { - vErrors.push(err9); - } - errors++; - } - } - if (data.drawHorizontalLine !== undefined) { - if (typeof data.drawHorizontalLine != "function") { - const err10 = { - instancePath: instancePath + "/drawHorizontalLine", - schemaPath: "#/properties/drawHorizontalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err10]; - } - else { - vErrors.push(err10); - } - errors++; - } - } - if (data.singleLine !== undefined) { - if (typeof data.singleLine != "boolean") { - const err11 = { - instancePath: instancePath + "/singleLine", - schemaPath: "#/properties/singleLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err11]; - } - else { - vErrors.push(err11); - } - errors++; - } - } - if (data.spanningCells !== undefined) { - let data13 = data.spanningCells; - if (Array.isArray(data13)) { - const len0 = data13.length; - for (let i0 = 0; i0 < len0; i0++) { - let data14 = data13[i0]; - if (data14 && typeof data14 == "object" && !Array.isArray(data14)) { - if (data14.row === undefined) { - const err12 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/required", - keyword: "required", - params: { - missingProperty: "row" - }, - message: "must have required property '" + "row" + "'" - }; - if (vErrors === null) { - vErrors = [err12]; - } - else { - vErrors.push(err12); - } - errors++; - } - if (data14.col === undefined) { - const err13 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/required", - keyword: "required", - params: { - missingProperty: "col" - }, - message: "must have required property '" + "col" + "'" - }; - if (vErrors === null) { - vErrors = [err13]; - } - else { - vErrors.push(err13); - } - errors++; - } - for (const key2 in data14) { - if (!(func8.call(schema13.properties.spanningCells.items.properties, key2))) { - const err14 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key2 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err14]; - } - else { - vErrors.push(err14); - } - errors++; - } - } - if (data14.col !== undefined) { - let data15 = data14.col; - if (!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))) { - const err15 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/col", - schemaPath: "#/properties/spanningCells/items/properties/col/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err15]; - } - else { - vErrors.push(err15); - } - errors++; - } - if ((typeof data15 == "number") && (isFinite(data15))) { - if (data15 < 0 || isNaN(data15)) { - const err16 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/col", - schemaPath: "#/properties/spanningCells/items/properties/col/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0 - }, - message: "must be >= 0" - }; - if (vErrors === null) { - vErrors = [err16]; - } - else { - vErrors.push(err16); - } - errors++; - } - } - } - if (data14.row !== undefined) { - let data16 = data14.row; - if (!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))) { - const err17 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/row", - schemaPath: "#/properties/spanningCells/items/properties/row/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err17]; - } - else { - vErrors.push(err17); - } - errors++; - } - if ((typeof data16 == "number") && (isFinite(data16))) { - if (data16 < 0 || isNaN(data16)) { - const err18 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/row", - schemaPath: "#/properties/spanningCells/items/properties/row/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 0 - }, - message: "must be >= 0" - }; - if (vErrors === null) { - vErrors = [err18]; - } - else { - vErrors.push(err18); - } - errors++; - } - } - } - if (data14.colSpan !== undefined) { - let data17 = data14.colSpan; - if (!(((typeof data17 == "number") && (!(data17 % 1) && !isNaN(data17))) && (isFinite(data17)))) { - const err19 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", - schemaPath: "#/properties/spanningCells/items/properties/colSpan/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err19]; - } - else { - vErrors.push(err19); - } - errors++; - } - if ((typeof data17 == "number") && (isFinite(data17))) { - if (data17 < 1 || isNaN(data17)) { - const err20 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/colSpan", - schemaPath: "#/properties/spanningCells/items/properties/colSpan/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err20]; - } - else { - vErrors.push(err20); - } - errors++; - } - } - } - if (data14.rowSpan !== undefined) { - let data18 = data14.rowSpan; - if (!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))) { - const err21 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", - schemaPath: "#/properties/spanningCells/items/properties/rowSpan/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err21]; - } - else { - vErrors.push(err21); - } - errors++; - } - if ((typeof data18 == "number") && (isFinite(data18))) { - if (data18 < 1 || isNaN(data18)) { - const err22 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/rowSpan", - schemaPath: "#/properties/spanningCells/items/properties/rowSpan/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err22]; - } - else { - vErrors.push(err22); - } - errors++; - } - } - } - if (data14.alignment !== undefined) { - if (!(validate68(data14.alignment, { - instancePath: instancePath + "/spanningCells/" + i0 + "/alignment", - parentData: data14, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); - errors = vErrors.length; - } - } - if (data14.verticalAlignment !== undefined) { - if (!(validate84(data14.verticalAlignment, { - instancePath: instancePath + "/spanningCells/" + i0 + "/verticalAlignment", - parentData: data14, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors); - errors = vErrors.length; - } - } - if (data14.wrapWord !== undefined) { - if (typeof data14.wrapWord !== "boolean") { - const err23 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/wrapWord", - schemaPath: "#/properties/spanningCells/items/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err23]; - } - else { - vErrors.push(err23); - } - errors++; - } - } - if (data14.truncate !== undefined) { - let data22 = data14.truncate; - if (!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))) { - const err24 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/truncate", - schemaPath: "#/properties/spanningCells/items/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err24]; - } - else { - vErrors.push(err24); - } - errors++; - } - } - if (data14.paddingLeft !== undefined) { - let data23 = data14.paddingLeft; - if (!(((typeof data23 == "number") && (!(data23 % 1) && !isNaN(data23))) && (isFinite(data23)))) { - const err25 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/paddingLeft", - schemaPath: "#/properties/spanningCells/items/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err25]; - } - else { - vErrors.push(err25); - } - errors++; - } - } - if (data14.paddingRight !== undefined) { - let data24 = data14.paddingRight; - if (!(((typeof data24 == "number") && (!(data24 % 1) && !isNaN(data24))) && (isFinite(data24)))) { - const err26 = { - instancePath: instancePath + "/spanningCells/" + i0 + "/paddingRight", - schemaPath: "#/properties/spanningCells/items/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err26]; - } - else { - vErrors.push(err26); - } - errors++; - } - } - } - else { - const err27 = { - instancePath: instancePath + "/spanningCells/" + i0, - schemaPath: "#/properties/spanningCells/items/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err27]; - } - else { - vErrors.push(err27); - } - errors++; - } - } - } - else { - const err28 = { - instancePath: instancePath + "/spanningCells", - schemaPath: "#/properties/spanningCells/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err28]; - } - else { - vErrors.push(err28); - } - errors++; - } - } - } - else { - const err29 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err29]; - } - else { - vErrors.push(err29); - } - errors++; - } - validate43.errors = vErrors; - return errors === 0; -} -exports["streamConfig.json"] = validate86; -const schema24 = { - "$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": "integer", - "minimum": 1 - }, - "drawVerticalLine": { - "typeof": "function" - } - }, - "required": ["columnDefault", "columnCount"], - "additionalProperties": false -}; -function validate87(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(func8.call(schema15.properties, key0))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.topBody !== undefined) { - if (!(validate46(data.topBody, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.headerJoin !== undefined) { - if (!(validate46(data.headerJoin, { - instancePath: instancePath + "/headerJoin", - parentData: data, - parentDataProperty: "headerJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinBody !== undefined) { - if (!(validate46(data.joinBody, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/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, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleUp !== undefined) { - if (!(validate46(data.joinMiddleUp, { - instancePath: instancePath + "/joinMiddleUp", - parentData: data, - parentDataProperty: "joinMiddleUp", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleDown !== undefined) { - if (!(validate46(data.joinMiddleDown, { - instancePath: instancePath + "/joinMiddleDown", - parentData: data, - parentDataProperty: "joinMiddleDown", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleLeft !== undefined) { - if (!(validate46(data.joinMiddleLeft, { - instancePath: instancePath + "/joinMiddleLeft", - parentData: data, - parentDataProperty: "joinMiddleLeft", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - if (data.joinMiddleRight !== undefined) { - if (!(validate46(data.joinMiddleRight, { - instancePath: instancePath + "/joinMiddleRight", - parentData: data, - parentDataProperty: "joinMiddleRight", - rootData - }))) { - vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); - errors = vErrors.length; - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - validate87.errors = vErrors; - return errors === 0; -} -function validate109(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs0 = errors; - let valid0 = false; - let passing0 = null; - const _errs1 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - for (const key0 in data) { - if (!(pattern0.test(key0))) { - const err0 = { - instancePath, - schemaPath: "#/oneOf/0/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - for (const key1 in data) { - if (pattern0.test(key1)) { - if (!(validate71(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - } - else { - const err1 = { - instancePath, - schemaPath: "#/oneOf/0/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - var _valid0 = _errs1 === errors; - if (_valid0) { - valid0 = true; - passing0 = 0; - } - const _errs5 = errors; - if (Array.isArray(data)) { - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - if (!(validate71(data[i0], { - instancePath: instancePath + "/" + i0, - parentData: data, - parentDataProperty: i0, - rootData - }))) { - vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); - errors = vErrors.length; - } - } - } - else { - const err2 = { - instancePath, - schemaPath: "#/oneOf/1/type", - keyword: "type", - params: { - type: "array" - }, - message: "must be array" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - var _valid0 = _errs5 === errors; - if (_valid0 && valid0) { - valid0 = false; - passing0 = [passing0, 1]; - } - else { - if (_valid0) { - valid0 = true; - passing0 = 1; - } - } - if (!valid0) { - const err3 = { - instancePath, - schemaPath: "#/oneOf", - keyword: "oneOf", - params: { - passingSchemas: passing0 - }, - message: "must match exactly one schema in oneOf" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - else { - errors = _errs0; - if (vErrors !== null) { - if (_errs0) { - vErrors.length = _errs0; - } - else { - vErrors = null; - } - } - } - validate109.errors = vErrors; - return errors === 0; -} -function validate113(data, { instancePath = "", 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 === "verticalAlignment")) || (key0 === "width")) || (key0 === "wrapWord")) || (key0 === "truncate")) || (key0 === "paddingLeft")) || (key0 === "paddingRight"))) { - const err0 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - } - if (data.alignment !== undefined) { - if (!(validate72(data.alignment, { - instancePath: instancePath + "/alignment", - parentData: data, - parentDataProperty: "alignment", - rootData - }))) { - vErrors = vErrors === null ? validate72.errors : vErrors.concat(validate72.errors); - errors = vErrors.length; - } - } - if (data.verticalAlignment !== undefined) { - if (!(validate74(data.verticalAlignment, { - instancePath: instancePath + "/verticalAlignment", - parentData: data, - parentDataProperty: "verticalAlignment", - rootData - }))) { - vErrors = vErrors === null ? validate74.errors : vErrors.concat(validate74.errors); - errors = vErrors.length; - } - } - if (data.width !== undefined) { - let data2 = data.width; - if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) { - const err1 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - if ((typeof data2 == "number") && (isFinite(data2))) { - if (data2 < 1 || isNaN(data2)) { - const err2 = { - instancePath: instancePath + "/width", - schemaPath: "#/properties/width/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - } - if (data.wrapWord !== undefined) { - if (typeof data.wrapWord !== "boolean") { - const err3 = { - instancePath: instancePath + "/wrapWord", - schemaPath: "#/properties/wrapWord/type", - keyword: "type", - params: { - type: "boolean" - }, - message: "must be boolean" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - } - if (data.truncate !== undefined) { - let data4 = data.truncate; - if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) { - const err4 = { - instancePath: instancePath + "/truncate", - schemaPath: "#/properties/truncate/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - if (data.paddingLeft !== undefined) { - let data5 = data.paddingLeft; - if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) { - const err5 = { - instancePath: instancePath + "/paddingLeft", - schemaPath: "#/properties/paddingLeft/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - if (data.paddingRight !== undefined) { - let data6 = data.paddingRight; - if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) { - const err6 = { - instancePath: instancePath + "/paddingRight", - schemaPath: "#/properties/paddingRight/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - } - } - else { - const err7 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err7]; - } - else { - vErrors.push(err7); - } - errors++; - } - validate113.errors = vErrors; - return errors === 0; -} -function validate86(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - /*# sourceURL="streamConfig.json" */ ; - let vErrors = null; - let errors = 0; - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.columnDefault === undefined) { - const err0 = { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: { - missingProperty: "columnDefault" - }, - message: "must have required property '" + "columnDefault" + "'" - }; - if (vErrors === null) { - vErrors = [err0]; - } - else { - vErrors.push(err0); - } - errors++; - } - if (data.columnCount === undefined) { - const err1 = { - instancePath, - schemaPath: "#/required", - keyword: "required", - params: { - missingProperty: "columnCount" - }, - message: "must have required property '" + "columnCount" + "'" - }; - if (vErrors === null) { - vErrors = [err1]; - } - else { - vErrors.push(err1); - } - errors++; - } - for (const key0 in data) { - if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount")) || (key0 === "drawVerticalLine"))) { - const err2 = { - instancePath, - schemaPath: "#/additionalProperties", - keyword: "additionalProperties", - params: { - additionalProperty: key0 - }, - message: "must NOT have additional properties" - }; - if (vErrors === null) { - vErrors = [err2]; - } - else { - vErrors.push(err2); - } - errors++; - } - } - if (data.border !== undefined) { - if (!(validate87(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); - errors = vErrors.length; - } - } - if (data.columns !== undefined) { - if (!(validate109(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate109.errors : vErrors.concat(validate109.errors); - errors = vErrors.length; - } - } - if (data.columnDefault !== undefined) { - if (!(validate113(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors); - errors = vErrors.length; - } - } - if (data.columnCount !== undefined) { - let data3 = data.columnCount; - if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) { - const err3 = { - instancePath: instancePath + "/columnCount", - schemaPath: "#/properties/columnCount/type", - keyword: "type", - params: { - type: "integer" - }, - message: "must be integer" - }; - if (vErrors === null) { - vErrors = [err3]; - } - else { - vErrors.push(err3); - } - errors++; - } - if ((typeof data3 == "number") && (isFinite(data3))) { - if (data3 < 1 || isNaN(data3)) { - const err4 = { - instancePath: instancePath + "/columnCount", - schemaPath: "#/properties/columnCount/minimum", - keyword: "minimum", - params: { - comparison: ">=", - limit: 1 - }, - message: "must be >= 1" - }; - if (vErrors === null) { - vErrors = [err4]; - } - else { - vErrors.push(err4); - } - errors++; - } - } - } - if (data.drawVerticalLine !== undefined) { - if (typeof data.drawVerticalLine != "function") { - const err5 = { - instancePath: instancePath + "/drawVerticalLine", - schemaPath: "#/properties/drawVerticalLine/typeof", - keyword: "typeof", - params: {}, - message: "must pass \"typeof\" keyword validation" - }; - if (vErrors === null) { - vErrors = [err5]; - } - else { - vErrors.push(err5); - } - errors++; - } - } - } - else { - const err6 = { - instancePath, - schemaPath: "#/type", - keyword: "type", - params: { - type: "object" - }, - message: "must be object" - }; - if (vErrors === null) { - vErrors = [err6]; - } - else { - vErrors.push(err6); - } - errors++; - } - validate86.errors = vErrors; - return errors === 0; -} -//# sourceMappingURL=validators.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/generated/validators.js.map b/node_modules/table/dist/src/generated/validators.js.map deleted file mode 100644 index 0436fc2..0000000 --- a/node_modules/table/dist/src/generated/validators.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/generated/validators.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;AACpC,MAAM,QAAQ,GAAG;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,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O,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;QACD,MAAM,EAAE,CAAC;KACZ;IACD,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,MAAM,KAAK,CAAC,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.d.ts b/node_modules/table/dist/src/getBorderCharacters.d.ts deleted file mode 100644 index 334489b..0000000 --- a/node_modules/table/dist/src/getBorderCharacters.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { BorderConfig } from './types/api'; -export declare const getBorderCharacters: (name: string) => BorderConfig; diff --git a/node_modules/table/dist/src/getBorderCharacters.js b/node_modules/table/dist/src/getBorderCharacters.js deleted file mode 100644 index 24b2612..0000000 --- a/node_modules/table/dist/src/getBorderCharacters.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -/* eslint-disable sort-keys-fix/sort-keys-fix */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBorderCharacters = void 0; -const getBorderCharacters = (name) => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - headerJoin: '┬', - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼', - joinMiddleDown: '┬', - joinMiddleUp: '┴', - joinMiddleLeft: '┤', - joinMiddleRight: '├', - }; - } - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - headerJoin: '┬', - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼', - joinMiddleDown: '┬', - joinMiddleUp: '┴', - joinMiddleLeft: '┤', - joinMiddleRight: '├', - }; - } - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - headerJoin: '+', - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|', - joinMiddleDown: '+', - joinMiddleUp: '+', - joinMiddleLeft: '+', - joinMiddleRight: '+', - }; - } - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - headerJoin: '', - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '', - joinMiddleDown: '', - joinMiddleUp: '', - joinMiddleLeft: '', - joinMiddleRight: '', - }; - } - throw new Error('Unknown border template "' + name + '".'); -}; -exports.getBorderCharacters = getBorderCharacters; -//# sourceMappingURL=getBorderCharacters.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/getBorderCharacters.js.map b/node_modules/table/dist/src/getBorderCharacters.js.map deleted file mode 100644 index 848b993..0000000 --- a/node_modules/table/dist/src/getBorderCharacters.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getBorderCharacters.js","sourceRoot":"","sources":["../../src/getBorderCharacters.ts"],"names":[],"mappings":";AAAA,gDAAgD;;;AAMzC,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAgB,EAAE;IAChE,IAAI,IAAI,KAAK,WAAW,EAAE;QACxB,OAAO;YACL,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,GAAG;YAEb,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,UAAU,EAAE,GAAG;YACf,WAAW,EAAE,GAAG;YAEhB,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YACd,QAAQ,EAAE,GAAG;YACb,UAA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GAAG;YACjB,cAAc,EAAE,GAAG;YACnB,eAAe,EAAE,GAAG;SACrB,CAAC;KACH;IAED,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,OAAO;YACL,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,EAAE;YAEZ,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YAEf,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YAEd,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,cAAc,EAAE,EAAE;YAClB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;SACpB,CAAC;KACH;IAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAlHW,QAAA,mBAAmB,uBAkH9B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/index.d.ts b/node_modules/table/dist/src/index.d.ts deleted file mode 100644 index 7ac2d57..0000000 --- a/node_modules/table/dist/src/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { createStream } from './createStream'; -import { getBorderCharacters } from './getBorderCharacters'; -import { table } from './table'; -export { table, createStream, getBorderCharacters, }; -export * from './types/api'; diff --git a/node_modules/table/dist/src/index.js b/node_modules/table/dist/src/index.js deleted file mode 100644 index 6271ec6..0000000 --- a/node_modules/table/dist/src/index.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBorderCharacters = exports.createStream = exports.table = void 0; -const createStream_1 = require("./createStream"); -Object.defineProperty(exports, "createStream", { enumerable: true, get: function () { return createStream_1.createStream; } }); -const getBorderCharacters_1 = require("./getBorderCharacters"); -Object.defineProperty(exports, "getBorderCharacters", { enumerable: true, get: function () { return getBorderCharacters_1.getBorderCharacters; } }); -const table_1 = require("./table"); -Object.defineProperty(exports, "table", { enumerable: true, get: function () { return table_1.table; } }); -__exportStar(require("./types/api"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/index.js.map b/node_modules/table/dist/src/index.js.map deleted file mode 100644 index 9344306..0000000 --- a/node_modules/table/dist/src/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAEwB;AAUtB,6FAXA,2BAAY,OAWA;AATd,+DAE+B;AAQ7B,oGATA,yCAAmB,OASA;AAPrB,mCAEiB;AAGf,sFAJA,aAAK,OAIA;AAKP,8CAA4B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.d.ts b/node_modules/table/dist/src/injectHeaderConfig.d.ts deleted file mode 100644 index 8acf707..0000000 --- a/node_modules/table/dist/src/injectHeaderConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig, TableUserConfig } from './types/api'; -import type { Row } from './types/internal'; -export declare const injectHeaderConfig: (rows: Row[], config: TableUserConfig) => [Row[], SpanningCellConfig[]]; diff --git a/node_modules/table/dist/src/injectHeaderConfig.js b/node_modules/table/dist/src/injectHeaderConfig.js deleted file mode 100644 index 2e82d12..0000000 --- a/node_modules/table/dist/src/injectHeaderConfig.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.injectHeaderConfig = void 0; -const injectHeaderConfig = (rows, config) => { - var _a; - let spanningCellConfig = (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []; - const headerConfig = config.header; - const adjustedRows = [...rows]; - if (headerConfig) { - spanningCellConfig = spanningCellConfig.map(({ row, ...rest }) => { - return { ...rest, - row: row + 1 }; - }); - const { content, ...headerStyles } = headerConfig; - spanningCellConfig.unshift({ alignment: 'center', - col: 0, - colSpan: rows[0].length, - paddingLeft: 1, - paddingRight: 1, - row: 0, - wrapWord: false, - ...headerStyles }); - adjustedRows.unshift([content, ...Array.from({ length: rows[0].length - 1 }).fill('')]); - } - return [adjustedRows, - spanningCellConfig]; -}; -exports.injectHeaderConfig = injectHeaderConfig; -//# sourceMappingURL=injectHeaderConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/injectHeaderConfig.js.map b/node_modules/table/dist/src/injectHeaderConfig.js.map deleted file mode 100644 index 29eead9..0000000 --- a/node_modules/table/dist/src/injectHeaderConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"injectHeaderConfig.js","sourceRoot":"","sources":["../../src/injectHeaderConfig.ts"],"names":[],"mappings":";;;AAQO,MAAM,kBAAkB,GAAG,CAAC,IAAW,EAAE,MAAuB,EAAiC,EAAE;;IACxG,IAAI,kBAAkB,GAAG,MAAA,MAAM,CAAC,aAAa,mCAAI,EAAE,CAAC;IACpD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACnC,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAE/B,IAAI,YAAY,EAAE;QAChB,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAC,GAAG,EAAE,GAAG,IAAI,EAAC,EAAE,EAAE;YAC7D,OAAO,EAAC,GAAG,IAAI;gBACb,GAAG,EAAE,GAAG,GAAG,CAAC,EAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,EAAC,OAAO,EAAE,GAAG,YAAY,EAAC,GAAG,YAAY,CAAC;QAEhD,kBAAkB,CAAC,OAAO,CAAC,EAAC,SAAS,EAAE,QAAQ;YAC7C,GAAG,EAAE,CAAC;YACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;YACvB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,KAAK;YACf,GAAG,YAAY,EAAC,CAAC,CAAC;QAEpB,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,KAAK,CAAC,IAAI,CAAS,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/F;IAED,OAAO,CAAC,YAAY;QAClB,kBAAkB,CAAC,CAAC;AACxB,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.d.ts b/node_modules/table/dist/src/makeRangeConfig.d.ts deleted file mode 100644 index b2d2c33..0000000 --- a/node_modules/table/dist/src/makeRangeConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { ColumnConfig, RangeConfig } from './types/internal'; -export declare const makeRangeConfig: (spanningCellConfig: SpanningCellConfig, columnsConfig: ColumnConfig[]) => RangeConfig; diff --git a/node_modules/table/dist/src/makeRangeConfig.js b/node_modules/table/dist/src/makeRangeConfig.js deleted file mode 100644 index 2acd824..0000000 --- a/node_modules/table/dist/src/makeRangeConfig.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeRangeConfig = void 0; -const utils_1 = require("./utils"); -const makeRangeConfig = (spanningCellConfig, columnsConfig) => { - var _a; - const { topLeft, bottomRight } = (0, utils_1.calculateRangeCoordinate)(spanningCellConfig); - const cellConfig = { - ...columnsConfig[topLeft.col], - ...spanningCellConfig, - paddingRight: (_a = spanningCellConfig.paddingRight) !== null && _a !== void 0 ? _a : columnsConfig[bottomRight.col].paddingRight, - }; - return { ...cellConfig, - bottomRight, - topLeft }; -}; -exports.makeRangeConfig = makeRangeConfig; -//# sourceMappingURL=makeRangeConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeRangeConfig.js.map b/node_modules/table/dist/src/makeRangeConfig.js.map deleted file mode 100644 index c37642e..0000000 --- a/node_modules/table/dist/src/makeRangeConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeRangeConfig.js","sourceRoot":"","sources":["../../src/makeRangeConfig.ts"],"names":[],"mappings":";;;AAMA,mCAEiB;AAEV,MAAM,eAAe,GAAG,CAAC,kBAAsC,EAAE,aAA6B,EAAe,EAAE;;IACpH,MAAM,EAAC,OAAO,EAAE,WAAW,EAAC,GAAG,IAAA,gCAAwB,EAAC,kBAAkB,CAAC,CAAC;IAE5E,MAAM,UAAU,GAA6B;QAC3C,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC;QAC7B,GAAG,kBAAkB;QACrB,YAAY,EACV,MAAA,kBAAkB,CAAC,YAAY,mCAC/B,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,YAAY;KAC9C,CAAC;IAEF,OAAO,EAAC,GAAG,UAAU;QACnB,WAAW;QACX,OAAO,EAAC,CAAC;AACb,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.d.ts b/node_modules/table/dist/src/makeStreamConfig.d.ts deleted file mode 100644 index cdd1f04..0000000 --- a/node_modules/table/dist/src/makeStreamConfig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StreamUserConfig } from './types/api'; -import type { StreamConfig } from './types/internal'; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -export declare const makeStreamConfig: (config: StreamUserConfig) => StreamConfig; diff --git a/node_modules/table/dist/src/makeStreamConfig.js b/node_modules/table/dist/src/makeStreamConfig.js deleted file mode 100644 index 227b579..0000000 --- a/node_modules/table/dist/src/makeStreamConfig.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeStreamConfig = void 0; -const utils_1 = require("./utils"); -const validateConfig_1 = require("./validateConfig"); -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - */ -const makeColumnsConfig = (columnCount, columns = {}, columnDefault) => { - return Array.from({ length: columnCount }).map((_, index) => { - return { - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - verticalAlignment: 'top', - wrapWord: false, - ...columnDefault, - ...columns[index], - }; - }); -}; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -const makeStreamConfig = (config) => { - (0, validateConfig_1.validateConfig)('streamConfig.json', config); - if (config.columnDefault.width === undefined) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - return { - drawVerticalLine: () => { - return true; - }, - ...config, - border: (0, utils_1.makeBorderConfig)(config.border), - columns: makeColumnsConfig(config.columnCount, config.columns, config.columnDefault), - }; -}; -exports.makeStreamConfig = makeStreamConfig; -//# sourceMappingURL=makeStreamConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeStreamConfig.js.map b/node_modules/table/dist/src/makeStreamConfig.js.map deleted file mode 100644 index 715a3fe..0000000 --- a/node_modules/table/dist/src/makeStreamConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeStreamConfig.js","sourceRoot":"","sources":["../../src/makeStreamConfig.ts"],"names":[],"mappings":";;;AASA,mCAEiB;AACjB,qDAE0B;AAE1B;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,WAAmB,EAC5C,UAAuC,EAAE,EACzC,aAAgD,EAAkB,EAAE;IACpE,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QACxD,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,QAAQ,EAAE,KAAK;YACf,GAAG,aAAa;YAChB,GAAG,OAAO,CAAC,KAAK,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,MAAwB,EAAgB,EAAE;IACzE,IAAA,+BAAc,EAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAE5C,IAAI,MAAM,CAAC,aAAa,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACpF;IAED,OAAO;QACL,gBAAgB,EAAE,GAAG,EAAE;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,GAAG,MAAM;QACT,MAAM,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC;KACrF,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,gBAAgB,oBAe3B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.d.ts b/node_modules/table/dist/src/makeTableConfig.d.ts deleted file mode 100644 index 599c018..0000000 --- a/node_modules/table/dist/src/makeTableConfig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { SpanningCellConfig, TableUserConfig } from './types/api'; -import type { Row, TableConfig } from './types/internal'; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -export declare const makeTableConfig: (rows: Row[], config?: TableUserConfig, injectedSpanningCellConfig?: SpanningCellConfig[] | undefined) => TableConfig; diff --git a/node_modules/table/dist/src/makeTableConfig.js b/node_modules/table/dist/src/makeTableConfig.js deleted file mode 100644 index 8b858ae..0000000 --- a/node_modules/table/dist/src/makeTableConfig.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeTableConfig = void 0; -const calculateMaximumColumnWidths_1 = require("./calculateMaximumColumnWidths"); -const spanningCellManager_1 = require("./spanningCellManager"); -const utils_1 = require("./utils"); -const validateConfig_1 = require("./validateConfig"); -const validateSpanningCellConfig_1 = require("./validateSpanningCellConfig"); -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - */ -const makeColumnsConfig = (rows, columns, columnDefault, spanningCellConfigs) => { - const columnWidths = (0, calculateMaximumColumnWidths_1.calculateMaximumColumnWidths)(rows, spanningCellConfigs); - return rows[0].map((_, columnIndex) => { - return { - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - verticalAlignment: 'top', - width: columnWidths[columnIndex], - wrapWord: false, - ...columnDefault, - ...columns === null || columns === void 0 ? void 0 : columns[columnIndex], - }; - }); -}; -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - */ -const makeTableConfig = (rows, config = {}, injectedSpanningCellConfig) => { - var _a, _b, _c, _d, _e; - (0, validateConfig_1.validateConfig)('config.json', config); - (0, validateSpanningCellConfig_1.validateSpanningCellConfig)(rows, (_a = config.spanningCells) !== null && _a !== void 0 ? _a : []); - const spanningCellConfigs = (_b = injectedSpanningCellConfig !== null && injectedSpanningCellConfig !== void 0 ? injectedSpanningCellConfig : config.spanningCells) !== null && _b !== void 0 ? _b : []; - const columnsConfig = makeColumnsConfig(rows, config.columns, config.columnDefault, spanningCellConfigs); - const drawVerticalLine = (_c = config.drawVerticalLine) !== null && _c !== void 0 ? _c : (() => { - return true; - }); - const drawHorizontalLine = (_d = config.drawHorizontalLine) !== null && _d !== void 0 ? _d : (() => { - return true; - }); - return { - ...config, - border: (0, utils_1.makeBorderConfig)(config.border), - columns: columnsConfig, - drawHorizontalLine, - drawVerticalLine, - singleLine: (_e = config.singleLine) !== null && _e !== void 0 ? _e : false, - spanningCellManager: (0, spanningCellManager_1.createSpanningCellManager)({ - columnsConfig, - drawHorizontalLine, - drawVerticalLine, - rows, - spanningCellConfigs, - }), - }; -}; -exports.makeTableConfig = makeTableConfig; -//# sourceMappingURL=makeTableConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/makeTableConfig.js.map b/node_modules/table/dist/src/makeTableConfig.js.map deleted file mode 100644 index 11617bf..0000000 --- a/node_modules/table/dist/src/makeTableConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"makeTableConfig.js","sourceRoot":"","sources":["../../src/makeTableConfig.ts"],"names":[],"mappings":";;;AAAA,iFAEwC;AACxC,+DAE+B;AAS/B,mCAEiB;AACjB,qDAE0B;AAC1B,6EAEsC;AAEtC;;;GAGG;AACH,MAAM,iBAAiB,GAAG,CAAC,IAAW,EACpC,OAAqC,EACrC,aAAgC,EAChC,mBAA0C,EAAkB,EAAE;IAC9D,MAAM,YAAY,GAAG,IAAA,2DAA4B,EAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAE7E,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE;QACpC,OAAO;YACL,SAAS,EAAE,MAAM;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,QAAQ,EAAE,MAAM,CAAC,iBAAiB;YAClC,iBAAiB,EAAE,KAAK;YACxB,KAAK,EAAE,YAAY,CAAC,WAAW,CAAC;YAChC,QAAQ,EAAE,KAAK;YACf,GA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\ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts b/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts deleted file mode 100644 index 1508e90..0000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { VerticalAlignment } from './types/api'; -import type { BaseConfig, Row } from './types/internal'; -export declare const padCellVertically: (lines: string[], rowHeight: number, verticalAlignment: VerticalAlignment) => string[]; -export declare const mapDataUsingRowHeights: (unmappedRows: Row[], rowHeights: number[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js b/node_modules/table/dist/src/mapDataUsingRowHeights.js deleted file mode 100644 index c13003d..0000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapDataUsingRowHeights = exports.padCellVertically = void 0; -const utils_1 = require("./utils"); -const wrapCell_1 = require("./wrapCell"); -const createEmptyStrings = (length) => { - return new Array(length).fill(''); -}; -const padCellVertically = (lines, rowHeight, verticalAlignment) => { - const availableLines = rowHeight - lines.length; - if (verticalAlignment === 'top') { - return [...lines, ...createEmptyStrings(availableLines)]; - } - if (verticalAlignment === 'bottom') { - return [...createEmptyStrings(availableLines), ...lines]; - } - return [ - ...createEmptyStrings(Math.floor(availableLines / 2)), - ...lines, - ...createEmptyStrings(Math.ceil(availableLines / 2)), - ]; -}; -exports.padCellVertically = padCellVertically; -const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => { - const nColumns = unmappedRows[0].length; - const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => { - const outputRowHeight = rowHeights[unmappedRowIndex]; - const outputRow = Array.from({ length: outputRowHeight }, () => { - return new Array(nColumns).fill(''); - }); - unmappedRow.forEach((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: unmappedRowIndex }); - if (containingRange) { - containingRange.extractCellContent(unmappedRowIndex).forEach((cellLine, cellLineIndex) => { - outputRow[cellLineIndex][cellIndex] = cellLine; - }); - return; - } - const cellLines = (0, wrapCell_1.wrapCell)(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord); - const paddedCellLines = (0, exports.padCellVertically)(cellLines, outputRowHeight, config.columns[cellIndex].verticalAlignment); - paddedCellLines.forEach((cellLine, cellLineIndex) => { - outputRow[cellLineIndex][cellIndex] = cellLine; - }); - }); - return outputRow; - }); - return (0, utils_1.flatten)(mappedRows); -}; -exports.mapDataUsingRowHeights = mapDataUsingRowHeights; -//# sourceMappingURL=mapDataUsingRowHeights.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/mapDataUsingRowHeights.js.map b/node_modules/table/dist/src/mapDataUsingRowHeights.js.map deleted file mode 100644 index 7bbe0f8..0000000 --- a/node_modules/table/dist/src/mapDataUsingRowHeights.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapDataUsingRowHeights.js","sourceRoot":"","sources":["../../src/mapDataUsingRowHeights.ts"],"names":[],"mappings":";;;AAOA,mCAEiB;AACjB,yCAEoB;AAEpB,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,EAAE;IAC5C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAe,EAAE,SAAiB,EAAE,iBAAoC,EAAY,EAAE;IACtH,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;IAEhD,IAAI,iBAAiB,KAAK,KAAK,EAAE;QAC/B,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;KAC1D;IAED,IAAI,iBAAiB,KAAK,QAAQ,EAAE;QAClC,OAAO,CAAC,GAAG,kBAAk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EH,OAAO;aACR;YACD,MAAM,SAAS,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;YAEtG,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,SAAS,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,iBAAiB,CAAC,CAAC;YAEnH,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE;gBAClD,SAAS,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;YACjD,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,eAAO,EAAC,UAAU,CAAC,CAAC;AAC7B,CAAC,CAAC;AAhCW,QAAA,sBAAsB,0BAgCjC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.d.ts b/node_modules/table/dist/src/padTableData.d.ts deleted file mode 100644 index 6bb7336..0000000 --- a/node_modules/table/dist/src/padTableData.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { BaseConfig, Row } from './types/internal'; -export declare const padString: (input: string, paddingLeft: number, paddingRight: number) => string; -export declare const padTableData: (rows: Row[], config: BaseConfig) => Row[]; diff --git a/node_modules/table/dist/src/padTableData.js b/node_modules/table/dist/src/padTableData.js deleted file mode 100644 index 38580f8..0000000 --- a/node_modules/table/dist/src/padTableData.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.padTableData = exports.padString = void 0; -const padString = (input, paddingLeft, paddingRight) => { - return ' '.repeat(paddingLeft) + input + ' '.repeat(paddingRight); -}; -exports.padString = padString; -const padTableData = (rows, config) => { - return rows.map((cells, rowIndex) => { - return cells.map((cell, cellIndex) => { - var _a; - const containingRange = (_a = config.spanningCellManager) === null || _a === void 0 ? void 0 : _a.getContainingRange({ col: cellIndex, - row: rowIndex }, { mapped: true }); - if (containingRange) { - return cell; - } - const { paddingLeft, paddingRight } = config.columns[cellIndex]; - return (0, exports.padString)(cell, paddingLeft, paddingRight); - }); - }); -}; -exports.padTableData = padTableData; -//# sourceMappingURL=padTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/padTableData.js.map b/node_modules/table/dist/src/padTableData.js.map deleted file mode 100644 index 2cf9c94..0000000 --- a/node_modules/table/dist/src/padTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"padTableData.js","sourceRoot":"","sources":["../../src/padTableData.ts"],"names":[],"mappings":";;;AAKO,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,WAAmB,EAAE,YAAoB,EAAU,EAAE;IAC5F,OAAO,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB;AAEK,MAAM,YAAY,GAAG,CAAC,IAAW,EAAE,MAAkB,EAAS,EAAE;IACrE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;;YACnC,MAAM,eAAe,GAAG,MAAA,MAAM,CAAC,mBAAmB,0CAAE,kBAAkB,CAAC,EAAC,GAAG,EAAE,SAAS;gBACpF,GAAG,EAAE,QAAQ,EAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAC;YAClC,IAAI,eAAe,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;YAED,MAAM,EAAC,WAAW,EAAE,YAAY,EAAC,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YAE9D,OAAO,IAAA,iBAAS,EAAC,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,YAAY,gBAcvB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/schemas/config.json b/node_modules/table/dist/src/schemas/config.json deleted file mode 100644 index cccb5ac..0000000 --- a/node_modules/table/dist/src/schemas/config.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "header": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["content"], - "additionalProperties": false - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawVerticalLine": { - "typeof": "function" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - }, - "spanningCells": { - "type": "array", - "items": { - "type": "object", - "properties": { - "col": { - "type": "integer", - "minimum": 0 - }, - "row": { - "type": "integer", - "minimum": 0 - }, - "colSpan": { - "type": "integer", - "minimum": 1 - }, - "rowSpan": { - "type": "integer", - "minimum": 1 - }, - "alignment": { - "$ref": "shared.json#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "shared.json#/definitions/verticalAlignment" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "required": ["row", "col"], - "additionalProperties": false - } - } - }, - "additionalProperties": false -} diff --git a/node_modules/table/dist/src/schemas/shared.json b/node_modules/table/dist/src/schemas/shared.json deleted file mode 100644 index 52a2d3a..0000000 --- a/node_modules/table/dist/src/schemas/shared.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "$id": "shared.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "columns": { - "oneOf": [ - { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/column" - } - } - ] - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "$ref": "#/definitions/alignment" - }, - "verticalAlignment": { - "$ref": "#/definitions/verticalAlignment" - }, - "width": { - "type": "integer", - "minimum": 1 - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "integer" - }, - "paddingLeft": { - "type": "integer" - }, - "paddingRight": { - "type": "integer" - } - }, - "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" - }, - "headerJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - }, - "joinMiddleUp": { - "$ref": "#/definitions/border" - }, - "joinMiddleDown": { - "$ref": "#/definitions/border" - }, - "joinMiddleLeft": { - "$ref": "#/definitions/border" - }, - "joinMiddleRight": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - }, - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center", - "justify" - ] - }, - "verticalAlignment": { - "type": "string", - "enum": [ - "top", - "middle", - "bottom" - ] - } - } -} diff --git a/node_modules/table/dist/src/schemas/streamConfig.json b/node_modules/table/dist/src/schemas/streamConfig.json deleted file mode 100644 index 94d3514..0000000 --- a/node_modules/table/dist/src/schemas/streamConfig.json +++ /dev/null @@ -1,25 +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": "integer", - "minimum": 1 - }, - "drawVerticalLine": { - "typeof": "function" - } - }, - "required": ["columnDefault", "columnCount"], - "additionalProperties": false -} diff --git a/node_modules/table/dist/src/spanningCellManager.d.ts b/node_modules/table/dist/src/spanningCellManager.d.ts deleted file mode 100644 index 752a35e..0000000 --- a/node_modules/table/dist/src/spanningCellManager.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { DrawHorizontalLine, DrawVerticalLine, SpanningCellConfig } from './types/api'; -import type { CellCoordinates, ColumnConfig, ResolvedRangeConfig, Row } from './types/internal'; -export declare type SpanningCellManager = { - getContainingRange: (cell: CellCoordinates, options?: { - mapped: true; - }) => ResolvedRangeConfig | undefined; - inSameRange: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; - rowHeights: number[]; - setRowHeights: (rowHeights: number[]) => void; - rowIndexMapping: number[]; - setRowIndexMapping: (mappedRowHeights: number[]) => void; -}; -export declare type SpanningCellParameters = { - spanningCellConfigs: SpanningCellConfig[]; - rows: Row[]; - columnsConfig: ColumnConfig[]; - drawVerticalLine: DrawVerticalLine; - drawHorizontalLine: DrawHorizontalLine; -}; -export declare type SpanningCellContext = SpanningCellParameters & { - rowHeights: number[]; -}; -export declare const createSpanningCellManager: (parameters: SpanningCellParameters) => SpanningCellManager; diff --git a/node_modules/table/dist/src/spanningCellManager.js b/node_modules/table/dist/src/spanningCellManager.js deleted file mode 100644 index dd391ec..0000000 --- a/node_modules/table/dist/src/spanningCellManager.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createSpanningCellManager = void 0; -const alignSpanningCell_1 = require("./alignSpanningCell"); -const calculateSpanningCellWidth_1 = require("./calculateSpanningCellWidth"); -const makeRangeConfig_1 = require("./makeRangeConfig"); -const utils_1 = require("./utils"); -const findRangeConfig = (cell, rangeConfigs) => { - return rangeConfigs.find((rangeCoordinate) => { - return (0, utils_1.isCellInRange)(cell, rangeCoordinate); - }); -}; -const getContainingRange = (rangeConfig, context) => { - const width = (0, calculateSpanningCellWidth_1.calculateSpanningCellWidth)(rangeConfig, context); - const wrappedContent = (0, alignSpanningCell_1.wrapRangeContent)(rangeConfig, width, context); - const alignedContent = (0, alignSpanningCell_1.alignVerticalRangeContent)(rangeConfig, wrappedContent, context); - const getCellContent = (rowIndex) => { - const { topLeft } = rangeConfig; - const { drawHorizontalLine, rowHeights } = context; - const totalWithinHorizontalBorderHeight = rowIndex - topLeft.row; - const totalHiddenHorizontalBorderHeight = (0, utils_1.sequence)(topLeft.row + 1, rowIndex).filter((index) => { - /* istanbul ignore next */ - return !(drawHorizontalLine === null || drawHorizontalLine === void 0 ? void 0 : drawHorizontalLine(index, rowHeights.length)); - }).length; - const offset = (0, utils_1.sumArray)(rowHeights.slice(topLeft.row, rowIndex)) + totalWithinHorizontalBorderHeight - totalHiddenHorizontalBorderHeight; - return alignedContent.slice(offset, offset + rowHeights[rowIndex]); - }; - const getBorderContent = (borderIndex) => { - const { topLeft } = rangeConfig; - const offset = (0, utils_1.sumArray)(context.rowHeights.slice(topLeft.row, borderIndex)) + (borderIndex - topLeft.row - 1); - return alignedContent[offset]; - }; - return { - ...rangeConfig, - extractBorderContent: getBorderContent, - extractCellContent: getCellContent, - height: wrappedContent.length, - width, - }; -}; -const inSameRange = (cell1, cell2, ranges) => { - const range1 = findRangeConfig(cell1, ranges); - const range2 = findRangeConfig(cell2, ranges); - if (range1 && range2) { - return (0, utils_1.areCellEqual)(range1.topLeft, range2.topLeft); - } - return false; -}; -const hashRange = (range) => { - const { row, col } = range.topLeft; - return `${row}/${col}`; -}; -const createSpanningCellManager = (parameters) => { - const { spanningCellConfigs, columnsConfig } = parameters; - const ranges = spanningCellConfigs.map((config) => { - return (0, makeRangeConfig_1.makeRangeConfig)(config, columnsConfig); - }); - const rangeCache = {}; - let rowHeights = []; - let rowIndexMapping = []; - return { getContainingRange: (cell, options) => { - var _a; - const originalRow = (options === null || options === void 0 ? void 0 : options.mapped) ? rowIndexMapping[cell.row] : cell.row; - const range = findRangeConfig({ ...cell, - row: originalRow }, ranges); - if (!range) { - return undefined; - } - if (rowHeights.length === 0) { - return getContainingRange(range, { ...parameters, - rowHeights }); - } - const hash = hashRange(range); - (_a = rangeCache[hash]) !== null && _a !== void 0 ? _a : (rangeCache[hash] = getContainingRange(range, { ...parameters, - rowHeights })); - return rangeCache[hash]; - }, - inSameRange: (cell1, cell2) => { - return inSameRange(cell1, cell2, ranges); - }, - rowHeights, - rowIndexMapping, - setRowHeights: (_rowHeights) => { - rowHeights = _rowHeights; - }, - setRowIndexMapping: (mappedRowHeights) => { - rowIndexMapping = (0, utils_1.flatten)(mappedRowHeights.map((height, index) => { - return Array.from({ length: height }, () => { - return index; - }); - })); - } }; -}; -exports.createSpanningCellManager = createSpanningCellManager; -//# sourceMappingURL=spanningCellManager.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/spanningCellManager.js.map b/node_modules/table/dist/src/spanningCellManager.js.map deleted file mode 100644 index cb165da..0000000 --- a/node_modules/table/dist/src/spanningCellManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"spanningCellManager.js","sourceRoot":"","sources":["../../src/spanningCellManager.ts"],"names":[],"mappings":";;;AAAA,2DAE6B;AAC7B,6E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AAK,EAAE,EAAE;YAC5B,OAAO,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;QACD,UAAU;QACV,eAAe;QACf,aAAa,EAAE,CAAC,WAAqB,EAAE,EAAE;YACvC,UAAU,GAAG,WAAW,CAAC;QAC3B,CAAC;QACD,kBAAkB,EAAE,CAAC,gBAA0B,EAAE,EAAE;YACjD,eAAe,GAAG,IAAA,eAAO,EAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;gBAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC,EAAE,GAAG,EAAE;oBACvC,OAAO,KAAK,CAAC;gBACf,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,CAAC;QACN,CAAC,EAAC,CAAC;AACL,CAAC,CAAC;AA9CW,QAAA,yBAAyB,6BA8CpC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.d.ts b/node_modules/table/dist/src/stringifyTableData.d.ts deleted file mode 100644 index 5c1270b..0000000 --- a/node_modules/table/dist/src/stringifyTableData.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Row } from './types/internal'; -export declare const stringifyTableData: (rows: unknown[][]) => Row[]; diff --git a/node_modules/table/dist/src/stringifyTableData.js b/node_modules/table/dist/src/stringifyTableData.js deleted file mode 100644 index 177141a..0000000 --- a/node_modules/table/dist/src/stringifyTableData.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.stringifyTableData = void 0; -const utils_1 = require("./utils"); -const stringifyTableData = (rows) => { - return rows.map((cells) => { - return cells.map((cell) => { - return (0, utils_1.normalizeString)(String(cell)); - }); - }); -}; -exports.stringifyTableData = stringifyTableData; -//# sourceMappingURL=stringifyTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/stringifyTableData.js.map b/node_modules/table/dist/src/stringifyTableData.js.map deleted file mode 100644 index 84a4b12..0000000 --- a/node_modules/table/dist/src/stringifyTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"stringifyTableData.js","sourceRoot":"","sources":["../../src/stringifyTableData.ts"],"names":[],"mappings":";;;AAGA,mCAEiB;AAEV,MAAM,kBAAkB,GAAG,CAAC,IAAiB,EAAS,EAAE;IAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,OAAO,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/table.d.ts b/node_modules/table/dist/src/table.d.ts deleted file mode 100644 index db1b397..0000000 --- a/node_modules/table/dist/src/table.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableUserConfig } from './types/api'; -export declare const table: (data: unknown[][], userConfig?: TableUserConfig) => string; diff --git a/node_modules/table/dist/src/table.js b/node_modules/table/dist/src/table.js deleted file mode 100644 index 835f08a..0000000 --- a/node_modules/table/dist/src/table.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.table = void 0; -const alignTableData_1 = require("./alignTableData"); -const calculateOutputColumnWidths_1 = require("./calculateOutputColumnWidths"); -const calculateRowHeights_1 = require("./calculateRowHeights"); -const drawTable_1 = require("./drawTable"); -const injectHeaderConfig_1 = require("./injectHeaderConfig"); -const makeTableConfig_1 = require("./makeTableConfig"); -const mapDataUsingRowHeights_1 = require("./mapDataUsingRowHeights"); -const padTableData_1 = require("./padTableData"); -const stringifyTableData_1 = require("./stringifyTableData"); -const truncateTableData_1 = require("./truncateTableData"); -const utils_1 = require("./utils"); -const validateTableData_1 = require("./validateTableData"); -const table = (data, userConfig = {}) => { - (0, validateTableData_1.validateTableData)(data); - let rows = (0, stringifyTableData_1.stringifyTableData)(data); - const [injectedRows, injectedSpanningCellConfig] = (0, injectHeaderConfig_1.injectHeaderConfig)(rows, userConfig); - const config = (0, makeTableConfig_1.makeTableConfig)(injectedRows, userConfig, injectedSpanningCellConfig); - rows = (0, truncateTableData_1.truncateTableData)(injectedRows, (0, utils_1.extractTruncates)(config)); - const rowHeights = (0, calculateRowHeights_1.calculateRowHeights)(rows, config); - config.spanningCellManager.setRowHeights(rowHeights); - config.spanningCellManager.setRowIndexMapping(rowHeights); - rows = (0, mapDataUsingRowHeights_1.mapDataUsingRowHeights)(rows, rowHeights, config); - rows = (0, alignTableData_1.alignTableData)(rows, config); - rows = (0, padTableData_1.padTableData)(rows, config); - const outputColumnWidths = (0, calculateOutputColumnWidths_1.calculateOutputColumnWidths)(config); - return (0, drawTable_1.drawTable)(rows, outputColumnWidths, rowHeights, config); -}; -exports.table = table; -//# sourceMappingURL=table.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/table.js.map b/node_modules/table/dist/src/table.js.map deleted file mode 100644 index 1ca79b0..0000000 --- a/node_modules/table/dist/src/table.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/table.ts"],"names":[],"mappings":";;;AAAA,qDAE0B;AAC1B,+EAEuC;AACvC,+DAE+B;AAC/B,2CAEqB;AACrB,6DAE8B;AAC9B,uDAE2B;AAC3B,qEAEkC;AAClC,iDAEwB;AACxB,6DAE8B;AAC9B,2DAE6B;AAI7B,mCAEiB;AACjB,2DAE6B;AAEtB,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAE,aAA8B,EAAE,EAAU,EAAE;IACnF,IAAA,qCAAiB,EAAC,IAAI,CAAC,CAAC;IAExB,IAAI,IAAI,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,YAAY,EAAE,0BAA0B,CAAC,GAAG,IAAA,uCAAkB,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAExF,MAAM,MAAM,GAAG,IAAA,iCAAe,EAAC,YAAY,EAAE,UAAU,EAAE,0BAA0B,CAAC,CAAC;IAErF,IAAI,GAAG,IAAA,qCAAiB,EAAC,YAAY,EAAE,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC,CAAC;IAEjE,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAErD,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACrD,MAAM,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAE1D,IAAI,GAAG,IAAA,+CAAsB,EAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,GAAG,IAAA,2BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAElC,MAAM,kBAAkB,GAAG,IAAA,yDAA2B,EAAC,MAAM,CAAC,CAAC;IAE/D,OAAO,IAAA,qBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC;AAvBW,QAAA,KAAK,SAuBhB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.d.ts b/node_modules/table/dist/src/truncateTableData.d.ts deleted file mode 100644 index e88e1ad..0000000 --- a/node_modules/table/dist/src/truncateTableData.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Row } from './types/internal'; -export declare const truncateString: (input: string, length: number) => string; -/** - * @todo Make it work with ASCII content. - */ -export declare const truncateTableData: (rows: Row[], truncates: number[]) => Row[]; diff --git a/node_modules/table/dist/src/truncateTableData.js b/node_modules/table/dist/src/truncateTableData.js deleted file mode 100644 index 1f7980f..0000000 --- a/node_modules/table/dist/src/truncateTableData.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.truncateTableData = exports.truncateString = void 0; -const lodash_truncate_1 = __importDefault(require("lodash.truncate")); -const truncateString = (input, length) => { - return (0, lodash_truncate_1.default)(input, { length, - omission: '…' }); -}; -exports.truncateString = truncateString; -/** - * @todo Make it work with ASCII content. - */ -const truncateTableData = (rows, truncates) => { - return rows.map((cells) => { - return cells.map((cell, cellIndex) => { - return (0, exports.truncateString)(cell, truncates[cellIndex]); - }); - }); -}; -exports.truncateTableData = truncateTableData; -//# sourceMappingURL=truncateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/truncateTableData.js.map b/node_modules/table/dist/src/truncateTableData.js.map deleted file mode 100644 index 921869f..0000000 --- a/node_modules/table/dist/src/truncateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"truncateTableData.js","sourceRoot":"","sources":["../../src/truncateTableData.ts"],"names":[],"mappings":";;;;;;AAAA,sEAAuC;AAKhC,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE;IACtE,OAAO,IAAA,yBAAQ,EAAC,KAAK,EAAE,EAAC,MAAM;QAC5B,QAAQ,EAAE,GAAG,EAAC,CAAC,CAAC;AACpB,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB;AAEF;;GAEG;AACI,MAAM,iBAAiB,GAAG,CAAC,IAAW,EAAE,SAAmB,EAAS,EAAE;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YACnC,OAAO,IAAA,sBAAc,EAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.d.ts b/node_modules/table/dist/src/types/api.d.ts deleted file mode 100644 index f76c51e..0000000 --- a/node_modules/table/dist/src/types/api.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -export declare type DrawLinePredicate = (index: number, size: number) => boolean; -export declare type DrawVerticalLine = DrawLinePredicate; -export declare type DrawHorizontalLine = DrawLinePredicate; -export declare type BorderUserConfig = { - readonly topLeft?: string; - readonly topRight?: string; - readonly topBody?: string; - readonly topJoin?: string; - readonly bottomLeft?: string; - readonly bottomRight?: string; - readonly bottomBody?: string; - readonly bottomJoin?: string; - readonly joinLeft?: string; - readonly joinRight?: string; - readonly joinBody?: string; - readonly joinJoin?: string; - readonly joinMiddleUp?: string; - readonly joinMiddleDown?: string; - readonly joinMiddleLeft?: string; - readonly joinMiddleRight?: string; - readonly headerJoin?: string; - readonly bodyRight?: string; - readonly bodyLeft?: string; - readonly bodyJoin?: string; -}; -export declare type BorderConfig = Required; -export declare type Alignment = 'center' | 'justify' | 'left' | 'right'; -export declare type VerticalAlignment = 'bottom' | 'middle' | 'top'; -export declare type CellUserConfig = { - /** - * Cell content horizontal alignment (default: left) - */ - readonly alignment?: Alignment; - /** - * Cell content vertical alignment (default: top) - */ - readonly verticalAlignment?: VerticalAlignment; - /** - * Number of characters are which the content will be truncated (default: Infinity) - */ - readonly truncate?: number; - /** - * Cell content padding width left (default: 1) - */ - readonly paddingLeft?: number; - /** - * Cell content padding width right (default: 1) - */ - readonly paddingRight?: number; - /** - * If true, the text is broken at the nearest space or one of the special characters: "\|/_.,;-" - */ - readonly wrapWord?: boolean; -}; -export declare type ColumnUserConfig = CellUserConfig & { - /** - * Column width (default: auto calculation based on the cell content) - */ - readonly width?: number; -}; -/** - * @deprecated Use spanning cell API instead - */ -export declare type HeaderUserConfig = Omit & { - readonly content: string; -}; -export declare type BaseUserConfig = { - /** - * Custom border - */ - readonly border?: BorderUserConfig; - /** - * Default values for all columns. Column specific settings overwrite the default values. - */ - readonly columnDefault?: ColumnUserConfig; - /** - * Column specific configuration. - */ - readonly columns?: Indexable; - /** - * Used to tell whether to draw a vertical line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - */ - readonly drawVerticalLine?: DrawVerticalLine; -}; -export declare type TableUserConfig = BaseUserConfig & { - /** - * The header configuration - */ - readonly header?: HeaderUserConfig; - /** - * 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. - */ - readonly drawHorizontalLine?: DrawHorizontalLine; - /** - * Horizontal lines inside the table are not drawn. - */ - readonly singleLine?: boolean; - readonly spanningCells?: SpanningCellConfig[]; -}; -export declare type SpanningCellConfig = CellUserConfig & { - readonly row: number; - readonly col: number; - readonly rowSpan?: number; - readonly colSpan?: number; -}; -export declare type StreamUserConfig = BaseUserConfig & { - /** - * The number of columns - */ - readonly columnCount: number; - /** - * Default values for all columns. Column specific settings overwrite the default values. - */ - readonly columnDefault: ColumnUserConfig & { - /** - * The default width for each column - */ - readonly width: number; - }; -}; -export declare type WritableStream = { - readonly write: (rows: string[]) => void; -}; -export declare type Indexable = { - readonly [index: number]: T; -}; diff --git a/node_modules/table/dist/src/types/api.js b/node_modules/table/dist/src/types/api.js deleted file mode 100644 index 57bf49a..0000000 --- a/node_modules/table/dist/src/types/api.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/api.js.map b/node_modules/table/dist/src/types/api.js.map deleted file mode 100644 index f396fdb..0000000 --- a/node_modules/table/dist/src/types/api.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.d.ts b/node_modules/table/dist/src/types/internal.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/node_modules/table/dist/src/types/internal.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/node_modules/table/dist/src/types/internal.js b/node_modules/table/dist/src/types/internal.js deleted file mode 100644 index f8a3d3e..0000000 --- a/node_modules/table/dist/src/types/internal.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=internal.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/types/internal.js.map b/node_modules/table/dist/src/types/internal.js.map deleted file mode 100644 index b612aad..0000000 --- a/node_modules/table/dist/src/types/internal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/types/internal.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.d.ts b/node_modules/table/dist/src/utils.d.ts deleted file mode 100644 index 223753f..0000000 --- a/node_modules/table/dist/src/utils.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { BaseConfig, CellCoordinates, RangeCoordinate } from './types/internal'; -export declare const sequence: (start: number, end: number) => number[]; -export declare const sumArray: (array: number[]) => number; -export declare const extractTruncates: (config: BaseConfig) => number[]; -export declare const flatten: (array: T[][]) => T[]; -export declare const calculateRangeCoordinate: (spanningCellConfig: SpanningCellConfig) => RangeCoordinate; -export declare const areCellEqual: (cell1: CellCoordinates, cell2: CellCoordinates) => boolean; -export declare const isCellInRange: (cell: CellCoordinates, { topLeft, bottomRight }: RangeCoordinate) => boolean; diff --git a/node_modules/table/dist/src/utils.js b/node_modules/table/dist/src/utils.js deleted file mode 100644 index 7de87d7..0000000 --- a/node_modules/table/dist/src/utils.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isCellInRange = exports.areCellEqual = exports.calculateRangeCoordinate = exports.flatten = exports.extractTruncates = exports.sumArray = exports.sequence = exports.distributeUnevenly = exports.countSpaceSequence = exports.groupBySizes = exports.makeBorderConfig = exports.splitAnsi = exports.normalizeString = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const string_width_1 = __importDefault(require("string-width")); -const strip_ansi_1 = __importDefault(require("strip-ansi")); -const getBorderCharacters_1 = require("./getBorderCharacters"); -/** - * Converts Windows-style newline to Unix-style - * - * @internal - */ -const normalizeString = (input) => { - return input.replace(/\r\n/g, '\n'); -}; -exports.normalizeString = normalizeString; -/** - * Splits ansi string by newlines - * - * @internal - */ -const splitAnsi = (input) => { - const lengths = (0, strip_ansi_1.default)(input).split('\n').map(string_width_1.default); - const result = []; - let startIndex = 0; - lengths.forEach((length) => { - result.push(length === 0 ? '' : (0, slice_ansi_1.default)(input, startIndex, startIndex + length)); - // Plus 1 for the newline character itself - startIndex += length + 1; - }); - return result; -}; -exports.splitAnsi = splitAnsi; -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @internal - */ -const makeBorderConfig = (border) => { - return { - ...(0, getBorderCharacters_1.getBorderCharacters)('honeywell'), - ...border, - }; -}; -exports.makeBorderConfig = makeBorderConfig; -/** - * Groups the array into sub-arrays by sizes. - * - * @internal - * @example - * groupBySizes(['a', 'b', 'c', 'd', 'e'], [2, 1, 2]) = [ ['a', 'b'], ['c'], ['d', 'e'] ] - */ -const groupBySizes = (array, sizes) => { - let startIndex = 0; - return sizes.map((size) => { - const group = array.slice(startIndex, startIndex + size); - startIndex += size; - return group; - }); -}; -exports.groupBySizes = groupBySizes; -/** - * Counts the number of continuous spaces in a string - * - * @internal - * @example - * countGroupSpaces('a bc de f') = 3 - */ -const countSpaceSequence = (input) => { - var _a, _b; - return (_b = (_a = input.match(/\s+/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; -}; -exports.countSpaceSequence = countSpaceSequence; -/** - * Creates the non-increasing number array given sum and length - * whose the difference between maximum and minimum is not greater than 1 - * - * @internal - * @example - * distributeUnevenly(6, 3) = [2, 2, 2] - * distributeUnevenly(8, 3) = [3, 3, 2] - */ -const distributeUnevenly = (sum, length) => { - const result = Array.from({ length }).fill(Math.floor(sum / length)); - return result.map((element, index) => { - return element + (index < sum % length ? 1 : 0); - }); -}; -exports.distributeUnevenly = distributeUnevenly; -const sequence = (start, end) => { - return Array.from({ length: end - start + 1 }, (_, index) => { - return index + start; - }); -}; -exports.sequence = sequence; -const sumArray = (array) => { - return array.reduce((accumulator, element) => { - return accumulator + element; - }, 0); -}; -exports.sumArray = sumArray; -const extractTruncates = (config) => { - return config.columns.map(({ truncate }) => { - return truncate; - }); -}; -exports.extractTruncates = extractTruncates; -const flatten = (array) => { - return [].concat(...array); -}; -exports.flatten = flatten; -const calculateRangeCoordinate = (spanningCellConfig) => { - const { row, col, colSpan = 1, rowSpan = 1 } = spanningCellConfig; - return { bottomRight: { col: col + colSpan - 1, - row: row + rowSpan - 1 }, - topLeft: { col, - row } }; -}; -exports.calculateRangeCoordinate = calculateRangeCoordinate; -const areCellEqual = (cell1, cell2) => { - return cell1.row === cell2.row && cell1.col === cell2.col; -}; -exports.areCellEqual = areCellEqual; -const isCellInRange = (cell, { topLeft, bottomRight }) => { - return (topLeft.row <= cell.row && - cell.row <= bottomRight.row && - topLeft.col <= cell.col && - cell.col <= bottomRight.col); -}; -exports.isCellInRange = isCellInRange; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/utils.js.map b/node_modules/table/dist/src/utils.js.map deleted file mode 100644 index 577b91c..0000000 --- a/node_modules/table/dist/src/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AACvC,4DAAmC;AACnC,+DAE+B;A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AO,EAAE,WAAW,EAAkB,EAAW,EAAE;IACvG,OAAO,CACL,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG;QACvB,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG;QAC3B,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG;QACvB,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG,CAC5B,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,aAAa,iBAOxB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateConfig.d.ts b/node_modules/table/dist/src/validateConfig.d.ts deleted file mode 100644 index e050cad..0000000 --- a/node_modules/table/dist/src/validateConfig.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TableUserConfig } from './types/api'; -export declare const validateConfig: (schemaId: 'config.json' | 'streamConfig.json', config: TableUserConfig) => void; diff --git a/node_modules/table/dist/src/validateConfig.js b/node_modules/table/dist/src/validateConfig.js deleted file mode 100644 index 2df152e..0000000 --- a/node_modules/table/dist/src/validateConfig.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateConfig = void 0; -const validators_1 = __importDefault(require("./generated/validators")); -const validateConfig = (schemaId, config) => { - const validate = validators_1.default[schemaId]; - if (!validate(config) && validate.errors) { - // eslint-disable-next-line promise/prefer-await-to-callbacks - const errors = validate.errors.map((error) => { - return { - 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.'); - } -}; -exports.validateConfig = validateConfig; -//# sourceMappingURL=validateConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateConfig.js.map b/node_modules/table/dist/src/validateConfig.js.map deleted file mode 100644 index db240b3..0000000 --- a/node_modules/table/dist/src/validateConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateConfig.js","sourceRoot":"","sources":["../../src/validateConfig.ts"],"names":[],"mappings":";;;;;;AAIA,wEAAgD;AAKzC,MAAM,cAAc,GAAG,CAAC,QAA6C,EAAE,MAAuB,EAAQ,EAAE;IAC7G,MAAM,QAAQ,GAAG,oBAAU,CAAC,QAAQ,CAAqB,CAAC;IAC1D,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;QACxC,6DAA6D;QAC7D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAkB,EAAE,EAAE;YACxD,OAAO;gBACL,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,+BAA+B;QAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC9B,8BAA8B;QAE9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC,CAAC;AAnBW,QAAA,cAAc,kBAmBzB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.d.ts b/node_modules/table/dist/src/validateSpanningCellConfig.d.ts deleted file mode 100644 index d04bd34..0000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SpanningCellConfig } from './types/api'; -import type { Row } from './types/internal'; -export declare const validateSpanningCellConfig: (rows: Row[], configs: SpanningCellConfig[]) => void; diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js b/node_modules/table/dist/src/validateSpanningCellConfig.js deleted file mode 100644 index e2859ad..0000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateSpanningCellConfig = void 0; -const utils_1 = require("./utils"); -const inRange = (start, end, value) => { - return start <= value && value <= end; -}; -const validateSpanningCellConfig = (rows, configs) => { - const [nRow, nCol] = [rows.length, rows[0].length]; - configs.forEach((config, configIndex) => { - const { colSpan, rowSpan } = config; - if (colSpan === undefined && rowSpan === undefined) { - throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${configIndex}]`); - } - if (colSpan !== undefined && colSpan < 1) { - throw new Error(`Expect colSpan is not equal zero, instead got: ${colSpan} in config.spanningCells[${configIndex}]`); - } - if (rowSpan !== undefined && rowSpan < 1) { - throw new Error(`Expect rowSpan is not equal zero, instead got: ${rowSpan} in config.spanningCells[${configIndex}]`); - } - }); - const rangeCoordinates = configs.map(utils_1.calculateRangeCoordinate); - rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { - if (!inRange(0, nCol - 1, topLeft.col) || - !inRange(0, nRow - 1, topLeft.row) || - !inRange(0, nCol - 1, bottomRight.col) || - !inRange(0, nRow - 1, bottomRight.row)) { - throw new Error(`Some cells in config.spanningCells[${rangeIndex}] are out of the table`); - } - }); - const configOccupy = Array.from({ length: nRow }, () => { - return Array.from({ length: nCol }); - }); - rangeCoordinates.forEach(({ topLeft, bottomRight }, rangeIndex) => { - (0, utils_1.sequence)(topLeft.row, bottomRight.row).forEach((row) => { - (0, utils_1.sequence)(topLeft.col, bottomRight.col).forEach((col) => { - if (configOccupy[row][col] !== undefined) { - throw new Error(`Spanning cells in config.spanningCells[${configOccupy[row][col]}] and config.spanningCells[${rangeIndex}] are overlap each other`); - } - configOccupy[row][col] = rangeIndex; - }); - }); - }); -}; -exports.validateSpanningCellConfig = validateSpanningCellConfig; -//# sourceMappingURL=validateSpanningCellConfig.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateSpanningCellConfig.js.map b/node_modules/table/dist/src/validateSpanningCellConfig.js.map deleted file mode 100644 index d5097be..0000000 --- a/node_modules/table/dist/src/validateSpanningCellConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateSpanningCellConfig.js","sourceRoot":"","sources":["../../src/validateSpanningCellConfig.ts"],"names":[],"mappings":";;;AAMA,mCAGiB;AAEjB,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;IAC5D,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,GAAG,CAAC;AACxC,CAAC,CAAC;AAEK,MAAM,0BAA0B,GAAG,CAAC,IAAW,EAAE,OAA6B,EAAQ,EAAE;IAC7F,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAEnD,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;QACtC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,MAAM,CAAC;QAClC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CAAC,0EAA0E,WAAW,GAAG,CAAC,CAAC;SAC3G;QACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,4BAA4B,WAAW,GAAG,CAAC,CAAC;SACtH;QACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,EAAE;YACxC,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,4BAA4B,WAAW,GAAG,CAAC,CAAC;SACtH;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;IAE/D,gBAAgB,CAAC,OAAO,CAAC,C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ACD,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YACtC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAzCW,QAAA,0BAA0B,8BAyCrC"} \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.d.ts b/node_modules/table/dist/src/validateTableData.d.ts deleted file mode 100644 index 84dac05..0000000 --- a/node_modules/table/dist/src/validateTableData.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const validateTableData: (rows: unknown[][]) => void; diff --git a/node_modules/table/dist/src/validateTableData.js b/node_modules/table/dist/src/validateTableData.js deleted file mode 100644 index a85e807..0000000 --- a/node_modules/table/dist/src/validateTableData.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateTableData = void 0; -const utils_1 = require("./utils"); -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 row of rows) { - if (!Array.isArray(row)) { - throw new TypeError('Table row data must be an array.'); - } - if (row.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } - for (const cell of row) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0, utils_1.normalizeString)(String(cell)))) { - throw new Error('Table data must not contain control characters.'); - } - } - } -}; -exports.validateTableData = validateTableData; -//# sourceMappingURL=validateTableData.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/validateTableData.js.map b/node_modules/table/dist/src/validateTableData.js.map deleted file mode 100644 index 568fb10..0000000 --- a/node_modules/table/dist/src/validateTableData.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validateTableData.js","sourceRoot":"","sources":["../../src/validateTableData.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AAEV,MAAM,iBAAiB,GAAG,CAAC,IAAiB,EAAQ,EAAE;IAC3D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAC;KACrD;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEpC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;SACzD;QAED,IAAI,GAAG,CAAC,MAAM,KAAK,YAAY,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SAClE;QAED,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;YACtB,4CAA4C;YAC5C,IAAI,0CAA0C,CAAC,IAAI,CAAC,IAAA,uBAAe,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;gBAClF,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACpE;SACF;KACF;AACH,CAAC,CAAC;AA/BW,QAAA,iBAAiB,qBA+B5B"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.d.ts b/node_modules/table/dist/src/wrapCell.d.ts deleted file mode 100644 index 52d7299..0000000 --- a/node_modules/table/dist/src/wrapCell.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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. - * - */ -export declare const wrapCell: (cellValue: string, cellWidth: number, useWrapWord: boolean) => string[]; diff --git a/node_modules/table/dist/src/wrapCell.js b/node_modules/table/dist/src/wrapCell.js deleted file mode 100644 index b2ce8de..0000000 --- a/node_modules/table/dist/src/wrapCell.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapCell = void 0; -const utils_1 = require("./utils"); -const wrapString_1 = require("./wrapString"); -const wrapWord_1 = require("./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. - * - */ -const wrapCell = (cellValue, cellWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = (0, utils_1.splitAnsi)(cellValue); - // 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_1.wrapWord)(cellLines[lineNr], cellWidth); - } - else { - lineChunks = (0, wrapString_1.wrapString)(cellLines[lineNr], cellWidth); - } - // Replace our original array element with whatever the wrapping returned - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - return cellLines; -}; -exports.wrapCell = wrapCell; -//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapCell.js.map b/node_modules/table/dist/src/wrapCell.js.map deleted file mode 100644 index 9ce0736..0000000 --- a/node_modules/table/dist/src/wrapCell.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapCell.js","sourceRoot":"","sources":["../../src/wrapCell.ts"],"names":[],"mappings":";;;AAAA,mCAEiB;AACjB,6CAEsB;AACtB,yCAEoB;AAEpB;;;;;;GAMG;AACI,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,SAAiB,EAAE,WAAoB,EAAY,EAAE;IAC/F,kCAAkC;IAClC,MAAM,SAAS,GAAG,IAAA,iBAAS,EAAC,SAAS,CAAC,CAAC;IAEvC,8EAA8E;IAC9E,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG;QAC/C,IAAI,UAAU,CAAC;QAEf,IAAI,WAAW,EAAE;YACf,UAAU,GAAG,IAAA,mBAAQ,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACrD;aAAM;YACL,UAAU,GAAG,IAAA,uBAAU,EAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;SACvD;QAED,yEAAyE;QACzE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC,CAAC;QAC3C,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC;KAC7B;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,QAAQ,YAoBnB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.d.ts b/node_modules/table/dist/src/wrapString.d.ts deleted file mode 100644 index 849e174..0000000 --- a/node_modules/table/dist/src/wrapString.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 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. - * - */ -export declare const wrapString: (subject: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapString.js b/node_modules/table/dist/src/wrapString.js deleted file mode 100644 index b09bd17..0000000 --- a/node_modules/table/dist/src/wrapString.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapString = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const string_width_1 = __importDefault(require("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. - * - */ -const wrapString = (subject, size) => { - let subjectSlice = subject; - const chunks = []; - do { - chunks.push((0, slice_ansi_1.default)(subjectSlice, 0, size)); - subjectSlice = (0, slice_ansi_1.default)(subjectSlice, size).trim(); - } while ((0, string_width_1.default)(subjectSlice)); - return chunks; -}; -exports.wrapString = wrapString; -//# sourceMappingURL=wrapString.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapString.js.map b/node_modules/table/dist/src/wrapString.js.map deleted file mode 100644 index c1c2a5b..0000000 --- a/node_modules/table/dist/src/wrapString.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapString.js","sourceRoot":"","sources":["../../src/wrapString.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,gEAAuC;AAEvC;;;;;;;GAOG;AACI,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAY,EAAE;IACpE,IAAI,YAAY,GAAG,OAAO,CAAC;IAE3B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,GAAG;QACD,MAAM,CAAC,IAAI,CAAC,IAAA,oBAAK,EAAC,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QAE1C,YAAY,GAAG,IAAA,oBAAK,EAAC,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;KACjD,QAAQ,IAAA,sBAAW,EAAC,YAAY,CAAC,EAAE;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAZW,QAAA,UAAU,cAYrB"} \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.d.ts b/node_modules/table/dist/src/wrapWord.d.ts deleted file mode 100644 index 083da4d..0000000 --- a/node_modules/table/dist/src/wrapWord.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const wrapWord: (input: string, size: number) => string[]; diff --git a/node_modules/table/dist/src/wrapWord.js b/node_modules/table/dist/src/wrapWord.js deleted file mode 100644 index 7571aa6..0000000 --- a/node_modules/table/dist/src/wrapWord.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wrapWord = void 0; -const slice_ansi_1 = __importDefault(require("slice-ansi")); -const strip_ansi_1 = __importDefault(require("strip-ansi")); -const calculateStringLengths = (input, size) => { - let subject = (0, strip_ansi_1.default)(input); - const chunks = []; - // https://regex101.com/r/gY5kZ1/1 - const re = new RegExp('(^.{1,' + String(Math.max(size, 1)) + '}(\\s+|$))|(^.{1,' + String(Math.max(size - 1, 1)) + '}(\\\\|/|_|\\.|,|;|-))'); - do { - let chunk; - const match = re.exec(subject); - if (match) { - chunk = match[0]; - subject = subject.slice(chunk.length); - const trimmedLength = chunk.trim().length; - const offset = chunk.length - trimmedLength; - chunks.push([trimmedLength, offset]); - } - else { - chunk = subject.slice(0, size); - subject = subject.slice(size); - chunks.push([chunk.length, 0]); - } - } while (subject.length); - return chunks; -}; -const wrapWord = (input, size) => { - const result = []; - let startIndex = 0; - calculateStringLengths(input, size).forEach(([length, offset]) => { - result.push((0, slice_ansi_1.default)(input, startIndex, startIndex + length)); - startIndex += length + offset; - }); - return result; -}; -exports.wrapWord = wrapWord; -//# sourceMappingURL=wrapWord.js.map \ No newline at end of file diff --git a/node_modules/table/dist/src/wrapWord.js.map b/node_modules/table/dist/src/wrapWord.js.map deleted file mode 100644 index fc61519..0000000 --- a/node_modules/table/dist/src/wrapWord.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrapWord.js","sourceRoot":"","sources":["../../src/wrapWord.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA+B;AAC/B,4DAAmC;AAEnC,MAAM,sBAAsB,GAAG,CAAC,KAAa,EAAE,IAAY,EAA0C,EAAE;IACrG,IAAI,OAAO,GAAG,IAAA,oBAAS,E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AAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE;QAC/D,MAAM,CAAC,IAAI,CAAC,IAAA,oBAAK,EAAC,KAAK,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC;QAE3D,UAAU,IAAI,MAAM,GAAG,MAAM,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAXW,QAAA,QAAQ,YAWnB"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/.runkit_example.js b/node_modules/table/node_modules/ajv/.runkit_example.js deleted file mode 100644 index 0d578d5..0000000 --- a/node_modules/table/node_modules/ajv/.runkit_example.js +++ /dev/null @@ -1,23 +0,0 @@ -const Ajv = require("ajv") -const ajv = new Ajv({allErrors: true}) - -const schema = { - type: "object", - properties: { - foo: {type: "string"}, - bar: {type: "number", maximum: 3}, - }, - required: ["foo", "bar"], - additionalProperties: false, -} - -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/LICENSE b/node_modules/table/node_modules/ajv/LICENSE deleted file mode 100644 index 139162a..0000000 --- a/node_modules/table/node_modules/ajv/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015-2021 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/table/node_modules/ajv/README.md b/node_modules/table/node_modules/ajv/README.md deleted file mode 100644 index d8ee276..0000000 --- a/node_modules/table/node_modules/ajv/README.md +++ /dev/null @@ -1,207 +0,0 @@ -Ajv logo - -  - -# Ajv JSON schema validator - -The fastest JSON validator for Node.js and browser. - -Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/). - -[![build](https://github.com/ajv-validator/ajv/actions/workflows/build.yml/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 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) -[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-70F0F9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2F8KvvURM6J38Gdq9dCuPswMOkMny0xCOJ%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAr8rPVRuMOXv6kwF2yUAap-eoVg-9ssOFCi1fIrxTUw0%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%224pwLRgWHU9tlroMWHz0uOg%3D%3D%22%7D) -[![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) - -## Ajv sponsors - -[Mozilla](https://www.mozilla.org)[](https://opencollective.com/ajv) - -[Microsoft](https://opensource.microsoft.com)[](https://opencollective.com/ajv)[](https://opencollective.com/ajv) - -[Retool](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)[Tidelift](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)[SimpleX](https://github.com/simplex-chat/simplex-chat)[](https://opencollective.com/ajv) - -## 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. - -Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html). - -## Documentation - -All documentation is available on the [Ajv website](https://ajv.js.org). - -Some useful site links: - -- [Getting started](https://ajv.js.org/guide/getting-started.html) -- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html) -- [API reference](https://ajv.js.org/api.html) -- [Strict mode](https://ajv.js.org/strict-mode.html) -- [Standalone validation code](https://ajv.js.org/standalone.html) -- [Security considerations](https://ajv.js.org/security.html) -- [Command line interface](https://ajv.js.org/packages/ajv-cli.html) -- [Frequently Asked Questions](https://ajv.js.org/faq.html) - -## 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=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) - -## Features - -- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6): - - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html)) - - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions: - - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator). - - keyword [nullable](https://ajv.js.org/json-schema.html#nullable). - - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available) - - support of recursive references between schemas - - correct string lengths for strings with unicode pairs - - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin). - - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema) -- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/): - - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html)) - - meta-schema for JTD schemas - - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema) -- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current -- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation -- "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors) -- [error messages with parameters](https://ajv.js.org/api.html#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](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties) -- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items -- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords -- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html) -- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package -- [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords -- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords - -## Install - -To install version 8: - -``` -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") - -const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} - -const schema = { - type: "object", - properties: { - foo: {type: "integer"}, - bar: {type: "string"}, - }, - required: ["foo"], - additionalProperties: false, -} - -const data = { - foo: 1, - bar: "abc", -} - -const validate = ajv.compile(schema) -const valid = validate(data) -if (!valid) console.log(validate.errors) -``` - -Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html) - -## Changes history - -See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases) - -**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0) - -[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 e835e2b..0000000 --- a/node_modules/table/node_modules/ajv/dist/2019.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore, { Options } from "./core"; -export declare class Ajv2019 extends AjvCore { - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv2019; -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"; -export { KeywordCxt } from "./compile/validate"; -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"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; 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 bad415c..0000000 --- a/node_modules/table/node_modules/ajv/dist/2019.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0; -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 discriminator_1 = require("./vocabularies/discriminator"); -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); - if (this.opts.discriminator) - this.addKeyword(discriminator_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.Ajv2019 = Ajv2019; -module.exports = exports = Ajv2019; -module.exports.Ajv2019 = Ajv2019; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv2019; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -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; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# 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 7e55d95..0000000 --- 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":";;;AACA,iCAAuC;AAEvC,kDAAsD;AACtD,oDAAsD;AACtD,8CAAgD;AAChD,4DAA8D;AAC9D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,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,C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FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/2020.d.ts b/node_modules/table/node_modules/ajv/dist/2020.d.ts deleted file mode 100644 index 2e56c8f..0000000 --- a/node_modules/table/node_modules/ajv/dist/2020.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore, { Options } from "./core"; -export declare class Ajv2020 extends AjvCore { - constructor(opts?: Options); - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv2020; -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"; -export { KeywordCxt } from "./compile/validate"; -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"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; diff --git a/node_modules/table/node_modules/ajv/dist/2020.js b/node_modules/table/node_modules/ajv/dist/2020.js deleted file mode 100644 index b3fe71c..0000000 --- a/node_modules/table/node_modules/ajv/dist/2020.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0; -const core_1 = require("./core"); -const draft2020_1 = require("./vocabularies/draft2020"); -const discriminator_1 = require("./vocabularies/discriminator"); -const json_schema_2020_12_1 = require("./refs/json-schema-2020-12"); -const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"; -class Ajv2020 extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }); - } - _addVocabularies() { - super._addVocabularies(); - draft2020_1.default.forEach((v) => this.addVocabulary(v)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - const { $data, meta } = this.opts; - if (!meta) - return; - json_schema_2020_12_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.Ajv2020 = Ajv2020; -module.exports = exports = Ajv2020; -module.exports.Ajv2020 = Ajv2020; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv2020; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -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; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# sourceMappingURL=2020.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/2020.js.map b/node_modules/table/node_modules/ajv/dist/2020.js.map deleted file mode 100644 index 2f4fda8..0000000 --- a/node_modules/table/node_modules/ajv/dist/2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,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,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3D,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,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;AA5BD,0BA4BC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;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;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ 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 fce3b03..0000000 --- a/node_modules/table/node_modules/ajv/dist/ajv.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { AnySchemaObject } from "./types"; -import AjvCore from "./core"; -export declare class Ajv extends AjvCore { - _addVocabularies(): void; - _addDefaultMetaSchema(): void; - defaultMeta(): string | AnySchemaObject | undefined; -} -export default Ajv; -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"; -export { KeywordCxt } from "./compile/validate"; -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"; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; 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 8eecf1b..0000000 --- a/node_modules/table/node_modules/ajv/dist/ajv.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; -const core_1 = require("./core"); -const draft7_1 = require("./vocabularies/draft7"); -const discriminator_1 = require("./vocabularies/discriminator"); -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)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _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.Ajv = Ajv; -module.exports = exports = Ajv; -module.exports.Ajv = Ajv; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -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; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# 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 42c3edf..0000000 --- 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":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAa,GAAI,SAAQ,cAAO;IAC9B,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAA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AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ 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 a0220ad..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts +++ /dev/null @@ -1,40 +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 type CodeItem = Name | string | number | boolean | null; -export type UsedNames = Record; -export type Code = _Code | Name; -export type SafeExpr = Code | number | boolean | null; -export declare const nil: _Code; -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 declare function getEsmExportName(key: Code | string | number): Code; -export declare function regexpCode(rx: RegExp): 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 f9ea525..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js +++ /dev/null @@ -1,156 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.regexpCode = exports.getEsmExportName = 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; -// eslint-disable-next-line @typescript-eslint/no-extraneous-class -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; -//Does best effort to format the name properly -function getEsmExportName(key) { - if (typeof key == "string" && exports.IDENTIFIER.test(key)) { - return new _Code(`${key}`); - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); -} -exports.getEsmExportName = getEsmExportName; -function regexpCode(rx) { - return new _Code(rx.toString()); -} -exports.regexpCode = regexpCode; -//# 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 2fe66c1..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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AQ,EAAE,CAAC,CAAA;AACjC,CAAC;AAFD,gCAEC"} \ 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 d586a4b..0000000 --- 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, regexpCode, Name, Code } from "./code"; -export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope"; -export type SafeExpr = Code | number | boolean | null; -export 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 a6c805a..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js +++ /dev/null @@ -1,697 +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.regexpCode = 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, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } }); -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(":"); - (0, 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, (0, code_1._) `${arr}.length`, (i) => { - this.var(name, (0, 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, (0, 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 : (0, 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 : (0, code_1._) `${par(x)} ${op} ${par(y)}`); -} -function par(x) { - return x instanceof code_1.Name ? x : (0, 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 baef9cf..0000000 --- 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,+BAA6F;AAArF,yFAAA,CAAC,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,2FAAA,GAAG,OAAA;AAAE,mGAAA,WAAW,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,4FAAA,IAAI,OAAA;AACxE,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,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACpB,EAAE,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;IAClB,GAAG,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACpB,EAAE,EAAE,IAAI,YAAK,CAAC,KAAK,CAAC;IACpB,GAAG,EAAE,IAAI,YAAK,CAAC,KAAK,CAAC;IACrB,GAAG,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;IACnB,EAAE,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACnB,GAAG,EAAE,IAAI,YAAK,CAAC,IAAI,CAAC;IACpB,GAAG,EAAE,IAAI,YAAK,CAAC,GAAG,CAAC;CACpB,CAAA;AAED,MAAe,IAAI;IAGjB,aAAa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AC,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 3d95305..0000000 --- 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 type ValueReference = unknown; -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 declare enum UsedValueState { - Started = 0, - Completed = 1 -} -export 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 4bc7794..0000000 --- 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 = 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 = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`; - } -} -exports.ValueScopeName = ValueScopeName; -const line = (0, 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 (0, 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 = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`; - } - else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) { - code = (0, 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 911769f..0000000 --- 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,8BAAd,cAAc,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,EAAE,MAAM,KAAkB,EAAE;QAJ9B,WAAM,GAAqC,EAAE,CAAA;QAK9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;IACvB,CAAC;IAED,MAAM,CAAC,YAA2B;QAChC,OAAO,YAAY,YAAY,WAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,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,EAAE,EAAE,CAAA;gBACtC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;gBAC5B,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;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/errors.d.ts b/node_modules/table/node_modules/ajv/dist/compile/errors.d.ts deleted file mode 100644 index 74eef7e..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/errors.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types"; -import { CodeGen, Code, Name } from "./codegen"; -export declare const keywordError: KeywordErrorDefinition; -export declare const keyword$DataError: KeywordErrorDefinition; -export interface ErrorPaths { - instancePath?: Code; - schemaPath?: string; - parentSchema?: boolean; -} -export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void; -export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): 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 24d721d..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/errors.js +++ /dev/null @@ -1,123 +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 util_1 = require("./util"); -const names_1 = require("./names"); -exports.keywordError = { - message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`, -}; -exports.keyword$DataError = { - message: ({ keyword, schemaType }) => schemaType - ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)` - : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`, -}; -function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) { - addError(gen, errObj); - } - else { - returnErrors(it, (0, codegen_1._) `[${errObj}]`); - } -} -exports.reportError = reportError; -function reportExtraError(cxt, error = exports.keywordError, errorPaths) { - const { it } = cxt; - const { gen, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - 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((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, 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, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`); - gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); - gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`); - if (it.opts.verbose) { - gen.assign((0, codegen_1._) `${err}.schema`, schemaValue); - gen.assign((0, codegen_1._) `${err}.data`, data); - } - }); -} -exports.extendErrors = extendErrors; -function addError(gen, errObj) { - const err = gen.const("err", errObj); - gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`); - gen.code((0, codegen_1._) `${names_1.default.errors}++`); -} -function returnErrors(it, errs) { - const { gen, validateName, schemaEnv } = it; - if (schemaEnv.$async) { - gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`); - } - else { - gen.assign((0, codegen_1._) `${validateName}.errors`, errs); - gen.return(false); - } -} -const E = { - keyword: new codegen_1.Name("keyword"), - schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors - 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"), -}; -function errorObjectCode(cxt, error, errorPaths) { - const { createErrors } = cxt.it; - if (createErrors === false) - return (0, codegen_1._) `{}`; - return errorObject(cxt, error, errorPaths); -} -function errorObject(cxt, error, errorPaths = {}) { - const { gen, it } = cxt; - const keyValues = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths), - ]; - extraErrorProps(cxt, error, keyValues); - return gen.object(...keyValues); -} -function errorInstancePath({ errorPath }, { instancePath }) { - const instPath = instancePath - ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` - : errorPath; - return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; -} -function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { - let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`; - if (schemaPath) { - schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; - } - return [E.schemaPath, schPath]; -} -function extraErrorProps(cxt, { params, message }, keyValues) { - const { keyword, data, schemaValue, it } = cxt; - const { opts, propertyName, topSchemaRef, schemaPath } = it; - keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]); - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - if (opts.verbose) { - keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); - } - if (propertyName) - keyValues.push([E.propertyName, propertyName]); -} -//# 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 ea08e4e..0000000 --- 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,iCAAyC;AACzC,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,cAAc,OAAO,sBAAsB;CACvE,CAAA;AAEY,QAAA,iBAAiB,GAA2B;IACvD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjC,UAAU;QACR,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,qBAAqB,UAAU,UAAU;QACzD,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,8BAA8B;CACnD,CAAA;AAQD,SAAgB,WAAW,CACzB,GAAoB,EACpB,QAAgC,oBAAY,EAC5C,UAAuB,EACvB,iBAA2B;IAE3B,MAAM,EAAC,EAAE,EAAC,GAAG,GAAG,CAAA;IAChB,MAAM,EAAC,GAAG,EAAE,aAAa,EAA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C,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,IAAA,WAAC,EAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;IACH,CAAC;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,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 2809353..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/index.d.ts +++ /dev/null @@ -1,80 +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 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 schemaId?: "$id" | "id"; - readonly root?: SchemaEnv; - readonly baseId?: string; - readonly schemaPath?: string; - readonly localRefs?: LocalRefs; - readonly meta?: boolean; -} -export declare class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema; - readonly schemaId?: "$id" | "id"; - readonly root: SchemaEnv; - baseId: string; - schemaPath?: 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 9e42a55..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/index.js +++ /dev/null @@ -1,242 +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 validation_error_1 = require("../runtime/validation_error"); -const names_1 = require("./names"); -const resolve_1 = require("./resolve"); -const util_1 = require("./util"); -const validate_1 = require("./validate"); -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.schemaId = env.schemaId; - this.root = env.root || this; - this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); - this.schemaPath = env.schemaPath; - 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 = (0, resolve_1.getFullPath)(this.opts.uriResolver, 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: validation_error_1.default, - code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`, - }); - } - 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], // 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: (0, 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: sch.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, codegen_1._) `""`, - opts: this.opts, - self: this, - }; - let sourceCode; - try { - this._compilations.add(sch); - (0, 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 = (0, 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 = (0, resolve_1.resolveUrl)(this.opts.uriResolver, 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 - const { schemaId } = this.opts; - if (schema) - _sch = new SchemaEnv({ schema, schemaId, root, baseId }); - } - if (_sch === undefined) - return; - return (root.refs[ref] = inlineOrCompile.call(this, _sch)); -} -exports.resolveRef = resolveRef; -function inlineOrCompile(sch) { - if ((0, 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 = this.opts.uriResolver.parse(ref); - const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); - // 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 = (0, 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 === (0, resolve_1.normalizeId)(ref)) { - const { schema } = schOrRef; - const { schemaId } = this.opts; - const schId = schema[schemaId]; - if (schId) - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema, schemaId, 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; - const partSchema = schema[(0, util_1.unescapeFragment)(part)]; - if (partSchema === undefined) - return; - schema = partSchema; - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - const schId = typeof schema === "object" && schema[this.opts.schemaId]; - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - } - } - let env; - if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { - const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, 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. - const { schemaId } = this.opts; - env = env || new SchemaEnv({ schema, schemaId, 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 22dcc0b..0000000 --- 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,kEAAyD;AACzD,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AA0D/C,MAAa,SAAS;IAkBpB,YAAY,GAAkB;;QATrB,SAAI,GAAe,EAAE,CAAA;QACrB,mBAAc,GAA6B,EAAE,CAAA;QASpD,IAAI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C,MAAM,GAAG,IAAA,oBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC;IACD,IAAI,GAA0B,CAAA;IAC9B,IAAI,OAAO,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3F,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QACnE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;IACD,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,GAAG,GAAG,GAAG,IAAI,IAAI,SAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;IAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,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 618c64a..0000000 --- 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 8fc94fd..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js +++ /dev/null @@ -1,350 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const ref_error_1 = require("../ref_error"); -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("../../runtime/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 = (0, codegen_1._) `undefined`; -function parserFunction(cxt) { - const { gen, parseName, char } = cxt; - gen.func(parseName, (0, 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((0, codegen_1._) `${parseName}.message`, undef); - gen.assign((0, codegen_1._) `${parseName}.position`, undef); - gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`); - gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`); - parseCode(cxt); - skipWhitespace(cxt); - gen.if(names_1.default.jsonPart, () => { - gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos); - gen.return(names_1.default.data); - }); - gen.if((0, 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, (0, codegen_1._) `[]`); - parseItems(cxt, "]", () => { - const el = gen.let("el"); - parseCode({ ...cxt, schema: schema.elements, data: el }); - gen.assign((0, codegen_1._) `${data}[${ix}++]`, el); - }); -} -function parseValues(cxt) { - const { gen, schema, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, (0, 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((0, 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, (0, 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((0, codegen_1._) `${key} === ${discriminator}`, () => { - parseString({ ...cxt, data: tag }); - gen.assign((0, codegen_1._) `${data}[${key}]`, tag); - gen.break(); - }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped - ); - }); - gen.assign(names_1.default.jsonPos, startPos); - gen.if((0, codegen_1._) `${tag} === undefined`); - parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`); - for (const tagValue in mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); - } - gen.else(); - parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`); - gen.endIf(); -} -function parseProperties(cxt) { - const { gen, data } = cxt; - parseToken(cxt, "{"); - gen.assign(data, (0, 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((0, 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: (0, codegen_1._) `${data}[${key}]` }); - } - else { - parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`); - } - gen.endIf(); - }); - if (properties) { - const hasProp = (0, code_1.hasPropFunc)(gen); - const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`)); - gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`)); - } -} -function parseDefinedProperty(cxt, key, schemas = {}) { - const { gen } = cxt; - for (const prop in schemas) { - gen.elseIf((0, codegen_1._) `${key} === ${prop}`); - parsePropertyValue(cxt, key, schemas[prop]); - } -} -function parsePropertyValue(cxt, key, schema) { - parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` }); -} -function parseType(cxt) { - const { gen, schema, data, self } = cxt; - switch (schema.type) { - case "boolean": - parseBoolean(cxt); - break; - case "string": - parseString(cxt); - break; - case "timestamp": { - parseString(cxt); - const vts = (0, util_1.useFunc)(gen, timestamp_1.default); - const { allowDate, parseDate } = self.opts; - const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`; - const fail = parseDate - ? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`) - : notValid; - gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`)); - break; - } - case "float32": - case "float64": - parseNumber(cxt); - break; - default: { - const t = schema.type; - if (!self.opts.int32range && (t === "int32" || t === "uint32")) { - parseNumber(cxt, 16); // 2 ** 53 - max safe integer - if (t === "uint32") { - gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`)); - } - } - else { - const [min, max, maxDigits] = type_1.intRange[t]; - parseNumber(cxt, maxDigits); - gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, 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((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`); - gen.assign(data, (0, 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((0, 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 ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, 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 }) - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`; -} -function parseEmpty(cxt) { - parseWith(cxt, parseJson_1.parseJson); -} -function parseWith(cxt, parseFunc, args) { - partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args); -} -function partialParse(cxt, parseFunc, args) { - const { gen, data } = cxt; - gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`); - gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`); - gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, 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((0, 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((0, 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 - ? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]` - : (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; -} -function jsonSyntaxError(cxt) { - parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); -} -function parsingError({ gen, parseName }, msg) { - gen.assign((0, codegen_1._) `${parseName}.message`, msg); - gen.assign((0, 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 87bd922..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js.map +++ /dev/null @@ -1 +0,0 @@ -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AAS,WAAW,EAAE,eAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --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 b0413d7..0000000 --- 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 341c500..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js +++ /dev/null @@ -1,229 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const types_1 = require("./types"); -const __1 = require(".."); -const codegen_1 = require("../codegen"); -const ref_error_1 = require("../ref_error"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const ref_1 = require("../../vocabularies/jtd/ref"); -const util_1 = require("../util"); -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, (0, 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((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt)); -} -function serializeElements(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, (0, 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, (0, codegen_1.str) `]`); -} -function serializeValues(cxt) { - const { gen, schema, data } = cxt; - gen.add(names_1.default.json, (0, 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, (0, 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, (0, codegen_1.str) `:`); - const value = gen.const("value", (0, codegen_1._) `${data}${(0, 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, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`); - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`); - serializeString({ ...cxt, data: tag }); - gen.if(false); - for (const tagValue in schema.mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - const sch = schema.mapping[tagValue]; - serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); - } - gen.endIf(); - gen.add(names_1.default.json, (0, codegen_1.str) `}`); -} -function serializeProperties(cxt) { - const { gen } = cxt; - gen.add(names_1.default.json, (0, codegen_1.str) `{`); - serializeSchemaProperties(cxt); - gen.add(names_1.default.json, (0, 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; - let firstProp; - for (const key of props) { - if (first) - first = false; - else - gen.add(names_1.default.json, (0, codegen_1.str) `,`); - serializeProperty(key, properties[key], keyValue(key)); - } - if (first) - firstProp = gen.let("first", true); - for (const key of optProps) { - const value = keyValue(key); - gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => { - addComma(cxt, firstProp); - serializeProperty(key, optionalProperties[key], value); - }); - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))); - } - 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", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`); - } - function serializeProperty(key, propSchema, value) { - gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`); - serializeCode({ ...cxt, schema: propSchema, data: value }); - } - function isAdditional(key, ps) { - return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true; - } -} -function serializeType(cxt) { - const { gen, schema, data } = cxt; - switch (schema.type) { - case "boolean": - gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`); - break; - case "string": - serializeString(cxt); - break; - case "timestamp": - gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt)); - break; - default: - serializeNumber(cxt); - } -} -function serializeString({ gen, data }) { - gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`); -} -function serializeNumber({ gen, data }) { - gen.add(names_1.default.json, (0, 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 ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, 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, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`); -} -function getSerialize(gen, sch) { - return sch.serialize - ? gen.scopeValue("serialize", { ref: sch.serialize }) - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`; -} -function serializeEmpty({ gen, data }) { - gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`); -} -function addComma({ gen }, first) { - if (first) { - gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`)); - } - else { - gen.add(names_1.default.json, (0, codegen_1.str) `,`); - } -} -//# 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 15c82c7..0000000 --- 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,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAwE;AACxE,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAqD;AACrD,oDAAiD;AACjD,kCAA+B;AAC/B,+CAAuC;AAEvC,MAAM,YAAY,GAAkD;IAClE,QAAQ,EAAE,iBAAiB;IAC3B,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,sBAAsB;IACrC,UAAU,EAAE,mBAAmB;IAC/B,kBAAkB,EAAE,mBAAmB;IACvC,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,YAAY;CAClB,CAAA;AAWD,SAAwB,iBAAiB,CAEvC,GAAc,EACd,WAA4B;IAE5B,MAAM,IAAI,GAAG,sBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC/C,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,MAAM,EAAC,GAAG,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACnC,MAAM,EAAC,aAAa,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IACjC,MAAM,GAAG,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC,GAAG,EAAE,KAAK,EAAE,aAAa,EAAC,CAAC,CAAA;IAChE,MAAM,aAAa,GAAG,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAChD,MAAM,GAAG,GAA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AAA,aAAG,EAAA,GAAG,CAAC,CAAA;IACzB,CAAC;AACH,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 678986f..0000000 --- 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 type SchemaObjectMap = { - [Ref in string]?: SchemaObject; -}; -export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"]; -export 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 b9c60a9..0000000 --- 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 53439e0..0000000 --- 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 5740e82..0000000 --- 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; - instancePath: 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 3bce5aa..0000000 --- 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"), // data passed to validation function - // args passed from referencing schema - valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below - instancePath: new codegen_1.Name("instancePath"), - parentData: new codegen_1.Name("parentData"), - parentDataProperty: new codegen_1.Name("parentDataProperty"), - rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef - // function scoped variables - vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors - errors: new codegen_1.Name("errors"), // counter of validation 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 971fcbf..0000000 --- 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,EAAE,qCAAqC;IAC7D,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+FAA+F;IAC3H,YAAY,EAAE,IAAI,cAAI,CAAC,cAAc,CAAC;IACtC,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC,EAAE,2EAA2E;IAC3G,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC,EAAE,8CAA8C;IAC1F,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC,EAAE,qCAAqC;IACnE,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+BAA+B;IAC3D,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/ref_error.d.ts b/node_modules/table/node_modules/ajv/dist/compile/ref_error.d.ts deleted file mode 100644 index 4337443..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ref_error.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { UriResolver } from "../types"; -export default class MissingRefError extends Error { - readonly missingRef: string; - readonly missingSchema: string; - constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string); -} diff --git a/node_modules/table/node_modules/ajv/dist/compile/ref_error.js b/node_modules/table/node_modules/ajv/dist/compile/ref_error.js deleted file mode 100644 index 3916dec..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ref_error.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const resolve_1 = require("./resolve"); -class MissingRefError extends Error { - constructor(resolver, baseId, ref, msg) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`); - this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); - this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); - } -} -exports.default = MissingRefError; -//# sourceMappingURL=ref_error.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/ref_error.js.map b/node_modules/table/node_modules/ajv/dist/compile/ref_error.js.map deleted file mode 100644 index d13f5f2..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/ref_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"} \ 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 3c20fff..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AnySchema, AnySchemaObject, UriResolver } from "../types"; -import type Ajv from "../ajv"; -import type { URIComponent } from "fast-uri"; -export type LocalRefs = { - [Ref in string]?: AnySchemaObject; -}; -export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean; -export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string; -export declare function _getFullPath(resolver: UriResolver, p: URIComponent): string; -export declare function normalizeId(id: string | undefined): string; -export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string; -export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): 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 f12f968..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/resolve.js +++ /dev/null @@ -1,155 +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"); -// 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") { - (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch))); - } - if (count === Infinity) - return Infinity; - } - return count; -} -function getFullPath(resolver, id = "", normalize) { - if (normalize !== false) - id = normalizeId(id); - const p = resolver.parse(id); - return _getFullPath(resolver, p); -} -exports.getFullPath = getFullPath; -function _getFullPath(resolver, p) { - const serialized = resolver.serialize(p); - return serialized.split("#")[0] + "#"; -} -exports._getFullPath = _getFullPath; -const TRAILING_SLASH_HASH = /#\/?$/; -function normalizeId(id) { - return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; -} -exports.normalizeId = normalizeId; -function resolveUrl(resolver, baseId, id) { - id = normalizeId(id); - return resolver.resolve(baseId, id); -} -exports.resolveUrl = resolveUrl; -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; -function getSchemaRefs(schema, baseId) { - if (typeof schema == "boolean") - return {}; - const { schemaId, uriResolver } = this.opts; - const schId = normalizeId(schema[schemaId] || baseId); - const baseIds = { "": schId }; - const pathPrefix = getFullPath(uriResolver, schId, false); - const localRefs = {}; - const schemaRefs = new Set(); - traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === undefined) - return; - const fullPath = pathPrefix + jsonPtr; - let innerBaseId = baseIds[parentJsonPtr]; - if (typeof sch[schemaId] == "string") - innerBaseId = addRef.call(this, sch[schemaId]); - addAnchor.call(this, sch.$anchor); - addAnchor.call(this, sch.$dynamicAnchor); - baseIds[jsonPtr] = innerBaseId; - function addRef(ref) { - // eslint-disable-next-line @typescript-eslint/unbound-method - const _resolve = this.opts.uriResolver.resolve; - ref = normalizeId(innerBaseId ? _resolve(innerBaseId, 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 f579194..0000000 --- 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":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,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,a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E,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;YACjC,CAAC;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;AAxDD,sCAwDC"} \ 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 51ec46a..0000000 --- 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 type JSONType = (typeof _jsonTypes)[number]; -export declare function isJSONType(x: unknown): x is JSONType; -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 82a591f..0000000 --- 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 084c70f..0000000 --- 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/util.d.ts b/node_modules/table/node_modules/ajv/dist/compile/util.d.ts deleted file mode 100644 index 1ec282a..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/util.d.ts +++ /dev/null @@ -1,40 +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; -type SomeEvaluated = EvaluatedProperties | EvaluatedItems; -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 useFunc(gen: CodeGen, f: { - code: string; -}): Name; -export declare enum Type { - Num = 0, - Str = 1 -} -export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string; -export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void; -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 73c87c8..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/util.js +++ /dev/null @@ -1,178 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = 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 code_1 = require("./codegen/code"); -// 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.strictSchema) - return; - if (typeof schema === "boolean") - return; - const rules = self.RULES.keywords; - for (const key in schema) { - if (!rules[key]) - 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 (0, codegen_1._) `${schema}`; - } - return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, 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((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => { - gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`)); - }), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => { - if (from === true) { - gen.assign(to, true); - } - else { - gen.assign(to, (0, 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((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, 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", (0, 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((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true)); -} -exports.setEvaluated = setEvaluated; -const snippets = {}; -function useFunc(gen, f) { - return gen.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)), - }); -} -exports.useFunc = useFunc; -var Type; -(function (Type) { - Type[Type["Num"] = 0] = "Num"; - Type[Type["Str"] = 1] = "Str"; -})(Type || (exports.Type = Type = {})); -function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { - // let path - if (dataProp instanceof codegen_1.Name) { - const isNumber = dataPropType === Type.Num; - return jsPropertySyntax - ? isNumber - ? (0, codegen_1._) `"[" + ${dataProp} + "]"` - : (0, codegen_1._) `"['" + ${dataProp} + "']"` - : isNumber - ? (0, codegen_1._) `"/" + ${dataProp}` - : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer - } - return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); -} -exports.getErrorPath = getErrorPath; -function checkStrictMode(it, msg, mode = it.opts.strictSchema) { - if (!mode) - return; - msg = `strict mode: ${msg}`; - if (mode === true) - throw new Error(msg); - it.self.logger.warn(msg); -} -exports.checkStrictMode = checkStrictMode; -//# 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 ee01008..0000000 --- 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;AAC7D,yCAAoC;AAGpC,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,CAAC;AAJD,wBAIC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,MAAiB;IAChE,IAAI,OAAO,MAAM,IAAI,SAAS;QAA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AC,sCAAsC;IAC3G,CAAC;IACD,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAChG,CAAC;AAjBD,oCAiBC;AAED,SAAgB,eAAe,CAC7B,EAAa,EACb,GAAW,EACX,OAAwB,EAAE,CAAC,IAAI,CAAC,YAAY;IAE5C,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,GAAG,GAAG,gBAAgB,GAAG,EAAE,CAAA;IAC3B,IAAI,IAAI,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AATD,0CASC"} \ 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 165d375..0000000 --- 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 6187dbb..0000000 --- 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 450cfe7..0000000 --- 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 0ce7952..0000000 --- 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 8eeb7b5..0000000 --- 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((0, 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, - }; - (0, errors_1.reportError)(cxt, boolError, undefined, 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 b7444a2..0000000 --- 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,CAAC;QACrB,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IAC7B,CAAC;SAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC/D,GAAG,CAAC,MAAM,CAAC,eAAC,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,YAAY,SAAS,EAAE,IAAI,CAAC,CAAA;QAC3C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;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,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA,CAAC,WAAW;QACjC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAC,WAAW;IAClC,CAAC;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,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAC3D,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 91a6194..0000000 --- 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 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 6d03e0d..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js +++ /dev/null @@ -1,203 +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 = 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; -// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -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 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strictNumbers, 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", (0, codegen_1._) `typeof ${data}`); - const coerced = gen.let("coerced", (0, codegen_1._) `undefined`); - if (opts.coerceTypes === "array") { - gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen - .assign(data, (0, codegen_1._) `${data}[0]`) - .assign(dataType, (0, codegen_1._) `typeof ${data}`) - .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); - } - gen.if((0, 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((0, codegen_1._) `${coerced} !== undefined`, () => { - gen.assign(data, coerced); - assignParentData(it, coerced); - }); - function coerceSpecificType(t) { - switch (t) { - case "string": - gen - .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`) - .assign(coerced, (0, codegen_1._) `"" + ${data}`) - .elseIf((0, codegen_1._) `${data} === null`) - .assign(coerced, (0, codegen_1._) `""`); - return; - case "number": - gen - .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})`) - .assign(coerced, (0, codegen_1._) `+${data}`); - return; - case "integer": - gen - .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`) - .assign(coerced, (0, codegen_1._) `+${data}`); - return; - case "boolean": - gen - .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`) - .assign(coerced, false) - .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`) - .assign(coerced, true); - return; - case "null": - gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`); - gen.assign(coerced, null); - return; - case "array": - gen - .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null`) - .assign(coerced, (0, codegen_1._) `[${data}]`); - } - } -} -function assignParentData({ gen, parentData, parentDataProperty }, expr) { - // TODO use gen.property - gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, 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 (0, codegen_1._) `${data} ${EQ} null`; - case "array": - cond = (0, codegen_1._) `Array.isArray(${data})`; - break; - case "object": - cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`; - break; - case "integer": - cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`); - break; - case "number": - cond = numCond(); - break; - default: - return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`; - } - return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); - function numCond(_cond = codegen_1.nil) { - return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, 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 = (0, util_1.toHash)(dataTypes); - if (types.array && types.object) { - const notObj = (0, codegen_1._) `typeof ${data} != "object"`; - cond = types.null ? notObj : (0, 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 = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); - return cond; -} -exports.checkDataTypes = checkDataTypes; -const typeError = { - message: ({ schema }) => `must be ${schema}`, - params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`, -}; -function reportTypeError(it) { - const cxt = getTypeErrorContext(it); - (0, errors_1.reportError)(cxt, typeError); -} -exports.reportTypeError = reportTypeError; -function getTypeErrorContext(it) { - const { gen, data, schema } = it; - const schemaCode = (0, 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 c8fb1c6..0000000 --- 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,wCAAkE;AAClE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,wBAAR,QAAQ,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,CAAC;QACZ,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM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"} \ 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 02ba453..0000000 --- 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 cd9c42d..0000000 --- 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 util_1 = require("../util"); -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 = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`; - if (compositeRule) { - (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); - return; - } - let condition = (0, codegen_1._) `${childData} === undefined`; - if (opts.useDefaults === "empty") { - condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`; - } - // `${childData} === undefined` + - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") - gen.if(condition, (0, codegen_1._) `${childData} = ${(0, 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 88d3672..0000000 --- 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,kCAAuC;AAEvC,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,CAAC;QAClC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC7B,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;SAAM,IAAI,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IACtE,CAAC;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,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,EAAE,CAAA;IAChD,IAAI,aAAa,EAAE,CAAC;QAClB,IAAA,sBAAe,EAAC,EAAE,EAAE,2BAA2B,SAAS,EAAE,CAAC,CAAA;QAC3D,OAAM;IACR,CAAC;IAED,IAAI,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,gBAAgB,CAAA;IAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE,CAAC;QACjC,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,OAAO,SAAS,gBAAgB,SAAS,SAAS,CAAA;IAC7E,CAAC;IACD,iCAAiC;IACjC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,MAAM,IAAA,mBAAS,EAAC,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 6c533ed..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from "../../types"; -import type { SchemaCxt, SchemaObjCxt } from ".."; -import { SubschemaArgs } from "./subschema"; -import { Code, Name, CodeGen } from "../codegen"; -import type { JSONType } from "../rules"; -import { ErrorPaths } from "../errors"; -export declare function validateFunctionCode(it: SchemaCxt): void; -export declare 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; - failResult(condition: Code, successAction?: () => void, failAction?: () => void): void; - pass(condition: Code, failAction?: () => void): void; - fail(condition?: Code): void; - fail$data(condition: Code): void; - error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void; - private _error; - $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/validate/index.js b/node_modules/table/node_modules/ajv/dist/compile/validate/index.js deleted file mode 100644 index 0d68332..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/index.js +++ /dev/null @@ -1,520 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; -const boolSchema_1 = require("./boolSchema"); -const dataType_1 = require("./dataType"); -const applicability_1 = require("./applicability"); -const dataType_2 = require("./dataType"); -const defaults_1 = require("./defaults"); -const keyword_1 = require("./keyword"); -const subschema_1 = require("./subschema"); -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const resolve_1 = require("../resolve"); -const util_1 = require("../util"); -const errors_1 = require("../errors"); -// 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, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); -} -exports.validateFunctionCode = validateFunctionCode; -function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { - if (opts.code.es5) { - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { - gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`); - destructureValCxtES5(gen, opts); - gen.code(body); - }); - } - else { - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); - } -} -function destructureValCxt(opts) { - return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; -} -function destructureValCxtES5(gen, opts) { - gen.if(names_1.default.valCxt, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`); - gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); - gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); - }, () => { - gen.var(names_1.default.instancePath, (0, codegen_1._) `""`); - gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`); - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`); - gen.var(names_1.default.rootData, names_1.default.data); - if (opts.dynamicRef) - gen.var(names_1.default.dynamicAnchors, (0, 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", (0, codegen_1._) `${validateName}.evaluated`); - gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`)); - gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`)); -} -function funcSourceUrl(schema, opts) { - const schId = typeof schema == "object" && schema[opts.schemaId]; - return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : 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; - } - } - (0, boolSchema_1.boolOrEmptySchema)(it, valid); -} -function schemaCxtHasRules({ schema, self }) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (self.RULES.all[key]) - return true; - return false; -} -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); - checkAsyncSchema(it); - const errsCount = gen.const("_errs", names_1.default.errors); - typeAndKeywords(it, errsCount); - // TODO var - gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); -} -function checkKeywords(it) { - (0, util_1.checkUnknownRules)(it); - checkRefsAndKeywords(it); -} -function typeAndKeywords(it, errsCount) { - if (it.opts.jtd) - return schemaKeywords(it, [], false, errsCount); - const types = (0, dataType_1.getSchemaTypes)(it.schema); - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); - schemaKeywords(it, types, !checkedTypes, errsCount); -} -function checkRefsAndKeywords(it) { - const { schema, errSchemaPath, opts, self } = it; - if (schema.$ref && opts.ignoreKeywordsWithRef && (0, 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.strictSchema) { - (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); - } -} -function updateContext(it) { - const schId = it.schema[it.opts.schemaId]; - if (schId) - it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); -} -function checkAsyncSchema(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((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`); - } - else if (typeof opts.$comment == "function") { - const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`; - const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); - gen.code((0, 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((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`)); - } - else { - gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors); - if (opts.unevaluated) - assignEvaluated(it); - gen.return((0, codegen_1._) `${names_1.default.errors} === 0`); - } -} -function assignEvaluated({ gen, evaluated, props, items }) { - if (props instanceof codegen_1.Name) - gen.assign((0, codegen_1._) `${evaluated}.props`, props); - if (items instanceof codegen_1.Name) - gen.assign((0, codegen_1._) `${evaluated}.items`, items); -} -function schemaKeywords(it, types, typeErrors, errsCount) { - const { gen, schema, data, allErrors, opts, self } = it; - const { RULES } = self; - if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { - gen.block(() => 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 (!(0, applicability_1.shouldUseGroup)(schema, group)) - return; - if (group.type) { - gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); - iterateKeywords(it, group); - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen.else(); - (0, dataType_2.reportTypeError)(it); - } - gen.endIf(); - } - else { - iterateKeywords(it, group); - } - // TODO make it "ok" call? - if (!allErrors) - gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`); - } -} -function iterateKeywords(it, group) { - const { gen, schema, opts: { useDefaults }, } = it; - if (useDefaults) - (0, defaults_1.assignDefaults)(it, group.type); - gen.block(() => { - for (const rule of group.rules) { - if ((0, applicability_1.shouldUseRule)(schema, rule)) { - 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(",")}"`); - } - }); - narrowSchemaTypes(it, types); -} -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" && (0, 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 narrowSchemaTypes(it, withTypes) { - const ts = []; - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) - ts.push(t); - else if (withTypes.includes("integer") && t === "number") - ts.push("integer"); - } - it.dataTypes = ts; -} -function strictTypesError(it, msg) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - msg += ` at "${schemaPath}" (strictTypes)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); -} -class KeywordCxt { - constructor(it, def, keyword) { - (0, keyword_1.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 = (0, 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 (!(0, keyword_1.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.failResult((0, codegen_1.not)(condition), successAction, failAction); - } - failResult(condition, successAction, failAction) { - this.gen.if(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.failResult((0, codegen_1.not)(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((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); - } - error(append, errorParams, errorPaths) { - if (errorParams) { - this.setParams(errorParams); - this._error(append, errorPaths); - this.setParams({}); - return; - } - this._error(append, errorPaths); - } - _error(append, errorPaths) { - ; - (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); - } - $dataError() { - (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); - } - reset() { - if (this.errsCount === undefined) - throw new Error('add "trackErrors" to keyword definition'); - (0, 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((0, codegen_1.or)((0, 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 (0, 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 (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.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 (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`; - } - return codegen_1.nil; - } - } - subschema(appl, valid) { - const subschema = (0, subschema_1.getSubschema)(this.it, appl); - (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); - (0, subschema_1.extendSubschemaMode)(subschema, appl); - const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; - subschemaCode(nextContext, valid); - return nextContext; - } - 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.KeywordCxt = KeywordCxt; -function keywordCode(it, keyword, def, ruleType) { - const cxt = new KeywordCxt(it, def, keyword); - if ("code" in def) { - def.code(cxt, ruleType); - } - else if (cxt.$data && def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } - else if ("macro" in def) { - (0, keyword_1.macroKeywordCode)(cxt, def); - } - else if (def.compile || def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } -} -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 = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; - expr = (0, 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=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 cdf5854..0000000 --- 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":";;;AASA,6CAAoE;AACpE,yCAAiE;AACjE,mDAA6D;AAC7D,yCAAmF;AACnF,yCAAyC;AACzC,uCAAkG;AAClG,2CAAiG;AACjG,wCAAwF;AACxF,oCAAwB;AACxB,wCAAqC;AACrC,kCAOgB;AAEhB,sCAMkB;AAElB,mGAAmG;AACnG,SAAgB,oBAAoB,CAAC,EAAa;IAChD,IAAI,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC;QACpB,aAAa,CAAC,EAAE,CAAC,CAAA;QACjB,IAAI,iBAAi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GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,IAAI,EAAE,CAAA;QAC9B,CAAC;IACH,CAAC;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/validate/keyword.d.ts b/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts deleted file mode 100644 index d15cee8..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { KeywordCxt } from "."; -import type { AddedKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition } from "../../types"; -import type { SchemaObjCxt } from ".."; -import type { JSONType } from "../rules"; -export declare function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void; -export declare function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void; -export declare function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined?: boolean): boolean; -export declare function validateKeywordUsage({ schema, opts, self, errSchemaPath }: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string): 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 1109d3a..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; -const codegen_1 = require("../codegen"); -const names_1 = require("../names"); -const code_1 = require("../../vocabularies/code"); -const errors_1 = require("../errors"); -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)); -} -exports.macroKeywordCode = macroKeywordCode; -function funcKeywordCode(cxt, def) { - var _a; - const { gen, keyword, schema, parentSchema, $data, it } = cxt; - checkAsyncKeyword(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((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e))); - return ruleErrs; - } - function validateSync() { - const validateErrs = (0, codegen_1._) `${validateRef}.errors`; - gen.assign(validateErrs, null); - assignValid(codegen_1.nil); - return validateErrs; - } - function assignValid(_await = def.async ? (0, 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, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); - } - function reportErrs(errors) { - var _a; - gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); - } -} -exports.funcKeywordCode = funcKeywordCode; -function modifyData(cxt) { - const { gen, data, it } = cxt; - gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`)); -} -function addErrs(cxt, errs) { - const { gen } = cxt; - gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => { - gen - .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`) - .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`); - (0, errors_1.extendErrors)(cxt); - }, () => cxt.error()); -} -function checkAsyncKeyword({ 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: (0, codegen_1.stringify)(result) }); -} -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"))); -} -exports.validSchemaType = validSchemaType; -function validateKeywordUsage({ schema, opts, self, errSchemaPath }, 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 "${keyword}" value is invalid at path "${errSchemaPath}": ` + - self.errorsText(def.validateSchema.errors); - if (opts.validateSchema === "log") - self.logger.error(msg); - else - throw new Error(msg); - } - } -} -exports.validateKeywordUsage = validateKeywordUsage; -//# 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 ad1d1b9..0000000 --- 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,wCAAsE;AACtE,oCAAwB;AAExB,kDAAwD;AACxD,sCAAsC;AAItC,SAAgB,gBAAgB,CAAC,GAAe,EAAE,GAA2B;IAC3E,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpD,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC,CAAA;IACrE,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;IACvD,IAAI,EAAE,CAAC,IAAI,CAAC,cAAc,KAAK,KAAK;QAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAE/E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,GAAG,CAAC,SAAS,CACX;QACE,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,aAAG;QACf,aAAa,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,OAAO,EAAE;QAC/C,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE,IAAI;KACpB,EACD,KAAK,CACN,CAAA;IACD,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,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ts b/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.d.ts deleted file mode 100644 index b92785f..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { AnySchema } from "../../types"; -import type { SchemaObjCxt } from ".."; -import { Code, Name } from "../codegen"; -import { Type } from "../util"; -import type { JSONType } from "../rules"; -export interface SubschemaContext { - 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 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 getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext; -export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void; -export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void; diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js b/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js deleted file mode 100644 index 9de2828..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; -const codegen_1 = require("../codegen"); -const util_1 = require("../util"); -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: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - } - : { - schema: sch[schemaProp], - schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, 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'); -} -exports.getSubschema = getSubschema; -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", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); - dataContextProps(nextData); - subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; - subschema.parentDataProperty = (0, 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]; - } -} -exports.extendSubschemaData = extendSubschemaData; -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 -} -exports.extendSubschemaMode = extendSubschemaMode; -//# sourceMappingURL=subschema.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js.map b/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js.map deleted file mode 100644 index e4f903f..0000000 --- a/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subschema.js","sourceRoot":"","sources":["../../../lib/compile/validate/subschema.ts"],"names":[],"mappings":";;;AAEA,wCAA0D;AAC1D,kCAA0D;AA6C1D,SAAgB,YAAY,CAC1B,EAAgB,EAChB,EAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAgB;IAErF,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,OA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,CAAC,SAAS,GAAG,EAAE,CAAA;QACxB,EAAE,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAA;QACxC,SAAS,CAAC,UAAU,GAAG,EAAE,CAAC,IAAI,CAAA;QAC9B,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IACpD,CAAC;AACH,CAAC;AArCD,kDAqCC;AAED,SAAgB,mBAAmB,CACjC,SAA2B,EAC3B,EAAC,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAgB;IAEtF,IAAI,aAAa,KAAK,SAAS;QAAE,SAAS,CAAC,aAAa,GAAG,aAAa,CAAA;IACxE,IAAI,YAAY,KAAK,SAAS;QAAE,SAAS,CAAC,YAAY,GAAG,YAAY,CAAA;IACrE,IAAI,SAAS,KAAK,SAAS;QAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5D,SAAS,CAAC,gBAAgB,GAAG,gBAAgB,CAAA,CAAC,gBAAgB;IAC9D,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA,CAAC,gBAAgB;AACtD,CAAC;AATD,kDASC"} \ 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 4591ed9..0000000 --- a/node_modules/table/node_modules/ajv/dist/core.d.ts +++ /dev/null @@ -1,173 +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; -} -export { KeywordCxt } from "./compile/validate"; -export { DefinedError } from "./vocabularies/errors"; -export { JSONType } from "./compile/rules"; -export { JSONSchemaType } from "./types/json-schema"; -export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } 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, RegExpEngine, UriResolver } from "./types"; -import type { JSONSchemaType } from "./types/json-schema"; -import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -import ValidationError from "./runtime/validation_error"; -import MissingRefError from "./compile/ref_error"; -import { ValidationRules } from "./compile/rules"; -import { SchemaEnv } from "./compile"; -import { Code, ValueScope } from "./compile/codegen"; -export type Options = CurrentOptions & DeprecatedOptions; -export interface CurrentOptions { - strict?: boolean | "log"; - strictSchema?: boolean | "log"; - strictNumbers?: boolean | "log"; - strictTypes?: boolean | "log"; - strictTuples?: boolean | "log"; - strictRequired?: boolean | "log"; - allowMatchingProperties?: boolean; - allowUnionTypes?: boolean; - validateFormats?: boolean; - $data?: boolean; - allErrors?: boolean; - verbose?: boolean; - discriminator?: boolean; - unicodeRegExp?: boolean; - timestamp?: "string" | "date"; - parseDate?: boolean; - allowDate?: 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; - schemaId?: "id" | "$id"; - 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; - int32range?: boolean; - messages?: boolean; - code?: CodeOptions; - uriResolver?: UriResolver; -} -export interface CodeOptions { - es5?: boolean; - esm?: boolean; - lines?: boolean; - optimize?: boolean | number; - formats?: Code; - source?: boolean; - process?: (code: string, schema?: SchemaEnv) => string; - regExp?: RegExpEngine; -} -interface InstanceCodeOptions extends CodeOptions { - regExp: RegExpEngine; - optimize: number; -} -interface DeprecatedOptions { - /** @deprecated */ - ignoreKeywordsWithRef?: boolean; - /** @deprecated */ - jsPropertySyntax?: boolean; - /** @deprecated */ - unicode?: boolean; -} -type RequiredInstanceOptions = { - [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable; -} & { - code: InstanceCodeOptions; -}; -export 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: T, data: unknown): data is JTDDataType; - 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: T, _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, baseId?: string, 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 7e30c83..0000000 --- a/node_modules/table/node_modules/ajv/dist/core.js +++ /dev/null @@ -1,618 +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; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -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 validation_error_1 = require("./runtime/validation_error"); -const ref_error_1 = require("./compile/ref_error"); -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 uri_1 = require("./runtime/uri"); -const defaultRegExp = (str, flags) => new RegExp(str, flags); -defaultRegExp.code = "new RegExp"; -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}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "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.", - ajvErrors: "It is default now.", -}; -const deprecatedOptions = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -}; -const MAX_EXPRESSION = 200; -// eslint-disable-next-line complexity -function requiredOptions(o) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; - const s = o.strict; - const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; - const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; - const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; - return { - strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, - strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, - strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", - strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", - strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, - code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, - loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, - loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, - meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, - messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, - inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, - schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", - addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, - validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, - validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, - unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, - int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, - uriResolver: uriResolver, - }; -} -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 = (0, 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, schemaId } = this.opts; - let _dataRefSchema = $dataRefSchema; - if (schemaId === "id") { - _dataRefSchema = { ...$dataRefSchema }; - _dataRefSchema.id = _dataRefSchema.$id; - delete _dataRefSchema.$id; - } - if (meta && $data) - this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); - } - defaultMeta() { - const { meta, schemaId } = this.opts; - return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined); - } - validate(schemaKeyRef, // key, ref or schema object - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents - 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 ref_error_1.default)) - 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") { - const { schemaId } = this.opts; - id = schema[schemaId]; - if (id !== undefined && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`); - } - } - key = (0, resolve_1.normalizeId)(key || id); - this._checkUnique(key); - this.schemas[key] = this._addSchema(schema, _meta, key, _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 { schemaId } = this.opts; - const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); - 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[this.opts.schemaId]; - if (id) { - id = (0, 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) { - (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); - return this; - } - keywordMetaschema.call(this, def); - const definition = { - ...def, - type: (0, dataType_1.getJSONTypes)(def.type), - schemaType: (0, dataType_1.getJSONTypes)(def.schemaType), - }; - (0, 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.instancePath} ${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, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { - let id; - const { schemaId } = this.opts; - if (typeof schema == "object") { - id = schema[schemaId]; - } - else { - 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; - baseId = (0, resolve_1.normalizeId)(id || baseId); - const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); - sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); - this._cache.set(sch.schema, sch); - if (addSchema && !baseId.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (baseId) - this._checkUnique(baseId); - this.refs[baseId] = 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; - } - } -} -Ajv.ValidationError = validation_error_1.default; -Ajv.MissingRefError = ref_error_1.default; -exports.default = Ajv; -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 = (0, 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; - (0, 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: (0, dataType_1.getJSONTypes)(definition.type), - schemaType: (0, 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 3760c3e..0000000 --- a/node_modules/table/node_modules/ajv/dist/core.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"core.js","sourceRoot":"","sources":["../lib/core.ts"],"names":[],"mappings":";;;AA4BA,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAKlB,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;AAsBnD,iEAAwD;AACxD,mDAAiD;AACjD,2CAAoF;AACpF,uCAAiE;AACjE,+CAAkD;AAClD,+CAA4D;AAC5D,0DAAwD;AACxD,yCAAuC;AACvC,mDAAkD;AAElD,uCAA8C;AAE9C,MAAM,aAAa,GAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAC1E,aAAa,CAAC,IAAI,GA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C,IAAI,CAAC,KAAK;QAAE,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,CAAA;IACvE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,gFAAgF;CACvF,CAAA;AAED,SAAS,YAAY,CAAC,MAAiB;IACrC,OAAO,EAAC,KAAK,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,CAAA;AACpC,CAAC"} \ No newline 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 a079ba4..0000000 --- a/node_modules/table/node_modules/ajv/dist/jtd.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { AnySchemaObject, SchemaObject, JTDParser } from "./types"; -import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema"; -import AjvCore, { CurrentOptions } from "./core"; -type JTDOptions = CurrentOptions & { - strict?: never; - allowMatchingProperties?: never; - allowUnionTypes?: never; - validateFormats?: never; - $data?: never; - verbose?: boolean; - $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; -}; -export declare 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; -} -export default Ajv; -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"; -export { KeywordCxt } from "./compile/validate"; -export { JTDErrorObject } from "./vocabularies/jtd"; -export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen"; -export { JTDSchemaType, SomeJTDSchemaType, JTDDataType }; -export { JTDOptions }; -export { default as ValidationError } from "./runtime/validation_error"; -export { default as MissingRefError } from "./compile/ref_error"; 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 1a3baaf..0000000 --- a/node_modules/table/node_modules/ajv/dist/jtd.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; -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_SCHEMA_ID = "JTD-meta-schema"; -class Ajv extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - jtd: true, - }); - } - _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.Ajv = Ajv; -module.exports = exports = Ajv; -module.exports.Ajv = Ajv; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = Ajv; -var validate_1 = require("./compile/validate"); -Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } }); -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; } }); -var validation_error_1 = require("./runtime/validation_error"); -Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } }); -var ref_error_1 = require("./compile/ref_error"); -Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -//# 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 6bf9f3b..0000000 --- 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"],"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AAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAG,GAAG,CAAC,MAA0B,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;QACpF,wBAAwB;QACxB,IAAI,CAAC,GAAG,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QAC/D,OAAO,GAAG,CAAC,SAAS,CAAA;IACtB,CAAC;IAEO,cAAc,CAAC,GAAc;QACnC,eAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAG,GAAG,CAAC,MAA0B,CAAC,WAAW,IAAI,EAAE,CAAC,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;AAvDD,kBAuDC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;AACxB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAElB,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;AAInD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"} \ 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 9ffc9f5..0000000 --- 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 cf00833..0000000 --- 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 e864962..0000000 --- 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 applicator = require("./meta/applicator.json"); -const content = require("./meta/content.json"); -const core = require("./meta/core.json"); -const format = require("./meta/format.json"); -const metadata = require("./meta/meta-data.json"); -const validation = require("./meta/validation.json"); -const META_SUPPORT_DATA = ["/properties"]; -function addMetaSchema2019($data) { - ; - [ - metaSchema, - applicator, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].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 9b8a36d..0000000 --- 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,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,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 c5e91cf..0000000 --- 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 b8f6373..0000000 --- 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 f71adbf..0000000 --- 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 03ccfce..0000000 --- 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 0e19432..0000000 --- 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 7027a12..0000000 --- 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 54eb715..0000000 --- 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-2020-12/index.d.ts b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts deleted file mode 100644 index c232ab0..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type Ajv from "../../core"; -export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv; diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js deleted file mode 100644 index d925675..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const metaSchema = require("./schema.json"); -const applicator = require("./meta/applicator.json"); -const unevaluated = require("./meta/unevaluated.json"); -const content = require("./meta/content.json"); -const core = require("./meta/core.json"); -const format = require("./meta/format-annotation.json"); -const metadata = require("./meta/meta-data.json"); -const validation = require("./meta/validation.json"); -const META_SUPPORT_DATA = ["/properties"]; -function addMetaSchema2020($data) { - ; - [ - metaSchema, - applicator, - unevaluated, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].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 = addMetaSchema2020; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map deleted file mode 100644 index eb90027..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,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;AAhBD,oCAgBC"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json deleted file mode 100644 index 674c913..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/applicator": true - }, - "$dynamicAnchor": "meta", - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "prefixItems": {"$ref": "#/$defs/schemaArray"}, - "items": {"$dynamicRef": "#meta"}, - "contains": {"$dynamicRef": "#meta"}, - "additionalProperties": {"$dynamicRef": "#meta"}, - "properties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "propertyNames": {"$dynamicRef": "#meta"}, - "if": {"$dynamicRef": "#meta"}, - "then": {"$dynamicRef": "#meta"}, - "else": {"$dynamicRef": "#meta"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$dynamicRef": "#meta"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$dynamicRef": "#meta"} - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json deleted file mode 100644 index 2ae23dd..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentEncoding": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentSchema": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json deleted file mode 100644 index 4c8e5cb..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true - }, - "$dynamicAnchor": "meta", - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "$ref": "#/$defs/uriReferenceString", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": {"$ref": "#/$defs/uriString"}, - "$ref": {"$ref": "#/$defs/uriReferenceString"}, - "$anchor": {"$ref": "#/$defs/anchorString"}, - "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, - "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, - "$vocabulary": { - "type": "object", - "propertyNames": {"$ref": "#/$defs/uriString"}, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"} - } - }, - "$defs": { - "anchorString": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, - "uriString": { - "type": "string", - "format": "uri" - }, - "uriReferenceString": { - "type": "string", - "format": "uri-reference" - } - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json deleted file mode 100644 index 83c26e3..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true - }, - "$dynamicAnchor": "meta", - - "title": "Format vocabulary meta-schema for annotation results", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json deleted file mode 100644 index 11946fb..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/meta-data": true - }, - "$dynamicAnchor": "meta", - - "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-2020-12/meta/unevaluated.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json deleted file mode 100644 index 5e4b203..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true - }, - "$dynamicAnchor": "meta", - - "title": "Unevaluated applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "unevaluatedItems": {"$dynamicRef": "#meta"}, - "unevaluatedProperties": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json deleted file mode 100644 index e0ae13d..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/validation": true - }, - "$dynamicAnchor": "meta", - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "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" - } - } - }, - "$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-2020-12/schema.json b/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json deleted file mode 100644 index 1c68270..0000000 --- a/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/schema", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true, - "https://json-schema.org/draft/2020-12/vocab/applicator": true, - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, - "https://json-schema.org/draft/2020-12/vocab/validation": true, - "https://json-schema.org/draft/2020-12/vocab/meta-data": true, - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/unevaluated"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format-annotation"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", - "properties": { - "definitions": { - "$comment": "\"definitions\" has been replaced by \"$defs\".", - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "deprecated": true, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", - "type": "object", - "additionalProperties": { - "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] - }, - "deprecated": true, - "default": {} - }, - "$recursiveAnchor": { - "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", - "$ref": "meta/core#/$defs/anchorString", - "deprecated": true - }, - "$recursiveRef": { - "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", - "$ref": "meta/core#/$defs/uriReferenceString", - "deprecated": true - } - } -} 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 5410064..0000000 --- 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 6a74851..0000000 --- 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 3968abd..0000000 --- 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 932797a..0000000 --- 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 1ee940a..0000000 --- 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 d46755b..0000000 --- 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,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,OAAO,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrC,UAAU,EAAE;QACV,GAAG,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KACtB;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,QAAQ,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACtC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,SAAS;gBACT,WAAW;gBACX,QAAQ;gBACR,SAAS;gBACT,SAAS;gBAC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BAAiB,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC/C,UAAU,EAAE;QACV,aAAa,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC/B,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,QAAQ,EAAE;oBACR,KAAK,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC;iBAC9D;aACF;SACF;KACF;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,UAAU,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACxC,UAAU,EAAE;QACV,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC;KACxB;IACD,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC;CACjC,CAAC,CAAA;AAEF,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpC,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,SAAS;YACT,OAAO;YACP,QAAQ;YACR,QAAQ;YACR,YAAY;YACZ,cAAc;YACd,sBAAsB;YACtB,iBAAiB;YACjB,UAAU;SACX,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,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/equal.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/equal.d.ts deleted file mode 100644 index 777cae2..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/equal.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as equal from "fast-deep-equal"; -type Equal = typeof equal & { - code: string; -}; -declare const _default: Equal; -export default _default; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/equal.js b/node_modules/table/node_modules/ajv/dist/runtime/equal.js deleted file mode 100644 index 774bba0..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/equal.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// https://github.com/ajv-validator/ajv/issues/889 -const equal = require("fast-deep-equal"); -equal.code = 'require("ajv/dist/runtime/equal").default'; -exports.default = equal; -//# sourceMappingURL=equal.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/equal.js.map b/node_modules/table/node_modules/ajv/dist/runtime/equal.js.map deleted file mode 100644 index 0e17901..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/equal.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/runtime/equal.ts"],"names":[],"mappings":";;AAAA,kDAAkD;AAClD,yCAAwC;AAGtC,KAAe,CAAC,IAAI,GAAG,2CAA2C,CAAA;AAEpE,kBAAe,KAAc,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 85f1d56..0000000 --- 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: string; -} -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: string; -} -export declare function parseJsonString(s: string, pos: number): string | undefined; -export declare namespace parseJsonString { - var message: string | undefined; - var position: number; - var code: string; -} 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 eaa2838..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js +++ /dev/null @@ -1,185 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0; -const rxParseJson = /position\s(\d+)(?: \(line \d+ column \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 = '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 = '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]; - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (c === undefined) { - errorMessage("unexpected end"); - return undefined; - } - c = c.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 { - errorMessage(`unexpected token ${c}`); - return undefined; - } - pos++; - } - str += String.fromCharCode(code); - } - else { - errorMessage(`unexpected token ${c}`); - return undefined; - } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - } - 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 = '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 7c125f8..0000000 --- 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,MAAM,WAAW,GAAG,+CAA+C,CAAA;AAEnE,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,CAAC;QACH,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,CAAC,CAAC,MAAM,CAAA;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,GAAG,WAAW,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,SAAS,CAAC,OAAO,GAAG,gBAAgB,CAAA;YACpC,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QACpB,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QACtB,SAAS,CAAC,QAAQ,GAAG,GAAG,GAAG,MAAM,CAAA;QACjC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACtB,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,SAAS,CAAC,OAAO,GAAG,oBAAoB,CAAC,EAAE,CAAA;YAC3C,OAAO,SA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H,CAAC;AA7DD,0CA6DC;AAED,eAAe,CAAC,OAAO,GAAG,SAA+B,CAAA;AACzD,eAAe,CAAC,QAAQ,GAAG,CAAW,CAAA;AACtC,eAAe,CAAC,IAAI,GAAG,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 0579dd3..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/quote.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function quote(s: string): string; -declare namespace quote { - var code: string; -} -export default quote; 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 ebf78f7..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/quote.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const rxEscapable = -// eslint-disable-next-line no-control-regex, no-misleading-character-class -/[\\"\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; -quote.code = 'require("ajv/dist/runtime/quote").default'; -//# 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 4d22625..0000000 --- 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,MAAM,WAAW;AACf,2EAA2E;AAC3E,iIAAiI,CAAA;AAEnI,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;AAED,KAAK,CAAC,IAAI,GAAG,2CAA2C,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/re2.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/re2.d.ts deleted file mode 100644 index c34a98f..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/re2.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as re2 from "re2"; -type Re2 = typeof re2 & { - code: string; -}; -declare const _default: Re2; -export default _default; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/re2.js b/node_modules/table/node_modules/ajv/dist/runtime/re2.js deleted file mode 100644 index 4b1ee25..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/re2.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const re2 = require("re2"); -re2.code = 'require("ajv/dist/runtime/re2").default'; -exports.default = re2; -//# sourceMappingURL=re2.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/re2.js.map b/node_modules/table/node_modules/ajv/dist/runtime/re2.js.map deleted file mode 100644 index bb938a2..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/re2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/timestamp.d.ts deleted file mode 100644 index cd48326..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function validTimestamp(str: string, allowDate: boolean): boolean; -declare namespace validTimestamp { - var code: string; -} -export default validTimestamp; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js b/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js deleted file mode 100644 index 5e0f065..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const DT_SEPARATOR = /t|\s/i; -const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; -const TIME = /^(\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, allowDate) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const dt = str.split(DT_SEPARATOR); - return ((dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || - (allowDate && dt.length === 1 && validDate(dt[0]))); -} -exports.default = validTimestamp; -function validDate(str) { - const matches = DATE.exec(str); - if (!matches) - return false; - const y = +matches[1]; - const m = +matches[2]; - const d = +matches[3]; - 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)))); -} -function validTime(str) { - const matches = TIME.exec(str); - if (!matches) - return false; - const hr = +matches[1]; - const min = +matches[2]; - const sec = +matches[3]; - const tzH = +(matches[4] || 0); - const tzM = +(matches[5] || 0); - return ((hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60)); -} -validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'; -//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js.map b/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js.map deleted file mode 100644 index 6b0eee0..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/runtime/timestamp.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,IAAI,GAAG,gEAAgE,CAAA;AAC7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EA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ED,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAC1B,MAAM,EAAE,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,GAAG,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,MAAM,GAAG,GAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACtC,MAAM,GAAG,GAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IACtC,OAAO,CACL,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;QACpC,cAAc;QACd,CAAC,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,GAAG,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,CAAC,CACpD,CAAA;AACH,CAAC;AAED,cAAc,CAAC,IAAI,GAAG,+CAA+C,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.d.ts deleted file mode 100644 index ecbee69..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare function ucs2length(str: string): number; -declare namespace ucs2length { - var code: string; -} -export default ucs2length; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js b/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js deleted file mode 100644 index 92ea0c0..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js +++ /dev/null @@ -1,24 +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; -ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; -//# sourceMappingURL=ucs2length.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js.map b/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js.map deleted file mode 100644 index a5ceb6b..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/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,CAAC;QACjB,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,CAAC;YACpD,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;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts deleted file mode 100644 index 8e9e079..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as uri from "fast-uri"; -type URI = typeof uri & { - code: string; -}; -declare const _default: URI; -export default _default; diff --git a/node_modules/table/node_modules/ajv/dist/runtime/uri.js b/node_modules/table/node_modules/ajv/dist/runtime/uri.js deleted file mode 100644 index bbd2f05..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/uri.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const uri = require("fast-uri"); -uri.code = 'require("ajv/dist/runtime/uri").default'; -exports.default = uri; -//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/uri.js.map b/node_modules/table/node_modules/ajv/dist/runtime/uri.js.map deleted file mode 100644 index 3f80a4c..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/uri.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../lib/runtime/uri.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAG7B,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.d.ts b/node_modules/table/node_modules/ajv/dist/runtime/validation_error.d.ts deleted file mode 100644 index b0ee969..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { ErrorObject } from "../types"; -export default class ValidationError extends Error { - readonly errors: Partial[]; - readonly ajv: true; - readonly validation: true; - constructor(errors: Partial[]); -} diff --git a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js b/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js deleted file mode 100644 index 353502c..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -class ValidationError extends Error { - constructor(errors) { - super("validation failed"); - this.errors = errors; - this.ajv = this.validation = true; - } -} -exports.default = ValidationError; -//# sourceMappingURL=validation_error.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js.map b/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js.map deleted file mode 100644 index 70206fb..0000000 --- a/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../lib/runtime/validation_error.ts"],"names":[],"mappings":";;AAEA,MAAqB,eAAgB,SAAQ,KAAK;IAKhD,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,kCAUC"} \ 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 a9141c3..0000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type AjvCore from "../core"; -import type { AnyValidateFunction } from "../types"; -declare function standaloneCode(ajv: AjvCore, refsOrFunc?: { - [K in string]?: string; -} | AnyValidateFunction): string; -export default standaloneCode; 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 b44bb5d..0000000 --- a/node_modules/table/node_modules/ajv/dist/standalone/index.js +++ /dev/null @@ -1,90 +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); - if (ajv.opts.code.esm) { - // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value - return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`; - } - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; - } - function multiExportsCode(schemas, getValidateFunc) { - var _a; - const usedValues = {}; - let code = (0, code_1._) `"use strict";`; - for (const name in schemas) { - const v = getValidateFunc(schemas[name]); - if (v) { - const vCode = validateCode(usedValues, v.source); - const exportSyntax = ajv.opts.code.esm - ? (0, code_1._) `export const ${(0, code_1.getEsmExportName)(name)}` - : (0, code_1._) `exports${(0, code_1.getProperty)(name)}`; - code = (0, code_1._) `${code}${_n}${exportSyntax} = ${(_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 ? (0, 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 = (0, 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 (0, 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); - } - } -} -module.exports = exports = standaloneCode; -Object.defineProperty(exports, "__esModule", { value: true }); -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 8551fe9..0000000 --- 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,kDAA0F;AAE1F,SAAS,cAAc,CACrB,GAAY,EACZ,UAA2D;IAE3D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAA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BAAE,OAAO,OAAO,CAAA;gBACtE,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,CAAC,CAAA;gBACxD,OAAO,IAAA,QAAC,EAAA,GAAG,OAAO,GAAG,EAAE,GAAG,KAAK,EAAE,CAAA;YACnC,CAAC;YACD,OAAO,SAAS,CAAA;QAClB,CAAC;QAED,SAAS,SAAS,CAAC,IAAoB;;YACrC,OAAO,MAAA,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3C,CAAC;QAED,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;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"} \ 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 156ac32..0000000 --- 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 35e5c99..0000000 --- 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((0, _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 6ac33b1..0000000 --- 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,IAAA,UAAc,EAAC,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 49903cd..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/index.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -import { URIComponent } from "fast-uri"; -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/validate"; -import type Ajv from "../core"; -interface _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - [x: string]: any; -} -export interface SchemaObject extends _SchemaObject { - id?: string; - $id?: string; - $schema?: string; - $async?: false; - [x: string]: any; -} -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 { - instancePath: 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 type EvaluatedProperties = { - [K in string]?: true; -} | true; -export 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 type AnyValidateFunction = ValidateFunction | AsyncValidateFunction; -export interface ErrorObject, S = unknown> { - keyword: K; - instancePath: string; - schemaPath: string; - params: P; - propertyName?: string; - message?: string; - schema?: S; - parentSchema?: AnySchemaObject; - data?: unknown; -} -export 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 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?: boolean; - 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) => string | 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; - 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; -export interface RegExpEngine { - (pattern: string, u: string): RegExpLike; - code: string; -} -export interface RegExpLike { - test: (s: string) => boolean; -} -export interface UriResolver { - parse(uri: string): URIComponent; - resolve(base: string, path: string): string; - serialize(component: URIComponent): string; -} -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/index.js b/node_modules/table/node_modules/ajv/dist/types/index.js deleted file mode 100644 index aa219d8..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=index.js.map \ No newline at end of file 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 1f80f85..0000000 --- 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 a391fef..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -type StrictNullChecksWrapper = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type; -type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never; -export type SomeJSONSchema = UncheckedJSONSchemaType; -type UncheckedPartialSchema = Partial>; -export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema>; -type JSONType = IsPartial extends true ? T | undefined : T; -interface NumberKeywords { - minimum?: number; - maximum?: number; - exclusiveMinimum?: number; - exclusiveMaximum?: number; - multipleOf?: number; - format?: string; -} -interface StringKeywords { - minLength?: number; - maxLength?: number; - pattern?: string; - format?: string; -} -type UncheckedJSONSchemaType = (// these two unions allow arbitrary unions of types -{ - anyOf: readonly UncheckedJSONSchemaType[]; -} | { - oneOf: readonly UncheckedJSONSchemaType[]; -} | ({ - type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[]; -} & UnionToIntersection) | ((T extends number ? { - type: JSONType<"number" | "integer", IsPartial>; -} & NumberKeywords : T extends string ? { - type: JSONType<"string", IsPartial>; -} & StringKeywords : T extends boolean ? { - type: JSONType<"boolean", IsPartial>; -} : T extends readonly [any, ...any[]] ? { - type: JSONType<"array", IsPartial>; - items: { - readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable; - } & { - length: T["length"]; - }; - minItems: T["length"]; -} & ({ - maxItems: T["length"]; -} | { - additionalItems: false; -}) : T extends readonly any[] ? { - type: JSONType<"array", IsPartial>; - items: UncheckedJSONSchemaType; - contains?: UncheckedPartialSchema; - minItems?: number; - maxItems?: number; - minContains?: number; - maxContains?: number; - uniqueItems?: true; - additionalItems?: never; -} : T extends Record ? { - type: JSONType<"object", IsPartial>; - additionalProperties?: boolean | UncheckedJSONSchemaType; - unevaluatedProperties?: boolean | UncheckedJSONSchemaType; - properties?: IsPartial extends true ? Partial> : UncheckedPropertiesSchema; - patternProperties?: Record>; - propertyNames?: Omit, "type"> & { - type?: "string"; - }; - dependencies?: { - [K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema; - }; - dependentRequired?: { - [K in keyof T]?: readonly (keyof T)[]; - }; - dependentSchemas?: { - [K in keyof T]?: UncheckedPartialSchema; - }; - minProperties?: number; - maxProperties?: number; -} & (IsPartial extends true ? { - required: readonly (keyof T)[]; -} : [UncheckedRequiredMembers] extends [never] ? { - required?: readonly UncheckedRequiredMembers[]; -} : { - required: readonly UncheckedRequiredMembers[]; -}) : T extends null ? { - type: JSONType<"null", IsPartial>; - nullable: true; -} : never) & { - allOf?: readonly UncheckedPartialSchema[]; - anyOf?: readonly UncheckedPartialSchema[]; - oneOf?: readonly UncheckedPartialSchema[]; - if?: UncheckedPartialSchema; - then?: UncheckedPartialSchema; - else?: UncheckedPartialSchema; - not?: UncheckedPartialSchema; -})) & { - [keyword: string]: any; - $id?: string; - $ref?: string; - $defs?: Record>; - definitions?: Record>; -}; -export type JSONSchemaType = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType>; -type Known = { - [key: string]: Known; -} | [Known, ...Known[]] | Known[] | number | string | boolean | null; -type UncheckedPropertiesSchema = { - [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | { - $ref: string; - }; -}; -export type PropertiesSchema = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema>; -type UncheckedRequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K; -}[keyof T]; -export type RequiredMembers = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers>; -type Nullable = undefined extends T ? { - nullable: true; - const?: null; - enum?: readonly (T | null)[]; - default?: T | null; -} : { - nullable?: false; - const?: T; - enum?: readonly T[]; - default?: T; -}; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/json-schema.js b/node_modules/table/node_modules/ajv/dist/types/json-schema.js deleted file mode 100644 index 2d8f98d..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/json-schema.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=json-schema.js.map \ No newline at end of file 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 ae6b4d0..0000000 --- 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 80ad312..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts +++ /dev/null @@ -1,174 +0,0 @@ -/** numeric strings */ -type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -/** string strings */ -type StringType = "string" | "timestamp"; -/** Generic JTD Schema without inference of the represented type */ -export type SomeJTDSchemaType = (// ref -{ - ref: string; -} | { - type: NumberType | StringType | "boolean"; -} | { - enum: string[]; -} | { - elements: SomeJTDSchemaType; -} | { - values: SomeJTDSchemaType; -} | { - properties: Record; - optionalProperties?: Record; - additionalProperties?: boolean; -} | { - properties?: Record; - optionalProperties: Record; - additionalProperties?: boolean; -} | { - discriminator: string; - mapping: Record; -} | {}) & { - nullable?: boolean; - metadata?: Record; - definitions?: Record; -}; -/** 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) */ -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 : false; -/** true if type is a properties 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; -/** true if type represents an empty record */ -type IsEmptyRecord = [T] extends [Record] ? [T] extends [never] ? false : true : false; -/** 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; -}) | (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 IsEmptyRecord> ? { - properties: Record; - optionalProperties?: Record; -} | { - optionalProperties: Record; -} : true extends IsValues> ? T extends Record ? { - values: JTDSchemaType; -} : never : true extends IsRecord, false> ? ([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, true> ? { - [K in keyof Exclude]-?: Exclude[K] extends string ? { - discriminator: K; - mapping: { - [M in Exclude[K]]: JTDSchemaType ? T : never, K>, D>; - }; - } : never; -}[keyof Exclude] : never) & (null extends T ? { - nullable: true; -} : { - nullable?: false; -}))) & { - metadata?: Record; - definitions?: { - [K in keyof D]: JTDSchemaType; - }; -}; -type JTDDataDef> = // ref -(S extends { - ref: string; -} ? D extends { - [K in S["ref"]]: infer V; -} ? JTDDataDef : never : S extends { - type: NumberType; -} ? number : S extends { - type: "boolean"; -} ? boolean : 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 type JTDDataType = S extends { - definitions: Record; -} ? JTDDataDef : JTDDataDef>; -export {}; diff --git a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js b/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js deleted file mode 100644 index 11338aa..0000000 --- a/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=jtd-schema.js.map \ No newline at end of file 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 add89bd..0000000 --- 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 6075156..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -export type AdditionalItemsError = ErrorObject<"additionalItems", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export declare function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void; -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 608d51e..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +++ /dev/null @@ -1,49 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateAdditionalItems = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, -}; -const def = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt) { - const { parentSchema, it } = cxt; - const { items } = parentSchema; - if (!Array.isArray(items)) { - (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - validateAdditionalItems(cxt, items); - }, -}; -function validateAdditionalItems(cxt, items) { - const { gen, schema, data, keyword, it } = cxt; - it.items = true; - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items.length }); - cxt.pass((0, codegen_1._) `${len} <= ${items.length}`); - } - else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var - gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); - cxt.ok(valid); - } - function validateItems(valid) { - gen.forRange("i", items.length, len, (i) => { - cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); - if (!it.allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - }); - } -} -exports.validateAdditionalItems = validateAdditionalItems; -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 0091d31..0000000 --- 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,6CAA2E;AAI3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,YAAY,EAAE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,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;IAED,SAAS,aAAa,CAAC,KAAW;QAChC,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YACzC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;YACpE,IAAI,CAAC,EAAE,CAAC,SAAS;gBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAnBD,0DAmBC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts deleted file mode 100644 index 74698c7..0000000 --- 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 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 1d3374b..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +++ /dev/null @@ -1,106 +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 util_1 = require("../../compile/util"); -const error = { - message: "must NOT have additional properties", - params: ({ params }) => (0, 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" && (0, util_1.alwaysValidSchema)(it, schema)) - return; - const props = (0, code_1.allSchemaProperties)(parentSchema.properties); - const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); - checkAdditionalProperties(); - cxt.ok((0, 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 = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); - definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); - } - else if (props.length) { - definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`)); - } - else { - definedProp = codegen_1.nil; - } - if (patProps.length) { - definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); - } - return (0, codegen_1.not)(definedProp); - } - function deleteAdditional(key) { - gen.code((0, 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" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.name("valid"); - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false); - gen.if((0, codegen_1.not)(valid), () => { - cxt.reset(); - deleteAdditional(key); - }); - } - else { - applyAdditionalSchema(key, valid); - if (!allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - } - } - function applyAdditionalSchema(key, valid, errors) { - const subschema = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: util_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 649ddae..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"additionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalProperties.ts"],"names":[],"mappings":";;AAOA,kCAAsE;AACtE,mDAAiE;AACjE,+CAAmC;AAEnC,6CAA0E;AAQ1E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,wBAAwB,MAAM,CAAC,kBAAkB,GAAG;CAC5E,CAAA;AAED,MAAM,GAAG,GAAmD;IAC1D,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,cAAc,EAAE,IAAI;IACpB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAG;QACN,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,E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H,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 cde2aa2..0000000 --- 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 1b1ae73..0000000 --- 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 ((0, 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 d119d0e..0000000 --- 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,IAAA,wBAAiB,EAAC,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 61bca56..0000000 --- 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 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 66cfce2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +++ /dev/null @@ -1,12 +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: "must match a 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 537ffcb..0000000 --- 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,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,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 5493e84..0000000 --- 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 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 6c5473f..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js +++ /dev/null @@ -1,95 +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: { min, max } }) => max === undefined - ? (0, codegen_1.str) `must contain at least ${min} valid item(s)` - : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`, - params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, 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", (0, codegen_1._) `${data}.length`); - cxt.setParams({ min, max }); - if (max === undefined && min === 0) { - (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); - return; - } - if (max !== undefined && min > max) { - (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); - cxt.fail(); - return; - } - if ((0, util_1.alwaysValidSchema)(it, schema)) { - let cond = (0, codegen_1._) `${len} >= ${min}`; - if (max !== undefined) - cond = (0, 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 if (min === 0) { - gen.let(valid, true); - if (max !== undefined) - gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount); - } - else { - gen.let(valid, false); - validateItemsWithCount(); - } - cxt.result(valid, () => cxt.reset()); - function validateItemsWithCount() { - const schValid = gen.name("_valid"); - const count = gen.let("count", 0); - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); - } - function validateItems(_valid, block) { - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword: "contains", - dataProp: i, - dataPropType: util_1.Type.Num, - compositeRule: true, - }, _valid); - block(); - }); - } - function checkLimits(count) { - gen.code((0, codegen_1._) `${count}++`); - if (max === undefined) { - gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break()); - } - else { - gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break()); - if (min === 1) - gen.assign(valid, true); - else - gen.if((0, 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 4157928..0000000 --- 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,6CAA2E;AAQ3E,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,IAAA,aAAG,EAAA,yBAAyB,GAAG,gBAAgB;QACjD,CAAC,CAAC,IAAA,aAAG,EAAA,yBAAyB,GAAG,qBAAqB,GAAG,gBAAgB;IAC7E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAAC,EAAE,EAAE,CAC/B,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,iBAAiB,GAAG,kBAAkB,GAAG,GAAG;CAC/F,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UA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AC,CAAC,CAAA;YACnE,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/applicator/dependencies.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts deleted file mode 100644 index 05900e0..0000000 --- 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/validate"; -export type PropertyDependencies = { - [K in string]?: string[]; -}; -export interface DependenciesErrorParams { - property: string; - missingProperty: string; - depsCount: number; - deps: string; -} -export 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 e81f86d..0000000 --- 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 (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`; - }, - params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, 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 = (0, 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) { - (0, code_1.checkReportMissingProp)(cxt, depProp); - } - }); - } - else { - gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); - (0, 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 ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) - continue; - gen.if((0, 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 50d7ca3..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependencies.ts"],"names":[],"mappings":";;;AAQA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAmG;AAmBtF,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,EAAC,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAA;QAChE,OAAO,IAAA,aAAG,EAAA,aAAa,YAAY,IAAI,IAAI,kBAAkB,QAAQ,aAAa,CAAA;IACpF,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAC,EAAC,EAAE,EAAE,CACjE,IAAA,WAAC,EAAA,cAAc,QAAQ;uBACJ,eAAe;iBACrB,SAAS;YACd,IAAI,GAAG,EAAE,2BAA2B;CAC/C,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,aAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;QAClD,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACnC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC;CACF,CAAA;AAED,SAAS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,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;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 cde2aa2..0000000 --- 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 66ef2e8..0000000 --- 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) => (0, 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 17712e6..0000000 --- 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,IAAA,iCAAkB,EAAC,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 8f602e3..0000000 --- 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 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 2c42a3e..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.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 error = { - message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`, - params: ({ params }) => (0, 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) { - (0, util_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((0, 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, (0, codegen_1._) `${keyword}`); - else - cxt.setParams({ ifClause: keyword }); - }; - } - }, -}; -function hasSchema(it, keyword) { - const schema = it.schema[keyword]; - return schema !== undefined && !(0, 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 54efb1d..0000000 --- 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,6CAAqE;AAIrE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,eAAe,MAAM,CAAC,QAAQ,UAAU;IAClE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,CA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,KAAK,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAEtC,SAAS,UAAU;YACjB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAC1B;gBACE,OAAO,EAAE,IAAI;gBACb,aAAa,EAAE,IAAI;gBACnB,YAAY,EAAE,KAAK;gBACnB,SAAS,EAAE,KAAK;aACjB,EACD,QAAQ,CACT,CAAA;YACD,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC;QAED,SAAS,cAAc,CAAC,OAAe,EAAE,QAAe;YACtD,OAAO,GAAG,EAAE;gBACV,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,IAAA,WAAC,EAAA,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,IAAA,wBAAiB,EAAC,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 b9cc5f5..0000000 --- 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 { ItemsError } from "./items2020"; -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"; -export default function getApplicator(draft2020?: boolean): Vocabulary; -export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | 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 cf592f2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const additionalItems_1 = require("./additionalItems"); -const prefixItems_1 = require("./prefixItems"); -const items_1 = require("./items"); -const items2020_1 = require("./items2020"); -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"); -function getApplicator(draft2020 = false) { - const applicator = [ - // any - not_1.default, - anyOf_1.default, - oneOf_1.default, - allOf_1.default, - if_1.default, - thenElse_1.default, - // object - propertyNames_1.default, - additionalProperties_1.default, - dependencies_1.default, - properties_1.default, - patternProperties_1.default, - ]; - // array - if (draft2020) - applicator.push(prefixItems_1.default, items2020_1.default); - else - applicator.push(additionalItems_1.default, items_1.default); - applicator.push(contains_1.default); - return applicator; -} -exports.default = getApplicator; -//# 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 ebcb853..0000000 --- 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,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"} \ 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 8e608ca..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, AnySchema } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -declare const def: CodeKeywordDefinition; -export declare function validateTuple(cxt: KeywordCxt, extraItems: string, schArr?: AnySchema[]): void; -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 26f527b..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateTuple = void 0; -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const def = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt) { - const { schema, it } = cxt; - if (Array.isArray(schema)) - return validateTuple(cxt, "additionalItems", schema); - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - cxt.ok((0, code_1.validateArray)(cxt)); - }, -}; -function validateTuple(cxt, extraItems, schArr = cxt.schema) { - const { gen, parentSchema, data, keyword, it } = cxt; - checkStrictTuple(parentSchema); - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); - } - const valid = gen.name("valid"); - const len = gen.const("len", (0, codegen_1._) `${data}.length`); - schArr.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({ - keyword, - schemaProp: i, - dataProp: i, - }, valid)); - cxt.ok(valid); - }); - function checkStrictTuple(sch) { - const { opts, errSchemaPath } = it; - const l = schArr.length; - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; - (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); - } - } -} -exports.validateTuple = validateTuple; -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 ef55118..0000000 --- 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,6CAAqF;AACrF,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,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,aAAa,CAAC,GAAG,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAA;QAC/E,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IAC5B,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAC3B,GAAe,EACf,UAAkB,EAClB,SAAsB,GAAG,CAAC,MAAM;IAEhC,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAA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Y,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,GAAG,GAAG,IAAI,OAAO,QAAQ,CAAC,oCAAoC,UAAU,4CAA4C,aAAa,GAAG,CAAA;YAC1I,IAAA,sBAAe,EAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAC7C,CAAC;IACH,CAAC;AACH,CAAC;AApCD,sCAoCC;AAED,kBAAe,GAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts deleted file mode 100644 index a2565b2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types"; -export type ItemsError = ErrorObject<"items", { - limit: number; -}, AnySchema>; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js deleted file mode 100644 index f2387d7..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const code_1 = require("../code"); -const additionalItems_1 = require("./additionalItems"); -const error = { - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`, -}; -const def = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error, - code(cxt) { - const { schema, parentSchema, it } = cxt; - const { prefixItems } = parentSchema; - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - if (prefixItems) - (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); - else - cxt.ok((0, code_1.validateArray)(cxt)); - }, -}; -exports.default = def; -//# sourceMappingURL=items2020.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map deleted file mode 100644 index 5034acd..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"items2020.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items2020.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAqC;AACrC,uDAAyD;AAIzD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtC,MAAM,EAAC,WAAW,EAAC,GAAG,YAAY,CAAA;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,IAAI,WAAW;YAAE,IAAA,yCAAuB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IACjC,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/not.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts deleted file mode 100644 index d2f4888..0000000 --- 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 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 89f6fdd..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js +++ /dev/null @@ -1,26 +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 ((0, 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.failResult(valid, () => cxt.reset(), () => cxt.error()); - }, - error: { message: "must 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 d99e6ea..0000000 --- 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,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;QACR,CAAC;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,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,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 1e1d34f..0000000 --- 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 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 441db2a..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +++ /dev/null @@ -1,60 +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: "must match exactly one schema in oneOf", - params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`, -}; -const def = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt) { - const { gen, schema, parentSchema, it } = cxt; - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - if (it.opts.discriminator && parentSchema.discriminator) - return; - 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 ((0, 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((0, codegen_1._) `${schValid} && ${valid}`) - .assign(valid, false) - .assign(passing, (0, 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 13b8bfe..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file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QAED,SAAS,aAAa;YACpB,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;gBAC3C,IAAI,MAA6B,CAAA;gBACjC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC;oBAC/B,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;gBACzB,CAAC;qBAAM,CAAC;oBACN,MAAM,GAAG,GAAG,CAAC,SAAS,CACpB;wBACE,OAAO,EAAE,OAAO;wBAChB,UAAU,EAAE,CAAC;wBACb,aAAa,EAAE,IAAI;qBACpB,EACD,QAAQ,CACT,CAAA;gBACH,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBACV,GAAG;yBACA,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,QAAQ,OAAO,KAAK,EAAE,CAAC;yBAC9B,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;yBACpB,MAAM,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,IAAI,OAAO,KAAK,CAAC,GAAG,CAAC;yBACtC,IAAI,EAAE,CAAA;gBACX,CAAC;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 cde2aa2..0000000 --- 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 48501c6..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const code_1 = require("../code"); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const util_2 = 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 = (0, code_1.allSchemaProperties)(schema); - const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); - if (patterns.length === 0 || - (alwaysValidPatterns.length === patterns.length && - (!it.opts.unevaluated || it.props === true))) { - return; - } - const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; - const valid = gen.name("valid"); - if (it.props !== true && !(it.props instanceof codegen_1.Name)) { - it.props = (0, util_2.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)) { - (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); - } - } - } - function validateProperties(pat) { - gen.forIn("key", data, (key) => { - gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat); - if (!alwaysValid) { - cxt.subschema({ - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: util_2.Type.Str, - }, valid); - } - if (it.opts.unevaluated && props !== true) { - gen.assign((0, codegen_1._) `${props}[${key}]`, true); - } - else if (!alwaysValid && !it.allErrors) { - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) - // or if all properties were evaluated (props === true) - gen.if((0, 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 231b081..0000000 --- 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,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,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,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,K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of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts deleted file mode 100644 index cde2aa2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.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/prefixItems.js b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js deleted file mode 100644 index 727bc23..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const items_1 = require("./items"); -const def = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => (0, items_1.validateTuple)(cxt, "items"), -}; -exports.default = def; -//# sourceMappingURL=prefixItems.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map deleted file mode 100644 index deef718..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"prefixItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/prefixItems.ts"],"names":[],"mappings":";;AACA,mCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,OAAO,CAAC;CAC3C,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 cde2aa2..0000000 --- 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 7347358..0000000 --- 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 validate_1 = require("../../compile/validate"); -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 validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); - } - const allProps = (0, 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, (0, util_1.toHash)(allProps), it.props); - } - const properties = allProps.filter((p) => !(0, 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((0, 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 13cd347..0000000 --- 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,qDAAiD;AACjD,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,EAAE,CAAC;YAC1F,8BAAK,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,EAAE,EAAE,8BAAK,EAAE,sBAAsB,CAAC,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YAChE,EAAE,CAAC,KAAK,GAA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AAC,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 a806da3..0000000 --- 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 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 f387115..0000000 --- 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: "property name must be valid", - params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`, -}; -const def = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt) { - const { gen, schema, data, it } = cxt; - if ((0, 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((0, 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 835b2bb..0000000 --- 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,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAA,wBAAiB,EAAC,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,IAAA,aAAG,EAAC,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 cde2aa2..0000000 --- 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 1ae6390..0000000 --- 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 util_1 = require("../../compile/util"); -const def = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword, parentSchema, it }) { - if (parentSchema.if === undefined) - (0, util_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 2629f4f..0000000 --- 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,6CAAkD;AAElD,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,IAAA,sBAAe,EAAC,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 f914bac..0000000 --- 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/validate"; -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, it: { opts } }: KeywordCxt, 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 8cb8993..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js +++ /dev/null @@ -1,131 +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 names_1 = require("../compile/names"); -const util_2 = require("../compile/util"); -function checkReportMissingProp(cxt, prop) { - const { gen, data, it } = cxt; - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { - cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true); - cxt.error(); - }); -} -exports.checkReportMissingProp = checkReportMissingProp; -function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { - return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, 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: (0, codegen_1._) `Object.prototype.hasOwnProperty`, - }); -} -exports.hasPropFunc = hasPropFunc; -function isOwnProperty(gen, data, property) { - return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`; -} -exports.isOwnProperty = isOwnProperty; -function propertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`; - return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond; -} -exports.propertyInData = propertyInData; -function noPropertyInData(gen, data, property, ownProperties) { - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`; - return ownProperties ? (0, codegen_1.or)(cond, (0, 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) => !(0, 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 ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; - const valCxt = [ - [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, 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 = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`; - return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`; -} -exports.callValidateCode = callValidateCode; -const newRegExp = (0, codegen_1._) `new RegExp`; -function usePattern({ gen, it: { opts } }, pattern) { - const u = opts.unicodeRegExp ? "u" : ""; - const { regExp } = opts.code; - const rx = regExp(pattern, u); - return gen.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, 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", (0, codegen_1._) `${data}.length`); - gen.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword, - dataProp: i, - dataPropType: util_1.Type.Num, - }, valid); - gen.if((0, 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) => (0, 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, (0, 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((0, 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 ef06de2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/code.js.map +++ /dev/null @@ -1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,CAAC,WAAW;QAAE,OAAM;IAE/C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACrC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEnC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CACb,MAAM,CAAC,OAAO,CAAC,CAAC,IAAe,EAAE,CAAS,EAAE,EAAE;QAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAC1B;YACE,OAAO;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,IAAI;SACpB,EACD,QAAQ,CACT,CAAA;QACD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,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,IAAA,aAAG,EAAC,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 cde2aa2..0000000 --- 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 313598a..0000000 --- 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 4eb27eb..0000000 --- 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 f2e34ee..0000000 --- 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 87656d7..0000000 --- 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 5bf65f9..0000000 --- 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 6a0967d..0000000 --- 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/validate"; -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 bac1ae8..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.callRef = exports.getValidate = void 0; -const ref_error_1 = require("../../compile/ref_error"); -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: $ref, it } = cxt; - const { baseId, schemaEnv: env, validateName, opts, self } = it; - const { root } = env; - if (($ref === "#" || $ref === "#/") && baseId === root.baseId) - return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); - if (schOrEnv === undefined) - throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); - if (schOrEnv instanceof compile_1.SchemaEnv) - return callValidate(schOrEnv); - return inlineRefSchema(schOrEnv); - function callRootRef() { - if (env === root) - return callRef(cxt, validateName, env, env.$async); - const rootName = gen.scopeValue("root", { ref: root }); - return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, 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: (0, 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: $ref, - }, valid); - cxt.mergeEvaluated(schCxt); - cxt.ok(valid); - } - }, -}; -function getValidate(cxt, sch) { - const { gen } = cxt; - return sch.validate - ? gen.scopeValue("validate", { ref: sch.validate }) - : (0, 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((0, codegen_1._) `await ${(0, 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((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); - addErrorsFrom(e); - if (!allErrors) - gen.assign(valid, false); - }); - cxt.ok(valid); - } - function callSyncRef() { - cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); - } - function addErrorsFrom(source) { - const errs = (0, codegen_1._) `${source}.errors`; - gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged - gen.assign(names_1.default.errors, (0, 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", (0, 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", (0, 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 3125bb8..0000000 --- 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,uDAAqD;AACrD,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,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,EAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC7D,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,WAAW,EAAE,CAAA;QACnF,MAAM,QAAQ,GAAG,oBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC1D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,mBAAe,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACxF,IAAI,QAAQ,YAAY,mBAAS;YAAE,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAA;QAChE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAA;QAEhC,SAAS,WAAW;YAClB,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAO,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;YACpE,MAAM,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gBAC/C,IAAI,YAAY,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBACrC,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;gBACpE,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,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;YAC7D,CAAC;QACH,CAAC;QACD,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACtB,IAAI,YAAY,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;gBAC/C,IAAI,YAAY,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBACrC,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;gBACpE,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAA,WAAC,EAAA,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;YAC7D,CAAC;QACH,CAAC;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/discriminator/index.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts deleted file mode 100644 index ab3669a..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { DiscrError, DiscrErrorObj } from "../discriminator/types"; -export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj; -declare const def: CodeKeywordDefinition; -export default def; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js deleted file mode 100644 index e113aed..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const types_1 = require("../discriminator/types"); -const compile_1 = require("../../compile"); -const ref_error_1 = require("../../compile/ref_error"); -const util_1 = require("../../compile/util"); -const error = { - message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag - ? `tag "${tagName}" must be string` - : `value of tag "${tagName}" must be in oneOf`, - params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, -}; -const def = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error, - code(cxt) { - const { gen, data, schema, parentSchema, it } = cxt; - const { oneOf } = parentSchema; - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option"); - } - const tagName = schema.propertyName; - if (typeof tagName != "string") - throw new Error("discriminator: requires propertyName"); - if (schema.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!oneOf) - throw new Error("discriminator: requires oneOf keyword"); - const valid = gen.let("valid", false); - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`); - gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); - cxt.ok(valid); - function validateMapping() { - const mapping = getMapping(); - gen.if(false); - for (const tagValue in mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(mapping[tagValue])); - } - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); - gen.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen.name("valid"); - const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); - cxt.mergeEvaluated(schCxt, codegen_1.Name); - return _valid; - } - function getMapping() { - var _a; - const oneOfMapping = {}; - const topRequired = hasRequired(parentSchema); - let tagRequired = true; - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i]; - if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { - const ref = sch.$ref; - sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); - if (sch instanceof compile_1.SchemaEnv) - sch = sch.schema; - if (sch === undefined) - throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); - } - const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; - if (typeof propSch != "object") { - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)); - addMappings(propSch, i); - } - if (!tagRequired) - throw new Error(`discriminator: "${tagName}" must be required`); - return oneOfMapping; - function hasRequired({ required }) { - return Array.isArray(required) && required.includes(tagName); - } - function addMappings(sch, i) { - if (sch.const) { - addMapping(sch.const, i); - } - else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i); - } - } - else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); - } - } - function addMapping(tagValue, i) { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`); - } - oneOfMapping[tagValue] = i; - } - } - }, -}; -exports.default = def; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js.map deleted file mode 100644 index f9d69db..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,uDAAqD;AACrD,6CAAuD;AAIvD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC3C,UAAU,KAAK,kBAAU,CAAC,GAAG;QAC3B,CAAC,CAAC,QAAQ,OAAO,kBAAkB;QACnC,CAAC,CAAC,iBAAiB,OAAO,oBAAoB;IAClD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAC,EAAC,EAAE,EAAE,CAC/C,IAAA,WAAC,EAAA,WAAW,UAAU,UAAU,OAAO,eAAe,GAAG,GAAG;CAC/D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;QACjE,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAA;QACnC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IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC;oBAC5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;gBAC9E,CAAC;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,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/discriminator/types.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts deleted file mode 100644 index 8550f6d..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ErrorObject } from "../../types"; -export declare enum DiscrError { - Tag = "tag", - Mapping = "mapping" -} -export type DiscrErrorObj = ErrorObject<"discriminator", { - error: E; - tag: string; - tagValue: unknown; -}, string>; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js deleted file mode 100644 index edf4da5..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DiscrError = void 0; -var DiscrError; -(function (DiscrError) { - DiscrError["Tag"] = "tag"; - DiscrError["Mapping"] = "mapping"; -})(DiscrError || (exports.DiscrError = DiscrError = {})); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js.map deleted file mode 100644 index 028633b..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB"} \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.d.ts deleted file mode 100644 index d65752c..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Vocabulary } from "../types"; -declare const draft2020Vocabularies: Vocabulary[]; -export default draft2020Vocabularies; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js b/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js deleted file mode 100644 index 23d244a..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js +++ /dev/null @@ -1,23 +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 dynamic_1 = require("./dynamic"); -const next_1 = require("./next"); -const unevaluated_1 = require("./unevaluated"); -const format_1 = require("./format"); -const metadata_1 = require("./metadata"); -const draft2020Vocabularies = [ - dynamic_1.default, - core_1.default, - validation_1.default, - (0, applicator_1.default)(true), - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary, - next_1.default, - unevaluated_1.default, -]; -exports.default = draft2020Vocabularies; -//# sourceMappingURL=draft2020.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js.map deleted file mode 100644 index ae1a4d8..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"draft2020.js","sourceRoot":"","sources":["../../lib/vocabularies/draft2020.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,uCAAyC;AACzC,iCAAmC;AACnC,+CAAiD;AACjD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,qBAAqB,GAAiB;IAC1C,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,EAAC,IAAI,CAAC;IAC7B,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAA;AAED,kBAAe,qBAAqB,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 469fb84..0000000 --- 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 1e993de..0000000 --- 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, - (0, 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 bc7389c..0000000 --- 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,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,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 5621213..0000000 --- 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/validate"; -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 972dc35..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +++ /dev/null @@ -1,30 +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 = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`; - const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt); - gen.if((0, 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 { schemaId } = self.opts; - const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta }); - compile_1.compileSchema.call(self, sch); - return (0, 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 e70afe3..0000000 --- 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,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,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,IAAA,WAAC,EAAA,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,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,MAAM,GAAG,GAAG,IAAI,mBAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAC5E,uBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,OAAO,IAAA,iBAAW,EAAC,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 fa2f2b8..0000000 --- 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/validate"; -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 9f010a0..0000000 --- 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", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, 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(() => { - (0, ref_1.callRef)(cxt, validate); - gen.let(valid, true); - }) - : () => (0, 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 69afd4d..0000000 --- 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,CAAC;QACjB,WAAW,EAAE,CAAA;IACf,CAAC;SAAM,CAAC;QACN,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;IACf,CAAC;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,CAAC;YAC7C,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,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;QACjE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;QACpC,CAAC;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,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,aAAO,EAAC,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 0c751d9..0000000 --- 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 f2388a7..0000000 --- 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 f96ba76..0000000 --- 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 cde2aa2..0000000 --- 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 9fd8323..0000000 --- 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 util_1 = require("../../compile/util"); -const def = { - keyword: "$recursiveAnchor", - schemaType: "boolean", - code(cxt) { - if (cxt.schema) - (0, dynamicAnchor_1.dynamicAnchor)(cxt, ""); - else - (0, util_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 5d5e381..0000000 --- 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,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,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 cde2aa2..0000000 --- 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 8cd5c69..0000000 --- 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) => (0, 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 f813804..0000000 --- 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,IAAA,uBAAU,EAAC,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 be67f2e..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts +++ /dev/null @@ -1,9 +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"; -import type { DiscriminatorError } from "./discriminator"; -export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js b/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js deleted file mode 100644 index d4d3fba..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=errors.js.map \ No newline at end of file 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 56bad73..0000000 --- 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 04dc98f..0000000 --- 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 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 aa667c1..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const error = { - message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`, - params: ({ schemaCode }) => (0, 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", (0, codegen_1._) `${fmts}[${schemaCode}]`); - const fType = gen.let("fType"); - const format = gen.let("format"); - // TODO simplify - gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef)); - cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); - function unknownFmt() { - if (opts.strictSchema === false) - return codegen_1.nil; - return (0, codegen_1._) `${schemaCode} && !${format}`; - } - function invalidFmt() { - const callFormat = schemaEnv.$async - ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` - : (0, codegen_1._) `${format}(${data})`; - const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; - return (0, 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.strictSchema === 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 code = fmtDef instanceof RegExp - ? (0, codegen_1.regexpCode)(fmtDef) - : opts.code.formats - ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` - : undefined; - const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, (0, 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 (0, codegen_1._) `await ${fmtRef}(${data})`; - } - return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, 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 b6d93c9..0000000 --- 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,mDAAoF;AAapF,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,sBAAsB,UAAU,GAAG;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,YAAY,UAAU,GAAG;CACrD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,Q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AI,KAAK,CAAC,6BAA6B,CAAC,CAAA;oBACrE,OAAO,IAAA,WAAC,EAAA,SAAS,MAAM,IAAI,IAAI,GAAG,CAAA;gBACpC,CAAC;gBACD,OAAO,OAAO,MAAM,IAAI,UAAU,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,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 c8019c9..0000000 --- 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 d19023d..0000000 --- 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 6315bfe..0000000 --- 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 85e16df..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { _JTDTypeError } from "./error"; -import { DiscrError, DiscrErrorObj } from "../discriminator/types"; -export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj | DiscrErrorObj; -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 e7074d2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +++ /dev/null @@ -1,71 +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 error_1 = require("./error"); -const types_1 = require("../discriminator/types"); -const error = { - message: (cxt) => { - const { schema, params } = cxt; - return params.discrError - ? params.discrError === types_1.DiscrError.Tag - ? `tag "${schema}" must be string` - : `value of tag "${schema}" must be in mapping` - : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { schema, params } = cxt; - return params.discrError - ? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` - : (0, error_1.typeErrorParams)(cxt, "object"); - }, -}; -const def = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, parentSchema } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - gen.if(cond); - validateDiscriminator(); - gen.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen.endIf(); - cxt.ok(valid); - function validateDiscriminator() { - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`); - gen.if((0, codegen_1._) `${tag} === undefined`); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }); - gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`); - validateMapping(tag); - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema }); - gen.endIf(); - } - function validateMapping(tag) { - gen.if(false); - for (const tagValue in parentSchema.mapping) { - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); - gen.assign(valid, applyTagSchema(tagValue)); - } - gen.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true }); - gen.endIf(); - } - 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 ca2a5ab..0000000 --- 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,mDAA+D;AAC/D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AACxE,kDAAgE;AAOhE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAU,CA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kB;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 82c942c..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, SchemaObject } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>; -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 9b8fb54..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js +++ /dev/null @@ -1,24 +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 error_1 = require("./error"); -const def = { - keyword: "elements", - schemaType: "object", - error: (0, error_1.typeError)("array"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const [valid] = (0, nullable_1.checkNullable)(cxt); - gen.if((0, codegen_1.not)(valid), () => gen.if((0, codegen_1._) `Array.isArray(${data})`, () => gen.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error())); - cxt.ok(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 38fe3a1..0000000 --- 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,mDAA4C;AAC5C,yCAAwC;AACxC,yCAAwC;AACxC,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,OAAO,CAAC;IACzB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CACtB,GAAG,CAAC,EAAE,CACJ,IAAA,WAAC,EAAA,iBAAiB,IAAI,GAAG,EACzB,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CACF,CAAA;QACD,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/jtd/enum.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts deleted file mode 100644 index 8ba1790..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject } from "../../types"; -export type JTDEnumError = ErrorObject<"enum", { - allowedValues: string[]; -}, string[]>; -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 78b01ee..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js +++ /dev/null @@ -1,43 +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 error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`, -}; -const def = { - keyword: "enum", - schemaType: "array", - error, - code(cxt) { - (0, 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; - const isString = (0, codegen_1._) `typeof ${data} == "string"`; - if (schema.length >= it.opts.loopEnum) { - let cond; - [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString); - gen.if(cond, loopEnum); - } - else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`))); - if (parentSchema.nullable) - valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid); - } - cxt.pass(valid); - function loopEnum() { - gen.forOf("v", schemaValue, (v) => gen.if((0, 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 06ee9e2..0000000 --- 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;AACxC,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,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,MAAM,QAAQ,GAAG,IAAA,WAAC,EAAA,UAAU,IAAI,cAAc,CAAA;QAC9C,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,IAAU,CACb;YAAA,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC7C,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,wBAAwB;YACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;YACvE,KAAK,GAAG,IAAA,aAAG,EAAC,QAAQ,EAAE,IAAA,YAAE,EAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YACpF,IAAI,YAAY,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,KAAK,CAAC,CAAA;QACnE,CAAC;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,IAAA,WAAC,EAAA,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/error.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.d.ts deleted file mode 100644 index d334ff5..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types"; -import { Code } from "../../compile/codegen"; -export type _JTDTypeError = ErrorObject; -export declare function typeError(t: string): KeywordErrorDefinition; -export declare function typeErrorMessage({ parentSchema }: KeywordErrorCxt, t: string): string; -export declare function typeErrorParams({ parentSchema }: KeywordErrorCxt, t: string): Code; diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js deleted file mode 100644 index 1a3920a..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0; -const codegen_1 = require("../../compile/codegen"); -function typeError(t) { - return { - message: (cxt) => typeErrorMessage(cxt, t), - params: (cxt) => typeErrorParams(cxt, t), - }; -} -exports.typeError = typeError; -function typeErrorMessage({ parentSchema }, t) { - return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`; -} -exports.typeErrorMessage = typeErrorMessage; -function typeErrorParams({ parentSchema }, t) { - return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`; -} -exports.typeErrorParams = typeErrorParams; -//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js.map b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js.map deleted file mode 100644 index db55967..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/error.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAQ7C,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;KACzC,CAAA;AACH,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACzE,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;AACzE,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACxE,OAAO,IAAA,WAAC,EAAA,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAA,GAAG,CAAA;AAC/D,CAAC;AAFD,0CAEC"} \ 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 c56246b..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Vocabulary } from "../../types"; -import { JTDTypeError } from "./type"; -import { JTDEnumError } from "./enum"; -import { JTDElementsError } from "./elements"; -import { JTDPropertiesError } from "./properties"; -import { JTDDiscriminatorError } from "./discriminator"; -import { JTDValuesError } from "./values"; -declare const jtdVocabulary: Vocabulary; -export default jtdVocabulary; -export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError; 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 18f40ab..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -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 713a187..0000000 --- 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,+BAA8B;AAC9B,iCAAgD;AAChD,iCAAgD;AAChD,yCAAqD;AACrD,6CAA2D;AAC3D,6DAAqD;AACrD,mDAAoE;AACpE,qCAA+C;AAC/C,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 86e15a8..0000000 --- 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 eeb3c91..0000000 --- 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 ((0, 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 2fea91c..0000000 --- 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,IAAA,wBAAiB,EAAC,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,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;IAC7E,CAAC;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 254f760..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { KeywordCxt } from "../../compile/validate"; -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 8c92d2c..0000000 --- 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 = codegen_1.nil) { - const valid = gen.name("valid"); - if (parentSchema.nullable) { - gen.let(valid, (0, codegen_1._) `${data} === null`); - cond = (0, 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, (0, 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 7d7a3f1..0000000 --- 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,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;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,IAAA,WAAC,EAAA,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 cde2aa2..0000000 --- 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 fe27275..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const properties_1 = require("./properties"); -const def = { - keyword: "optionalProperties", - schemaType: "object", - error: properties_1.error, - code(cxt) { - if (cxt.parentSchema.properties) - return; - (0, 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 21e5f0d..0000000 --- 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,6CAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,kBAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,IAAA,+BAAkB,EAAC,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 54e3b34..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types"; -import type { KeywordCxt } from "../../compile/validate"; -import { _JTDTypeError } from "./error"; -declare enum PropError { - Additional = "additional", - Missing = "missing" -} -type PropKeyword = "properties" | "optionalProperties"; -type PropSchema = { - [P in string]?: SchemaObject; -}; -export type JTDPropertiesError = _JTDTypeError | ErrorObject | ErrorObject; -export declare const error: KeywordErrorDefinition; -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 f4e9de4..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateProperties = exports.error = 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 error_1 = require("./error"); -var PropError; -(function (PropError) { - PropError["Additional"] = "additional"; - PropError["Missing"] = "missing"; -})(PropError || (PropError = {})); -exports.error = { - message: (cxt) => { - const { params } = cxt; - return params.propError - ? params.propError === PropError.Additional - ? "must NOT have additional properties" - : `must have property '${params.missingProperty}'` - : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { params } = cxt; - return params.propError - ? params.propError === PropError.Additional - ? (0, codegen_1._) `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` - : (0, codegen_1._) `{error: ${params.propError}, missingProperty: ${params.missingProperty}}` - : (0, error_1.typeErrorParams)(cxt, "object"); - }, -}; -const def = { - keyword: "properties", - schemaType: "object", - error: exports.error, - code: validateProperties, -}; -// const error: KeywordErrorDefinition = { -// message: "should NOT have additional properties", -// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -// } -function validateProperties(cxt) { - (0, 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 - ? (0, 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 ? (0, 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) => !(0, 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((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop)); - cxt.ok(_valid); - } - function missingProperty(prop) { - if (required) { - gen.assign(_valid, false); - cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop }); - } - 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 addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator); - const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); - const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp); - gen.if(extra, () => { - if (it.opts.removeAdditional) { - gen.code((0, codegen_1._) `delete ${data}[${key}]`); - } - else { - cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true }); - if (!it.opts.allErrors) - gen.break(); - } - }); - }); - } - function isAdditional(key, props, keyword, jtdDiscriminator) { - let additional; - if (props.length > 8) { - // TODO maybe an option instead of hard-coded 8? - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword); - additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key)); - if (jtdDiscriminator !== undefined) { - additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`); - } - } - else if (props.length || jtdDiscriminator !== undefined) { - const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props); - additional = (0, codegen_1.and)(...ps.map((p) => (0, 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 184111e..0000000 --- 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":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAC,G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_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 ccdf84c..0000000 --- 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 b7c6b02..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js +++ /dev/null @@ -1,67 +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 ref_error_1 = require("../../compile/ref_error"); -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) { - (0, 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, (0, codegen_1._) `${data} === null`); - gen.if((0, 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 ref_error_1.default(it.opts.uriResolver, "", 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, schemaPath: `/definitions/${ref}` })); - const v = (0, ref_1.getValidate)(cxt, sch); - const errsCount = gen.const("_errs", names_1.default.errors); - (0, ref_1.callRef)(cxt, v, sch, sch.$async); - gen.assign(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`); - } - function inlineRefSchema(schema) { - const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, 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 c15dbf9..0000000 --- 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,uDAAqD;AACrD,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,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;Q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,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;YAChC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,QAAQ,eAAC,CAAC,MAAM,EAAE,CAAC,CAAA;QACpD,CAAC;QAED,SAAS,eAAe,CAAC,MAAuB;YAC9C,MAAM,OAAO,GAAG,GAAG,CAAC,UAAU,CAC5B,QAAQ,EACR,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,mBAAS,EAAC,MAAM,CAAC,EAAC,CAAC,CAAC,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,CACtF,CAAA;YACD,GAAG,CAAC,SAAS,CACX;gBACE,MAAM;gBACN,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,aAAG;gBACf,YAAY,EAAE,OAAO;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,CAAC;QACzB,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;IAC3F,CAAC;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 a115c7d..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { CodeKeywordDefinition } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>; -export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"; -export declare const intRange: { - [T in IntType]: [number, number, number]; -}; -export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType; -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 17a0b51..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.intRange = void 0; -const codegen_1 = require("../../compile/codegen"); -const timestamp_1 = require("../../runtime/timestamp"); -const util_1 = require("../../compile/util"); -const metadata_1 = require("./metadata"); -const error_1 = require("./error"); -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 error = { - message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema), - params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema), -}; -function timestampCode(cxt) { - const { gen, data, it } = cxt; - const { timestamp, allowDate } = it.opts; - if (timestamp === "date") - return (0, codegen_1._) `${data} instanceof Date `; - const vts = (0, util_1.useFunc)(gen, timestamp_1.default); - const allowDateArg = allowDate ? (0, codegen_1._) `, true` : codegen_1.nil; - const validString = (0, codegen_1._) `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`; - return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._) `${data} instanceof Date`, validString); -} -const def = { - keyword: "type", - schemaType: "string", - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { data, schema, parentSchema, it } = cxt; - let cond; - switch (schema) { - case "boolean": - case "string": - cond = (0, codegen_1._) `typeof ${data} == ${schema}`; - break; - case "timestamp": { - cond = timestampCode(cxt); - break; - } - case "float32": - case "float64": - cond = (0, codegen_1._) `typeof ${data} == "number"`; - break; - default: { - const sch = schema; - cond = (0, codegen_1._) `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`; - if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { - if (sch === "uint32") - cond = (0, codegen_1._) `${cond} && ${data} >= 0`; - } - else { - const [min, max] = exports.intRange[sch]; - cond = (0, codegen_1._) `${cond} && ${data} >= ${min} && ${data} <= ${max}`; - } - } - } - cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, 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 cf538ed..0000000 --- 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,mDAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,yCAAwC;AACxC,mCAAwE;AAM3D,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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AAC,CAAA;IACxE,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/union.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.d.ts deleted file mode 100644 index cde2aa2..0000000 --- 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 01a9439..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js +++ /dev/null @@ -1,12 +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, - error: { message: "must match a schema in union" }, -}; -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 4d6eb41..0000000 --- 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;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,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 1eaa884..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { CodeKeywordDefinition, SchemaObject } from "../../types"; -import { _JTDTypeError } from "./error"; -export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>; -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 3c2c95f..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const util_1 = require("../../compile/util"); -const codegen_1 = require("../../compile/codegen"); -const metadata_1 = require("./metadata"); -const nullable_1 = require("./nullable"); -const error_1 = require("./error"); -const def = { - keyword: "values", - schemaType: "object", - error: (0, error_1.typeError)("object"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen, data, schema, it } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - if ((0, util_1.alwaysValidSchema)(it, schema)) { - gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error()); - } - else { - gen.if(cond); - gen.assign(valid, validateMap()); - gen.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen.endIf(); - } - cxt.ok(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: util_1.Type.Str, - }, _valid); - gen.if((0, 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 8a1a5c2..0000000 --- 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,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC;IAC1B,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,8BAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QACjD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAA;YACZ,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,CAAA;YAChC,GAAG,CAAC,MAAM,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,CAAC,CAAA;YACtB,GAAG,CAAC,KAAK,EAAE,CAAA;YACX,GAAG,CAAC,KAAK,EAAE,CAAA;QACb,CAAC;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QAEb,SAAS,WAAW;YAClB,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YAChC,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;gBACjB,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;gBACvC,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;gBACjD,OAAO,QAAQ,CAAA;YACjB,CAAC;YACD,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACrB,cAAc,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YACjC,OAAO,MAAM,CAAA;YAEb,SAAS,cAAc,CAAC,QAAoB;gBAC1C,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;oBAC7B,GAAG,CAAC,SAAS,CACX;wBACE,OAAO,EAAE,QAAQ;wBACjB,QAAQ,EAAE,GAAG;wBACb,YAAY,EAAE,WAAI,CAAC,GAAG;qBACvB,EACD,MAAM,CACP,CAAA;oBACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,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 df9cc07..0000000 --- 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 f07bf28..0000000 --- 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 0d61f08..0000000 --- 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 7fd5c64..0000000 --- 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 c861b32..0000000 --- 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 474a6d4..0000000 --- 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 ec67e63..0000000 --- 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 30e3167..0000000 --- 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 a4872ea..0000000 --- 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 06f0239..0000000 --- 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 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 0a0cd3a..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +++ /dev/null @@ -1,40 +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: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, 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", (0, codegen_1._) `${data}.length`); - if (schema === false) { - cxt.setParams({ len: items }); - cxt.fail((0, codegen_1._) `${len} > ${items}`); - } - else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`); - gen.if((0, 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: util_1.Type.Num }, valid); - if (!it.allErrors) - gen.if((0, 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 b91f86e..0000000 --- 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,6CAA0D;AAI1D,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAA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E,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;gBACxF,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,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 ba63f62..0000000 --- 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 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 ad29849..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +++ /dev/null @@ -1,65 +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 error = { - message: "must NOT have unevaluated properties", - params: ({ params }) => (0, 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((0, 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((0, 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 (!(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen.name("valid"); - cxt.subschema({ - keyword: "unevaluatedProperties", - dataProp: key, - dataPropType: util_1.Type.Str, - }, valid); - if (!allErrors) - gen.if((0, codegen_1.not)(valid), () => gen.break()); - } - } - function unevaluatedDynamic(evaluatedProps, key) { - return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`; - } - function unevaluatedStatic(evaluatedProps, key) { - const ps = []; - for (const p in evaluatedProps) { - if (evaluatedProps[p] === true) - ps.push((0, codegen_1._) `${key} !== ${p}`); - } - return (0, 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 f83022e..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"unevaluatedProperties.js","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iBAAiB,CAAC,cAAsC,EAAE,GAAS;YAC1E,MAAM,EAAE,GAAW,EAAE,CAAA;YACrB,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;gBAC/B,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;oBAAE,EAAE,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;YAC7D,CAAC;YACD,OAAO,IAAA,aAAG,EAAC,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 af91a90..0000000 --- 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 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 9564496..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: "must be equal to constant", - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`, -}; -const def = { - keyword: "const", - $data: true, - error, - code(cxt) { - const { gen, data, $data, schemaCode, schema } = cxt; - if ($data || (schema && typeof schema == "object")) { - cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); - } - else { - cxt.fail((0, codegen_1._) `${schema} !== ${data}`); - } - }, -}; -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 63cfe60..0000000 --- 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,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;QACnE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;QACpC,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/dependentRequired.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts deleted file mode 100644 index 00f0d37..0000000 --- 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 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 09e5963..0000000 --- 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) => (0, 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 c7e88f8..0000000 --- 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,IAAA,mCAAoB,EAAC,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 6231082..0000000 --- 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 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 eab6487..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, 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; - let eql; - const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default))); - 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 = (0, 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((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); - } - function equalCode(vSchema, i) { - const sch = schema[i]; - return typeof sch === "object" && sch !== null - ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])` - : (0, 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 33afdcf..0000000 --- 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,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAI,GAAqB,CAAA;QACzB,MAAM,MAAM,GAAG,GAAS,EAAE,CAAC,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,IAA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AC5C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI;gBAC3C,CAAC,CAAC,IAAA,WAAC,EAAA,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 a078be5..0000000 --- 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; -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/dist/vocabularies/validation/index.js b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js deleted file mode 100644 index 7b56b4e..0000000 --- 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 69436fb..0000000 --- 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 cde2aa2..0000000 --- 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 c884dae..0000000 --- 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 util_1 = require("../../compile/util"); -const def = { - keyword: ["maxContains", "minContains"], - type: "array", - schemaType: "number", - code({ keyword, parentSchema, it }) { - if (parentSchema.contains === undefined) { - (0, util_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 084ee2c..0000000 --- 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,6CAAkD;AAElD,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,CAAC;YACxC,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;QACnE,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/limitItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts deleted file mode 100644 index cde2aa2..0000000 --- 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 e1386f8..0000000 --- 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 (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => (0, 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((0, 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 690c734..0000000 --- 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,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAA,WAAC,EAAA,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 cde2aa2..0000000 --- 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 6ae5f92..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const ucs2length_1 = require("../../runtime/ucs2length"); -const error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxLength" ? "more" : "fewer"; - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`; - }, - params: ({ schemaCode }) => (0, 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; - const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; - cxt.fail$data((0, 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 f09c35e..0000000 --- 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,6CAA0C;AAC1C,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,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,MAAM,GAAG,GACP,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,IAAI,GAAG,CAAA;QAC7F,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,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 7b35096..0000000 --- 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"; -type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"; -type Comparison = "<=" | ">=" | "<" | ">"; -export 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 a97c0eb..0000000 --- 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 }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, 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((0, 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 18a3653..0000000 --- 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":";;AAEA,mDAA6D;AAE7D,MAAM,GAAG,GAAG,mBAAS,CAAA;AAMrB,MAAM,IAAI,GAA4D;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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 cde2aa2..0000000 --- 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 e6fc40c..0000000 --- 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 (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`; - }, - params: ({ schemaCode }) => (0, 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((0, 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 a695943..0000000 --- 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,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAA,WAAC,EAAA,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 67685dc..0000000 --- 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 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 43cf67b..0000000 --- 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 }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`, - params: ({ schemaCode }) => (0, 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 - ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` - : (0, codegen_1._) `${res} !== parseInt(${res})`; - cxt.fail$data((0, 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 9ef825b..0000000 --- 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,IAAA,aAAG,EAAA,uBAAuB,UAAU,EAAE;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAA,WAAC,EAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,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 7edbfda..0000000 --- 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 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 f8ccdf2..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js +++ /dev/null @@ -1,24 +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 }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`, -}; -const def = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt) { - const { data, $data, schema, schemaCode, it } = cxt; - // TODO regexp should be wrapped in try/catchs - const u = it.opts.unicodeRegExp ? "u" : ""; - const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); - cxt.fail$data((0, 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 82fa5d7..0000000 --- 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,IAAA,aAAG,EAAA,uBAAuB,UAAU,GAAG;IAClE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,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,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,8CAA8C;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,eAAe,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACrF,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,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 c9cffda..0000000 --- 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 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 1d8e292..0000000 --- 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 util_1 = require("../../compile/util"); -const error = { - message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`, - params: ({ params: { missingProperty } }) => (0, 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)`; - (0, util_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) { - (0, 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((0, code_1.checkMissingProp)(cxt, schema, missing)); - (0, code_1.reportMissingProp)(cxt, missing); - gen.else(); - } - } - function loopAllRequired() { - gen.forOf("prop", schemaCode, (prop) => { - cxt.setParams({ missingProperty: prop }); - gen.if((0, 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, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); - gen.if((0, 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 9ec186f..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/required.ts"],"names":[],"mappings":";;AAEA,kCAMgB;AAChB,mDAAkE;AAClE,6CAAkD;AAQlD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,gCAAgC,eAAe,GAAG;IAC/F,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,qBAAqB,eAAe,GAAG;CAClF,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAM;QACzC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAA;QAClD,IAAI,EAAE,CAAC,SAAS;YAAE,aAAa,EAAE,CAAA;;YAC5B,eAAe,EAAE,CAAA;QAEtB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAA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niqueItems.d.ts b/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts deleted file mode 100644 index e7c241b..0000000 --- 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 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 cdbecea..0000000 --- a/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const dataType_1 = require("../../compile/validate/dataType"); -const codegen_1 = require("../../compile/codegen"); -const util_1 = require("../../compile/util"); -const equal_1 = require("../../runtime/equal"); -const error = { - message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({ params: { i, j } }) => (0, 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 ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; - cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`); - cxt.ok(valid); - function validateUniqueItems() { - const i = gen.let("i", (0, codegen_1._) `${data}.length`); - const j = gen.let("j"); - cxt.setParams({ i, j }); - gen.assign(valid, true); - gen.if((0, 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 = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); - const indices = gen.const("indices", (0, codegen_1._) `{}`); - gen.for((0, codegen_1._) `;${i}--;`, () => { - gen.let(item, (0, codegen_1._) `${data}[${i}]`); - gen.if(wrongType, (0, codegen_1._) `continue`); - if (itemTypes.length > 1) - gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`); - gen - .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => { - gen.assign(j, (0, codegen_1._) `${indices}[${item}]`); - cxt.error(); - gen.assign(valid, false).break(); - }) - .code((0, codegen_1._) `${indices}[${item}] = ${i}`); - }); - } - function loopN2(i, j) { - const eql = (0, util_1.useFunc)(gen, equal_1.default); - const outer = gen.name("outer"); - gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, 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 46eb7a2..0000000 --- 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,6CAA0C;AAC1C,+CAAuC;AAQvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAC5B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ajv/lib/2019.ts deleted file mode 100644 index 3f7194f..0000000 --- a/node_modules/table/node_modules/ajv/lib/2019.ts +++ /dev/null @@ -1,81 +0,0 @@ -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 discriminator from "./vocabularies/discriminator" -import addMetaSchema2019 from "./refs/json-schema-2019-09" - -const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema" - -export 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) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _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)) - } -} - -module.exports = exports = Ajv2019 -module.exports.Ajv2019 = Ajv2019 -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv2019 - -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" -export {KeywordCxt} from "./compile/validate" -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" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" diff --git a/node_modules/table/node_modules/ajv/lib/2020.ts b/node_modules/table/node_modules/ajv/lib/2020.ts deleted file mode 100644 index cfb36af..0000000 --- a/node_modules/table/node_modules/ajv/lib/2020.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type {AnySchemaObject} from "./types" -import AjvCore, {Options} from "./core" - -import draft2020Vocabularies from "./vocabularies/draft2020" -import discriminator from "./vocabularies/discriminator" -import addMetaSchema2020 from "./refs/json-schema-2020-12" - -const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema" - -export class Ajv2020 extends AjvCore { - constructor(opts: Options = {}) { - super({ - ...opts, - dynamicRef: true, - next: true, - unevaluated: true, - }) - } - - _addVocabularies(): void { - super._addVocabularies() - draft2020Vocabularies.forEach((v) => this.addVocabulary(v)) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _addDefaultMetaSchema(): void { - super._addDefaultMetaSchema() - const {$data, meta} = this.opts - if (!meta) return - addMetaSchema2020.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)) - } -} - -module.exports = exports = Ajv2020 -module.exports.Ajv2020 = Ajv2020 -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv2020 - -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" -export {KeywordCxt} from "./compile/validate" -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" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" 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 8275b93..0000000 --- a/node_modules/table/node_modules/ajv/lib/ajv.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type {AnySchemaObject} from "./types" -import AjvCore from "./core" -import draft7Vocabularies from "./vocabularies/draft7" -import discriminator from "./vocabularies/discriminator" -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 class Ajv extends AjvCore { - _addVocabularies(): void { - super._addVocabularies() - draft7Vocabularies.forEach((v) => this.addVocabulary(v)) - if (this.opts.discriminator) this.addKeyword(discriminator) - } - - _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)) - } -} - -module.exports = exports = Ajv -module.exports.Ajv = Ajv -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv - -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" -export {KeywordCxt} from "./compile/validate" -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" -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" 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 9d4de61..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/codegen/code.ts +++ /dev/null @@ -1,169 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-extraneous-class -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}]` -} - -//Does best effort to format the name properly -export function getEsmExportName(key: Code | string | number): Code { - if (typeof key == "string" && IDENTIFIER.test(key)) { - return new _Code(`${key}`) - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`) -} - -export function regexpCode(rx: RegExp): Code { - return new _Code(rx.toString()) -} 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 5a6d1ee..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/codegen/index.ts +++ /dev/null @@ -1,852 +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, regexpCode, 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 5119922..0000000 --- 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/errors.ts b/node_modules/table/node_modules/ajv/lib/compile/errors.ts deleted file mode 100644 index 18424a0..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/errors.ts +++ /dev/null @@ -1,184 +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 {getErrorPath, Type} from "./util" -import N from "./names" - -export const keywordError: KeywordErrorDefinition = { - message: ({keyword}) => str`must 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 interface ErrorPaths { - instancePath?: Code - schemaPath?: string - parentSchema?: boolean -} - -export function reportError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError, - errorPaths?: ErrorPaths, - overrideAllErrors?: boolean -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error, errorPaths) - if (overrideAllErrors ?? (compositeRule || allErrors)) { - addError(gen, errObj) - } else { - returnErrors(it, _`[${errObj}]`) - } -} - -export function reportExtraError( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition = keywordError, - errorPaths?: ErrorPaths -): void { - const {it} = cxt - const {gen, compositeRule, allErrors} = it - const errObj = errorObjectCode(cxt, error, errorPaths) - 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}.instancePath === undefined`, () => - gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, 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"), -} - -function errorObjectCode( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition, - errorPaths?: ErrorPaths -): Code { - const {createErrors} = cxt.it - if (createErrors === false) return _`{}` - return errorObject(cxt, error, errorPaths) -} - -function errorObject( - cxt: KeywordErrorCxt, - error: KeywordErrorDefinition, - errorPaths: ErrorPaths = {} -): Code { - const {gen, it} = cxt - const keyValues: [Name, SafeExpr | string][] = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths), - ] - extraErrorProps(cxt, error, keyValues) - return gen.object(...keyValues) -} - -function errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] { - const instPath = instancePath - ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}` - : errorPath - return [N.instancePath, strConcat(N.instancePath, instPath)] -} - -function errorSchemaPath( - {keyword, it: {errSchemaPath}}: KeywordErrorCxt, - {schemaPath, parentSchema}: ErrorPaths -): [Name, string | Code] { - let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}` - if (schemaPath) { - schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}` - } - return [E.schemaPath, schPath] -} - -function extraErrorProps( - cxt: KeywordErrorCxt, - {params, message}: KeywordErrorDefinition, - keyValues: [Name, SafeExpr | string][] -): void { - const {keyword, data, schemaValue, it} = cxt - const {opts, propertyName, topSchemaRef, schemaPath} = it - keyValues.push( - [E.keyword, keyword], - [E.params, typeof params == "function" ? params(cxt) : params || _`{}`] - ) - 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] - ) - } - if (propertyName) keyValues.push([E.propertyName, propertyName]) -} 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 bfc3934..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/index.ts +++ /dev/null @@ -1,324 +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 "../runtime/validation_error" -import N from "./names" -import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve" -import {schemaHasRulesButRef, unescapeFragment} from "./util" -import {validateFunctionCode} from "./validate" -import {URIComponent} from "fast-uri" -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 schemaId?: "$id" | "id" - readonly root?: SchemaEnv - readonly baseId?: string - readonly schemaPath?: string - readonly localRefs?: LocalRefs - readonly meta?: boolean -} - -export class SchemaEnv implements SchemaEnvArgs { - readonly schema: AnySchema - readonly schemaId?: "$id" | "id" - readonly root: SchemaEnv - baseId: string // TODO possibly, it should be readonly - schemaPath?: string - 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.schemaId = env.schemaId - this.root = env.root || this - this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"]) - this.schemaPath = env.schemaPath - 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(this.opts.uriResolver, 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/runtime/validation_error").default`, - }) - } - - 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: sch.schemaPath || (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(this.opts.uriResolver, 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 - const {schemaId} = this.opts - if (schema) _sch = new SchemaEnv({schema, schemaId, 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 = this.opts.uriResolver.parse(ref) - const refPath = _getFullPath(this.opts.uriResolver, p) - let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined) - // 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 - const {schemaId} = this.opts - const schId = schema[schemaId] - if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId) - return new SchemaEnv({schema, schemaId, root, baseId}) - } - return getJsonPointer.call(this, p, schOrRef) -} - -const PREVENT_SCOPE_CHANGE = new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions", -]) - -function getJsonPointer( - this: Ajv, - parsedRef: URIComponent, - {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 - const partSchema = schema[unescapeFragment(part)] - if (partSchema === undefined) return - schema = partSchema - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? - const schId = typeof schema === "object" && schema[this.opts.schemaId] - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = resolveUrl(this.opts.uriResolver, baseId, schId) - } - } - let env: SchemaEnv | undefined - if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) { - const $ref = resolveUrl(this.opts.uriResolver, 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. - const {schemaId} = this.opts - env = env || new SchemaEnv({schema, schemaId, 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 a0141c7..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/jtd/parse.ts +++ /dev/null @@ -1,411 +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, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen" -import MissingRefError from "../ref_error" -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 {useFunc} from "../util" -import validTimestamp from "../../runtime/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, self} = cxt - switch (schema.type) { - case "boolean": - parseBoolean(cxt) - break - case "string": - parseString(cxt) - break - case "timestamp": { - parseString(cxt) - const vts = useFunc(gen, validTimestamp) - const {allowDate, parseDate} = self.opts - const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})` - const fail: Code = parseDate - ? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`) - : notValid - gen.if(fail, () => parsingError(cxt, str`invalid timestamp`)) - break - } - case "float32": - case "float64": - parseNumber(cxt) - break - default: { - const t = schema.type as IntType - if (!self.opts.int32range && (t === "int32" || t === "uint32")) { - parseNumber(cxt, 16) // 2 ** 53 - max safe integer - if (t === "uint32") { - gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`)) - } - } else { - const [min, max, maxDigits] = intRange[t] - 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(self.opts.uriResolver, "", 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: string}, args?: SafeExpr): void { - partialParse(cxt, useFunc(cxt.gen, parseFunc), 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 1d22882..0000000 --- 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 "../ref_error" -import N from "../names" -import {isOwnProperty} from "../../vocabularies/code" -import {hasRef} from "../../vocabularies/jtd/ref" -import {useFunc} from "../util" -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 - let firstProp: Name | undefined - - for (const key of props) { - if (first) first = false - else gen.add(N.json, str`,`) - serializeProperty(key, properties[key], keyValue(key)) - } - if (first) firstProp = gen.let("first", true) - for (const key of optProps) { - const value = keyValue(key) - gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => { - addComma(cxt, firstProp) - serializeProperty(key, optionalProperties[key], value) - }) - } - if (schema.additionalProperties) { - gen.forIn("key", data, (key) => - gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)) - ) - } - - 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 { - 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, _`${useFunc(gen, quote)}(${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(self.opts.uriResolver, "", 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 { - if (first) { - gen.if( - first, - () => gen.assign(first, false), - () => gen.add(N.json, str`,`) - ) - } else { - gen.add(N.json, str`,`) - } -} 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 1258050..0000000 --- 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 b4b242e..0000000 --- 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 - instancePath: new Name("instancePath"), - 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/ref_error.ts b/node_modules/table/node_modules/ajv/lib/compile/ref_error.ts deleted file mode 100644 index 386bf04..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/ref_error.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {resolveUrl, normalizeId, getFullPath} from "./resolve" -import type {UriResolver} from "../types" - -export default class MissingRefError extends Error { - readonly missingRef: string - readonly missingSchema: string - - constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`) - this.missingRef = resolveUrl(resolver, baseId, ref) - this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef)) - } -} 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 b8c4aca..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/resolve.ts +++ /dev/null @@ -1,149 +0,0 @@ -import type {AnySchema, AnySchemaObject, UriResolver} from "../types" -import type Ajv from "../ajv" -import type {URIComponent} from "fast-uri" -import {eachItem} from "./util" -import * as equal from "fast-deep-equal" -import * as traverse from "json-schema-traverse" - -// 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(resolver: UriResolver, id = "", normalize?: boolean): string { - if (normalize !== false) id = normalizeId(id) - const p = resolver.parse(id) - return _getFullPath(resolver, p) -} - -export function _getFullPath(resolver: UriResolver, p: URIComponent): string { - const serialized = resolver.serialize(p) - return serialized.split("#")[0] + "#" -} - -const TRAILING_SLASH_HASH = /#\/?$/ -export function normalizeId(id: string | undefined): string { - return id ? id.replace(TRAILING_SLASH_HASH, "") : "" -} - -export function resolveUrl(resolver: UriResolver, baseId: string, id: string): string { - id = normalizeId(id) - return resolver.resolve(baseId, id) -} - -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i - -export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs { - if (typeof schema == "boolean") return {} - const {schemaId, uriResolver} = this.opts - const schId = normalizeId(schema[schemaId] || baseId) - const baseIds: {[JsonPtr in string]?: string} = {"": schId} - const pathPrefix = getFullPath(uriResolver, schId, 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 innerBaseId = baseIds[parentJsonPtr] - if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId]) - addAnchor.call(this, sch.$anchor) - addAnchor.call(this, sch.$dynamicAnchor) - baseIds[jsonPtr] = innerBaseId - - function addRef(this: Ajv, ref: string): string { - // eslint-disable-next-line @typescript-eslint/unbound-method - const _resolve = this.opts.uriResolver.resolve - ref = normalizeId(innerBaseId ? _resolve(innerBaseId, 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 7dbf7ab..0000000 --- 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/util.ts b/node_modules/table/node_modules/ajv/lib/compile/util.ts deleted file mode 100644 index cefae51..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/util.ts +++ /dev/null @@ -1,213 +0,0 @@ -import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types" -import type {SchemaCxt, SchemaObjCxt} from "." -import {_, getProperty, Code, Name, CodeGen} from "./codegen" -import {_Code} from "./codegen/code" -import type {Rule, ValidationRules} from "./rules" - -// 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.strictSchema) 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.assign(to, _`${to} || {}`).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)) -} - -const snippets: {[S in string]?: _Code} = {} - -export function useFunc(gen: CodeGen, f: {code: string}): Name { - return gen.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)), - }) -} - -export enum Type { - Num, - Str, -} - -export 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) -} - -export function checkStrictMode( - it: SchemaCxt, - msg: string, - mode: boolean | "log" = it.opts.strictSchema -): 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/applicability.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/applicability.ts deleted file mode 100644 index 478b704..0000000 --- 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 1563550..0000000 --- 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, undefined, 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 d8142b3..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/dataType.ts +++ /dev/null @@ -1,230 +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 {_, 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 -} - -// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents -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.strictNumbers, 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.strictNumbers), () => 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}) => `must 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 2ad3d4d..0000000 --- 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 "../util" - -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 15ecabd..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts +++ /dev/null @@ -1,582 +0,0 @@ -import type { - AddedKeywordDefinition, - AnySchema, - AnySchemaObject, - KeywordErrorCxt, - KeywordCxtParams, -} from "../../types" -import type {SchemaCxt, SchemaObjCxt} from ".." -import type {InstanceOptions} from "../../core" -import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema" -import {coerceAndCheckDataType, getSchemaTypes} from "./dataType" -import {shouldUseGroup, shouldUseRule} from "./applicability" -import {checkDataType, checkDataTypes, reportTypeError, DataType} from "./dataType" -import {assignDefaults} from "./defaults" -import {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from "./keyword" -import {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from "./subschema" -import {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from "../codegen" -import N from "../names" -import {resolveUrl} from "../resolve" -import { - schemaRefOrVal, - schemaHasRulesButRef, - checkUnknownRules, - checkStrictMode, - unescapeJsonPointer, - mergeEvaluated, -} from "../util" -import type {JSONType, Rule, RuleGroup} from "../rules" -import { - ErrorPaths, - reportError, - reportExtraError, - resetErrorsCount, - keyword$DataError, -} from "../errors" - -// 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.instancePath}="", ${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.instancePath, _`${N.valCxt}.${N.instancePath}`) - 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.instancePath, _`""`) - 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 { - const schId = typeof schema == "object" && schema[opts.schemaId] - return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil -} - -// schema compilation - this function is used recursively to generate code for sub-schemas -function subschemaCode(it: SchemaCxt, valid: Name): void { - if (isSchemaObj(it)) { - checkKeywords(it) - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid) - return - } - } - boolOrEmptySchema(it, valid) -} - -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) - checkAsyncSchema(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.strictSchema) { - checkStrictMode(it, "default is ignored in the schema root") - } -} - -function updateContext(it: SchemaObjCxt): void { - const schId = it.schema[it.opts.schemaId] - if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId) -} - -function checkAsyncSchema(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) -} - -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.strictNumbers)) - 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(",")}"`) - } - }) - narrowSchemaTypes(it, types) -} - -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 narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void { - const ts: JSONType[] = [] - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) ts.push(t) - else if (withTypes.includes("integer") && t === "number") ts.push("integer") - } - it.dataTypes = ts -} - -function strictTypesError(it: SchemaObjCxt, msg: string): void { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath - msg += ` at "${schemaPath}" (strictTypes)` - checkStrictMode(it, msg, it.opts.strictTypes) -} - -export 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.failResult(not(condition), successAction, failAction) - } - - failResult(condition: Code, successAction?: () => void, failAction?: () => void): void { - this.gen.if(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.failResult(not(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?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void { - if (errorParams) { - this.setParams(errorParams) - this._error(append, errorPaths) - this.setParams({}) - return - } - this._error(append, errorPaths) - } - - private _error(append?: boolean, errorPaths?: ErrorPaths): void { - ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths) - } - - $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.strictNumbers, 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 { - const subschema = getSubschema(this.it, appl) - extendSubschemaData(subschema, this.it, appl) - extendSubschemaMode(subschema, appl) - const nextContext = {...this.it, ...subschema, items: undefined, props: undefined} - subschemaCode(nextContext, valid) - return nextContext - } - - 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 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) - } -} - -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/validate/keyword.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts deleted file mode 100644 index f854aa7..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/keyword.ts +++ /dev/null @@ -1,171 +0,0 @@ -import type {KeywordCxt} from "." -import type { - AnySchema, - SchemaValidateFunction, - AnyValidateFunction, - AddedKeywordDefinition, - MacroKeywordDefinition, - FuncKeywordDefinition, -} from "../../types" -import type {SchemaObjCxt} from ".." -import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen" -import N from "../names" -import type {JSONType} from "../rules" -import {callValidateCode} from "../../vocabularies/code" -import {extendErrors} from "../errors" - -type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction - -export 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)) -} - -export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void { - const {gen, keyword, schema, parentSchema, $data, it} = cxt - checkAsyncKeyword(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 checkAsyncKeyword({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)} - ) -} - -export 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") - ) - ) -} - -export function validateKeywordUsage( - {schema, opts, self, errSchemaPath}: 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 "${keyword}" value is invalid at path "${errSchemaPath}": ` + - self.errorsText(def.validateSchema.errors) - if (opts.validateSchema === "log") self.logger.error(msg) - else throw new Error(msg) - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/compile/validate/subschema.ts b/node_modules/table/node_modules/ajv/lib/compile/validate/subschema.ts deleted file mode 100644 index 9072ed7..0000000 --- a/node_modules/table/node_modules/ajv/lib/compile/validate/subschema.ts +++ /dev/null @@ -1,135 +0,0 @@ -import type {AnySchema} from "../../types" -import type {SchemaObjCxt} from ".." -import {_, str, getProperty, Code, Name} from "../codegen" -import {escapeFragment, getErrorPath, Type} from "../util" -import type {JSONType} from "../rules" - -export 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 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 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') -} - -export 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] - } -} - -export 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 -} 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 e41ca3e..0000000 --- a/node_modules/table/node_modules/ajv/lib/core.ts +++ /dev/null @@ -1,891 +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 -} - -export {KeywordCxt} from "./compile/validate" -export {DefinedError} from "./vocabularies/errors" -export {JSONType} from "./compile/rules" -export {JSONSchemaType} from "./types/json-schema" -export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} 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, - RegExpEngine, - UriResolver, -} from "./types" -import type {JSONSchemaType} from "./types/json-schema" -import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" -import ValidationError from "./runtime/validation_error" -import MissingRefError from "./compile/ref_error" -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" - -import DefaultUriResolver from "./runtime/uri" - -const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags) -defaultRegExp.code = "new RegExp" - -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" - strictSchema?: boolean | "log" - strictNumbers?: 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 - discriminator?: boolean - unicodeRegExp?: boolean - timestamp?: "string" | "date" // JTD only - parseDate?: boolean // JTD only - allowDate?: boolean // JTD only - $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 - schemaId?: "id" | "$id" - 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 - int32range?: boolean // JTD only - messages?: boolean - code?: CodeOptions // NEW - uriResolver?: UriResolver -} - -export interface CodeOptions { - es5?: boolean - esm?: 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 - regExp?: RegExpEngine -} - -interface InstanceCodeOptions extends CodeOptions { - regExp: RegExpEngine - 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 - strictDefaults?: boolean - strictKeywords?: boolean - uniqueItems?: boolean - unknownFormats?: true | string[] | "ignore" - cache?: any - serialize?: (schema: AnySchema) => unknown - ajvErrors?: boolean -} - -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}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "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.", - ajvErrors: "It is default now.", -} - -const deprecatedOptions: OptionsInfo = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.', -} - -type RequiredInstanceOptions = { - [K in - | "strictSchema" - | "strictNumbers" - | "strictTypes" - | "strictTuples" - | "strictRequired" - | "inlineRefs" - | "loopRequired" - | "loopEnum" - | "meta" - | "messages" - | "schemaId" - | "addUsedSchema" - | "validateSchema" - | "validateFormats" - | "int32range" - | "unicodeRegExp" - | "uriResolver"]: NonNullable -} & {code: InstanceCodeOptions} - -export type InstanceOptions = Options & RequiredInstanceOptions - -const MAX_EXPRESSION = 200 - -// eslint-disable-next-line complexity -function requiredOptions(o: Options): RequiredInstanceOptions { - const s = o.strict - const _optz = o.code?.optimize - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0 - const regExp = o.code?.regExp ?? defaultRegExp - const uriResolver = o.uriResolver ?? DefaultUriResolver - return { - strictSchema: o.strictSchema ?? s ?? true, - strictNumbers: o.strictNumbers ?? s ?? true, - strictTypes: o.strictTypes ?? s ?? "log", - strictTuples: o.strictTuples ?? s ?? "log", - strictRequired: o.strictRequired ?? s ?? false, - code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp}, - loopRequired: o.loopRequired ?? MAX_EXPRESSION, - loopEnum: o.loopEnum ?? MAX_EXPRESSION, - meta: o.meta ?? true, - messages: o.messages ?? true, - inlineRefs: o.inlineRefs ?? true, - schemaId: o.schemaId ?? "$id", - addUsedSchema: o.addUsedSchema ?? true, - validateSchema: o.validateSchema ?? true, - validateFormats: o.validateFormats ?? true, - unicodeRegExp: o.unicodeRegExp ?? true, - int32range: o.int32range ?? true, - uriResolver: uriResolver, - } -} - -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, schemaId} = this.opts - let _dataRefSchema: SchemaObject = $dataRefSchema - if (schemaId === "id") { - _dataRefSchema = {...$dataRefSchema} - _dataRefSchema.id = _dataRefSchema.$id - delete _dataRefSchema.$id - } - if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false) - } - - defaultMeta(): string | AnySchemaObject | undefined { - const {meta, schemaId} = this.opts - return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || 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 - // This overload is only intended for typescript inference, the first - // argument prevents manual type annotation from matching this overload - // eslint-disable-next-line @typescript-eslint/no-unused-vars - validate( - schema: T, - data: unknown - ): data is JTDDataType - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents - 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 - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents - 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 - // This overload is only intended for typescript inference, the first - // argument prevents manual type annotation from matching this overload - // eslint-disable-next-line @typescript-eslint/no-unused-vars - compile( - schema: T, - _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") { - const {schemaId} = this.opts - id = schema[schemaId] - if (id !== undefined && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`) - } - } - key = normalizeId(key || id) - this._checkUnique(key) - this.schemas[key] = this._addSchema(schema, _meta, key, _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 {schemaId} = this.opts - const root = new SchemaEnv({schema: {}, schemaId}) - 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[this.opts.schemaId] - 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.instancePath} ${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, - baseId?: string, - validateSchema = this.opts.validateSchema, - addSchema = this.opts.addUsedSchema - ): SchemaEnv { - let id: string | undefined - const {schemaId} = this.opts - if (typeof schema == "object") { - id = schema[schemaId] - } else { - 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 - - baseId = normalizeId(id || baseId) - const localRefs = getSchemaRefs.call(this, schema, baseId) - sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs}) - this._cache.set(sch.schema, sch) - if (addSchema && !baseId.startsWith("#")) { - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) - if (baseId) this._checkUnique(baseId) - this.refs[baseId] = 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 a7e7bce..0000000 --- a/node_modules/table/node_modules/ajv/lib/jtd.ts +++ /dev/null @@ -1,132 +0,0 @@ -import type {AnySchemaObject, SchemaObject, JTDParser} from "./types" -import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema" -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_SCHEMA_ID = "JTD-meta-schema" - -type JTDOptions = CurrentOptions & { - // strict mode options not supported with JTD: - strict?: never - allowMatchingProperties?: never - allowUnionTypes?: never - validateFormats?: never - // validation and reporting options not supported with JTD: - $data?: never - verbose?: boolean - $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 -} - -export class Ajv extends AjvCore { - constructor(opts: JTDOptions = {}) { - super({ - ...opts, - jtd: true, - }) - } - - _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 - } -} - -module.exports = exports = Ajv -module.exports.Ajv = Ajv -Object.defineProperty(exports, "__esModule", {value: true}) - -export default Ajv - -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" -export {KeywordCxt} from "./compile/validate" -export {JTDErrorObject} from "./vocabularies/jtd" -export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen" - -export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} -export {JTDOptions} -export {default as ValidationError} from "./runtime/validation_error" -export {default as MissingRefError} from "./compile/ref_error" 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 9ffc9f5..0000000 --- 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 b6ea719..0000000 --- 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 applicator from "./meta/applicator.json" -import * as content from "./meta/content.json" -import * as core from "./meta/core.json" -import * as format from "./meta/format.json" -import * as metadata from "./meta/meta-data.json" -import * as validation from "./meta/validation.json" - -const META_SUPPORT_DATA = ["/properties"] - -export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv { - ;[ - metaSchema, - applicator, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].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 c5e91cf..0000000 --- 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 b8f6373..0000000 --- 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 f71adbf..0000000 --- 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 03ccfce..0000000 --- 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 0e19432..0000000 --- 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 7027a12..0000000 --- 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 54eb715..0000000 --- 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-2020-12/index.ts b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts deleted file mode 100644 index 8e850d0..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type Ajv from "../../core" -import type {AnySchemaObject} from "../../types" -import * as metaSchema from "./schema.json" -import * as applicator from "./meta/applicator.json" -import * as unevaluated from "./meta/unevaluated.json" -import * as content from "./meta/content.json" -import * as core from "./meta/core.json" -import * as format from "./meta/format-annotation.json" -import * as metadata from "./meta/meta-data.json" -import * as validation from "./meta/validation.json" - -const META_SUPPORT_DATA = ["/properties"] - -export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv { - ;[ - metaSchema, - applicator, - unevaluated, - content, - core, - with$data(this, format), - metadata, - with$data(this, validation), - ].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-2020-12/meta/applicator.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json deleted file mode 100644 index 674c913..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/applicator", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/applicator": true - }, - "$dynamicAnchor": "meta", - - "title": "Applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "prefixItems": {"$ref": "#/$defs/schemaArray"}, - "items": {"$dynamicRef": "#meta"}, - "contains": {"$dynamicRef": "#meta"}, - "additionalProperties": {"$dynamicRef": "#meta"}, - "properties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "propertyNames": {"format": "regex"}, - "default": {} - }, - "dependentSchemas": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "default": {} - }, - "propertyNames": {"$dynamicRef": "#meta"}, - "if": {"$dynamicRef": "#meta"}, - "then": {"$dynamicRef": "#meta"}, - "else": {"$dynamicRef": "#meta"}, - "allOf": {"$ref": "#/$defs/schemaArray"}, - "anyOf": {"$ref": "#/$defs/schemaArray"}, - "oneOf": {"$ref": "#/$defs/schemaArray"}, - "not": {"$dynamicRef": "#meta"} - }, - "$defs": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": {"$dynamicRef": "#meta"} - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json deleted file mode 100644 index 2ae23dd..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/content", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Content vocabulary meta-schema", - - "type": ["object", "boolean"], - "properties": { - "contentEncoding": {"type": "string"}, - "contentMediaType": {"type": "string"}, - "contentSchema": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json deleted file mode 100644 index 4c8e5cb..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/core", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true - }, - "$dynamicAnchor": "meta", - - "title": "Core vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "$id": { - "$ref": "#/$defs/uriReferenceString", - "$comment": "Non-empty fragments not allowed.", - "pattern": "^[^#]*#?$" - }, - "$schema": {"$ref": "#/$defs/uriString"}, - "$ref": {"$ref": "#/$defs/uriReferenceString"}, - "$anchor": {"$ref": "#/$defs/anchorString"}, - "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"}, - "$dynamicAnchor": {"$ref": "#/$defs/anchorString"}, - "$vocabulary": { - "type": "object", - "propertyNames": {"$ref": "#/$defs/uriString"}, - "additionalProperties": { - "type": "boolean" - } - }, - "$comment": { - "type": "string" - }, - "$defs": { - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"} - } - }, - "$defs": { - "anchorString": { - "type": "string", - "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" - }, - "uriString": { - "type": "string", - "format": "uri" - }, - "uriReferenceString": { - "type": "string", - "format": "uri-reference" - } - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json deleted file mode 100644 index 83c26e3..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true - }, - "$dynamicAnchor": "meta", - - "title": "Format vocabulary meta-schema for annotation results", - "type": ["object", "boolean"], - "properties": { - "format": {"type": "string"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json deleted file mode 100644 index 11946fb..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/meta-data", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/meta-data": true - }, - "$dynamicAnchor": "meta", - - "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-2020-12/meta/unevaluated.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json deleted file mode 100644 index 5e4b203..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true - }, - "$dynamicAnchor": "meta", - - "title": "Unevaluated applicator vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "unevaluatedItems": {"$dynamicRef": "#meta"}, - "unevaluatedProperties": {"$dynamicRef": "#meta"} - } -} diff --git a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json deleted file mode 100644 index e0ae13d..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/meta/validation", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/validation": true - }, - "$dynamicAnchor": "meta", - - "title": "Validation vocabulary meta-schema", - "type": ["object", "boolean"], - "properties": { - "type": { - "anyOf": [ - {"$ref": "#/$defs/simpleTypes"}, - { - "type": "array", - "items": {"$ref": "#/$defs/simpleTypes"}, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "const": true, - "enum": { - "type": "array", - "items": true - }, - "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" - } - } - }, - "$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-2020-12/schema.json b/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json deleted file mode 100644 index 1c68270..0000000 --- a/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://json-schema.org/draft/2020-12/schema", - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true, - "https://json-schema.org/draft/2020-12/vocab/applicator": true, - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, - "https://json-schema.org/draft/2020-12/vocab/validation": true, - "https://json-schema.org/draft/2020-12/vocab/meta-data": true, - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, - "https://json-schema.org/draft/2020-12/vocab/content": true - }, - "$dynamicAnchor": "meta", - - "title": "Core and Validation specifications meta-schema", - "allOf": [ - {"$ref": "meta/core"}, - {"$ref": "meta/applicator"}, - {"$ref": "meta/unevaluated"}, - {"$ref": "meta/validation"}, - {"$ref": "meta/meta-data"}, - {"$ref": "meta/format-annotation"}, - {"$ref": "meta/content"} - ], - "type": ["object", "boolean"], - "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", - "properties": { - "definitions": { - "$comment": "\"definitions\" has been replaced by \"$defs\".", - "type": "object", - "additionalProperties": {"$dynamicRef": "#meta"}, - "deprecated": true, - "default": {} - }, - "dependencies": { - "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.", - "type": "object", - "additionalProperties": { - "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}] - }, - "deprecated": true, - "default": {} - }, - "$recursiveAnchor": { - "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".", - "$ref": "meta/core#/$defs/anchorString", - "deprecated": true - }, - "$recursiveRef": { - "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".", - "$ref": "meta/core#/$defs/uriReferenceString", - "deprecated": true - } - } -} 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 5410064..0000000 --- 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 6a74851..0000000 --- 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 3968abd..0000000 --- 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 c019812..0000000 --- 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/equal.ts b/node_modules/table/node_modules/ajv/lib/runtime/equal.ts deleted file mode 100644 index 3cb0063..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/equal.ts +++ /dev/null @@ -1,7 +0,0 @@ -// https://github.com/ajv-validator/ajv/issues/889 -import * as equal from "fast-deep-equal" - -type Equal = typeof equal & {code: string} -;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default' - -export default equal as Equal 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 472e5e5..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/parseJson.ts +++ /dev/null @@ -1,177 +0,0 @@ -const rxParseJson = /position\s(\d+)(?: \(line \d+ column \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 as Error).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] - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (c === undefined) { - errorMessage("unexpected end") - return undefined - } - c = c.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 { - errorMessage(`unexpected token ${c}`) - return undefined - } - pos++ - } - str += String.fromCharCode(code) - } else { - errorMessage(`unexpected token ${c}`) - return undefined - } - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - } 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 1160e6a..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/quote.ts +++ /dev/null @@ -1,31 +0,0 @@ -const rxEscapable = - // eslint-disable-next-line no-control-regex, no-misleading-character-class - /[\\"\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) + - '"' - ) -} - -quote.code = 'require("ajv/dist/runtime/quote").default' diff --git a/node_modules/table/node_modules/ajv/lib/runtime/re2.ts b/node_modules/table/node_modules/ajv/lib/runtime/re2.ts deleted file mode 100644 index 0c769bc..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/re2.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as re2 from "re2" - -type Re2 = typeof re2 & {code: string} -;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default' - -export default re2 as Re2 diff --git a/node_modules/table/node_modules/ajv/lib/runtime/timestamp.ts b/node_modules/table/node_modules/ajv/lib/runtime/timestamp.ts deleted file mode 100644 index 1625f9a..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/timestamp.ts +++ /dev/null @@ -1,46 +0,0 @@ -const DT_SEPARATOR = /t|\s/i -const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/ -const TIME = /^(\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, allowDate: boolean): boolean { - // http://tools.ietf.org/html/rfc3339#section-5.6 - const dt: string[] = str.split(DT_SEPARATOR) - return ( - (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) || - (allowDate && dt.length === 1 && validDate(dt[0])) - ) -} - -function validDate(str: string): boolean { - const matches: string[] | null = DATE.exec(str) - if (!matches) return false - const y: number = +matches[1] - const m: number = +matches[2] - const d: number = +matches[3] - 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))) - ) -} - -function validTime(str: string): boolean { - const matches: string[] | null = TIME.exec(str) - if (!matches) return false - const hr: number = +matches[1] - const min: number = +matches[2] - const sec: number = +matches[3] - const tzH: number = +(matches[4] || 0) - const tzM: number = +(matches[5] || 0) - return ( - (hr <= 23 && min <= 59 && sec <= 59) || - // leap second - (hr - tzH === 23 && min - tzM === 59 && sec === 60) - ) -} - -validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default' diff --git a/node_modules/table/node_modules/ajv/lib/runtime/ucs2length.ts b/node_modules/table/node_modules/ajv/lib/runtime/ucs2length.ts deleted file mode 100644 index 47d8292..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/ucs2length.ts +++ /dev/null @@ -1,20 +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 -} - -ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default' diff --git a/node_modules/table/node_modules/ajv/lib/runtime/uri.ts b/node_modules/table/node_modules/ajv/lib/runtime/uri.ts deleted file mode 100644 index 5450549..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/uri.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as uri from "fast-uri" - -type URI = typeof uri & {code: string} -;(uri as URI).code = 'require("ajv/dist/runtime/uri").default' - -export default uri as URI diff --git a/node_modules/table/node_modules/ajv/lib/runtime/validation_error.ts b/node_modules/table/node_modules/ajv/lib/runtime/validation_error.ts deleted file mode 100644 index 2d19a46..0000000 --- a/node_modules/table/node_modules/ajv/lib/runtime/validation_error.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type {ErrorObject} from "../types" - -export default 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 - } -} 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 b6129ce..0000000 --- a/node_modules/table/node_modules/ajv/lib/standalone/index.ts +++ /dev/null @@ -1,100 +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, getEsmExportName} from "../compile/codegen/code" - -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) - if (ajv.opts.code.esm) { - // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value - return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}` - } - 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) - const exportSyntax = ajv.opts.code.esm - ? _`export const ${getEsmExportName(name)}` - : _`exports${getProperty(name)}` - code = _`${code}${_n}${exportSyntax} = ${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) - } - } -} - -module.exports = exports = standaloneCode -Object.defineProperty(exports, "__esModule", {value: true}) - -export default standaloneCode 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 c4b2c30..0000000 --- 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 39bc51b..0000000 --- a/node_modules/table/node_modules/ajv/lib/types/index.ts +++ /dev/null @@ -1,244 +0,0 @@ -import {URIComponent} from "fast-uri" -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/validate" -import type Ajv from "../core" - -interface _SchemaObject { - id?: string - $id?: string - $schema?: string - [x: string]: any // TODO -} - -export interface SchemaObject extends _SchemaObject { - id?: string - $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 { - instancePath: 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 { - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents - (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 - 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) => string | 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 - -export interface RegExpEngine { - (pattern: string, u: string): RegExpLike - code: string -} - -export interface RegExpLike { - test: (s: string) => boolean -} - -export interface UriResolver { - parse(uri: string): URIComponent - resolve(base: string, path: string): string - serialize(component: URIComponent): 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 065c972..0000000 --- a/node_modules/table/node_modules/ajv/lib/types/json-schema.ts +++ /dev/null @@ -1,187 +0,0 @@ -/* eslint-disable @typescript-eslint/no-empty-interface */ -type StrictNullChecksWrapper = undefined extends null - ? `strictNullChecks must be true in tsconfig to use ${Name}` - : Type - -type UnionToIntersection = (U extends any ? (_: U) => void : never) extends (_: infer I) => void - ? I - : never - -export type SomeJSONSchema = UncheckedJSONSchemaType - -type UncheckedPartialSchema = Partial> - -export type PartialSchema = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema> - -type JSONType = IsPartial extends true - ? T | undefined - : T - -interface NumberKeywords { - minimum?: number - maximum?: number - exclusiveMinimum?: number - exclusiveMaximum?: number - multipleOf?: number - format?: string -} - -interface StringKeywords { - minLength?: number - maxLength?: number - pattern?: string - format?: string -} - -type UncheckedJSONSchemaType = ( - | // these two unions allow arbitrary unions of types - { - anyOf: readonly UncheckedJSONSchemaType[] - } - | { - oneOf: readonly UncheckedJSONSchemaType[] - } - // this union allows for { type: (primitive)[] } style schemas - | ({ - type: readonly (T extends number - ? JSONType<"number" | "integer", IsPartial> - : T extends string - ? JSONType<"string", IsPartial> - : T extends boolean - ? JSONType<"boolean", IsPartial> - : never)[] - } & UnionToIntersection< - T extends number - ? NumberKeywords - : T extends string - ? StringKeywords - : T extends boolean - ? // eslint-disable-next-line @typescript-eslint/ban-types - {} - : never - >) - // this covers "normal" types; it's last so typescript looks to it first for errors - | ((T extends number - ? { - type: JSONType<"number" | "integer", IsPartial> - } & NumberKeywords - : T extends string - ? { - type: JSONType<"string", IsPartial> - } & StringKeywords - : T extends boolean - ? { - type: JSONType<"boolean", IsPartial> - } - : T extends readonly [any, ...any[]] - ? { - // JSON AnySchema for tuple - type: JSONType<"array", IsPartial> - items: { - readonly [K in keyof T]-?: UncheckedJSONSchemaType & Nullable - } & {length: T["length"]} - minItems: T["length"] - } & ({maxItems: T["length"]} | {additionalItems: false}) - : T extends readonly any[] - ? { - type: JSONType<"array", IsPartial> - items: UncheckedJSONSchemaType - contains?: UncheckedPartialSchema - 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", IsPartial> - additionalProperties?: boolean | UncheckedJSONSchemaType - unevaluatedProperties?: boolean | UncheckedJSONSchemaType - properties?: IsPartial extends true - ? Partial> - : UncheckedPropertiesSchema - patternProperties?: Record> - propertyNames?: Omit, "type"> & {type?: "string"} - dependencies?: {[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema} - dependentRequired?: {[K in keyof T]?: readonly (keyof T)[]} - dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema} - minProperties?: number - maxProperties?: number - } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties - ? {required: readonly (keyof T)[]} - : [UncheckedRequiredMembers] extends [never] - ? {required?: readonly UncheckedRequiredMembers[]} - : {required: readonly UncheckedRequiredMembers[]}) - : T extends null - ? { - type: JSONType<"null", IsPartial> - nullable: true - } - : never) & { - allOf?: readonly UncheckedPartialSchema[] - anyOf?: readonly UncheckedPartialSchema[] - oneOf?: readonly UncheckedPartialSchema[] - if?: UncheckedPartialSchema - then?: UncheckedPartialSchema - else?: UncheckedPartialSchema - not?: UncheckedPartialSchema - }) -) & { - [keyword: string]: any - $id?: string - $ref?: string - $defs?: Record> - definitions?: Record> -} - -export type JSONSchemaType = StrictNullChecksWrapper< - "JSONSchemaType", - UncheckedJSONSchemaType -> - -type Known = - | {[key: string]: Known} - | [Known, ...Known[]] - | Known[] - | number - | string - | boolean - | null - -type UncheckedPropertiesSchema = { - [K in keyof T]-?: (UncheckedJSONSchemaType & Nullable) | {$ref: string} -} - -export type PropertiesSchema = StrictNullChecksWrapper< - "PropertiesSchema", - UncheckedPropertiesSchema -> - -type UncheckedRequiredMembers = { - [K in keyof T]-?: undefined extends T[K] ? never : K -}[keyof T] - -export type RequiredMembers = StrictNullChecksWrapper< - "RequiredMembers", - UncheckedRequiredMembers -> - -type Nullable = undefined extends T - ? { - nullable: true - const?: null // 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 - } - : { - nullable?: false - const?: T - enum?: readonly T[] - 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 61b2bde..0000000 --- a/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts +++ /dev/null @@ -1,273 +0,0 @@ -/** numeric strings */ -type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32" - -/** string strings */ -type StringType = "string" | "timestamp" - -/** Generic JTD Schema without inference of the represented type */ -export type SomeJTDSchemaType = ( - | // ref - {ref: string} - // primitives - | {type: NumberType | StringType | "boolean"} - // enum - | {enum: string[]} - // elements - | {elements: SomeJTDSchemaType} - // values - | {values: SomeJTDSchemaType} - // properties - | { - properties: Record - optionalProperties?: Record - additionalProperties?: boolean - } - | { - properties?: Record - optionalProperties: Record - additionalProperties?: boolean - } - // discriminator - | {discriminator: string; mapping: Record} - // empty - // NOTE see the end of - // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492 - // eslint-disable-next-line @typescript-eslint/ban-types - | {} -) & { - nullable?: boolean - metadata?: Record - definitions?: Record -} - -/** 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 : false - -/** true if type is a properties 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 - -/** true if type represents an empty record */ -type IsEmptyRecord = [T] extends [Record] - ? [T] extends [never] - ? false - : true - : false - -/** 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 - : // empty properties - true extends IsEmptyRecord> - ? - | {properties: Record; optionalProperties?: Record} - | {optionalProperties: Record} - : // values - true extends IsValues> - ? T extends Record - ? { - values: JTDSchemaType - } - : never - : // properties - true extends IsRecord, false> - ? ([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, true> - ? { - [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 ? T : never, K>, - 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} - ? D extends {[K in S["ref"]]: infer V} - ? JTDDataDef - : never - : // type - S extends {type: NumberType} - ? number - : S extends {type: "boolean"} - ? boolean - : 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 755e5b3..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" - -export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must 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 {parentSchema, it} = cxt - const {items} = parentSchema - if (!Array.isArray(items)) { - checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas') - return - } - validateAdditionalItems(cxt, items) - }, -} - -export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void { - const {gen, schema, data, keyword, it} = cxt - 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, 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 bfb511c..0000000 --- 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 type {SubschemaArgs} from "../../compile/validate/subschema" -import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util" - -export type AdditionalPropertiesError = ErrorObject< - "additionalProperties", - {additionalProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "must 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(cxt, 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 cdfa86f..0000000 --- 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/validate" -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 bd331b5..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +++ /dev/null @@ -1,14 +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: "must match a 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 d88675c..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/contains.ts +++ /dev/null @@ -1,109 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util" - -export type ContainsError = ErrorObject< - "contains", - {minContains: number; maxContains?: number}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: ({params: {min, max}}) => - max === undefined - ? str`must contain at least ${min} valid item(s)` - : str`must 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 if (min === 0) { - gen.let(valid, true) - if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount) - } else { - gen.let(valid, false) - validateItemsWithCount() - } - cxt.result(valid, () => cxt.reset()) - - function validateItemsWithCount(): void { - const schValid = gen.name("_valid") - const count = gen.let("count", 0) - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))) - } - - 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 f676112..0000000 --- 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/validate" -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`must 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 dbd3ae4..0000000 --- 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 5a40d5e..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/if.ts +++ /dev/null @@ -1,80 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {SchemaObjCxt} from "../../compile" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode} from "../../compile/util" - -export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params}) => str`must 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 fc52716..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type {ErrorNoParams, Vocabulary} from "../../types" -import additionalItems, {AdditionalItemsError} from "./additionalItems" -import prefixItems from "./prefixItems" -import items from "./items" -import items2020, {ItemsError} from "./items2020" -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" - -export default function getApplicator(draft2020 = false): Vocabulary { - const applicator = [ - // any - notKeyword, - anyOf, - oneOf, - allOf, - ifKeyword, - thenElse, - // object - propertyNames, - additionalProperties, - dependencies, - properties, - patternProperties, - ] - // array - if (draft2020) applicator.push(prefixItems, items2020) - else applicator.push(additionalItems, items) - applicator.push(contains) - return applicator -} - -export type ApplicatorKeywordError = - | ErrorNoParams<"false schema"> - | AdditionalItemsError - | ItemsError - | 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 033cb39..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_} from "../../compile/codegen" -import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util" -import {validateArray} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt: KeywordCxt) { - const {schema, it} = cxt - if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema) - it.items = true - if (alwaysValidSchema(it, schema)) return - cxt.ok(validateArray(cxt)) - }, -} - -export function validateTuple( - cxt: KeywordCxt, - extraItems: string, - schArr: AnySchema[] = cxt.schema -): void { - const {gen, parentSchema, data, keyword, it} = cxt - checkStrictTuple(parentSchema) - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = mergeEvaluated.items(gen, schArr.length, it.items) - } - 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, - schemaProp: i, - dataProp: i, - }, - valid - ) - ) - cxt.ok(valid) - }) - - function checkStrictTuple(sch: AnySchemaObject): void { - const {opts, errSchemaPath} = it - const l = schArr.length - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false) - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"` - checkStrictMode(it, msg, opts.strictTuples) - } - } -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items2020.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items2020.ts deleted file mode 100644 index 2a99b08..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" -import {validateArray} from "../code" -import {validateAdditionalItems} from "./additionalItems" - -export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must NOT have more than ${len} items`, - params: ({params: {len}}) => _`{limit: ${len}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error, - code(cxt: KeywordCxt) { - const {schema, parentSchema, it} = cxt - const {prefixItems} = parentSchema - it.items = true - if (alwaysValidSchema(it, schema)) return - if (prefixItems) validateAdditionalItems(cxt, prefixItems) - else cxt.ok(validateArray(cxt)) - }, -} - -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 8691db0..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/not.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -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.failResult( - valid, - () => cxt.reset(), - () => cxt.error() - ) - }, - error: {message: "must 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 c25353f..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -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: "must 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, parentSchema, it} = cxt - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - if (it.opts.discriminator && parentSchema.discriminator) return - 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 ea624e2..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +++ /dev/null @@ -1,91 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {allSchemaProperties, usePattern} from "../code" -import {_, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, checkStrictMode} from "../../compile/util" -import {evaluatedPropsToName, Type} from "../../compile/util" -import {AnySchema} from "../../types" - -const def: CodeKeywordDefinition = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt: KeywordCxt) { - const {gen, schema, data, parentSchema, it} = cxt - const {opts} = it - const patterns = allSchemaProperties(schema) - const alwaysValidPatterns = patterns.filter((p) => - alwaysValidSchema(it, schema[p] as AnySchema) - ) - - if ( - patterns.length === 0 || - (alwaysValidPatterns.length === patterns.length && - (!it.opts.unevaluated || it.props === true)) - ) { - return - } - - const checkProperties = - opts.strictSchema && !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(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat) - if (!alwaysValid) { - 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 (!alwaysValid && !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/prefixItems.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts deleted file mode 100644 index 008fb2d..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateTuple} from "./items" - -const def: CodeKeywordDefinition = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => validateTuple(cxt, "items"), -} - -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 a55b19c..0000000 --- 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/validate" -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 1c54d60..0000000 --- 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/validate" -import {_, not} from "../../compile/codegen" -import {alwaysValidSchema} from "../../compile/util" - -export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema> - -const error: KeywordErrorDefinition = { - message: "property name must be valid", - 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 5055182..0000000 --- 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/validate" -import {checkStrictMode} from "../../compile/util" - -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 92cdd5b..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/code.ts +++ /dev/null @@ -1,168 +0,0 @@ -import type {AnySchema, SchemaMap} from "../types" -import type {SchemaCxt} from "../compile" -import type {KeywordCxt} from "../compile/validate" -import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen" -import {alwaysValidSchema, Type} from "../compile/util" -import N from "../compile/names" -import {useFunc} from "../compile/util" -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.instancePath, strConcat(N.instancePath, 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})` -} - -const newRegExp = _`new RegExp` - -export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name { - const u = opts.unicodeRegExp ? "u" : "" - const {regExp} = opts.code - const rx = regExp(pattern, u) - - return gen.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, 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 aa36c4b..0000000 --- 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 e63e289..0000000 --- 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 5d59fbc..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/core/ref.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type {CodeKeywordDefinition, AnySchema} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import MissingRefError from "../../compile/ref_error" -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: $ref, it} = cxt - const {baseId, schemaEnv: env, validateName, opts, self} = it - const {root} = env - if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef() - const schOrEnv = resolveRef.call(self, root, baseId, $ref) - if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref) - if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv) - return inlineRefSchema(schOrEnv) - - function callRootRef(): void { - if (env === root) return callRef(cxt, validateName, env, env.$async) - const rootName = gen.scopeValue("root", {ref: root}) - return callRef(cxt, _`${rootName}.validate`, root, 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: $ref, - }, - 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/discriminator/index.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/index.ts deleted file mode 100644 index 19ae604..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/index.ts +++ /dev/null @@ -1,113 +0,0 @@ -import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, getProperty, Name} from "../../compile/codegen" -import {DiscrError, DiscrErrorObj} from "../discriminator/types" -import {resolveRef, SchemaEnv} from "../../compile" -import MissingRefError from "../../compile/ref_error" -import {schemaHasRulesButRef} from "../../compile/util" - -export type DiscriminatorError = DiscrErrorObj | DiscrErrorObj - -const error: KeywordErrorDefinition = { - message: ({params: {discrError, tagName}}) => - discrError === DiscrError.Tag - ? `tag "${tagName}" must be string` - : `value of tag "${tagName}" must be in oneOf`, - params: ({params: {discrError, tag, tagName}}) => - _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error, - code(cxt: KeywordCxt) { - const {gen, data, schema, parentSchema, it} = cxt - const {oneOf} = parentSchema - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option") - } - const tagName = schema.propertyName - if (typeof tagName != "string") throw new Error("discriminator: requires propertyName") - if (schema.mapping) throw new Error("discriminator: mapping is not supported") - if (!oneOf) throw new Error("discriminator: requires oneOf keyword") - const valid = gen.let("valid", false) - const tag = gen.const("tag", _`${data}${getProperty(tagName)}`) - gen.if( - _`typeof ${tag} == "string"`, - () => validateMapping(), - () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName}) - ) - cxt.ok(valid) - - function validateMapping(): void { - const mapping = getMapping() - gen.if(false) - for (const tagValue in mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - gen.assign(valid, applyTagSchema(mapping[tagValue])) - } - gen.else() - cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName}) - gen.endIf() - } - - function applyTagSchema(schemaProp?: number): Name { - const _valid = gen.name("valid") - const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid) - cxt.mergeEvaluated(schCxt, Name) - return _valid - } - - function getMapping(): {[T in string]?: number} { - const oneOfMapping: {[T in string]?: number} = {} - const topRequired = hasRequired(parentSchema) - let tagRequired = true - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i] - if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) { - const ref = sch.$ref - sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref) - if (sch instanceof SchemaEnv) sch = sch.schema - if (sch === undefined) throw new MissingRefError(it.opts.uriResolver, it.baseId, ref) - } - const propSch = sch?.properties?.[tagName] - if (typeof propSch != "object") { - throw new Error( - `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"` - ) - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)) - addMappings(propSch, i) - } - if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`) - return oneOfMapping - - function hasRequired({required}: AnySchemaObject): boolean { - return Array.isArray(required) && required.includes(tagName) - } - - function addMappings(sch: AnySchemaObject, i: number): void { - if (sch.const) { - addMapping(sch.const, i) - } else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i) - } - } else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`) - } - } - - function addMapping(tagValue: unknown, i: number): void { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`) - } - oneOfMapping[tagValue] = i - } - } - }, -} - -export default def diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/types.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/types.ts deleted file mode 100644 index bee5a27..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/discriminator/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {ErrorObject} from "../../types" - -export enum DiscrError { - Tag = "tag", - Mapping = "mapping", -} - -export type DiscrErrorObj = ErrorObject< - "discriminator", - {error: E; tag: string; tagValue: unknown}, - string -> diff --git a/node_modules/table/node_modules/ajv/lib/vocabularies/draft2020.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/draft2020.ts deleted file mode 100644 index 47fbf0e..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/draft2020.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {Vocabulary} from "../types" -import coreVocabulary from "./core" -import validationVocabulary from "./validation" -import getApplicatorVocabulary from "./applicator" -import dynamicVocabulary from "./dynamic" -import nextVocabulary from "./next" -import unevaluatedVocabulary from "./unevaluated" -import formatVocabulary from "./format" -import {metadataVocabulary, contentVocabulary} from "./metadata" - -const draft2020Vocabularies: Vocabulary[] = [ - dynamicVocabulary, - coreVocabulary, - validationVocabulary, - getApplicatorVocabulary(true), - formatVocabulary, - metadataVocabulary, - contentVocabulary, - nextVocabulary, - unevaluatedVocabulary, -] - -export default draft2020Vocabularies 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 226a644..0000000 --- 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 getApplicatorVocabulary from "./applicator" -import formatVocabulary from "./format" -import {metadataVocabulary, contentVocabulary} from "./metadata" - -const draft7Vocabularies: Vocabulary[] = [ - coreVocabulary, - validationVocabulary, - getApplicatorVocabulary(), - 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 ca1adb9..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -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 {schemaId} = self.opts - const sch = new SchemaEnv({schema, schemaId, 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 6a573f3..0000000 --- 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/validate" -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 6d521db..0000000 --- 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 25f3db9..0000000 --- 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/util" - -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 c84af0f..0000000 --- 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 c9ca3f0..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/errors.ts +++ /dev/null @@ -1,18 +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" -import type {DiscriminatorError} from "./discriminator" - -export type DefinedError = - | TypeError - | ApplicatorKeywordError - | ValidationKeywordError - | FormatError - | UnevaluatedPropertiesError - | UnevaluatedItemsError - | DependentRequiredError - | DiscriminatorError 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 4b1c13e..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/format/format.ts +++ /dev/null @@ -1,120 +0,0 @@ -import type { - AddedFormat, - FormatValidator, - AsyncFormatValidator, - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, nil, or, Code, getProperty, regexpCode} 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`must 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.strictSchema === 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.strictSchema === 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 code = - fmtDef instanceof RegExp - ? regexpCode(fmtDef) - : opts.code.formats - ? _`${opts.code.formats}${getProperty(schema)}` - : undefined - const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code}) - 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 bca2f5b..0000000 --- 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 f487c97..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +++ /dev/null @@ -1,89 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, not, getProperty, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" -import {DiscrError, DiscrErrorObj} from "../discriminator/types" - -export type JTDDiscriminatorError = - | _JTDTypeError<"discriminator", "object", string> - | DiscrErrorObj - | DiscrErrorObj - -const error: KeywordErrorDefinition = { - message: (cxt) => { - const {schema, params} = cxt - return params.discrError - ? params.discrError === DiscrError.Tag - ? `tag "${schema}" must be string` - : `value of tag "${schema}" must be in mapping` - : typeErrorMessage(cxt, "object") - }, - params: (cxt) => { - const {schema, params} = cxt - return params.discrError - ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` - : typeErrorParams(cxt, "object") - }, -} - -const def: CodeKeywordDefinition = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - error, - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, parentSchema} = cxt - const [valid, cond] = checkNullableObject(cxt, data) - - gen.if(cond) - validateDiscriminator() - gen.elseIf(not(valid)) - cxt.error() - gen.endIf() - cxt.ok(valid) - - function validateDiscriminator(): void { - const tag = gen.const("tag", _`${data}${getProperty(schema)}`) - gen.if(_`${tag} === undefined`) - cxt.error(false, {discrError: DiscrError.Tag, tag}) - gen.elseIf(_`typeof ${tag} == "string"`) - validateMapping(tag) - gen.else() - cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema}) - gen.endIf() - } - - function validateMapping(tag: Name): void { - gen.if(false) - for (const tagValue in parentSchema.mapping) { - gen.elseIf(_`${tag} === ${tagValue}`) - gen.assign(valid, applyTagSchema(tagValue)) - } - gen.else() - cxt.error( - false, - {discrError: DiscrError.Mapping, tag}, - {instancePath: schema, schemaPath: "mapping", parentSchema: true} - ) - gen.endIf() - } - - 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 983af7c..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/elements.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type {CodeKeywordDefinition, SchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema} from "../../compile/util" -import {validateArray} from "../code" -import {_, not} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullable} from "./nullable" -import {typeError, _JTDTypeError} from "./error" - -export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject> - -const def: CodeKeywordDefinition = { - keyword: "elements", - schemaType: "object", - error: typeError("array"), - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - if (alwaysValidSchema(it, schema)) return - const [valid] = checkNullable(cxt) - gen.if(not(valid), () => - gen.if( - _`Array.isArray(${data})`, - () => gen.assign(valid, validateArray(cxt)), - () => cxt.error() - ) - ) - cxt.ok(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 75464ff..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/enum.ts +++ /dev/null @@ -1,45 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, or, and, Code} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullable} from "./nullable" - -export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]> - -const error: KeywordErrorDefinition = { - message: "must be equal to one of the allowed values", - params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "enum", - schemaType: "array", - error, - 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 - const isString = _`typeof ${data} == "string"` - if (schema.length >= it.opts.loopEnum) { - let cond: Code - ;[valid, cond] = checkNullable(cxt, isString) - gen.if(cond, loopEnum) - } else { - /* istanbul ignore if */ - if (!Array.isArray(schema)) throw new Error("ajv implementation error") - valid = and(isString, 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/error.ts b/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/error.ts deleted file mode 100644 index 5069322..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/error.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types" -import {_, Code} from "../../compile/codegen" - -export type _JTDTypeError = ErrorObject< - K, - {type: T; nullable: boolean}, - S -> - -export function typeError(t: string): KeywordErrorDefinition { - return { - message: (cxt) => typeErrorMessage(cxt, t), - params: (cxt) => typeErrorParams(cxt, t), - } -} - -export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string { - return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}` -} - -export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code { - return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}` -} 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 f7baebc..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -import type {Vocabulary} from "../../types" -import refKeyword from "./ref" -import typeKeyword, {JTDTypeError} from "./type" -import enumKeyword, {JTDEnumError} from "./enum" -import elements, {JTDElementsError} from "./elements" -import properties, {JTDPropertiesError} from "./properties" -import optionalProperties from "./optionalProperties" -import discriminator, {JTDDiscriminatorError} from "./discriminator" -import values, {JTDValuesError} 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 - -export type JTDErrorObject = - | JTDTypeError - | JTDEnumError - | JTDElementsError - | JTDPropertiesError - | JTDDiscriminatorError - | JTDValuesError 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 19eeb8c..0000000 --- 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 c74b05d..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type {KeywordCxt} from "../../compile/validate" -import {_, not, nil, Code, Name} from "../../compile/codegen" - -export function checkNullable( - {gen, data, parentSchema}: KeywordCxt, - cond: Code = nil -): [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 8e91c8d..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {validateProperties, error} from "./properties" - -const def: CodeKeywordDefinition = { - keyword: "optionalProperties", - schemaType: "object", - error, - 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 9dd24c5..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts +++ /dev/null @@ -1,184 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - SchemaObject, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -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" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" - -enum PropError { - Additional = "additional", - Missing = "missing", -} - -type PropKeyword = "properties" | "optionalProperties" - -type PropSchema = {[P in string]?: SchemaObject} - -export type JTDPropertiesError = - | _JTDTypeError - | ErrorObject - | ErrorObject - -export const error: KeywordErrorDefinition = { - message: (cxt) => { - const {params} = cxt - return params.propError - ? params.propError === PropError.Additional - ? "must NOT have additional properties" - : `must have property '${params.missingProperty}'` - : typeErrorMessage(cxt, "object") - }, - params: (cxt) => { - const {params} = cxt - return params.propError - ? params.propError === PropError.Additional - ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` - : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` - : typeErrorParams(cxt, "object") - }, -} - -const def: CodeKeywordDefinition = { - keyword: "properties", - schemaType: "object", - error, - code: validateProperties, -} - -// const error: KeywordErrorDefinition = { -// message: "should NOT have additional properties", -// params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`, -// } - -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(prop) - ) - cxt.ok(_valid) - } - - function missingProperty(prop: string): void { - if (required) { - gen.assign(_valid, false) - cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop}) - } 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 addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator) - 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.error( - false, - {propError: PropError.Additional, additionalProperty: key}, - {instancePath: key, parentSchema: true} - ) - if (!it.opts.allErrors) gen.break() - } - }) - }) - } - - function isAdditional( - key: Name, - props: string[], - keyword: string, - jtdDiscriminator?: 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)) - if (jtdDiscriminator !== undefined) { - additional = and(additional, _`${key} !== ${jtdDiscriminator}`) - } - } else if (props.length || jtdDiscriminator !== undefined) { - const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props) - additional = and(...ps.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 97646ee..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/ref.ts +++ /dev/null @@ -1,76 +0,0 @@ -import type {CodeKeywordDefinition, AnySchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {compileSchema, SchemaEnv} from "../../compile" -import {_, not, nil, stringify} from "../../compile/codegen" -import MissingRefError from "../../compile/ref_error" -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(it.opts.uriResolver, "", 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, schemaPath: `/definitions/${ref}`}) - ) - 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 1727430..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/type.ts +++ /dev/null @@ -1,75 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, nil, or, Code} from "../../compile/codegen" -import validTimestamp from "../../runtime/timestamp" -import {useFunc} from "../../compile/util" -import {checkMetadata} from "./metadata" -import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error" - -export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType> - -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], -} - -export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType - -const error: KeywordErrorDefinition = { - message: (cxt) => typeErrorMessage(cxt, cxt.schema), - params: (cxt) => typeErrorParams(cxt, cxt.schema), -} - -function timestampCode(cxt: KeywordCxt): Code { - const {gen, data, it} = cxt - const {timestamp, allowDate} = it.opts - if (timestamp === "date") return _`${data} instanceof Date ` - const vts = useFunc(gen, validTimestamp) - const allowDateArg = allowDate ? _`, true` : nil - const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})` - return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString) -} - -const def: CodeKeywordDefinition = { - keyword: "type", - schemaType: "string", - error, - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {data, schema, parentSchema, it} = cxt - let cond: Code - switch (schema) { - case "boolean": - case "string": - cond = _`typeof ${data} == ${schema}` - break - case "timestamp": { - cond = timestampCode(cxt) - break - } - case "float32": - case "float64": - cond = _`typeof ${data} == "number"` - break - default: { - const sch = schema as IntType - cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)` - if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { - if (sch === "uint32") cond = _`${cond} && ${data} >= 0` - } else { - const [min, max] = intRange[sch] - cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}` - } - } - } - 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 588f07a..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/union.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type {CodeKeywordDefinition} from "../../types" -import {validateUnion} from "../code" - -const def: CodeKeywordDefinition = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: validateUnion, - error: {message: "must match a schema in union"}, -} - -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 e649450..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type {CodeKeywordDefinition, SchemaObject} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {alwaysValidSchema, Type} from "../../compile/util" -import {not, or, Name} from "../../compile/codegen" -import {checkMetadata} from "./metadata" -import {checkNullableObject} from "./nullable" -import {typeError, _JTDTypeError} from "./error" - -export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject> - -const def: CodeKeywordDefinition = { - keyword: "values", - schemaType: "object", - error: typeError("object"), - code(cxt: KeywordCxt) { - checkMetadata(cxt) - const {gen, data, schema, it} = cxt - const [valid, cond] = checkNullableObject(cxt, data) - if (alwaysValidSchema(it, schema)) { - gen.if(not(or(cond, valid)), () => cxt.error()) - } else { - gen.if(cond) - gen.assign(valid, validateMap()) - gen.elseIf(not(valid)) - cxt.error() - gen.endIf() - } - cxt.ok(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 b9d5af8..0000000 --- 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 1e987ad..0000000 --- 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 f7f0815..0000000 --- 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 50bf0e7..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type { - CodeKeywordDefinition, - ErrorObject, - KeywordErrorDefinition, - AnySchema, -} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, not, Name} from "../../compile/codegen" -import {alwaysValidSchema, Type} from "../../compile/util" - -export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema> - -const error: KeywordErrorDefinition = { - message: ({params: {len}}) => str`must 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 0e6868f..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { - CodeKeywordDefinition, - KeywordErrorDefinition, - ErrorObject, - AnySchema, -} from "../../types" -import {_, not, and, Name, Code} from "../../compile/codegen" -import {alwaysValidSchema, Type} from "../../compile/util" -import N from "../../compile/names" - -export type UnevaluatedPropertiesError = ErrorObject< - "unevaluatedProperties", - {unevaluatedProperty: string}, - AnySchema -> - -const error: KeywordErrorDefinition = { - message: "must 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 a3b94a5..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/const.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type ConstError = ErrorObject<"const", {allowedValue: any}> - -const error: KeywordErrorDefinition = { - message: "must be equal to constant", - params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "const", - $data: true, - error, - code(cxt: KeywordCxt) { - const {gen, data, $data, schemaCode, schema} = cxt - if ($data || (schema && typeof schema == "object")) { - cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`) - } else { - cxt.fail(_`${schema} !== ${data}`) - } - }, -} - -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 4c616cf..0000000 --- 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 76377fb..0000000 --- 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/validate" -import {_, or, Name, Code} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}> - -const error: KeywordErrorDefinition = { - message: "must 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 - let eql: Name | undefined - const getEql = (): Name => (eql ??= useFunc(gen, 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(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()) - ) - } - - function equalCode(vSchema: Name, i: number): Code { - const sch = schema[i] - return typeof sch === "object" && sch !== null - ? _`${getEql()}(${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 3531b19..0000000 --- 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 8bb43c1..0000000 --- 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/validate" -import {checkStrictMode} from "../../compile/util" - -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 566de85..0000000 --- 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/validate" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxItems" ? "more" : "fewer" - return str`must 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 f4f9472..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {_, str, operators} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import ucs2length from "../../runtime/ucs2length" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxLength" ? "more" : "fewer" - return str`must 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 - const len = - it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${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 5499202..0000000 --- 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/validate" -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`must 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 07fffa8..0000000 --- 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/validate" -import {_, str, operators} from "../../compile/codegen" - -const error: KeywordErrorDefinition = { - message({keyword, schemaCode}) { - const comp = keyword === "maxProperties" ? "more" : "fewer" - return str`must NOT have ${comp} than ${schemaCode} properties` - }, - 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 1fd79ab..0000000 --- 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/validate" -import {_, str} from "../../compile/codegen" - -export type MultipleOfError = ErrorObject< - "multipleOf", - {multipleOf: number}, - number | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({schemaCode}) => str`must 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 7b27b7d..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/pattern.ts +++ /dev/null @@ -1,28 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -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`must match pattern "${schemaCode}"`, - params: ({schemaCode}) => _`{pattern: ${schemaCode}}`, -} - -const def: CodeKeywordDefinition = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt: KeywordCxt) { - const {data, $data, schema, schemaCode, it} = cxt - // TODO regexp should be wrapped in try/catchs - const u = it.opts.unicodeRegExp ? "u" : "" - const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema) - 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 fea7367..0000000 --- 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/validate" -import { - checkReportMissingProp, - checkMissingProp, - reportMissingProp, - propertyInData, - noPropertyInData, -} from "../code" -import {_, str, nil, not, Name, Code} from "../../compile/codegen" -import {checkStrictMode} from "../../compile/util" - -export type RequiredError = ErrorObject< - "required", - {missingProperty: string}, - string[] | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {missingProperty}}) => str`must 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 765c4d0..0000000 --- a/node_modules/table/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types" -import type {KeywordCxt} from "../../compile/validate" -import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType" -import {_, str, Name} from "../../compile/codegen" -import {useFunc} from "../../compile/util" -import equal from "../../runtime/equal" - -export type UniqueItemsError = ErrorObject< - "uniqueItems", - {i: number; j: number}, - boolean | {$data: string} -> - -const error: KeywordErrorDefinition = { - message: ({params: {i, j}}) => - str`must 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.strictNumbers, 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 = useFunc(gen, 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 17df7b1..0000000 --- a/node_modules/table/node_modules/ajv/package.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "name": "ajv", - "version": "8.17.1", - "description": "Another JSON Schema Validator", - "main": "dist/ajv.js", - "types": "dist/ajv.d.ts", - "files": [ - "lib/", - "dist/", - ".runkit_example.js" - ], - "scripts": { - "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite", - "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"", - "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"", - "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot", - "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec", - "test-debug": "npm run test-spec -- --inspect-brk", - "test-cov": "nyc npm run test-spec", - "rollup": "rm -rf bundle && rollup -c", - "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD", - "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts", - "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests", - "test-karma": "karma start", - "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start", - "test-all": "npm run test-cov && if-node-version 12 npm run test-browser", - "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov", - "test-ci": "AJV_FULL_TEST=true npm test", - "prepublish": "npm run build", - "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd", - "docs:dev": "./scripts/prepare-site && vuepress dev docs", - "docs:build": "./scripts/prepare-site && vuepress build docs" - }, - "nyc": { - "exclude": [ - "**/spec/**", - "node_modules" - ], - "reporter": [ - "lcov", - "text-summary" - ] - }, - "repository": "ajv-validator/ajv", - "keywords": [ - "JSON", - "schema", - "validator", - "validation", - "jsonschema", - "json-schema", - "json-schema-validator", - "json-schema-validation" - ], - "author": "Evgeny Poberezkin", - "license": "MIT", - "bugs": "https://github.com/ajv-validator/ajv/issues", - "homepage": "https://ajv.js.org", - "runkitExampleFilename": ".runkit_example.js", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "devDependencies": { - "@ajv-validator/config": "^0.5.0", - "@rollup/plugin-commonjs": "^25.0.7", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-typescript": "^11.1.6", - "@types/chai": "^4.3.11", - "@types/mocha": "^10.0.6", - "@types/node": "^20.11.30", - "@types/require-from-string": "^1.2.3", - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.3.1", - "ajv-formats": "^3.0.1", - "browserify": "^17.0.0", - "chai": "^4.4.1", - "cross-env": "^7.0.3", - "dayjs": "^1.11.10", - "dayjs-plugin-utc": "^0.1.2", - "eslint": "^8.57.0", - "eslint-config-prettier": "^9.1.0", - "glob": "^10.3.10", - "husky": "^9.0.11", - "if-node-version": "^1.1.1", - "jimp": "^0.22.10", - "js-beautify": "^1.15.1", - "json-schema-test": "^2.0.0", - "karma": "^6.4.2", - "karma-chrome-launcher": "^3.2.0", - "karma-mocha": "^2.0.1", - "lint-staged": "^15.2.2", - "mocha": "^10.3.0", - "module-from-string": "^3.3.0", - "node-fetch": "^3.3.2", - "nyc": "^15.1.0", - "prettier": "3.0.3", - "re2": "^1.20.9", - "rollup": "^2.79.1", - "rollup-plugin-terser": "^7.0.2", - "ts-node": "^10.9.2", - "tsify": "^5.0.4", - "typescript": "5.3.3", - "uri-js": "^4.4.1" - }, - "collective": { - "type": "opencollective", - "url": "https://opencollective.com/ajv" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - }, - "prettier": "@ajv-validator/config/prettierrc.json", - "husky": { - "hooks": { - "pre-commit": "lint-staged && npm test" - } - }, - "lint-staged": { - "*.{json,yaml,js,ts}": "prettier --write" - } -} diff --git a/node_modules/table/node_modules/ansi-regex/index.d.ts b/node_modules/table/node_modules/ansi-regex/index.d.ts deleted file mode 100644 index 2dbf6af..0000000 --- a/node_modules/table/node_modules/ansi-regex/index.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -declare namespace ansiRegex { - interface Options { - /** - Match only the first ANSI escape. - - @default false - */ - onlyFirst: boolean; - } -} - -/** -Regular expression for matching ANSI escape codes. - -@example -``` -import ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` -*/ -declare function ansiRegex(options?: ansiRegex.Options): RegExp; - -export = ansiRegex; diff --git a/node_modules/table/node_modules/ansi-regex/index.js b/node_modules/table/node_modules/ansi-regex/index.js deleted file mode 100644 index 616ff83..0000000 --- a/node_modules/table/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = ({onlyFirst = false} = {}) => { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' - ].join('|'); - - return new RegExp(pattern, onlyFirst ? undefined : 'g'); -}; diff --git a/node_modules/table/node_modules/ansi-regex/license b/node_modules/table/node_modules/ansi-regex/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/table/node_modules/ansi-regex/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/ansi-regex/package.json b/node_modules/table/node_modules/ansi-regex/package.json deleted file mode 100644 index 017f531..0000000 --- a/node_modules/table/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "ansi-regex", - "version": "5.0.1", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": "chalk/ansi-regex", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/table/node_modules/ansi-regex/readme.md b/node_modules/table/node_modules/ansi-regex/readme.md deleted file mode 100644 index 4d848bc..0000000 --- a/node_modules/table/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,78 +0,0 @@ -# ansi-regex - -> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install ansi-regex -``` - - -## Usage - -```js -const ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001B[4mcake\u001B[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001B[4mcake\u001B[0m'.match(ansiRegex()); -//=> ['\u001B[4m', '\u001B[0m'] - -'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); -//=> ['\u001B[4m'] - -'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); -//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] -``` - - -## API - -### ansiRegex(options?) - -Returns a regex for matching ANSI escape codes. - -#### options - -Type: `object` - -##### onlyFirst - -Type: `boolean`
-Default: `false` *(Matches any ANSI escape codes in a string)* - -Match only the first ANSI escape. - - -## FAQ - -### Why do you test for codes not in the ECMA 48 standard? - -Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. - -On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. - - -## 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/table/node_modules/ansi-styles/index.d.ts b/node_modules/table/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e..0000000 --- a/node_modules/table/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/table/node_modules/ansi-styles/index.js b/node_modules/table/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581..0000000 --- a/node_modules/table/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/table/node_modules/ansi-styles/license b/node_modules/table/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/table/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/ansi-styles/package.json b/node_modules/table/node_modules/ansi-styles/package.json deleted file mode 100644 index 7539328..0000000 --- a/node_modules/table/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/table/node_modules/ansi-styles/readme.md b/node_modules/table/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de..0000000 --- a/node_modules/table/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` 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-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/table/node_modules/color-convert/CHANGELOG.md b/node_modules/table/node_modules/color-convert/CHANGELOG.md deleted file mode 100644 index 0a7bce4..0000000 --- a/node_modules/table/node_modules/color-convert/CHANGELOG.md +++ /dev/null @@ -1,54 +0,0 @@ -# 1.0.0 - 2016-01-07 - -- Removed: unused speed test -- Added: Automatic routing between previously unsupported conversions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Removed: `convert()` class -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: all functions to lookup dictionary -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Changed: `ansi` to `ansi256` -([#27](https://github.com/Qix-/color-convert/pull/27)) -- Fixed: argument grouping for functions requiring only one argument -([#27](https://github.com/Qix-/color-convert/pull/27)) - -# 0.6.0 - 2015-07-23 - -- Added: methods to handle -[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: - - rgb2ansi16 - - rgb2ansi - - hsl2ansi16 - - hsl2ansi - - hsv2ansi16 - - hsv2ansi - - hwb2ansi16 - - hwb2ansi - - cmyk2ansi16 - - cmyk2ansi - - keyword2ansi16 - - keyword2ansi - - ansi162rgb - - ansi162hsl - - ansi162hsv - - ansi162hwb - - ansi162cmyk - - ansi162keyword - - ansi2rgb - - ansi2hsl - - ansi2hsv - - ansi2hwb - - ansi2cmyk - - ansi2keyword -([#18](https://github.com/harthur/color-convert/pull/18)) - -# 0.5.3 - 2015-06-02 - -- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` -([#15](https://github.com/harthur/color-convert/issues/15)) - ---- - -Check out commit logs for older releases diff --git a/node_modules/table/node_modules/color-convert/LICENSE b/node_modules/table/node_modules/color-convert/LICENSE deleted file mode 100644 index 5b4c386..0000000 --- a/node_modules/table/node_modules/color-convert/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011-2016 Heather Arthur - -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/table/node_modules/color-convert/README.md b/node_modules/table/node_modules/color-convert/README.md deleted file mode 100644 index d4b08fc..0000000 --- a/node_modules/table/node_modules/color-convert/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# color-convert - -[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert) - -Color-convert is a color conversion library for JavaScript and node. -It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest): - -```js -var convert = require('color-convert'); - -convert.rgb.hsl(140, 200, 100); // [96, 48, 59] -convert.keyword.rgb('blue'); // [0, 0, 255] - -var rgbChannels = convert.rgb.channels; // 3 -var cmykChannels = convert.cmyk.channels; // 4 -var ansiChannels = convert.ansi16.channels; // 1 -``` - -# Install - -```console -$ npm install color-convert -``` - -# API - -Simply get the property of the _from_ and _to_ conversion that you're looking for. - -All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function. - -All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha). - -```js -var convert = require('color-convert'); - -// Hex to LAB -convert.hex.lab('DEADBF'); // [ 76, 21, -2 ] -convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ] - -// RGB to CMYK -convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ] -convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ] -``` - -### Arrays -All functions that accept multiple arguments also support passing an array. - -Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.) - -```js -var convert = require('color-convert'); - -convert.rgb.hex(123, 45, 67); // '7B2D43' -convert.rgb.hex([123, 45, 67]); // '7B2D43' -``` - -## Routing - -Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex). - -Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js). - -# Contribute - -If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request. - -# License -Copyright © 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE). diff --git a/node_modules/table/node_modules/color-convert/conversions.js b/node_modules/table/node_modules/color-convert/conversions.js deleted file mode 100644 index 2657f26..0000000 --- a/node_modules/table/node_modules/color-convert/conversions.js +++ /dev/null @@ -1,839 +0,0 @@ -/* MIT license */ -/* eslint-disable no-mixed-operators */ -const cssKeywords = require('color-name'); - -// NOTE: conversions should only return primitive values (i.e. arrays, or -// values that give correct `typeof` results). -// do not use box values types (i.e. Number(), String(), etc.) - -const reverseKeywords = {}; -for (const key of Object.keys(cssKeywords)) { - reverseKeywords[cssKeywords[key]] = key; -} - -const convert = { - rgb: {channels: 3, labels: 'rgb'}, - hsl: {channels: 3, labels: 'hsl'}, - hsv: {channels: 3, labels: 'hsv'}, - hwb: {channels: 3, labels: 'hwb'}, - cmyk: {channels: 4, labels: 'cmyk'}, - xyz: {channels: 3, labels: 'xyz'}, - lab: {channels: 3, labels: 'lab'}, - lch: {channels: 3, labels: 'lch'}, - hex: {channels: 1, labels: ['hex']}, - keyword: {channels: 1, labels: ['keyword']}, - ansi16: {channels: 1, labels: ['ansi16']}, - ansi256: {channels: 1, labels: ['ansi256']}, - hcg: {channels: 3, labels: ['h', 'c', 'g']}, - apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, - gray: {channels: 1, labels: ['gray']} -}; - -module.exports = convert; - -// Hide .channels and .labels properties -for (const model of Object.keys(convert)) { - if (!('channels' in convert[model])) { - throw new Error('missing channels property: ' + model); - } - - if (!('labels' in convert[model])) { - throw new Error('missing channel labels property: ' + model); - } - - if (convert[model].labels.length !== convert[model].channels) { - throw new Error('channel and label counts mismatch: ' + model); - } - - const {channels, labels} = convert[model]; - delete convert[model].channels; - delete convert[model].labels; - Object.defineProperty(convert[model], 'channels', {value: channels}); - Object.defineProperty(convert[model], 'labels', {value: labels}); -} - -convert.rgb.hsl = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const min = Math.min(r, g, b); - const max = Math.max(r, g, b); - const delta = max - min; - let h; - let s; - - if (max === min) { - h = 0; - } else if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else if (b === max) { - h = 4 + (r - g) / delta; - } - - h = Math.min(h * 60, 360); - - if (h < 0) { - h += 360; - } - - const l = (min + max) / 2; - - if (max === min) { - s = 0; - } else if (l <= 0.5) { - s = delta / (max + min); - } else { - s = delta / (2 - max - min); - } - - return [h, s * 100, l * 100]; -}; - -convert.rgb.hsv = function (rgb) { - let rdif; - let gdif; - let bdif; - let h; - let s; - - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const v = Math.max(r, g, b); - const diff = v - Math.min(r, g, b); - const diffc = function (c) { - return (v - c) / 6 / diff + 1 / 2; - }; - - if (diff === 0) { - h = 0; - s = 0; - } else { - s = diff / v; - rdif = diffc(r); - gdif = diffc(g); - bdif = diffc(b); - - if (r === v) { - h = bdif - gdif; - } else if (g === v) { - h = (1 / 3) + rdif - bdif; - } else if (b === v) { - h = (2 / 3) + gdif - rdif; - } - - if (h < 0) { - h += 1; - } else if (h > 1) { - h -= 1; - } - } - - return [ - h * 360, - s * 100, - v * 100 - ]; -}; - -convert.rgb.hwb = function (rgb) { - const r = rgb[0]; - const g = rgb[1]; - let b = rgb[2]; - const h = convert.rgb.hsl(rgb)[0]; - const w = 1 / 255 * Math.min(r, Math.min(g, b)); - - b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); - - return [h, w * 100, b * 100]; -}; - -convert.rgb.cmyk = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - - const k = Math.min(1 - r, 1 - g, 1 - b); - const c = (1 - r - k) / (1 - k) || 0; - const m = (1 - g - k) / (1 - k) || 0; - const y = (1 - b - k) / (1 - k) || 0; - - return [c * 100, m * 100, y * 100, k * 100]; -}; - -function comparativeDistance(x, y) { - /* - See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance - */ - return ( - ((x[0] - y[0]) ** 2) + - ((x[1] - y[1]) ** 2) + - ((x[2] - y[2]) ** 2) - ); -} - -convert.rgb.keyword = function (rgb) { - const reversed = reverseKeywords[rgb]; - if (reversed) { - return reversed; - } - - let currentClosestDistance = Infinity; - let currentClosestKeyword; - - for (const keyword of Object.keys(cssKeywords)) { - const value = cssKeywords[keyword]; - - // Compute comparative distance - const distance = comparativeDistance(rgb, value); - - // Check if its less, if so set as closest - if (distance < currentClosestDistance) { - currentClosestDistance = distance; - currentClosestKeyword = keyword; - } - } - - return currentClosestKeyword; -}; - -convert.keyword.rgb = function (keyword) { - return cssKeywords[keyword]; -}; - -convert.rgb.xyz = function (rgb) { - let r = rgb[0] / 255; - let g = rgb[1] / 255; - let b = rgb[2] / 255; - - // Assume sRGB - r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92); - g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92); - b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92); - - const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); - const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); - const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); - - return [x * 100, y * 100, z * 100]; -}; - -convert.rgb.lab = function (rgb) { - const xyz = convert.rgb.xyz(rgb); - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.hsl.rgb = function (hsl) { - const h = hsl[0] / 360; - const s = hsl[1] / 100; - const l = hsl[2] / 100; - let t2; - let t3; - let val; - - if (s === 0) { - val = l * 255; - return [val, val, val]; - } - - if (l < 0.5) { - t2 = l * (1 + s); - } else { - t2 = l + s - l * s; - } - - const t1 = 2 * l - t2; - - const rgb = [0, 0, 0]; - for (let i = 0; i < 3; i++) { - t3 = h + 1 / 3 * -(i - 1); - if (t3 < 0) { - t3++; - } - - if (t3 > 1) { - t3--; - } - - if (6 * t3 < 1) { - val = t1 + (t2 - t1) * 6 * t3; - } else if (2 * t3 < 1) { - val = t2; - } else if (3 * t3 < 2) { - val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; - } else { - val = t1; - } - - rgb[i] = val * 255; - } - - return rgb; -}; - -convert.hsl.hsv = function (hsl) { - const h = hsl[0]; - let s = hsl[1] / 100; - let l = hsl[2] / 100; - let smin = s; - const lmin = Math.max(l, 0.01); - - l *= 2; - s *= (l <= 1) ? l : 2 - l; - smin *= lmin <= 1 ? lmin : 2 - lmin; - const v = (l + s) / 2; - const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); - - return [h, sv * 100, v * 100]; -}; - -convert.hsv.rgb = function (hsv) { - const h = hsv[0] / 60; - const s = hsv[1] / 100; - let v = hsv[2] / 100; - const hi = Math.floor(h) % 6; - - const f = h - Math.floor(h); - const p = 255 * v * (1 - s); - const q = 255 * v * (1 - (s * f)); - const t = 255 * v * (1 - (s * (1 - f))); - v *= 255; - - switch (hi) { - case 0: - return [v, t, p]; - case 1: - return [q, v, p]; - case 2: - return [p, v, t]; - case 3: - return [p, q, v]; - case 4: - return [t, p, v]; - case 5: - return [v, p, q]; - } -}; - -convert.hsv.hsl = function (hsv) { - const h = hsv[0]; - const s = hsv[1] / 100; - const v = hsv[2] / 100; - const vmin = Math.max(v, 0.01); - let sl; - let l; - - l = (2 - s) * v; - const lmin = (2 - s) * vmin; - sl = s * vmin; - sl /= (lmin <= 1) ? lmin : 2 - lmin; - sl = sl || 0; - l /= 2; - - return [h, sl * 100, l * 100]; -}; - -// http://dev.w3.org/csswg/css-color/#hwb-to-rgb -convert.hwb.rgb = function (hwb) { - const h = hwb[0] / 360; - let wh = hwb[1] / 100; - let bl = hwb[2] / 100; - const ratio = wh + bl; - let f; - - // Wh + bl cant be > 1 - if (ratio > 1) { - wh /= ratio; - bl /= ratio; - } - - const i = Math.floor(6 * h); - const v = 1 - bl; - f = 6 * h - i; - - if ((i & 0x01) !== 0) { - f = 1 - f; - } - - const n = wh + f * (v - wh); // Linear interpolation - - let r; - let g; - let b; - /* eslint-disable max-statements-per-line,no-multi-spaces */ - switch (i) { - default: - case 6: - case 0: r = v; g = n; b = wh; break; - case 1: r = n; g = v; b = wh; break; - case 2: r = wh; g = v; b = n; break; - case 3: r = wh; g = n; b = v; break; - case 4: r = n; g = wh; b = v; break; - case 5: r = v; g = wh; b = n; break; - } - /* eslint-enable max-statements-per-line,no-multi-spaces */ - - return [r * 255, g * 255, b * 255]; -}; - -convert.cmyk.rgb = function (cmyk) { - const c = cmyk[0] / 100; - const m = cmyk[1] / 100; - const y = cmyk[2] / 100; - const k = cmyk[3] / 100; - - const r = 1 - Math.min(1, c * (1 - k) + k); - const g = 1 - Math.min(1, m * (1 - k) + k); - const b = 1 - Math.min(1, y * (1 - k) + k); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.rgb = function (xyz) { - const x = xyz[0] / 100; - const y = xyz[1] / 100; - const z = xyz[2] / 100; - let r; - let g; - let b; - - r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); - g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); - b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); - - // Assume sRGB - r = r > 0.0031308 - ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055) - : r * 12.92; - - g = g > 0.0031308 - ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055) - : g * 12.92; - - b = b > 0.0031308 - ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055) - : b * 12.92; - - r = Math.min(Math.max(0, r), 1); - g = Math.min(Math.max(0, g), 1); - b = Math.min(Math.max(0, b), 1); - - return [r * 255, g * 255, b * 255]; -}; - -convert.xyz.lab = function (xyz) { - let x = xyz[0]; - let y = xyz[1]; - let z = xyz[2]; - - x /= 95.047; - y /= 100; - z /= 108.883; - - x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116); - y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116); - z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116); - - const l = (116 * y) - 16; - const a = 500 * (x - y); - const b = 200 * (y - z); - - return [l, a, b]; -}; - -convert.lab.xyz = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let x; - let y; - let z; - - y = (l + 16) / 116; - x = a / 500 + y; - z = y - b / 200; - - const y2 = y ** 3; - const x2 = x ** 3; - const z2 = z ** 3; - y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; - x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; - z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; - - x *= 95.047; - y *= 100; - z *= 108.883; - - return [x, y, z]; -}; - -convert.lab.lch = function (lab) { - const l = lab[0]; - const a = lab[1]; - const b = lab[2]; - let h; - - const hr = Math.atan2(b, a); - h = hr * 360 / 2 / Math.PI; - - if (h < 0) { - h += 360; - } - - const c = Math.sqrt(a * a + b * b); - - return [l, c, h]; -}; - -convert.lch.lab = function (lch) { - const l = lch[0]; - const c = lch[1]; - const h = lch[2]; - - const hr = h / 360 * 2 * Math.PI; - const a = c * Math.cos(hr); - const b = c * Math.sin(hr); - - return [l, a, b]; -}; - -convert.rgb.ansi16 = function (args, saturation = null) { - const [r, g, b] = args; - let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization - - value = Math.round(value / 50); - - if (value === 0) { - return 30; - } - - let ansi = 30 - + ((Math.round(b / 255) << 2) - | (Math.round(g / 255) << 1) - | Math.round(r / 255)); - - if (value === 2) { - ansi += 60; - } - - return ansi; -}; - -convert.hsv.ansi16 = function (args) { - // Optimization here; we already know the value and don't need to get - // it converted for us. - return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); -}; - -convert.rgb.ansi256 = function (args) { - const r = args[0]; - const g = args[1]; - const b = args[2]; - - // We use the extended greyscale palette here, with the exception of - // black and white. normal palette only has 4 greyscale shades. - if (r === g && g === b) { - if (r < 8) { - return 16; - } - - if (r > 248) { - return 231; - } - - return Math.round(((r - 8) / 247) * 24) + 232; - } - - const ansi = 16 - + (36 * Math.round(r / 255 * 5)) - + (6 * Math.round(g / 255 * 5)) - + Math.round(b / 255 * 5); - - return ansi; -}; - -convert.ansi16.rgb = function (args) { - let color = args % 10; - - // Handle greyscale - if (color === 0 || color === 7) { - if (args > 50) { - color += 3.5; - } - - color = color / 10.5 * 255; - - return [color, color, color]; - } - - const mult = (~~(args > 50) + 1) * 0.5; - const r = ((color & 1) * mult) * 255; - const g = (((color >> 1) & 1) * mult) * 255; - const b = (((color >> 2) & 1) * mult) * 255; - - return [r, g, b]; -}; - -convert.ansi256.rgb = function (args) { - // Handle greyscale - if (args >= 232) { - const c = (args - 232) * 10 + 8; - return [c, c, c]; - } - - args -= 16; - - let rem; - const r = Math.floor(args / 36) / 5 * 255; - const g = Math.floor((rem = args % 36) / 6) / 5 * 255; - const b = (rem % 6) / 5 * 255; - - return [r, g, b]; -}; - -convert.rgb.hex = function (args) { - const integer = ((Math.round(args[0]) & 0xFF) << 16) - + ((Math.round(args[1]) & 0xFF) << 8) - + (Math.round(args[2]) & 0xFF); - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.hex.rgb = function (args) { - const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); - if (!match) { - return [0, 0, 0]; - } - - let colorString = match[0]; - - if (match[0].length === 3) { - colorString = colorString.split('').map(char => { - return char + char; - }).join(''); - } - - const integer = parseInt(colorString, 16); - const r = (integer >> 16) & 0xFF; - const g = (integer >> 8) & 0xFF; - const b = integer & 0xFF; - - return [r, g, b]; -}; - -convert.rgb.hcg = function (rgb) { - const r = rgb[0] / 255; - const g = rgb[1] / 255; - const b = rgb[2] / 255; - const max = Math.max(Math.max(r, g), b); - const min = Math.min(Math.min(r, g), b); - const chroma = (max - min); - let grayscale; - let hue; - - if (chroma < 1) { - grayscale = min / (1 - chroma); - } else { - grayscale = 0; - } - - if (chroma <= 0) { - hue = 0; - } else - if (max === r) { - hue = ((g - b) / chroma) % 6; - } else - if (max === g) { - hue = 2 + (b - r) / chroma; - } else { - hue = 4 + (r - g) / chroma; - } - - hue /= 6; - hue %= 1; - - return [hue * 360, chroma * 100, grayscale * 100]; -}; - -convert.hsl.hcg = function (hsl) { - const s = hsl[1] / 100; - const l = hsl[2] / 100; - - const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l)); - - let f = 0; - if (c < 1.0) { - f = (l - 0.5 * c) / (1.0 - c); - } - - return [hsl[0], c * 100, f * 100]; -}; - -convert.hsv.hcg = function (hsv) { - const s = hsv[1] / 100; - const v = hsv[2] / 100; - - const c = s * v; - let f = 0; - - if (c < 1.0) { - f = (v - c) / (1 - c); - } - - return [hsv[0], c * 100, f * 100]; -}; - -convert.hcg.rgb = function (hcg) { - const h = hcg[0] / 360; - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - if (c === 0.0) { - return [g * 255, g * 255, g * 255]; - } - - const pure = [0, 0, 0]; - const hi = (h % 1) * 6; - const v = hi % 1; - const w = 1 - v; - let mg = 0; - - /* eslint-disable max-statements-per-line */ - switch (Math.floor(hi)) { - case 0: - pure[0] = 1; pure[1] = v; pure[2] = 0; break; - case 1: - pure[0] = w; pure[1] = 1; pure[2] = 0; break; - case 2: - pure[0] = 0; pure[1] = 1; pure[2] = v; break; - case 3: - pure[0] = 0; pure[1] = w; pure[2] = 1; break; - case 4: - pure[0] = v; pure[1] = 0; pure[2] = 1; break; - default: - pure[0] = 1; pure[1] = 0; pure[2] = w; - } - /* eslint-enable max-statements-per-line */ - - mg = (1.0 - c) * g; - - return [ - (c * pure[0] + mg) * 255, - (c * pure[1] + mg) * 255, - (c * pure[2] + mg) * 255 - ]; -}; - -convert.hcg.hsv = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const v = c + g * (1.0 - c); - let f = 0; - - if (v > 0.0) { - f = c / v; - } - - return [hcg[0], f * 100, v * 100]; -}; - -convert.hcg.hsl = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - - const l = g * (1.0 - c) + 0.5 * c; - let s = 0; - - if (l > 0.0 && l < 0.5) { - s = c / (2 * l); - } else - if (l >= 0.5 && l < 1.0) { - s = c / (2 * (1 - l)); - } - - return [hcg[0], s * 100, l * 100]; -}; - -convert.hcg.hwb = function (hcg) { - const c = hcg[1] / 100; - const g = hcg[2] / 100; - const v = c + g * (1.0 - c); - return [hcg[0], (v - c) * 100, (1 - v) * 100]; -}; - -convert.hwb.hcg = function (hwb) { - const w = hwb[1] / 100; - const b = hwb[2] / 100; - const v = 1 - b; - const c = v - w; - let g = 0; - - if (c < 1) { - g = (v - c) / (1 - c); - } - - return [hwb[0], c * 100, g * 100]; -}; - -convert.apple.rgb = function (apple) { - return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; -}; - -convert.rgb.apple = function (rgb) { - return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; -}; - -convert.gray.rgb = function (args) { - return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; -}; - -convert.gray.hsl = function (args) { - return [0, 0, args[0]]; -}; - -convert.gray.hsv = convert.gray.hsl; - -convert.gray.hwb = function (gray) { - return [0, 100, gray[0]]; -}; - -convert.gray.cmyk = function (gray) { - return [0, 0, 0, gray[0]]; -}; - -convert.gray.lab = function (gray) { - return [gray[0], 0, 0]; -}; - -convert.gray.hex = function (gray) { - const val = Math.round(gray[0] / 100 * 255) & 0xFF; - const integer = (val << 16) + (val << 8) + val; - - const string = integer.toString(16).toUpperCase(); - return '000000'.substring(string.length) + string; -}; - -convert.rgb.gray = function (rgb) { - const val = (rgb[0] + rgb[1] + rgb[2]) / 3; - return [val / 255 * 100]; -}; diff --git a/node_modules/table/node_modules/color-convert/index.js b/node_modules/table/node_modules/color-convert/index.js deleted file mode 100644 index b648e57..0000000 --- a/node_modules/table/node_modules/color-convert/index.js +++ /dev/null @@ -1,81 +0,0 @@ -const conversions = require('./conversions'); -const route = require('./route'); - -const convert = {}; - -const models = Object.keys(conversions); - -function wrapRaw(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - return fn(args); - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -function wrapRounded(fn) { - const wrappedFn = function (...args) { - const arg0 = args[0]; - - if (arg0 === undefined || arg0 === null) { - return arg0; - } - - if (arg0.length > 1) { - args = arg0; - } - - const result = fn(args); - - // We're assuming the result is an array here. - // see notice in conversions.js; don't use box types - // in conversion functions. - if (typeof result === 'object') { - for (let len = result.length, i = 0; i < len; i++) { - result[i] = Math.round(result[i]); - } - } - - return result; - }; - - // Preserve .conversion property if there is one - if ('conversion' in fn) { - wrappedFn.conversion = fn.conversion; - } - - return wrappedFn; -} - -models.forEach(fromModel => { - convert[fromModel] = {}; - - Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); - Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); - - const routes = route(fromModel); - const routeModels = Object.keys(routes); - - routeModels.forEach(toModel => { - const fn = routes[toModel]; - - convert[fromModel][toModel] = wrapRounded(fn); - convert[fromModel][toModel].raw = wrapRaw(fn); - }); -}); - -module.exports = convert; diff --git a/node_modules/table/node_modules/color-convert/package.json b/node_modules/table/node_modules/color-convert/package.json deleted file mode 100644 index 6e48000..0000000 --- a/node_modules/table/node_modules/color-convert/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "color-convert", - "description": "Plain color conversion functions", - "version": "2.0.1", - "author": "Heather Arthur ", - "license": "MIT", - "repository": "Qix-/color-convert", - "scripts": { - "pretest": "xo", - "test": "node test/basic.js" - }, - "engines": { - "node": ">=7.0.0" - }, - "keywords": [ - "color", - "colour", - "convert", - "converter", - "conversion", - "rgb", - "hsl", - "hsv", - "hwb", - "cmyk", - "ansi", - "ansi16" - ], - "files": [ - "index.js", - "conversions.js", - "route.js" - ], - "xo": { - "rules": { - "default-case": 0, - "no-inline-comments": 0, - "operator-linebreak": 0 - } - }, - "devDependencies": { - "chalk": "^2.4.2", - "xo": "^0.24.0" - }, - "dependencies": { - "color-name": "~1.1.4" - } -} diff --git a/node_modules/table/node_modules/color-convert/route.js b/node_modules/table/node_modules/color-convert/route.js deleted file mode 100644 index 1a08521..0000000 --- a/node_modules/table/node_modules/color-convert/route.js +++ /dev/null @@ -1,97 +0,0 @@ -const conversions = require('./conversions'); - -/* - This function routes a model to all other models. - - all functions that are routed have a property `.conversion` attached - to the returned synthetic function. This property is an array - of strings, each with the steps in between the 'from' and 'to' - color models (inclusive). - - conversions that are not possible simply are not included. -*/ - -function buildGraph() { - const graph = {}; - // https://jsperf.com/object-keys-vs-for-in-with-closure/3 - const models = Object.keys(conversions); - - for (let len = models.length, i = 0; i < len; i++) { - graph[models[i]] = { - // http://jsperf.com/1-vs-infinity - // micro-opt, but this is simple. - distance: -1, - parent: null - }; - } - - return graph; -} - -// https://en.wikipedia.org/wiki/Breadth-first_search -function deriveBFS(fromModel) { - const graph = buildGraph(); - const queue = [fromModel]; // Unshift -> queue -> pop - - graph[fromModel].distance = 0; - - while (queue.length) { - const current = queue.pop(); - const adjacents = Object.keys(conversions[current]); - - for (let len = adjacents.length, i = 0; i < len; i++) { - const adjacent = adjacents[i]; - const node = graph[adjacent]; - - if (node.distance === -1) { - node.distance = graph[current].distance + 1; - node.parent = current; - queue.unshift(adjacent); - } - } - } - - return graph; -} - -function link(from, to) { - return function (args) { - return to(from(args)); - }; -} - -function wrapConversion(toModel, graph) { - const path = [graph[toModel].parent, toModel]; - let fn = conversions[graph[toModel].parent][toModel]; - - let cur = graph[toModel].parent; - while (graph[cur].parent) { - path.unshift(graph[cur].parent); - fn = link(conversions[graph[cur].parent][cur], fn); - cur = graph[cur].parent; - } - - fn.conversion = path; - return fn; -} - -module.exports = function (fromModel) { - const graph = deriveBFS(fromModel); - const conversion = {}; - - const models = Object.keys(graph); - for (let len = models.length, i = 0; i < len; i++) { - const toModel = models[i]; - const node = graph[toModel]; - - if (node.parent === null) { - // No possible conversion, or this node is the source model. - continue; - } - - conversion[toModel] = wrapConversion(toModel, graph); - } - - return conversion; -}; - diff --git a/node_modules/table/node_modules/color-name/README.md b/node_modules/table/node_modules/color-name/README.md deleted file mode 100644 index 932b979..0000000 --- a/node_modules/table/node_modules/color-name/README.md +++ /dev/null @@ -1,11 +0,0 @@ -A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. - -[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) - - -```js -var colors = require('color-name'); -colors.red //[255,0,0] -``` - - diff --git a/node_modules/table/node_modules/color-name/index.js b/node_modules/table/node_modules/color-name/index.js deleted file mode 100644 index b7c198a..0000000 --- a/node_modules/table/node_modules/color-name/index.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; diff --git a/node_modules/table/node_modules/color-name/package.json b/node_modules/table/node_modules/color-name/package.json deleted file mode 100644 index 782dd82..0000000 --- a/node_modules/table/node_modules/color-name/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "color-name", - "version": "1.1.4", - "description": "A list of color names and its values", - "main": "index.js", - "files": [ - "index.js" - ], - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git@github.com:colorjs/color-name.git" - }, - "keywords": [ - "color-name", - "color", - "color-keyword", - "keyword" - ], - "author": "DY ", - "license": "MIT", - "bugs": { - "url": "https://github.com/colorjs/color-name/issues" - }, - "homepage": "https://github.com/colorjs/color-name" -} diff --git a/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7..0000000 --- a/node_modules/table/node_modules/emoji-regex/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/emoji-regex/README.md b/node_modules/table/node_modules/emoji-regex/README.md deleted file mode 100644 index f10e173..0000000 --- a/node_modules/table/node_modules/emoji-regex/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) - -_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. - -This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. - -## Installation - -Via [npm](https://www.npmjs.com/): - -```bash -npm install emoji-regex -``` - -In [Node.js](https://nodejs.org/): - -```js -const emojiRegex = require('emoji-regex'); -// Note: because the regular expression has the global flag set, this module -// exports a function that returns the regex rather than exporting the regular -// expression itself, to make it impossible to (accidentally) mutate the -// original regular expression. - -const text = ` -\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) -\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji -\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) -\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier -`; - -const regex = emojiRegex(); -let match; -while (match = regex.exec(text)) { - const emoji = match[0]; - console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); -} -``` - -Console output: - -``` -Matched sequence ⌚ — code points: 1 -Matched sequence ⌚ — code points: 1 -Matched sequence ↔️ — code points: 2 -Matched sequence ↔️ — code points: 2 -Matched sequence 👩 — code points: 1 -Matched sequence 👩 — code points: 1 -Matched sequence 👩🏿 — code points: 2 -Matched sequence 👩🏿 — code points: 2 -``` - -To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: - -```js -const emojiRegex = require('emoji-regex/text.js'); -``` - -Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: - -```js -const emojiRegex = require('emoji-regex/es2015/index.js'); -const emojiRegexText = require('emoji-regex/es2015/text.js'); -``` - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## License - -_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/table/node_modules/emoji-regex/es2015/index.js b/node_modules/table/node_modules/emoji-regex/es2015/index.js deleted file mode 100644 index b4cf3dc..0000000 --- a/node_modules/table/node_modules/emoji-regex/es2015/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -module.exports = () => { - // https://mths.be/emoji - return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1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64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; -}; diff --git a/node_modules/table/node_modules/emoji-regex/es2015/text.js b/node_modules/table/node_modules/emoji-regex/es2015/text.js deleted file mode 100644 index 780309d..0000000 --- a/node_modules/table/node_modules/emoji-regex/es2015/text.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -module.exports = () => { - // https://mths.be/emoji - return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}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{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu; -}; diff --git a/node_modules/table/node_modules/emoji-regex/index.d.ts b/node_modules/table/node_modules/emoji-regex/index.d.ts deleted file mode 100644 index 1955b47..0000000 --- a/node_modules/table/node_modules/emoji-regex/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -declare module 'emoji-regex' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/text' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/es2015' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} - -declare module 'emoji-regex/es2015/text' { - function emojiRegex(): RegExp; - - export default emojiRegex; -} diff --git a/node_modules/table/node_modules/emoji-regex/index.js b/node_modules/table/node_modules/emoji-regex/index.js deleted file mode 100644 index d993a3a..0000000 --- a/node_modules/table/node_modules/emoji-regex/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -module.exports = function () { - // https://mths.be/emoji - return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uD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D30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; -}; diff --git a/node_modules/table/node_modules/emoji-regex/package.json b/node_modules/table/node_modules/emoji-regex/package.json deleted file mode 100644 index 6d32352..0000000 --- a/node_modules/table/node_modules/emoji-regex/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "emoji-regex", - "version": "8.0.0", - "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", - "homepage": "https://mths.be/emoji-regex", - "main": "index.js", - "types": "index.d.ts", - "keywords": [ - "unicode", - "regex", - "regexp", - "regular expressions", - "code points", - "symbols", - "characters", - "emoji" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "repository": { - "type": "git", - "url": "https://github.com/mathiasbynens/emoji-regex.git" - }, - "bugs": "https://github.com/mathiasbynens/emoji-regex/issues", - "files": [ - "LICENSE-MIT.txt", - "index.js", - "index.d.ts", - "text.js", - "es2015/index.js", - "es2015/text.js" - ], - "scripts": { - "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", - "test": "mocha", - "test:watch": "npm run test -- --watch" - }, - "devDependencies": { - "@babel/cli": "^7.2.3", - "@babel/core": "^7.3.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", - "@babel/preset-env": "^7.3.4", - "mocha": "^6.0.2", - "regexgen": "^1.3.0", - "unicode-12.0.0": "^0.7.9" - } -} diff --git a/node_modules/table/node_modules/emoji-regex/text.js b/node_modules/table/node_modules/emoji-regex/text.js deleted file mode 100644 index 0a55ce2..0000000 --- a/node_modules/table/node_modules/emoji-regex/text.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -module.exports = function () { - // https://mths.be/emoji - return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\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uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\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DCF\uDDD1-\uDDDD])/g; -}; diff --git a/node_modules/table/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/table/node_modules/is-fullwidth-code-point/index.d.ts deleted file mode 100644 index 729d202..0000000 --- a/node_modules/table/node_modules/is-fullwidth-code-point/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). - -@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. - -@example -``` -import isFullwidthCodePoint from 'is-fullwidth-code-point'; - -isFullwidthCodePoint('谢'.codePointAt(0)); -//=> true - -isFullwidthCodePoint('a'.codePointAt(0)); -//=> false -``` -*/ -export default function isFullwidthCodePoint(codePoint: number): boolean; diff --git a/node_modules/table/node_modules/is-fullwidth-code-point/index.js b/node_modules/table/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index 671f97f..0000000 --- a/node_modules/table/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/* eslint-disable yoda */ -'use strict'; - -const isFullwidthCodePoint = codePoint => { - if (Number.isNaN(codePoint)) { - return false; - } - - // Code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if ( - codePoint >= 0x1100 && ( - codePoint <= 0x115F || // Hangul Jamo - codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET - codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - (0x3250 <= codePoint && codePoint <= 0x4DBF) || - // CJK Unified Ideographs .. Yi Radicals - (0x4E00 <= codePoint && codePoint <= 0xA4C6) || - // Hangul Jamo Extended-A - (0xA960 <= codePoint && codePoint <= 0xA97C) || - // Hangul Syllables - (0xAC00 <= codePoint && codePoint <= 0xD7A3) || - // CJK Compatibility Ideographs - (0xF900 <= codePoint && codePoint <= 0xFAFF) || - // Vertical Forms - (0xFE10 <= codePoint && codePoint <= 0xFE19) || - // CJK Compatibility Forms .. Small Form Variants - (0xFE30 <= codePoint && codePoint <= 0xFE6B) || - // Halfwidth and Fullwidth Forms - (0xFF01 <= codePoint && codePoint <= 0xFF60) || - (0xFFE0 <= codePoint && codePoint <= 0xFFE6) || - // Kana Supplement - (0x1B000 <= codePoint && codePoint <= 0x1B001) || - // Enclosed Ideographic Supplement - (0x1F200 <= codePoint && codePoint <= 0x1F251) || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - (0x20000 <= codePoint && codePoint <= 0x3FFFD) - ) - ) { - return true; - } - - return false; -}; - -module.exports = isFullwidthCodePoint; -module.exports.default = isFullwidthCodePoint; diff --git a/node_modules/table/node_modules/is-fullwidth-code-point/license b/node_modules/table/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/table/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/is-fullwidth-code-point/package.json b/node_modules/table/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 2137e88..0000000 --- a/node_modules/table/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "is-fullwidth-code-point", - "version": "3.0.0", - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "license": "MIT", - "repository": "sindresorhus/is-fullwidth-code-point", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd-check" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "string", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "devDependencies": { - "ava": "^1.3.1", - "tsd-check": "^0.5.0", - "xo": "^0.24.0" - } -} diff --git a/node_modules/table/node_modules/is-fullwidth-code-point/readme.md b/node_modules/table/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 4236bba..0000000 --- a/node_modules/table/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install is-fullwidth-code-point -``` - - -## Usage - -```js -const isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt(0)); -//=> true - -isFullwidthCodePoint('a'.codePointAt(0)); -//=> false -``` - - -## API - -### isFullwidthCodePoint(codePoint) - -#### codePoint - -Type: `number` - -The [code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) 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 618559a..0000000 --- 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 44f80f4..0000000 --- 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 f8ef5ba..0000000 --- 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 924825b..0000000 --- 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/LICENSE b/node_modules/table/node_modules/json-schema-traverse/LICENSE deleted file mode 100644 index 7f15435..0000000 --- a/node_modules/table/node_modules/json-schema-traverse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Evgeny Poberezkin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/table/node_modules/json-schema-traverse/README.md b/node_modules/table/node_modules/json-schema-traverse/README.md deleted file mode 100644 index f3e6007..0000000 --- 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 0772dae..0000000 --- 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 e521bfa..0000000 --- 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 `${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/table/node_modules/slice-ansi/license b/node_modules/table/node_modules/slice-ansi/license deleted file mode 100644 index e05b33c..0000000 --- a/node_modules/table/node_modules/slice-ansi/license +++ /dev/null @@ -1,10 +0,0 @@ -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: - -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/table/node_modules/slice-ansi/package.json b/node_modules/table/node_modules/slice-ansi/package.json deleted file mode 100644 index 7d6ea69..0000000 --- a/node_modules/table/node_modules/slice-ansi/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "slice-ansi", - "version": "4.0.0", - "description": "Slice a string with ANSI escape codes", - "license": "MIT", - "repository": "chalk/slice-ansi", - "funding": "https://github.com/chalk/slice-ansi?sponsor=1", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "slice", - "string", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "devDependencies": { - "ava": "^2.1.0", - "chalk": "^3.0.0", - "random-item": "^3.0.0", - "strip-ansi": "^6.0.0", - "xo": "^0.26.1" - } -} diff --git a/node_modules/table/node_modules/slice-ansi/readme.md b/node_modules/table/node_modules/slice-ansi/readme.md deleted file mode 100644 index 88d3677..0000000 --- a/node_modules/table/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/table/node_modules/string-width/index.d.ts b/node_modules/table/node_modules/string-width/index.d.ts deleted file mode 100644 index 12b5309..0000000 --- a/node_modules/table/node_modules/string-width/index.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -declare const stringWidth: { - /** - Get the visual width of a string - the number of columns required to display it. - - Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - - @example - ``` - import stringWidth = require('string-width'); - - stringWidth('a'); - //=> 1 - - stringWidth('古'); - //=> 2 - - stringWidth('\u001B[1m古\u001B[22m'); - //=> 2 - ``` - */ - (string: string): number; - - // TODO: remove this in the next major version, refactor the whole definition to: - // declare function stringWidth(string: string): number; - // export = stringWidth; - default: typeof stringWidth; -} - -export = stringWidth; diff --git a/node_modules/table/node_modules/string-width/index.js b/node_modules/table/node_modules/string-width/index.js deleted file mode 100644 index f4d261a..0000000 --- a/node_modules/table/node_modules/string-width/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; -const stripAnsi = require('strip-ansi'); -const isFullwidthCodePoint = require('is-fullwidth-code-point'); -const emojiRegex = require('emoji-regex'); - -const stringWidth = string => { - if (typeof string !== 'string' || string.length === 0) { - return 0; - } - - string = stripAnsi(string); - - if (string.length === 0) { - return 0; - } - - string = string.replace(emojiRegex(), ' '); - - let width = 0; - - for (let i = 0; i < string.length; i++) { - const code = string.codePointAt(i); - - // Ignore control characters - if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { - continue; - } - - // Ignore combining characters - if (code >= 0x300 && code <= 0x36F) { - continue; - } - - // Surrogates - if (code > 0xFFFF) { - i++; - } - - width += isFullwidthCodePoint(code) ? 2 : 1; - } - - return width; -}; - -module.exports = stringWidth; -// TODO: remove this in the next major version -module.exports.default = stringWidth; diff --git a/node_modules/table/node_modules/string-width/license b/node_modules/table/node_modules/string-width/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/table/node_modules/string-width/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/string-width/package.json b/node_modules/table/node_modules/string-width/package.json deleted file mode 100644 index 28ba7b4..0000000 --- a/node_modules/table/node_modules/string-width/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "string-width", - "version": "4.2.3", - "description": "Get the visual width of a string - the number of columns required to display it", - "license": "MIT", - "repository": "sindresorhus/string-width", - "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": [ - "string", - "character", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - } -} diff --git a/node_modules/table/node_modules/string-width/readme.md b/node_modules/table/node_modules/string-width/readme.md deleted file mode 100644 index bdd3141..0000000 --- a/node_modules/table/node_modules/string-width/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# string-width - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install string-width -``` - - -## Usage - -```js -const stringWidth = require('string-width'); - -stringWidth('a'); -//=> 1 - -stringWidth('古'); -//=> 2 - -stringWidth('\u001B[1m古\u001B[22m'); -//=> 2 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string -- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string - - ---- - -
- - 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/table/node_modules/strip-ansi/index.d.ts b/node_modules/table/node_modules/strip-ansi/index.d.ts deleted file mode 100644 index 907fccc..0000000 --- a/node_modules/table/node_modules/strip-ansi/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. - -@example -``` -import stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` -*/ -declare function stripAnsi(string: string): string; - -export = stripAnsi; diff --git a/node_modules/table/node_modules/strip-ansi/index.js b/node_modules/table/node_modules/strip-ansi/index.js deleted file mode 100644 index 9a593df..0000000 --- a/node_modules/table/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -const ansiRegex = require('ansi-regex'); - -module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; diff --git a/node_modules/table/node_modules/strip-ansi/license b/node_modules/table/node_modules/strip-ansi/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/table/node_modules/strip-ansi/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/table/node_modules/strip-ansi/package.json b/node_modules/table/node_modules/strip-ansi/package.json deleted file mode 100644 index 1a41108..0000000 --- a/node_modules/table/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,54 +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/node_modules/strip-ansi/readme.md b/node_modules/table/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7c4b56d..0000000 --- a/node_modules/table/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,46 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) - -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string - - -## Install - -``` -$ npm install strip-ansi -``` - - -## Usage - -```js -const stripAnsi = require('strip-ansi'); - -stripAnsi('\u001B[4mUnicorn\u001B[0m'); -//=> 'Unicorn' - -stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); -//=> 'Click' -``` - - -## strip-ansi for enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of strip-ansi 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-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - - -## Related - -- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module -- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module -- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - diff --git a/node_modules/table/package.json b/node_modules/table/package.json deleted file mode 100644 index 40528da..0000000 --- a/node_modules/table/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "author": { - "email": "gajus@gajus.com", - "name": "Gajus Kuizinas", - "url": "http://gajus.com" - }, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "description": "Formats data into a string table.", - "devDependencies": { - "@types/chai": "^4.2.16", - "@types/lodash.mapvalues": "^4.6.6", - "@types/lodash.truncate": "^4.4.6", - "@types/mocha": "^9.0.0", - "@types/node": "^14.14.37", - "@types/sinon": "^10.0.0", - "@types/slice-ansi": "^4.0.0", - "ajv-cli": "^5.0.0", - "ajv-keywords": "^5.0.0", - "chai": "^4.2.0", - "chalk": "^4.1.0", - "coveralls": "^3.1.0", - "eslint": "^7.32.0", - "eslint-config-canonical": "^25.0.0", - "gitdown": "^3.1.4", - "husky": "^4.3.6", - "js-beautify": "^1.14.0", - "lodash.mapvalues": "^4.6.0", - "mkdirp": "^1.0.4", - "mocha": "^8.2.1", - "nyc": "^15.1.0", - "semantic-release": "^17.3.1", - "sinon": "^12.0.1", - "ts-node": "^9.1.1", - "typescript": "4.5.2" - }, - "engines": { - "node": ">=10.0.0" - }, - "husky": { - "hooks": { - "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", - "pre-commit": "npm run build && npm run lint && npm run test" - } - }, - "keywords": [ - "ascii", - "text", - "table", - "align", - "ansi" - ], - "license": "BSD-3-Clause", - "main": "./dist/src/index.js", - "files": [ - "dist/src/" - ], - "name": "table", - "repository": { - "type": "git", - "url": "https://github.com/gajus/table" - }, - "scripts": { - "prebuild": "rm -fr ./src/generated && mkdirp ./src/generated", - "build": "npm run create-validators && tsc", - "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 > ./src/generated/validators.js", - "lint": "eslint ./src ./test", - "test": "nyc mocha && nyc check-coverage --lines 95" - }, - "version": "6.8.2" -} diff --git a/node_modules/v8-compile-cache/LICENSE b/node_modules/v8-compile-cache/LICENSE deleted file mode 100644 index b72b670..0000000 --- a/node_modules/v8-compile-cache/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019 Andres Suarez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/v8-compile-cache/README.md b/node_modules/v8-compile-cache/README.md deleted file mode 100644 index 6e0b99f..0000000 --- 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 60be2f1..0000000 --- a/node_modules/v8-compile-cache/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "v8-compile-cache", - "version": "2.4.0", - "description": "Require hook for automatic V8 compile cache persistence", - "main": "v8-compile-cache.js", - "scripts": { - "bench": "bench/run.sh", - "eslint": "eslint --max-warnings=0 .", - "tap": "tap test/*-test.js", - "test": "npm run tap", - "posttest": "npm run eslint" - }, - "author": "Andres Suarez ", - "repository": { - "type": "git", - "url": "https://github.com/zertosh/v8-compile-cache.git" - }, - "files": [ - "v8-compile-cache.js" - ], - "license": "MIT", - "dependencies": {}, - "devDependencies": { - "babel-core": "6.26.3", - "eslint": "^7.12.1", - "flow-parser": "0.136.0", - "rimraf": "^2.5.4", - "rxjs": "6.6.3", - "semver": "^5.3.0", - "tap": "^9.0.0", - "temp": "^0.8.3", - "yarn": "1.22.10" - } -} diff --git a/node_modules/v8-compile-cache/v8-compile-cache.js b/node_modules/v8-compile-cache/v8-compile-cache.js deleted file mode 100644 index 56fd061..0000000 --- a/node_modules/v8-compile-cache/v8-compile-cache.js +++ /dev/null @@ -1,373 +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'; - // Avoid cache incompatibility issues with Rosetta on Apple Silicon. - const arch = process.arch; - 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, arch, 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/yaml/browser/dist/compose/compose-collection.js b/node_modules/yaml/browser/dist/compose/compose-collection.js index 8d4507f..b80fba2 100644 --- a/node_modules/yaml/browser/dist/compose/compose-collection.js +++ b/node_modules/yaml/browser/dist/compose/compose-collection.js @@ -23,10 +23,23 @@ function resolveCollection(CN, ctx, token, onError, tagName, tag) { coll.tag = tagName; return coll; } -function composeCollection(CN, ctx, token, tagToken, onError) { +function composeCollection(CN, ctx, token, props, onError) { + const tagToken = props.tag; const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg)); + if (token.type === 'block-seq') { + const { anchor, newlineAfterProp: nl } = props; + const lastProp = anchor && tagToken + ? anchor.offset > tagToken.offset + ? anchor + : tagToken + : (anchor ?? tagToken); + if (lastProp && (!nl || nl.offset < lastProp.offset)) { + const message = 'Missing newline after block sequence props'; + onError(lastProp, 'MISSING_CHAR', message); + } + } const expType = token.type === 'block-map' ? 'map' : token.type === 'block-seq' @@ -40,8 +53,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) { !tagName || tagName === '!' || (tagName === YAMLMap.tagName && expType === 'map') || - (tagName === YAMLSeq.tagName && expType === 'seq') || - !expType) { + (tagName === YAMLSeq.tagName && expType === 'seq')) { return resolveCollection(CN, ctx, token, onError, tagName); } let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType); diff --git a/node_modules/yaml/browser/dist/compose/compose-node.js b/node_modules/yaml/browser/dist/compose/compose-node.js index 39d98e3..611c4a5 100644 --- a/node_modules/yaml/browser/dist/compose/compose-node.js +++ b/node_modules/yaml/browser/dist/compose/compose-node.js @@ -26,7 +26,7 @@ function composeNode(ctx, token, props, onError) { case 'block-map': case 'block-seq': case 'flow-collection': - node = composeCollection(CN, ctx, token, tag, onError); + node = composeCollection(CN, ctx, token, props, onError); if (anchor) node.anchor = anchor.source.substring(1); break; diff --git a/node_modules/yaml/browser/dist/compose/resolve-block-map.js b/node_modules/yaml/browser/dist/compose/resolve-block-map.js index 977cd6b..1413a88 100644 --- a/node_modules/yaml/browser/dist/compose/resolve-block-map.js +++ b/node_modules/yaml/browser/dist/compose/resolve-block-map.js @@ -42,7 +42,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta } continue; } - if (keyProps.hasNewlineAfterProp || containsNewline(key)) { + if (keyProps.newlineAfterProp || containsNewline(key)) { onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line'); } } diff --git a/node_modules/yaml/browser/dist/compose/resolve-props.js b/node_modules/yaml/browser/dist/compose/resolve-props.js index 163bda2..dd6ce6c 100644 --- a/node_modules/yaml/browser/dist/compose/resolve-props.js +++ b/node_modules/yaml/browser/dist/compose/resolve-props.js @@ -5,11 +5,11 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn let comment = ''; let commentSep = ''; let hasNewline = false; - let hasNewlineAfterProp = false; let reqSpace = false; let tab = null; let anchor = null; let tag = null; + let newlineAfterProp = null; let comma = null; let found = null; let start = null; @@ -63,7 +63,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn atNewline = true; hasNewline = true; if (anchor || tag) - hasNewlineAfterProp = true; + newlineAfterProp = token; hasSpace = true; break; case 'anchor': @@ -137,9 +137,9 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn spaceBefore, comment, hasNewline, - hasNewlineAfterProp, anchor, tag, + newlineAfterProp, end, start: start ?? end }; diff --git a/node_modules/yaml/browser/dist/nodes/Collection.js b/node_modules/yaml/browser/dist/nodes/Collection.js index a5f89be..0ebdeda 100644 --- a/node_modules/yaml/browser/dist/nodes/Collection.js +++ b/node_modules/yaml/browser/dist/nodes/Collection.js @@ -143,6 +143,5 @@ class Collection extends NodeBase { } } } -Collection.maxFlowStringSingleLineLength = 60; export { Collection, collectionFromPath, isEmptyPath }; diff --git a/node_modules/yaml/browser/dist/parse/lexer.js b/node_modules/yaml/browser/dist/parse/lexer.js index dff9fe4..fbab236 100644 --- a/node_modules/yaml/browser/dist/parse/lexer.js +++ b/node_modules/yaml/browser/dist/parse/lexer.js @@ -290,15 +290,11 @@ class Lexer { if (!this.atEnd && !this.hasChars(4)) return this.setNext('line-start'); const s = this.peek(3); - if (s === '---' && isEmpty(this.charAt(3))) { + if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) { yield* this.pushCount(3); this.indentValue = 0; this.indentNext = 0; - return 'doc'; - } - else if (s === '...' && isEmpty(this.charAt(3))) { - yield* this.pushCount(3); - return 'stream'; + return s === '---' ? 'doc' : 'stream'; } } this.indentValue = yield* this.pushSpaces(false); diff --git a/node_modules/yaml/browser/dist/stringify/foldFlowLines.js b/node_modules/yaml/browser/dist/stringify/foldFlowLines.js index 2a55426..2f0bd07 100644 --- a/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +++ b/node_modules/yaml/browser/dist/stringify/foldFlowLines.js @@ -9,6 +9,8 @@ const FOLD_QUOTED = 'quoted'; function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { if (!lineWidth || lineWidth < 0) return text; + if (lineWidth < minContentWidth) + minContentWidth = 0; const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); if (text.length <= endStep) return text; diff --git a/node_modules/yaml/dist/cli.d.ts b/node_modules/yaml/dist/cli.d.ts index d10442b..7e2ea2a 100644 --- a/node_modules/yaml/dist/cli.d.ts +++ b/node_modules/yaml/dist/cli.d.ts @@ -1,5 +1,4 @@ -/// -export declare const help = "yaml: A command-line YAML processor and inspector\n\nReads stdin and writes output to stdout and errors & warnings to stderr.\n\nUsage:\n yaml Process a YAML stream, outputting it as YAML\n yaml cst Parse the CST of a YAML stream\n yaml lex Parse the lexical tokens of a YAML stream\n yaml valid Validate a YAML stream, returning 0 on success\n\nOptions:\n --help, -h Show this message.\n --json, -j Output JSON.\n\nAdditional options for bare \"yaml\" command:\n --doc, -d Output pretty-printed JS Document objects.\n --single, -1 Require the input to consist of a single YAML document.\n --strict, -s Stop on errors.\n --visit, -v Apply a visitor to each document (requires a path to import)\n --yaml 1.1 Set the YAML version. (default: 1.2)"; +export declare const help = "yaml: A command-line YAML processor and inspector\n\nReads stdin and writes output to stdout and errors & warnings to stderr.\n\nUsage:\n yaml Process a YAML stream, outputting it as YAML\n yaml cst Parse the CST of a YAML stream\n yaml lex Parse the lexical tokens of a YAML stream\n yaml valid Validate a YAML stream, returning 0 on success\n\nOptions:\n --help, -h Show this message.\n --json, -j Output JSON.\n --indent 2 Output pretty-printed data, indented by the given number of spaces.\n\nAdditional options for bare \"yaml\" command:\n --doc, -d Output pretty-printed JS Document objects.\n --single, -1 Require the input to consist of a single YAML document.\n --strict, -s Stop on errors.\n --visit, -v Apply a visitor to each document (requires a path to import)\n --yaml 1.1 Set the YAML version. (default: 1.2)"; export declare class UserError extends Error { static ARGS: number; static SINGLE: number; diff --git a/node_modules/yaml/dist/cli.mjs b/node_modules/yaml/dist/cli.mjs index e74c8f8..d3c7d43 100644 --- a/node_modules/yaml/dist/cli.mjs +++ b/node_modules/yaml/dist/cli.mjs @@ -22,6 +22,7 @@ Usage: Options: --help, -h Show this message. --json, -j Output JSON. + --indent 2 Output pretty-printed data, indented by the given number of spaces. Additional options for bare "yaml" command: --doc, -d Output pretty-printed JS Document objects. @@ -46,6 +47,7 @@ async function cli(stdin, done, argv) { options: { doc: { type: 'boolean', short: 'd' }, help: { type: 'boolean', short: 'h' }, + indent: { type: 'string', short: 'i' }, json: { type: 'boolean', short: 'j' }, single: { type: 'boolean', short: '1' }, strict: { type: 'boolean', short: 's' }, @@ -58,6 +60,7 @@ async function cli(stdin, done, argv) { return done(new UserError(UserError.ARGS, error.message)); } const { positionals: [mode], values: opt } = args; + let indent = Number(opt.indent); stdin.setEncoding('utf-8'); // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing switch (opt.help || mode) { @@ -82,7 +85,7 @@ async function cli(stdin, done, argv) { for (const tok of lexer.lex('', false)) add(tok); if (opt.json) - console.log(JSON.stringify(data)); + console.log(JSON.stringify(data, null, indent)); done(); }); break; @@ -104,7 +107,7 @@ async function cli(stdin, done, argv) { for (const tok of parser.parse('', false)) add(tok); if (opt.json) - console.log(JSON.stringify(data)); + console.log(JSON.stringify(data, null, indent)); done(); }); break; @@ -153,7 +156,8 @@ async function cli(stdin, done, argv) { if (reqDocEnd) console.log('...'); try { - const str = String(doc); + indent || (indent = 2); + const str = doc.toString({ indent }); console.log(str.endsWith('\n') ? str.slice(0, -1) : str); } catch (error) { @@ -181,7 +185,7 @@ async function cli(stdin, done, argv) { return done(new UserError(UserError.SINGLE, 'Input stream contained no documents')); } if (mode !== 'valid' && opt.json) { - console.log(JSON.stringify(opt.single ? data[0] : data)); + console.log(JSON.stringify(opt.single ? data[0] : data, null, indent)); } done(); }); diff --git a/node_modules/yaml/dist/compose/compose-collection.d.ts b/node_modules/yaml/dist/compose/compose-collection.d.ts index b310e2d..22fe516 100644 --- a/node_modules/yaml/dist/compose/compose-collection.d.ts +++ b/node_modules/yaml/dist/compose/compose-collection.d.ts @@ -2,4 +2,10 @@ import type { ParsedNode } from '../nodes/Node.js'; import type { BlockMap, BlockSequence, FlowCollection, SourceToken } from '../parse/cst.js'; import type { ComposeContext, ComposeNode } from './compose-node.js'; import type { ComposeErrorHandler } from './composer.js'; -export declare function composeCollection(CN: ComposeNode, ctx: ComposeContext, token: BlockMap | BlockSequence | FlowCollection, tagToken: SourceToken | null, onError: ComposeErrorHandler): ParsedNode; +interface Props { + anchor: SourceToken | null; + tag: SourceToken | null; + newlineAfterProp: SourceToken | null; +} +export declare function composeCollection(CN: ComposeNode, ctx: ComposeContext, token: BlockMap | BlockSequence | FlowCollection, props: Props, onError: ComposeErrorHandler): ParsedNode; +export {}; diff --git a/node_modules/yaml/dist/compose/compose-collection.js b/node_modules/yaml/dist/compose/compose-collection.js index e4b1971..3f91468 100644 --- a/node_modules/yaml/dist/compose/compose-collection.js +++ b/node_modules/yaml/dist/compose/compose-collection.js @@ -25,10 +25,23 @@ function resolveCollection(CN, ctx, token, onError, tagName, tag) { coll.tag = tagName; return coll; } -function composeCollection(CN, ctx, token, tagToken, onError) { +function composeCollection(CN, ctx, token, props, onError) { + const tagToken = props.tag; const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg)); + if (token.type === 'block-seq') { + const { anchor, newlineAfterProp: nl } = props; + const lastProp = anchor && tagToken + ? anchor.offset > tagToken.offset + ? anchor + : tagToken + : (anchor ?? tagToken); + if (lastProp && (!nl || nl.offset < lastProp.offset)) { + const message = 'Missing newline after block sequence props'; + onError(lastProp, 'MISSING_CHAR', message); + } + } const expType = token.type === 'block-map' ? 'map' : token.type === 'block-seq' @@ -42,8 +55,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) { !tagName || tagName === '!' || (tagName === YAMLMap.YAMLMap.tagName && expType === 'map') || - (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq') || - !expType) { + (tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) { return resolveCollection(CN, ctx, token, onError, tagName); } let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType); diff --git a/node_modules/yaml/dist/compose/compose-node.d.ts b/node_modules/yaml/dist/compose/compose-node.d.ts index 8d3e467..85d6820 100644 --- a/node_modules/yaml/dist/compose/compose-node.d.ts +++ b/node_modules/yaml/dist/compose/compose-node.d.ts @@ -15,6 +15,7 @@ interface Props { comment: string; anchor: SourceToken | null; tag: SourceToken | null; + newlineAfterProp: SourceToken | null; end: number; } declare const CN: { diff --git a/node_modules/yaml/dist/compose/compose-node.js b/node_modules/yaml/dist/compose/compose-node.js index 7eb1daf..c6c61dd 100644 --- a/node_modules/yaml/dist/compose/compose-node.js +++ b/node_modules/yaml/dist/compose/compose-node.js @@ -28,7 +28,7 @@ function composeNode(ctx, token, props, onError) { case 'block-map': case 'block-seq': case 'flow-collection': - node = composeCollection.composeCollection(CN, ctx, token, tag, onError); + node = composeCollection.composeCollection(CN, ctx, token, props, onError); if (anchor) node.anchor = anchor.source.substring(1); break; diff --git a/node_modules/yaml/dist/compose/resolve-block-map.d.ts b/node_modules/yaml/dist/compose/resolve-block-map.d.ts index 58855c8..cf82dee 100644 --- a/node_modules/yaml/dist/compose/resolve-block-map.d.ts +++ b/node_modules/yaml/dist/compose/resolve-block-map.d.ts @@ -1,7 +1,6 @@ -import type { ParsedNode } from '../nodes/Node.js'; import { YAMLMap } from '../nodes/YAMLMap.js'; import type { BlockMap } from '../parse/cst.js'; import { CollectionTag } from '../schema/types.js'; import type { ComposeContext, ComposeNode } from './compose-node.js'; import type { ComposeErrorHandler } from './composer.js'; -export declare function resolveBlockMap({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bm: BlockMap, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLMap.Parsed; +export declare function resolveBlockMap({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bm: BlockMap, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLMap.Parsed; diff --git a/node_modules/yaml/dist/compose/resolve-block-map.js b/node_modules/yaml/dist/compose/resolve-block-map.js index 09e5e30..f9126f6 100644 --- a/node_modules/yaml/dist/compose/resolve-block-map.js +++ b/node_modules/yaml/dist/compose/resolve-block-map.js @@ -44,7 +44,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta } continue; } - if (keyProps.hasNewlineAfterProp || utilContainsNewline.containsNewline(key)) { + if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) { onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line'); } } diff --git a/node_modules/yaml/dist/compose/resolve-block-seq.d.ts b/node_modules/yaml/dist/compose/resolve-block-seq.d.ts index 3a15f52..139ad25 100644 --- a/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +++ b/node_modules/yaml/dist/compose/resolve-block-seq.d.ts @@ -3,4 +3,4 @@ import type { BlockSequence } from '../parse/cst.js'; import { CollectionTag } from '../schema/types.js'; import type { ComposeContext, ComposeNode } from './compose-node.js'; import type { ComposeErrorHandler } from './composer.js'; -export declare function resolveBlockSeq({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bs: BlockSequence, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLSeq.Parsed; +export declare function resolveBlockSeq({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bs: BlockSequence, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLSeq.Parsed; diff --git a/node_modules/yaml/dist/compose/resolve-props.d.ts b/node_modules/yaml/dist/compose/resolve-props.d.ts index 4012043..ea3d828 100644 --- a/node_modules/yaml/dist/compose/resolve-props.d.ts +++ b/node_modules/yaml/dist/compose/resolve-props.d.ts @@ -15,9 +15,9 @@ export declare function resolveProps(tokens: SourceToken[], { flow, indicator, n spaceBefore: boolean; comment: string; hasNewline: boolean; - hasNewlineAfterProp: boolean; anchor: SourceToken | null; tag: SourceToken | null; + newlineAfterProp: SourceToken | null; end: number; start: number; }; diff --git a/node_modules/yaml/dist/compose/resolve-props.js b/node_modules/yaml/dist/compose/resolve-props.js index 03912bd..9b63cfd 100644 --- a/node_modules/yaml/dist/compose/resolve-props.js +++ b/node_modules/yaml/dist/compose/resolve-props.js @@ -7,11 +7,11 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn let comment = ''; let commentSep = ''; let hasNewline = false; - let hasNewlineAfterProp = false; let reqSpace = false; let tab = null; let anchor = null; let tag = null; + let newlineAfterProp = null; let comma = null; let found = null; let start = null; @@ -65,7 +65,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn atNewline = true; hasNewline = true; if (anchor || tag) - hasNewlineAfterProp = true; + newlineAfterProp = token; hasSpace = true; break; case 'anchor': @@ -139,9 +139,9 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn spaceBefore, comment, hasNewline, - hasNewlineAfterProp, anchor, tag, + newlineAfterProp, end, start: start ?? end }; diff --git a/node_modules/yaml/dist/nodes/Collection.d.ts b/node_modules/yaml/dist/nodes/Collection.d.ts index 981ca11..0b5979d 100644 --- a/node_modules/yaml/dist/nodes/Collection.d.ts +++ b/node_modules/yaml/dist/nodes/Collection.d.ts @@ -4,7 +4,6 @@ import { NodeBase } from './Node.js'; export declare function collectionFromPath(schema: Schema, path: unknown[], value: unknown): import("./Node.js").Node; export declare const isEmptyPath: (path: Iterable | null | undefined) => path is null | undefined; export declare abstract class Collection extends NodeBase { - static maxFlowStringSingleLineLength: number; schema: Schema | undefined; [NODE_TYPE]: symbol; items: unknown[]; diff --git a/node_modules/yaml/dist/nodes/Collection.js b/node_modules/yaml/dist/nodes/Collection.js index 1c03294..bdf8cb4 100644 --- a/node_modules/yaml/dist/nodes/Collection.js +++ b/node_modules/yaml/dist/nodes/Collection.js @@ -145,7 +145,6 @@ class Collection extends Node.NodeBase { } } } -Collection.maxFlowStringSingleLineLength = 60; exports.Collection = Collection; exports.collectionFromPath = collectionFromPath; diff --git a/node_modules/yaml/dist/nodes/identity.d.ts b/node_modules/yaml/dist/nodes/identity.d.ts index c12fdf7..a576b1a 100644 --- a/node_modules/yaml/dist/nodes/identity.d.ts +++ b/node_modules/yaml/dist/nodes/identity.d.ts @@ -13,7 +13,7 @@ export declare const SCALAR: unique symbol; export declare const SEQ: unique symbol; export declare const NODE_TYPE: unique symbol; export declare const isAlias: (node: any) => node is Alias; -export declare const isDocument: (node: any) => node is Document; +export declare const isDocument: (node: any) => node is Document; export declare const isMap: (node: any) => node is YAMLMap; export declare const isPair: (node: any) => node is Pair; export declare const isScalar: (node: any) => node is Scalar; diff --git a/node_modules/yaml/dist/parse/lexer.js b/node_modules/yaml/dist/parse/lexer.js index 5efe32b..9ac766e 100644 --- a/node_modules/yaml/dist/parse/lexer.js +++ b/node_modules/yaml/dist/parse/lexer.js @@ -292,15 +292,11 @@ class Lexer { if (!this.atEnd && !this.hasChars(4)) return this.setNext('line-start'); const s = this.peek(3); - if (s === '---' && isEmpty(this.charAt(3))) { + if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) { yield* this.pushCount(3); this.indentValue = 0; this.indentNext = 0; - return 'doc'; - } - else if (s === '...' && isEmpty(this.charAt(3))) { - yield* this.pushCount(3); - return 'stream'; + return s === '---' ? 'doc' : 'stream'; } } this.indentValue = yield* this.pushSpaces(false); diff --git a/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts b/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts index 12727dc..95b03c7 100644 --- a/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +++ b/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts @@ -9,12 +9,12 @@ export declare class YAMLOMap extends YAMLSeq { add: (pair: import("../../index.js").Pair | { key: any; value: any; - }, overwrite?: boolean | undefined) => void; + }, overwrite?: boolean) => void; delete: (key: unknown) => boolean; get: { (key: unknown, keepScalar: true): import("../../index.js").Scalar | undefined; - (key: unknown, keepScalar?: false | undefined): any; - (key: unknown, keepScalar?: boolean | undefined): any; + (key: unknown, keepScalar?: false): any; + (key: unknown, keepScalar?: boolean): any; }; has: (key: unknown) => boolean; set: (key: any, value: any) => void; diff --git a/node_modules/yaml/dist/stringify/foldFlowLines.js b/node_modules/yaml/dist/stringify/foldFlowLines.js index 829a560..9c61058 100644 --- a/node_modules/yaml/dist/stringify/foldFlowLines.js +++ b/node_modules/yaml/dist/stringify/foldFlowLines.js @@ -11,6 +11,8 @@ const FOLD_QUOTED = 'quoted'; function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) { if (!lineWidth || lineWidth < 0) return text; + if (lineWidth < minContentWidth) + minContentWidth = 0; const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length); if (text.length <= endStep) return text; diff --git a/node_modules/yaml/package.json b/node_modules/yaml/package.json index 364436b..a9dc677 100644 --- a/node_modules/yaml/package.json +++ b/node_modules/yaml/package.json @@ -1,6 +1,6 @@ { "name": "yaml", - "version": "2.4.5", + "version": "2.5.0", "license": "ISC", "author": "Eemeli Aro ", "repository": "github:eemeli/yaml", diff --git a/package-lock.json b/package-lock.json index e7239f3..2786893 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,7 +65,9 @@ "@babel/eslint-parser": "^7.25.1", "@babel/preset-env": "^7.25.3", "@eslint/js": "^9.8.0", - "eslint": "^7.32.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "globals": "^15.9.0", @@ -157,6 +159,15 @@ "eslint": "^7.5.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/@babel/eslint-parser/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@babel/generator": { "version": "7.25.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", @@ -1815,24 +1826,51 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "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.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.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/globals": { @@ -1851,33 +1889,46 @@ } }, "node_modules/@eslint/js": { - "version": "9.8.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.8.0.tgz", - "integrity": "sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==", + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.9.0.tgz", + "integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.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==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", "dev": true }, @@ -1938,6 +1989,63 @@ "eslint-scope": "5.1.1" } }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@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/@pkgr/core": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", @@ -1950,10 +2058,234 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz", + "integrity": "sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/type-utils": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.1.tgz", + "integrity": "sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.1.tgz", + "integrity": "sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz", + "integrity": "sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.0.1", + "@typescript-eslint/utils": "8.0.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.1.tgz", + "integrity": "sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz", + "integrity": "sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/visitor-keys": "8.0.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.1.tgz", + "integrity": "sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.0.1", + "@typescript-eslint/types": "8.0.1", + "@typescript-eslint/typescript-estree": "8.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.1.tgz", + "integrity": "sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.1", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1987,15 +2319,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz", @@ -2033,18 +2356,15 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "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/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "engines": { "node": ">=8" @@ -2299,12 +2619,29 @@ } } }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2318,9 +2655,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz", + "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==", "dev": true }, "node_modules/emoji-regex": { @@ -2328,40 +2665,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==" }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/enquirer/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/enquirer/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", @@ -2395,57 +2698,55 @@ } }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "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", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "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.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "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-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "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" @@ -2494,58 +2795,40 @@ } }, "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.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8.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==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "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" + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "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==", + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/eslint/node_modules/ansi-regex": { @@ -2630,18 +2913,6 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint/node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -2667,39 +2938,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.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.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" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esquery": { @@ -2714,15 +2966,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -2735,7 +2978,7 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -2744,15 +2987,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -2801,6 +3035,34 @@ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2813,11 +3075,14 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", - "dev": true + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } }, "node_modules/file-entry-cache": { "version": "6.0.1", @@ -2842,6 +3107,22 @@ "node": ">=8" } }, + "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": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/flat-cache": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", @@ -2877,12 +3158,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "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": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", - "dev": true - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2936,15 +3211,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": { @@ -2959,6 +3234,32 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3001,9 +3302,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.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -3106,6 +3407,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-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -3129,13 +3439,12 @@ "dev": true }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "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": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -3217,21 +3526,21 @@ } }, "node_modules/lint-staged": { - "version": "15.2.7", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.7.tgz", - "integrity": "sha512-+FdVbbCZ+yoh7E/RosSdqKJyUM2OEjTciH0TFNkawKgvFp1zbGlEC39RADg+xKBG1R4mhoH2j85myBQZ5wR+lw==", + "version": "15.2.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.8.tgz", + "integrity": "sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==", "dev": true, "dependencies": { "chalk": "~5.3.0", "commander": "~12.1.0", - "debug": "~4.3.4", + "debug": "~4.3.6", "execa": "~8.0.1", - "lilconfig": "~3.1.1", - "listr2": "~8.2.1", + "lilconfig": "~3.1.2", + "listr2": "~8.2.4", "micromatch": "~4.0.7", "pidtree": "~0.6.0", "string-argv": "~0.3.2", - "yaml": "~2.4.2" + "yaml": "~2.5.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -3259,6 +3568,21 @@ "node": ">=18.0.0" } }, + "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/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -3271,12 +3595,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", - "dev": true - }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -3338,6 +3656,15 @@ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", @@ -3385,9 +3712,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -3466,6 +3793,36 @@ "node": ">= 0.8.0" } }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "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/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3478,6 +3835,15 @@ "node": ">=6" } }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3501,6 +3867,15 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -3565,15 +3940,6 @@ "node": ">=6.0.0" } }, - "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/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -3583,6 +3949,26 @@ "node": ">=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/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -3616,18 +4002,6 @@ "@babel/runtime": "^7.8.4" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/regexpu-core": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", @@ -3666,15 +4040,6 @@ "jsesc": "bin/jsesc" } }, - "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/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -3730,6 +4095,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "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/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", @@ -3751,6 +4126,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -3790,6 +4188,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/slice-ansi": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", @@ -3805,12 +4212,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true - }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -3912,144 +4313,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/table": { - "version": "6.8.2", - "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", - "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/table/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/table/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/table/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/table/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/table/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/table/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/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/table/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/table/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4076,6 +4339,18 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", @@ -4106,6 +4381,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -4185,12 +4474,6 @@ "punycode": "^2.1.0" } }, - "node_modules/v8-compile-cache": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz", - "integrity": "sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==", - "dev": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -4243,15 +4526,27 @@ "dev": true }, "node_modules/yaml": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", - "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", "bin": { "yaml": "bin.mjs" }, "engines": { "node": ">= 14" } + }, + "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/package.json b/package.json index 338dc7d..59d82cf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "prepare": "husky install", "lint-php": "phpcs --standard=PSR12 && phpcbf --standard=PSR12 && php-cs-fixer fix", - "lint": "eslint . --ext .js,.jsx,.ts,.tsx", + "lint": "eslint .", "format": "prettier --write ." }, "repository": { @@ -32,7 +32,9 @@ "@babel/eslint-parser": "^7.25.1", "@babel/preset-env": "^7.25.3", "@eslint/js": "^9.8.0", - "eslint": "^7.32.0", + "@typescript-eslint/eslint-plugin": "^8.0.1", + "@typescript-eslint/parser": "^8.0.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", "globals": "^15.9.0", diff --git a/phpcs.xml b/phpcs.xml index 5479836..a0cf8af 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,14 +1,37 @@ - Custom ruleset excluding specific rules. + Custom ruleset with additional checks for namespaces and unused variables. - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/phpcs_config.txt b/phpcs_config.txt new file mode 100644 index 0000000..a5e5159 --- /dev/null +++ b/phpcs_config.txt @@ -0,0 +1,3 @@ +Using config file: /var/www/html/google_forms/vendor/squizlabs/php_codesniffer/CodeSniffer.conf + +installed_paths: ../../slevomat/coding-standard diff --git a/phpcs_errors.json b/phpcs_errors.json new file mode 100644 index 0000000..ee8a5bd --- /dev/null +++ b/phpcs_errors.json @@ -0,0 +1,2 @@ +{"totals":{"errors":7,"warnings":1,"fixable":0},"files":{"\/var\/www\/html\/google_forms\/application\/controllers\/Testing\/Dummy.php":{"errors":7,"warnings":1,"messages":[{"message":"Missing doc comment for class Dummy","source":"Squiz.Commenting.ClassComment.Missing","severity":5,"fixable":false,"type":"ERROR","line":9,"column":1},{"message":"Class name application\\controllers\\Testing\\Dummy does not match filepath \/var\/www\/html\/google_forms\/application\/controllers\/Testing\/Dummy.php.","source":"SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName","severity":5,"fixable":false,"type":"ERROR","line":9,"column":7},{"message":"Missing doc comment for function show()","source":"Squiz.Commenting.FunctionComment.Missing","severity":5,"fixable":false,"type":"ERROR","line":13,"column":12},{"message":"Assignments must be the first block of code on a line","source":"Squiz.PHP.DisallowMultipleAssignments.Found","severity":5,"fixable":false,"type":"ERROR","line":15,"column":17},{"message":"Code after the RETURN statement on line 25 cannot be executed","source":"Squiz.PHP.NonExecutableCode.Unreachable","severity":5,"fixable":false,"type":"WARNING","line":27,"column":13},{"message":"Missing @return tag in function comment","source":"Squiz.Commenting.FunctionComment.MissingReturn","severity":5,"fixable":false,"type":"ERROR","line":40,"column":5},{"message":"The value of a comparison must not be assigned to a variable","source":"Squiz.PHP.DisallowComparisonAssignment.AssignedComparison","severity":5,"fixable":false,"type":"ERROR","line":44,"column":18},{"message":"Use of the \"global\" keyword is forbidden; use \"$GLOBALS['db']\" instead","source":"Squiz.PHP.GlobalKeyword.NotAllowed","severity":5,"fixable":false,"type":"ERROR","line":47,"column":9}]}}} +{"totals":{"errors":5,"warnings":1,"fixable":0},"files":{"\/var\/www\/html\/google_forms\/application\/controllers\/Testing\/Form.php":{"errors":5,"warnings":1,"messages":[{"message":"You must use \"\/**\" style comments for a class comment","source":"Squiz.Commenting.ClassComment.WrongStyle","severity":5,"fixable":false,"type":"ERROR","line":9,"column":7},{"message":"Class name application\\controllers\\Form does not match filepath \/var\/www\/html\/google_forms\/application\/controllers\/Testing\/Form.php.","source":"SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName","severity":5,"fixable":false,"type":"ERROR","line":9,"column":13},{"message":"Missing doc comment for function __construct()","source":"Squiz.Commenting.FunctionComment.Missing","severity":5,"fixable":false,"type":"ERROR","line":11,"column":12},{"message":"Missing doc comment for function submit()","source":"Squiz.Commenting.FunctionComment.Missing","severity":5,"fixable":false,"type":"ERROR","line":18,"column":12},{"message":"Line exceeds 120 characters; contains 136 characters","source":"Generic.Files.LineLength.TooLong","severity":5,"fixable":false,"type":"WARNING","line":25,"column":136},{"message":"Missing doc comment for function view()","source":"Squiz.Commenting.FunctionComment.Missing","severity":5,"fixable":false,"type":"ERROR","line":31,"column":12}]}}} diff --git a/node_modules/fast-uri/test/.gitkeep b/phpcs_errors_processed.json similarity index 100% rename from node_modules/fast-uri/test/.gitkeep rename to phpcs_errors_processed.json diff --git a/preprocess-js.sh b/preprocess-js.sh deleted file mode 100644 index b730375..0000000 --- a/preprocess-js.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Preprocess JavaScript files to handle PHP code as placeholders -for FILE in "$@"; do - TEMP_FILE=$(mktemp) - - # Replace PHP code blocks with placeholders - sed -E 's/|$)/__PHP_BLOCK_START__\1__PHP_BLOCK_END__/g' "$FILE" > "$TEMP_FILE" - - # Handle short PHP tags - sed -E 's/|$)/__PHP_BLOCK_START__\1__PHP_BLOCK_END__/g' "$TEMP_FILE" > "$FILE" - - rm "$TEMP_FILE" -done diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 0000000..856c16b --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,10 @@ + + + Custom coding standard for namespace matching. + + + + + + + diff --git a/setup_phpcs.php b/setup_phpcs.php new file mode 100644 index 0000000..c090b70 --- /dev/null +++ b/setup_phpcs.php @@ -0,0 +1,22 @@ +standard = '/var/www/html/google_forms/ruleset.xml'; // Path to your ruleset.xml + +// Create a new PHP_CodeSniffer runner +$runner = new Runner(); +$runner->config = $config; + +// Run PHP_CodeSniffer with the specified standard +$runner->run(); diff --git a/vendor/autoload.php b/vendor/autoload.php index 0428e5f..7129e17 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -6,7 +6,7 @@ if (PHP_VERSION_ID < 50600) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running ' . PHP_VERSION . ', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.' . PHP_EOL; + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, $err); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index d1f0c8d..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -449,7 +449,7 @@ class ClassLoader return false; } if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix . $class, $hit); + $file = apcu_fetch($this->apcuPrefix.$class, $hit); if ($hit) { return $file; } @@ -463,7 +463,7 @@ class ClassLoader } if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix . $class, $file); + apcu_add($this->apcuPrefix.$class, $file); } if (false === $file) { @@ -572,7 +572,7 @@ class ClassLoader * @param string $file * @return void */ - self::$includeFile = \Closure::bind(static function ($file) { + self::$includeFile = \Closure::bind(static function($file) { include $file; }, null, null); } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 1933b2e..51e734a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -327,11 +327,11 @@ class InstalledVersions foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir . '/composer/installed.php')) { + } elseif (is_file($vendorDir.'/composer/installed.php')) { /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir . '/composer/installed.php'; + $required = require $vendorDir.'/composer/installed.php'; $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir . '/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } } diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 1908da4..2f882e5 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,7 +6,12 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'SlevomatCodingStandard\\' => array($vendorDir . '/slevomat/coding-standard/SlevomatCodingStandard'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), + 'PHPStan\\PhpDocParser\\' => array($vendorDir . '/phpstan/phpdoc-parser/src'), + 'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), + 'CustomSniffs\\' => array($baseDir . '/custom_sniffs'), + 'App\\' => array($baseDir . '/application'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 28c338e..9a8a568 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -6,49 +6,83 @@ namespace Composer\Autoload; class ComposerStaticInit9fa79f662bb907dfff5f96091a839960 { - public static $files = array( + public static $files = array ( '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', ); - public static $prefixLengthsPsr4 = array( - 'P' => - array( - 'PhpParser\\' => 10, + public static $prefixLengthsPsr4 = array ( + 'S' => + array ( + 'SlevomatCodingStandard\\' => 23, ), - 'D' => - array( + 'P' => + array ( + 'PhpParser\\' => 10, + 'PHPStan\\PhpDocParser\\' => 21, + 'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 57, + ), + 'D' => + array ( 'Doctrine\\Instantiator\\' => 22, 'DeepCopy\\' => 9, ), + 'C' => + array ( + 'CustomSniffs\\' => 13, + ), + 'A' => + array ( + 'App\\' => 4, + ), ); - public static $prefixDirsPsr4 = array( - 'PhpParser\\' => - array( + public static $prefixDirsPsr4 = array ( + 'SlevomatCodingStandard\\' => + array ( + 0 => __DIR__ . '/..' . '/slevomat/coding-standard/SlevomatCodingStandard', + ), + 'PhpParser\\' => + array ( 0 => __DIR__ . '/..' . '/nikic/php-parser/lib/PhpParser', ), - 'Doctrine\\Instantiator\\' => - array( + 'PHPStan\\PhpDocParser\\' => + array ( + 0 => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src', + ), + 'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => + array ( + 0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src', + ), + 'Doctrine\\Instantiator\\' => + array ( 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', ), - 'DeepCopy\\' => - array( + 'DeepCopy\\' => + array ( 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', ), + 'CustomSniffs\\' => + array ( + 0 => __DIR__ . '/../..' . '/custom_sniffs', + ), + 'App\\' => + array ( + 0 => __DIR__ . '/../..' . '/application', + ), ); - public static $prefixesPsr0 = array( - 'o' => - array( - 'org\\bovigo\\vfs\\' => - array( + public static $prefixesPsr0 = array ( + 'o' => + array ( + 'org\\bovigo\\vfs\\' => + array ( 0 => __DIR__ . '/..' . '/mikey179/vfsstream/src/main/php', ), ), ); - public static $classMap = array( + public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'PHPUnit\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Exception.php', 'PHPUnit\\Framework\\ActualValueIsNotAnObjectException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception/ActualValueIsNotAnObjectException.php', @@ -688,6 +722,7 @@ class ComposerStaticInit9fa79f662bb907dfff5f96091a839960 $loader->prefixDirsPsr4 = ComposerStaticInit9fa79f662bb907dfff5f96091a839960::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInit9fa79f662bb907dfff5f96091a839960::$prefixesPsr0; $loader->classMap = ComposerStaticInit9fa79f662bb907dfff5f96091a839960::$classMap; + }, null, ClassLoader::class); } } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index bdb3ddf..aaa0c7c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,5 +1,86 @@ { "packages": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "time": "2023-01-05T11:28:13+00:00", + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "install-path": "../dealerdirect/phpcodesniffer-composer-installer" + }, { "name": "doctrine/instantiator", "version": "1.5.0", @@ -37,7 +118,9 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["MIT"], + "license": [ + "MIT" + ], "authors": [ { "name": "Marco Pivetta", @@ -47,7 +130,10 @@ ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": ["constructor", "instantiate"], + "keywords": [ + "constructor", + "instantiate" + ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", "source": "https://github.com/doctrine/instantiator/tree/1.5.0" @@ -103,7 +189,9 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Frank Kleine", @@ -152,15 +240,25 @@ "type": "library", "installation-source": "dist", "autoload": { - "files": ["src/DeepCopy/deep_copy.php"], + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", - "license": ["MIT"], + "license": [ + "MIT" + ], "description": "Create deep copies (clones) of your objects", - "keywords": ["clone", "copy", "duplicate", "object", "object graph"], + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" @@ -199,7 +297,9 @@ "phpunit/phpunit": "^9.0" }, "time": "2024-07-01T20:03:41+00:00", - "bin": ["bin/php-parse"], + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { @@ -213,14 +313,19 @@ } }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Nikita Popov" } ], "description": "A PHP parser written in PHP", - "keywords": ["parser", "php"], + "keywords": [ + "parser", + "php" + ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" @@ -259,10 +364,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -315,10 +424,14 @@ "type": "library", "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -343,6 +456,56 @@ }, "install-path": "../phar-io/version" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.29.1", + "version_normalized": "1.29.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "reference": "fcaefacf2d5c417e928405b71b400d4ce10daaf4", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "time": "2024-05-31T08:52:43+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.29.1" + }, + "install-path": "../phpstan/phpdoc-parser" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.31", @@ -389,10 +552,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -402,7 +569,11 @@ ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": ["coverage", "testing", "xunit"], + "keywords": [ + "coverage", + "testing", + "xunit" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", @@ -446,10 +617,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -459,7 +634,10 @@ ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": ["filesystem", "iterator"], + "keywords": [ + "filesystem", + "iterator" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" @@ -506,10 +684,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -519,7 +701,9 @@ ], "description": "Invoke callables with a timeout", "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": ["process"], + "keywords": [ + "process" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" @@ -562,10 +746,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -575,7 +763,9 @@ ], "description": "Simple template engine.", "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": ["template"], + "keywords": [ + "template" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" @@ -618,10 +808,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -631,7 +825,9 @@ ], "description": "Utility class for timing", "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": ["timer"], + "keywords": [ + "timer" + ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" @@ -693,7 +889,9 @@ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "time": "2024-07-10T11:45:39+00:00", - "bin": ["phpunit"], + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { @@ -702,11 +900,17 @@ }, "installation-source": "dist", "autoload": { - "files": ["src/Framework/Assert/Functions.php"], - "classmap": ["src/"] + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -716,7 +920,11 @@ ], "description": "The PHP Unit Testing framework.", "homepage": "https://phpunit.de/", - "keywords": ["phpunit", "testing", "xunit"], + "keywords": [ + "phpunit", + "testing", + "xunit" + ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", @@ -768,10 +976,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -823,10 +1035,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -878,10 +1094,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -934,10 +1154,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -958,7 +1182,11 @@ ], "description": "Provides the functionality to compare PHP values for equality", "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": ["comparator", "compare", "equality"], + "keywords": [ + "comparator", + "compare", + "equality" + ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" @@ -1002,10 +1230,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1058,10 +1290,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1074,7 +1310,12 @@ ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": ["diff", "udiff", "unidiff", "unified diff"], + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" @@ -1120,10 +1361,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1132,7 +1377,11 @@ ], "description": "Provides functionality to handle HHVM/PHP environments", "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": ["Xdebug", "environment", "hhvm"], + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" @@ -1177,10 +1426,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1205,7 +1458,10 @@ ], "description": "Provides the functionality to export PHP variables for visualization", "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": ["export", "exporter"], + "keywords": [ + "export", + "exporter" + ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" @@ -1254,10 +1510,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1266,7 +1526,9 @@ ], "description": "Snapshotting of global state", "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": ["global state"], + "keywords": [ + "global state" + ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" @@ -1310,10 +1572,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1367,10 +1633,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1421,10 +1691,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1475,10 +1749,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1537,10 +1815,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1590,10 +1872,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1642,10 +1928,14 @@ }, "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Sebastian Bergmann", @@ -1667,6 +1957,74 @@ ], "install-path": "../sebastian/version" }, + { + "name": "slevomat/coding-standard", + "version": "8.15.0", + "version_normalized": "8.15.0.0", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "7d1d957421618a3803b593ec31ace470177d7817" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", + "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.9.0" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.60", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.16", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + }, + "time": "2024-03-09T15:20:58+00:00", + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "install-path": "../slevomat/coding-standard" + }, { "name": "squizlabs/php_codesniffer", "version": "3.10.2", @@ -1692,7 +2050,10 @@ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "time": "2024-07-21T23:26:44+00:00", - "bin": ["bin/phpcbf", "bin/phpcs"], + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], "type": "library", "extra": { "branch-alias": { @@ -1701,7 +2062,9 @@ }, "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Greg Sherwood", @@ -1718,7 +2081,11 @@ ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", - "keywords": ["phpcs", "standards", "static analysis"], + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], "support": { "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", @@ -1766,10 +2133,14 @@ "type": "library", "installation-source": "dist", "autoload": { - "classmap": ["src/"] + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", - "license": ["BSD-3-Clause"], + "license": [ + "BSD-3-Clause" + ], "authors": [ { "name": "Arne Blankerts", @@ -1793,12 +2164,14 @@ ], "dev": true, "dev-package-names": [ + "dealerdirect/phpcodesniffer-composer-installer", "doctrine/instantiator", "mikey179/vfsstream", "myclabs/deep-copy", "nikic/php-parser", "phar-io/manifest", "phar-io/version", + "phpstan/phpdoc-parser", "phpunit/php-code-coverage", "phpunit/php-file-iterator", "phpunit/php-invoker", @@ -1821,6 +2194,7 @@ "sebastian/resource-operations", "sebastian/type", "sebastian/version", + "slevomat/coding-standard", "squizlabs/php_codesniffer", "theseer/tokenizer" ] diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 1e08315..bc16401 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,11 +1,9 @@ - array( 'name' => 'codeigniter/framework', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '819dc9e876d1bc0d67640592ee12179dc2315637', + 'reference' => '4cbb9629636bfd04af1cf322b44c697f55559a74', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -15,12 +13,21 @@ return array( 'codeigniter/framework' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '819dc9e876d1bc0d67640592ee12179dc2315637', + 'reference' => '4cbb9629636bfd04af1cf322b44c697f55559a74', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), + 'dealerdirect/phpcodesniffer-composer-installer' => array( + 'pretty_version' => 'v1.0.0', + 'version' => '1.0.0.0', + 'reference' => '4be43904336affa5c2f70744a348312336afd0da', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'doctrine/instantiator' => array( 'pretty_version' => '1.5.0', 'version' => '1.5.0.0', @@ -75,6 +82,15 @@ return array( 'aliases' => array(), 'dev_requirement' => true, ), + 'phpstan/phpdoc-parser' => array( + 'pretty_version' => '1.29.1', + 'version' => '1.29.1.0', + 'reference' => 'fcaefacf2d5c417e928405b71b400d4ce10daaf4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'phpunit/php-code-coverage' => array( 'pretty_version' => '9.2.31', 'version' => '9.2.31.0', @@ -273,6 +289,15 @@ return array( 'aliases' => array(), 'dev_requirement' => true, ), + 'slevomat/coding-standard' => array( + 'pretty_version' => '8.15.0', + 'version' => '8.15.0.0', + 'reference' => '7d1d957421618a3803b593ec31ace470177d7817', + 'type' => 'phpcodesniffer-standard', + 'install_path' => __DIR__ . '/../slevomat/coding-standard', + 'aliases' => array(), + 'dev_requirement' => true, + ), 'squizlabs/php_codesniffer' => array( 'pretty_version' => '3.10.2', 'version' => '3.10.2.0', diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index c38d230..580fa96 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 50307)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.3.7". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70400)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { @@ -14,9 +14,9 @@ if ($issues) { } if (!ini_get('display_errors')) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL . PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL . PHP_EOL); + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL . PHP_EOL . str_replace('You are running ' . PHP_VERSION . '.', '', implode(PHP_EOL, $issues)) . PHP_EOL . PHP_EOL; + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( diff --git a/node_modules/regexpp/LICENSE b/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md similarity index 90% rename from node_modules/regexpp/LICENSE rename to vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md index 883ee1f..9bc8806 100644 --- a/node_modules/regexpp/LICENSE +++ b/vendor/dealerdirect/phpcodesniffer-composer-installer/LICENSE.md @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2018 Toru Nagashima +Copyright (c) 2016-2022 Dealerdirect B.V. and contributors +Copyright (c) 2022 PHPCSStandards and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md b/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md new file mode 100644 index 0000000..e8c263a --- /dev/null +++ b/vendor/dealerdirect/phpcodesniffer-composer-installer/README.md @@ -0,0 +1,285 @@ +# PHP_CodeSniffer Standards Composer Installer Plugin + +![Project Stage][project-stage-shield] +![Last Commit][last-updated-shield] +![Awesome][awesome-shield] +[![License][license-shield]](LICENSE.md) + +[![Tests][ghactionstest-shield]][ghactions] +[![Latest Version on Packagist][packagist-version-shield]][packagist-version] +[![Packagist][packagist-shield]][packagist] + +[![Contributor Covenant][code-of-conduct-shield]][code-of-conduct] + +This composer installer plugin allows for easy installation of [PHP_CodeSniffer][codesniffer] coding standards (rulesets). + +No more symbolic linking of directories, checking out repositories on specific locations or changing +the `phpcs` configuration. + +## Usage + +Installation can be done with [Composer][composer], by requiring this package as a development dependency: + +```bash +composer require --dev dealerdirect/phpcodesniffer-composer-installer +``` + +When using Composer 2.2 or higher, Composer will [ask for your permission](https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution) to allow this plugin to execute code. For this plugin to be functional, permission needs to be granted. + +When permission has been granted, the following snippet will automatically be added to your `composer.json` file by Composer: +```json +{ + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} +``` + +When using Composer < 2.2, you can add the permission flag ahead of the upgrade to Composer 2.2, by running: +```bash +composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true +``` + +That's it. + +### Compatibility + +This plugin is compatible with: + +- PHP **5.4+**, **7.x**, and **8.x** (Support for PHP v8 is available since [`v0.7.0`][v0.7]) +- [Composer][composer] **1.x** and **2.x** (Support for Composer v2 is available since [`v0.7.0`][v0.7]) +- [PHP_CodeSniffer][codesniffer] **2.x** and **3.x** (Support for PHP_CodeSniffer v3 is available since [`v0.4.0`][v0.4]) + + +> **ℹ️ Please Note:** [Composer treats _minor_ releases below 1.0.0 as _major_ releases][composer-manual-caret]. So version `0.7.x` (or higher) of this plugin must be _explicitly_ set as version constraint when using Composer 2.x or PHP 8.0. In other words: using `^0.6` will **not** work with Composer 2.x or PHP 8.0. + +### How it works + +Basically, this plugin executes the following steps: + +- This plugin searches for [`phpcodesniffer-standard` packages][] in all of your currently installed Composer packages. +- Matching packages and the project itself are scanned for PHP_CodeSniffer rulesets. +- The plugin will call PHP_CodeSniffer and configure the `installed_paths` option. + +### Example project + +The following is an example Composer project and has included +multiple `phpcodesniffer-standard` packages. + +```json +{ + "name": "example/project", + "description": "Just an example project", + "type": "project", + "require": {}, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "*", + "object-calisthenics/phpcs-calisthenics-rules": "*", + "phpcompatibility/php-compatibility": "*", + "wp-coding-standards/wpcs": "*" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} +``` + +After running `composer install` PHP_CodeSniffer just works: + +```bash +$ ./vendor/bin/phpcs -i +The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, ObjectCalisthenics, +PHPCompatibility, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra +``` + +### Calling the plugin directly + +In some circumstances, it is desirable to call this plugin's functionality +directly. For instance, during development or in [CI][definition-ci] environments. + +As the plugin requires Composer to work, direct calls need to be wired through a +project's `composer.json`. + +This is done by adding a call to the `Plugin::run` function in the `script` +section of the `composer.json`: + +```json +{ + "scripts": { + "install-codestandards": [ + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run" + ] + } +} +``` + +The command can then be called using `composer run-script install-codestandards` or +referenced from other script configurations, as follows: + +```json +{ + "scripts": { + "install-codestandards": [ + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run" + ], + "post-install-cmd": [ + "@install-codestandards" + ] + } +} +``` + +For more details about Composer scripts, please refer to [the section on scripts +in the Composer manual][composer-manual-scripts]. + +### Changing the Coding Standards search depth + +By default, this plugin searches up for Coding Standards up to three directories +deep. In most cases, this should be sufficient. However, this plugin allows +you to customize the search depth setting if needed. + +```json +{ + "extra": { + "phpcodesniffer-search-depth": 5 + } +} +``` + +### Caveats + +When this plugin is installed globally, composer will load the _global_ plugin rather +than the one from the local repository. Despite [this behavior being documented +in the composer manual][using-composer-plugins], it could potentially confuse +as another version of the plugin could be run and not the one specified by the project. + +## Developing Coding Standards + +Coding standard can be developed normally, as documented by [PHP_CodeSniffer][codesniffer], in the [Coding Standard Tutorial][tutorial]. + +Create a composer package of your coding standard by adding a `composer.json` file. + +```json +{ + "name" : "acme/phpcodesniffer-our-standards", + "description" : "Package contains all coding standards of the Acme company", + "require" : { + "php" : ">=5.4.0", + "squizlabs/php_codesniffer" : "^3.6" + }, + "type" : "phpcodesniffer-standard" +} +``` + +Requirements: +* The repository may contain one or more standards. +* Each standard can have a separate directory no deeper than 3 levels from the repository root. +* The package `type` must be `phpcodesniffer-standard`. Without this, the plugin will not trigger. + +### Requiring the plugin from within your coding standard + +If your coding standard itself depends on additional external PHPCS standards, this plugin can +make life easier on your end-users by taking care of the installation of all standards - yours +and your dependencies - for them. + +This can help reduce the number of support questions about setting the `installed_paths`, as well +as simplify your standard's installation instructions. + +For this to work, make sure your external standard adds this plugin to the `composer.json` config +via `require`, **not** `require-dev`. + +> :warning: Your end-user may already `require-dev` this plugin and/or other external standards used +> by your end-users may require this plugin as well. +> +> To prevent your end-users getting into "_dependency hell_", make sure to make the version requirement +> for this plugin flexible. +> +> As, for now, this plugin is still regarded as "unstable" (version < 1.0), remember that Composer +> treats unstable minors as majors and will not be able to resolve one config requiring this plugin +> at version `^0.5`, while another requires it at version `^0.6`. +> Either allow multiple minors or use `*` as the version requirement. +> +> Some examples of flexible requirements which can be used: +> ```bash +> composer require dealerdirect/phpcodesniffer-composer-installer:"*" +> composer require dealerdirect/phpcodesniffer-composer-installer:"0.*" +> composer require dealerdirect/phpcodesniffer-composer-installer:"^0.4.1 || ^0.5 || ^0.6 || ^0.7" +> ``` + +## Changelog + +This repository does not contain a `CHANGELOG.md` file, however, we do publish a changelog on each release +using the [GitHub releases][changelog] functionality. + +## Contributing + +This is an active open-source project. We are always open to people who want to +use the code or contribute to it. + +We've set up a separate document for our [contribution guidelines][contributing-guidelines]. + +Thank you for being involved! :heart_eyes: + +## Authors & contributors + +The original idea and setup of this repository is by [Franck Nijhof][frenck], employee @ Dealerdirect. + +For a full list of all author and/or contributors, check [the contributors page][contributors]. + +## License + +The MIT License (MIT) + +Copyright (c) 2016-2022 Dealerdirect B.V. and contributors +Copyright (c) 2022 PHPCSStandards and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +[awesome-shield]: https://img.shields.io/badge/awesome%3F-yes-brightgreen.svg +[changelog]: https://github.com/PHPCSStandards/composer-installer/releases +[code-of-conduct-shield]: https://img.shields.io/badge/Contributor%20Covenant-v2.0-ff69b4.svg +[code-of-conduct]: CODE_OF_CONDUCT.md +[codesniffer]: https://github.com/squizlabs/PHP_CodeSniffer +[composer-manual-scripts]: https://getcomposer.org/doc/articles/scripts.md +[composer-manual-caret]: https://getcomposer.org/doc/articles/versions.md#caret-version-range- +[composer]: https://getcomposer.org/ +[contributing-guidelines]: CONTRIBUTING.md +[contributors]: https://github.com/PHPCSStandards/composer-installer/graphs/contributors +[definition-ci]: https://en.wikipedia.org/wiki/Continuous_integration +[frenck]: https://github.com/frenck +[last-updated-shield]: https://img.shields.io/github/last-commit/PHPCSStandards/composer-installer.svg +[license-shield]: https://img.shields.io/github/license/PHPCSStandards/composer-installer.svg +[packagist-shield]: https://img.shields.io/packagist/dt/dealerdirect/phpcodesniffer-composer-installer.svg +[packagist-version-shield]: https://img.shields.io/packagist/v/dealerdirect/phpcodesniffer-composer-installer.svg +[packagist-version]: https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer +[packagist]: https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer +[`phpcodesniffer-standard` packages]: https://packagist.org/explore/?type=phpcodesniffer-standard +[project-stage-shield]: https://img.shields.io/badge/Project%20Stage-Development-yellowgreen.svg +[scrutinizer-shield]: https://img.shields.io/scrutinizer/g/dealerdirect/phpcodesniffer-composer-installer.svg +[scrutinizer]: https://scrutinizer-ci.com/g/dealerdirect/phpcodesniffer-composer-installer/ +[ghactionstest-shield]: https://github.com/PHPCSStandards/composer-installer/actions/workflows/integrationtest.yml/badge.svg +[ghactions]: https://github.com/PHPCSStandards/composer-installer/actions/workflows/integrationtest.yml +[tutorial]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial +[using-composer-plugins]: https://getcomposer.org/doc/articles/plugins.md#using-plugins +[v0.4]: https://github.com/PHPCSStandards/composer-installer/releases/tag/v0.4.0 +[v0.7]: https://github.com/PHPCSStandards/composer-installer/releases/tag/v0.7.0 diff --git a/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json b/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json new file mode 100644 index 0000000..bf3355a --- /dev/null +++ b/vendor/dealerdirect/phpcodesniffer-composer-installer/composer.json @@ -0,0 +1,71 @@ +{ + "name": "dealerdirect/phpcodesniffer-composer-installer", + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "type": "composer-plugin", + "keywords": [ + "composer", "installer", "plugin", + "phpcs", "phpcbf", "codesniffer", "phpcodesniffer", "php_codesniffer", + "standard", "standards", "style guide", "stylecheck", + "qa", "quality", "code quality", "tests" + ], + "homepage": "http://www.dealerdirect.com", + "license": "MIT", + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name" : "Contributors", + "homepage" : "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "require": { + "php": ">=5.4", + "composer-plugin-api": "^1.0 || ^2.0", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "ext-json": "*", + "ext-zip": "*", + "composer/composer": "*", + "phpcompatibility/php-compatibility": "^9.0", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "yoast/phpunit-polyfills": "^1.0" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Tests\\": "tests/" + } + }, + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "scripts": { + "install-codestandards": [ + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run" + ], + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git" + ], + "test": [ + "@php ./vendor/phpunit/phpunit/phpunit --no-coverage" + ], + "coverage": [ + "@php ./vendor/phpunit/phpunit/phpunit" + ] + } +} diff --git a/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php b/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php new file mode 100644 index 0000000..a2863d6 --- /dev/null +++ b/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php @@ -0,0 +1,637 @@ + + */ +class Plugin implements PluginInterface, EventSubscriberInterface +{ + const KEY_MAX_DEPTH = 'phpcodesniffer-search-depth'; + + const MESSAGE_ERROR_WRONG_MAX_DEPTH = + 'The value of "%s" (in the composer.json "extra".section) must be an integer larger than %d, %s given.'; + + const MESSAGE_NOT_INSTALLED = 'PHPCodeSniffer is not installed'; + const MESSAGE_NOTHING_TO_INSTALL = 'No PHPCS standards to install or update'; + const MESSAGE_PLUGIN_UNINSTALLED = 'PHPCodeSniffer Composer Installer is uninstalled'; + const MESSAGE_RUNNING_INSTALLER = 'Running PHPCodeSniffer Composer Installer'; + + const PACKAGE_NAME = 'squizlabs/php_codesniffer'; + const PACKAGE_TYPE = 'phpcodesniffer-standard'; + + const PHPCS_CONFIG_REGEX = '`%s:[^\r\n]+`'; + const PHPCS_CONFIG_KEY = 'installed_paths'; + + const PLUGIN_NAME = 'dealerdirect/phpcodesniffer-composer-installer'; + + /** + * @var Composer + */ + private $composer; + + /** + * @var string + */ + private $cwd; + + /** + * @var Filesystem + */ + private $filesystem; + + /** + * @var array + */ + private $installedPaths; + + /** + * @var IOInterface + */ + private $io; + + /** + * @var ProcessExecutor + */ + private $processExecutor; + + /** + * Triggers the plugin's main functionality. + * + * Makes it possible to run the plugin as a custom command. + * + * @param Event $event + * + * @throws \InvalidArgumentException + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public static function run(Event $event) + { + $io = $event->getIO(); + $composer = $event->getComposer(); + + $instance = new static(); + + $instance->io = $io; + $instance->composer = $composer; + $instance->init(); + $instance->onDependenciesChangedEvent(); + } + + /** + * {@inheritDoc} + * + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public function activate(Composer $composer, IOInterface $io) + { + $this->composer = $composer; + $this->io = $io; + + $this->init(); + } + + /** + * {@inheritDoc} + */ + public function deactivate(Composer $composer, IOInterface $io) + { + } + + /** + * {@inheritDoc} + */ + public function uninstall(Composer $composer, IOInterface $io) + { + } + + /** + * Prepares the plugin so it's main functionality can be run. + * + * @throws \RuntimeException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + private function init() + { + $this->cwd = getcwd(); + $this->installedPaths = array(); + + $this->processExecutor = new ProcessExecutor($this->io); + $this->filesystem = new Filesystem($this->processExecutor); + } + + /** + * {@inheritDoc} + */ + public static function getSubscribedEvents() + { + return array( + ScriptEvents::POST_INSTALL_CMD => array( + array('onDependenciesChangedEvent', 0), + ), + ScriptEvents::POST_UPDATE_CMD => array( + array('onDependenciesChangedEvent', 0), + ), + ); + } + + /** + * Entry point for post install and post update events. + * + * @throws \InvalidArgumentException + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + public function onDependenciesChangedEvent() + { + $io = $this->io; + $isVerbose = $io->isVerbose(); + $exitCode = 0; + + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_RUNNING_INSTALLER)); + } + + if ($this->isPHPCodeSnifferInstalled() === true) { + $this->loadInstalledPaths(); + $installPathCleaned = $this->cleanInstalledPaths(); + $installPathUpdated = $this->updateInstalledPaths(); + + if ($installPathCleaned === true || $installPathUpdated === true) { + $exitCode = $this->saveInstalledPaths(); + } elseif ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_NOTHING_TO_INSTALL)); + } + } else { + $pluginPackage = $this + ->composer + ->getRepositoryManager() + ->getLocalRepository() + ->findPackages(self::PLUGIN_NAME) + ; + + $isPluginUninstalled = count($pluginPackage) === 0; + + if ($isPluginUninstalled) { + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_PLUGIN_UNINSTALLED)); + } + } else { + $exitCode = 1; + if ($isVerbose) { + $io->write(sprintf('%s', self::MESSAGE_NOT_INSTALLED)); + } + } + } + + return $exitCode; + } + + /** + * Load all paths from PHP_CodeSniffer into an array. + * + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + */ + private function loadInstalledPaths() + { + if ($this->isPHPCodeSnifferInstalled() === true) { + $this->processExecutor->execute( + $this->getPhpcsCommand() . ' --config-show', + $output, + $this->getPHPCodeSnifferInstallPath() + ); + + $regex = sprintf(self::PHPCS_CONFIG_REGEX, self::PHPCS_CONFIG_KEY); + if (preg_match($regex, $output, $match) === 1) { + $phpcsInstalledPaths = str_replace(self::PHPCS_CONFIG_KEY . ': ', '', $match[0]); + $phpcsInstalledPaths = trim($phpcsInstalledPaths); + + if ($phpcsInstalledPaths !== '') { + $this->installedPaths = explode(',', $phpcsInstalledPaths); + } + } + } + } + + /** + * Save all coding standard paths back into PHP_CodeSniffer + * + * @throws LogicException + * @throws ProcessFailedException + * @throws RuntimeException + * + * @return int Exit code. 0 for success, 1 or higher for failure. + */ + private function saveInstalledPaths() + { + // Check if we found installed paths to set. + if (count($this->installedPaths) !== 0) { + sort($this->installedPaths); + $paths = implode(',', $this->installedPaths); + $arguments = array('--config-set', self::PHPCS_CONFIG_KEY, $paths); + $configMessage = sprintf( + 'PHP CodeSniffer Config %s set to %s', + self::PHPCS_CONFIG_KEY, + $paths + ); + } else { + // Delete the installed paths if none were found. + $arguments = array('--config-delete', self::PHPCS_CONFIG_KEY); + $configMessage = sprintf( + 'PHP CodeSniffer Config %s delete', + self::PHPCS_CONFIG_KEY + ); + } + + // Prepare message in case of failure + $failMessage = sprintf( + 'Failed to set PHP CodeSniffer %s Config', + self::PHPCS_CONFIG_KEY + ); + + // Okay, lets rock! + $command = vsprintf( + '%s %s', + array( + 'phpcs command' => $this->getPhpcsCommand(), + 'arguments' => implode(' ', $arguments), + ) + ); + + $exitCode = $this->processExecutor->execute($command, $configResult, $this->getPHPCodeSnifferInstallPath()); + if ($exitCode === 0) { + $exitCode = $this->verifySaveSuccess(); + } + + if ($exitCode === 0) { + $this->io->write($configMessage); + } else { + $this->io->write($failMessage); + } + + if ($this->io->isVerbose() && !empty($configResult)) { + $this->io->write(sprintf('%s', $configResult)); + } + + return $exitCode; + } + + /** + * Verify that the paths which were expected to be saved, have been. + * + * @return int Exit code. 0 for success, 1 for failure. + */ + private function verifySaveSuccess() + { + $exitCode = 1; + $expectedPaths = $this->installedPaths; + + // Request the currently set installed paths after the save. + $this->loadInstalledPaths(); + + $registeredPaths = array_intersect($this->installedPaths, $expectedPaths); + $registeredCount = count($registeredPaths); + $expectedCount = count($expectedPaths); + + if ($expectedCount === $registeredCount) { + $exitCode = 0; + } + + if ($exitCode === 1 && $this->io->isVerbose()) { + $verificationMessage = sprintf( + "Paths to external standards found by the plugin: %s\n" + . 'Actual paths registered with PHPCS: %s', + implode(', ', $expectedPaths), + implode(', ', $this->installedPaths) + ); + $this->io->write($verificationMessage); + } + + return $exitCode; + } + + /** + * Get the command to call PHPCS. + */ + protected function getPhpcsCommand() + { + // Determine the path to the main PHPCS file. + $phpcsPath = $this->getPHPCodeSnifferInstallPath(); + if (file_exists($phpcsPath . '/bin/phpcs') === true) { + // PHPCS 3.x. + $phpcsExecutable = './bin/phpcs'; + } else { + // PHPCS 2.x. + $phpcsExecutable = './scripts/phpcs'; + } + + return vsprintf( + '%s %s', + array( + 'php executable' => $this->getPhpExecCommand(), + 'phpcs executable' => $phpcsExecutable, + ) + ); + } + + /** + * Get the path to the current PHP version being used. + * + * Duplicate of the same in the EventDispatcher class in Composer itself. + */ + protected function getPhpExecCommand() + { + $finder = new PhpExecutableFinder(); + + $phpPath = $finder->find(false); + + if ($phpPath === false) { + throw new \RuntimeException('Failed to locate PHP binary to execute ' . $phpPath); + } + + $phpArgs = $finder->findArguments(); + $phpArgs = $phpArgs + ? ' ' . implode(' ', $phpArgs) + : '' + ; + + $command = ProcessExecutor::escape($phpPath) . + $phpArgs . + ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')) . + ' -d disable_functions=' . ProcessExecutor::escape(ini_get('disable_functions')) . + ' -d memory_limit=' . ProcessExecutor::escape(ini_get('memory_limit')) + ; + + return $command; + } + + /** + * Iterate trough all known paths and check if they are still valid. + * + * If path does not exists, is not an directory or isn't readable, the path + * is removed from the list. + * + * @return bool True if changes where made, false otherwise + */ + private function cleanInstalledPaths() + { + $changes = false; + foreach ($this->installedPaths as $key => $path) { + // This might be a relative path as well + $alternativePath = realpath($this->getPHPCodeSnifferInstallPath() . \DIRECTORY_SEPARATOR . $path); + + if ( + (is_dir($path) === false || is_readable($path) === false) && + ( + $alternativePath === false || + is_dir($alternativePath) === false || + is_readable($alternativePath) === false + ) + ) { + unset($this->installedPaths[$key]); + $changes = true; + } + } + return $changes; + } + + /** + * Check all installed packages (including the root package) against + * the installed paths from PHP_CodeSniffer and add the missing ones. + * + * @return bool True if changes where made, false otherwise + * + * @throws \InvalidArgumentException + * @throws \RuntimeException + */ + private function updateInstalledPaths() + { + $changes = false; + $searchPaths = array(); + + // Add root package only if it has the expected package type. + if ( + $this->composer->getPackage() instanceof RootPackageInterface + && $this->composer->getPackage()->getType() === self::PACKAGE_TYPE + ) { + $searchPaths[] = $this->cwd; + } + + $codingStandardPackages = $this->getPHPCodingStandardPackages(); + foreach ($codingStandardPackages as $package) { + $installPath = $this->composer->getInstallationManager()->getInstallPath($package); + if ($this->filesystem->isAbsolutePath($installPath) === false) { + $installPath = $this->filesystem->normalizePath( + $this->cwd . \DIRECTORY_SEPARATOR . $installPath + ); + } + $searchPaths[] = $installPath; + } + + // Nothing to do. + if ($searchPaths === array()) { + return false; + } + + $finder = new Finder(); + $finder->files() + ->depth('<= ' . $this->getMaxDepth()) + ->depth('>= ' . $this->getMinDepth()) + ->ignoreUnreadableDirs() + ->ignoreVCS(true) + ->in($searchPaths) + ->name('ruleset.xml'); + + // Process each found possible ruleset. + foreach ($finder as $ruleset) { + $standardsPath = $ruleset->getPath(); + + // Pick the directory above the directory containing the standard, unless this is the project root. + if ($standardsPath !== $this->cwd) { + $standardsPath = dirname($standardsPath); + } + + // Use relative paths for local project repositories. + if ($this->isRunningGlobally() === false) { + $standardsPath = $this->filesystem->findShortestPath( + $this->getPHPCodeSnifferInstallPath(), + $standardsPath, + true + ); + } + + // De-duplicate and add when directory is not configured. + if (in_array($standardsPath, $this->installedPaths, true) === false) { + $this->installedPaths[] = $standardsPath; + $changes = true; + } + } + + return $changes; + } + + /** + * Iterates through Composers' local repository looking for valid Coding + * Standard packages. + * + * @return array Composer packages containing coding standard(s) + */ + private function getPHPCodingStandardPackages() + { + $codingStandardPackages = array_filter( + $this->composer->getRepositoryManager()->getLocalRepository()->getPackages(), + function (PackageInterface $package) { + if ($package instanceof AliasPackage) { + return false; + } + return $package->getType() === Plugin::PACKAGE_TYPE; + } + ); + + return $codingStandardPackages; + } + + /** + * Searches for the installed PHP_CodeSniffer Composer package + * + * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against + * + * @return PackageInterface|null + */ + private function getPHPCodeSnifferPackage($versionConstraint = null) + { + $packages = $this + ->composer + ->getRepositoryManager() + ->getLocalRepository() + ->findPackages(self::PACKAGE_NAME, $versionConstraint); + + return array_shift($packages); + } + + /** + * Returns the path to the PHP_CodeSniffer package installation location + * + * @return string + */ + private function getPHPCodeSnifferInstallPath() + { + return $this->composer->getInstallationManager()->getInstallPath($this->getPHPCodeSnifferPackage()); + } + + /** + * Simple check if PHP_CodeSniffer is installed. + * + * @param null|string|\Composer\Semver\Constraint\ConstraintInterface $versionConstraint to match against + * + * @return bool Whether PHP_CodeSniffer is installed + */ + private function isPHPCodeSnifferInstalled($versionConstraint = null) + { + return ($this->getPHPCodeSnifferPackage($versionConstraint) !== null); + } + + /** + * Test if composer is running "global" + * This check kinda dirty, but it is the "Composer Way" + * + * @return bool Whether Composer is running "globally" + * + * @throws \RuntimeException + */ + private function isRunningGlobally() + { + return ($this->composer->getConfig()->get('home') === $this->cwd); + } + + /** + * Determines the maximum search depth when searching for Coding Standards. + * + * @return int + * + * @throws \InvalidArgumentException + */ + private function getMaxDepth() + { + $maxDepth = 3; + + $extra = $this->composer->getPackage()->getExtra(); + + if (array_key_exists(self::KEY_MAX_DEPTH, $extra)) { + $maxDepth = $extra[self::KEY_MAX_DEPTH]; + $minDepth = $this->getMinDepth(); + + if ( + (string) (int) $maxDepth !== (string) $maxDepth /* Must be an integer or cleanly castable to one */ + || $maxDepth <= $minDepth /* Larger than the minimum */ + || is_float($maxDepth) === true /* Within the boundaries of integer */ + ) { + $message = vsprintf( + self::MESSAGE_ERROR_WRONG_MAX_DEPTH, + array( + 'key' => self::KEY_MAX_DEPTH, + 'min' => $minDepth, + 'given' => var_export($maxDepth, true), + ) + ); + + throw new \InvalidArgumentException($message); + } + } + + return (int) $maxDepth; + } + + /** + * Returns the minimal search depth for Coding Standard packages. + * + * Usually this is 0, unless PHP_CodeSniffer >= 3 is used. + * + * @return int + */ + private function getMinDepth() + { + if ($this->isPHPCodeSnifferInstalled('>= 3.0.0') !== true) { + return 1; + } + return 0; + } +} diff --git a/node_modules/eslint-utils/LICENSE b/vendor/phpstan/phpdoc-parser/LICENSE similarity index 95% rename from node_modules/eslint-utils/LICENSE rename to vendor/phpstan/phpdoc-parser/LICENSE index 883ee1f..98a854e 100644 --- a/node_modules/eslint-utils/LICENSE +++ b/vendor/phpstan/phpdoc-parser/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Toru Nagashima +Copyright (c) 2016 Ondřej Mirtes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ 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. +SOFTWARE. \ No newline at end of file diff --git a/vendor/phpstan/phpdoc-parser/README.md b/vendor/phpstan/phpdoc-parser/README.md new file mode 100644 index 0000000..3b321b2 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/README.md @@ -0,0 +1,121 @@ +

PHPDoc Parser for PHPStan

+ +

+ Build Status + Latest Stable Version + License + PHPStan Enabled +

+ +This library `phpstan/phpdoc-parser` represents PHPDocs with an AST (Abstract Syntax Tree). It supports parsing and modifying PHPDocs. + +For the complete list of supported PHPDoc features check out PHPStan documentation. PHPStan is the main (but not the only) user of this library. + +* [PHPDoc Basics](https://phpstan.org/writing-php-code/phpdocs-basics) (list of PHPDoc tags) +* [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) (list of PHPDoc types) +* [phpdoc-parser API Reference](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.html) with all the AST node types etc. + +This parser also supports parsing [Doctrine Annotations](https://github.com/doctrine/annotations). The AST nodes live in the [PHPStan\PhpDocParser\Ast\PhpDoc\Doctrine namespace](https://phpstan.github.io/phpdoc-parser/namespace-PHPStan.PhpDocParser.Ast.PhpDoc.Doctrine.html). The support needs to be turned on by setting `bool $parseDoctrineAnnotations` to `true` in `Lexer` and `PhpDocParser` class constructors. + +## Installation + +``` +composer require phpstan/phpdoc-parser +``` + +## Basic usage + +```php +tokenize('/** @param Lorem $a */')); +$phpDocNode = $phpDocParser->parse($tokens); // PhpDocNode +$paramTags = $phpDocNode->getParamTagValues(); // ParamTagValueNode[] +echo $paramTags[0]->parameterName; // '$a' +echo $paramTags[0]->type; // IdentifierTypeNode - 'Lorem' +``` + +### Format-preserving printer + +This component can be used to modify the AST +and print it again as close as possible to the original. + +It's heavily inspired by format-preserving printer component in [nikic/PHP-Parser](https://github.com/nikic/PHP-Parser). + +```php + true, 'indexes' => true]; + +$lexer = new Lexer(); +$constExprParser = new ConstExprParser(true, true, $usedAttributes); +$typeParser = new TypeParser($constExprParser, true, $usedAttributes); +$phpDocParser = new PhpDocParser($typeParser, $constExprParser, true, true, $usedAttributes); + +$tokens = new TokenIterator($lexer->tokenize('/** @param Lorem $a */')); +$phpDocNode = $phpDocParser->parse($tokens); // PhpDocNode + +$cloningTraverser = new NodeTraverser([new CloningVisitor()]); + +/** @var PhpDocNode $newPhpDocNode */ +[$newPhpDocNode] = $cloningTraverser->traverse([$phpDocNode]); + +// change something in $newPhpDocNode +$newPhpDocNode->getParamTagValues()[0]->type = new IdentifierTypeNode('Ipsum'); + +// print changed PHPDoc +$printer = new Printer(); +$newPhpDoc = $printer->printFormatPreserving($newPhpDocNode, $phpDocNode, $tokens); +echo $newPhpDoc; // '/** @param Ipsum $a */' +``` + +## Code of Conduct + +This project adheres to a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code. + +## Building + +Initially you need to run `composer install`, or `composer update` in case you aren't working in a folder which was built before. + +Afterwards you can either run the whole build including linting and coding standards using + + make + +or run only tests using + + make tests diff --git a/vendor/phpstan/phpdoc-parser/composer.json b/vendor/phpstan/phpdoc-parser/composer.json new file mode 100644 index 0000000..f1c648e --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/composer.json @@ -0,0 +1,44 @@ +{ + "name": "phpstan/phpdoc-parser", + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "license": "MIT", + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "config": { + "platform": { + "php": "7.4.6" + }, + "sort-packages": true, + "allow-plugins": { + "phpstan/extension-installer": true + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "autoload-dev": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "tests/PHPStan" + ] + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php b/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php new file mode 100644 index 0000000..2b9c10e --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/AbstractNodeVisitor.php @@ -0,0 +1,34 @@ +key = $key; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->key !== null) { + return sprintf('%s => %s', $this->key, $this->value); + + } + + return (string) $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php new file mode 100644 index 0000000..1f9def3 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprArrayNode.php @@ -0,0 +1,30 @@ +items = $items; + } + + + public function __toString(): string + { + return '[' . implode(', ', $this->items) . ']'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php new file mode 100644 index 0000000..e681127 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprFalseNode.php @@ -0,0 +1,17 @@ +value = $value; + } + + + public function __toString(): string + { + return $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php new file mode 100644 index 0000000..5339bb5 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprIntegerNode.php @@ -0,0 +1,26 @@ +value = $value; + } + + + public function __toString(): string + { + return $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php new file mode 100644 index 0000000..1859f03 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprNode.php @@ -0,0 +1,10 @@ +value = $value; + } + + + public function __toString(): string + { + return $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php new file mode 100644 index 0000000..ec98032 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/ConstExprTrueNode.php @@ -0,0 +1,17 @@ +className = $className; + $this->name = $name; + } + + + public function __toString(): string + { + if ($this->className === '') { + return $this->name; + + } + + return "{$this->className}::{$this->name}"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/DoctrineConstExprStringNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/DoctrineConstExprStringNode.php new file mode 100644 index 0000000..a503937 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/DoctrineConstExprStringNode.php @@ -0,0 +1,42 @@ +value = $value; + } + + public function __toString(): string + { + return self::escape($this->value); + } + + public static function unescape(string $value): string + { + // from https://github.com/doctrine/annotations/blob/a9ec7af212302a75d1f92fa65d3abfbd16245a2a/lib/Doctrine/Common/Annotations/DocLexer.php#L103-L107 + return str_replace('""', '"', substr($value, 1, strlen($value) - 2)); + } + + private static function escape(string $value): string + { + // from https://github.com/phpstan/phpdoc-parser/issues/205#issuecomment-1662323656 + return sprintf('"%s"', str_replace('"', '""', $value)); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php new file mode 100644 index 0000000..f2792b1 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/ConstExpr/QuoteAwareConstExprStringNode.php @@ -0,0 +1,78 @@ +quoteType = $quoteType; + } + + + public function __toString(): string + { + if ($this->quoteType === self::SINGLE_QUOTED) { + // from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1007 + return sprintf("'%s'", addcslashes($this->value, '\'\\')); + } + + // from https://github.com/nikic/PHP-Parser/blob/0ffddce52d816f72d0efc4d9b02e276d3309ef01/lib/PhpParser/PrettyPrinter/Standard.php#L1010-L1040 + return sprintf('"%s"', $this->escapeDoubleQuotedString()); + } + + private function escapeDoubleQuotedString(): string + { + $quote = '"'; + $escaped = addcslashes($this->value, "\n\r\t\f\v$" . $quote . '\\'); + + // Escape control characters and non-UTF-8 characters. + // Regex based on https://stackoverflow.com/a/11709412/385378. + $regex = '/( + [\x00-\x08\x0E-\x1F] # Control characters + | [\xC0-\xC1] # Invalid UTF-8 Bytes + | [\xF5-\xFF] # Invalid UTF-8 Bytes + | \xE0(?=[\x80-\x9F]) # Overlong encoding of prior code point + | \xF0(?=[\x80-\x8F]) # Overlong encoding of prior code point + | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start + | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start + | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start + | (?<=[\x00-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle + | (? */ + private $attributes = []; + + /** + * @param mixed $value + */ + public function setAttribute(string $key, $value): void + { + $this->attributes[$key] = $value; + } + + public function hasAttribute(string $key): bool + { + return array_key_exists($key, $this->attributes); + } + + /** + * @return mixed + */ + public function getAttribute(string $key) + { + if ($this->hasAttribute($key)) { + return $this->attributes[$key]; + } + + return null; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/NodeTraverser.php b/vendor/phpstan/phpdoc-parser/src/Ast/NodeTraverser.php new file mode 100644 index 0000000..63b25c3 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/NodeTraverser.php @@ -0,0 +1,312 @@ + Visitors */ + private $visitors = []; + + /** @var bool Whether traversal should be stopped */ + private $stopTraversal; + + /** + * @param list $visitors + */ + public function __construct(array $visitors) + { + $this->visitors = $visitors; + } + + /** + * Traverses an array of nodes using the registered visitors. + * + * @param Node[] $nodes Array of nodes + * + * @return Node[] Traversed array of nodes + */ + public function traverse(array $nodes): array + { + $this->stopTraversal = false; + + foreach ($this->visitors as $visitor) { + $return = $visitor->beforeTraverse($nodes); + if ($return === null) { + continue; + } + + $nodes = $return; + } + + $nodes = $this->traverseArray($nodes); + + foreach ($this->visitors as $visitor) { + $return = $visitor->afterTraverse($nodes); + if ($return === null) { + continue; + } + + $nodes = $return; + } + + return $nodes; + } + + /** + * Recursively traverse a node. + * + * @param Node $node Node to traverse. + * + * @return Node Result of traversal (may be original node or new one) + */ + private function traverseNode(Node $node): Node + { + $subNodeNames = array_keys(get_object_vars($node)); + foreach ($subNodeNames as $name) { + $subNode =& $node->$name; + + if (is_array($subNode)) { + $subNode = $this->traverseArray($subNode); + if ($this->stopTraversal) { + break; + } + } elseif ($subNode instanceof Node) { + $traverseChildren = true; + $breakVisitorIndex = null; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($subNode); + if ($return === null) { + continue; + } + + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $return; + } elseif ($return === self::DONT_TRAVERSE_CHILDREN) { + $traverseChildren = false; + } elseif ($return === self::DONT_TRAVERSE_CURRENT_AND_CHILDREN) { + $traverseChildren = false; + $breakVisitorIndex = $visitorIndex; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($traverseChildren) { + $subNode = $this->traverseNode($subNode); + if ($this->stopTraversal) { + break; + } + } + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->leaveNode($subNode); + + if ($return !== null) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $return; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } elseif (is_array($return)) { + throw new LogicException( + 'leaveNode() may only return an array ' . + 'if the parent structure is an array' + ); + } else { + throw new LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($breakVisitorIndex === $visitorIndex) { + break; + } + } + } + } + + return $node; + } + + /** + * Recursively traverse array (usually of nodes). + * + * @param mixed[] $nodes Array to traverse + * + * @return mixed[] Result of traversal (may be original array or changed one) + */ + private function traverseArray(array $nodes): array + { + $doNodes = []; + + foreach ($nodes as $i => &$node) { + if ($node instanceof Node) { + $traverseChildren = true; + $breakVisitorIndex = null; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($node); + if ($return === null) { + continue; + } + + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $node = $return; + } elseif (is_array($return)) { + $doNodes[] = [$i, $return]; + continue 2; + } elseif ($return === self::REMOVE_NODE) { + $doNodes[] = [$i, []]; + continue 2; + } elseif ($return === self::DONT_TRAVERSE_CHILDREN) { + $traverseChildren = false; + } elseif ($return === self::DONT_TRAVERSE_CURRENT_AND_CHILDREN) { + $traverseChildren = false; + $breakVisitorIndex = $visitorIndex; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($traverseChildren) { + $node = $this->traverseNode($node); + if ($this->stopTraversal) { + break; + } + } + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->leaveNode($node); + + if ($return !== null) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $node = $return; + } elseif (is_array($return)) { + $doNodes[] = [$i, $return]; + break; + } elseif ($return === self::REMOVE_NODE) { + $doNodes[] = [$i, []]; + break; + } elseif ($return === self::STOP_TRAVERSAL) { + $this->stopTraversal = true; + break 2; + } else { + throw new LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); + } + } + + if ($breakVisitorIndex === $visitorIndex) { + break; + } + } + } elseif (is_array($node)) { + throw new LogicException('Invalid node structure: Contains nested arrays'); + } + } + + if (count($doNodes) > 0) { + while ([$i, $replace] = array_pop($doNodes)) { + array_splice($nodes, $i, 1, $replace); + } + } + + return $nodes; + } + + private function ensureReplacementReasonable(Node $old, Node $new): void + { + if ($old instanceof TypeNode && !$new instanceof TypeNode) { + throw new LogicException(sprintf('Trying to replace TypeNode with %s', get_class($new))); + } + + if ($old instanceof ConstExprNode && !$new instanceof ConstExprNode) { + throw new LogicException(sprintf('Trying to replace ConstExprNode with %s', get_class($new))); + } + + if ($old instanceof PhpDocChildNode && !$new instanceof PhpDocChildNode) { + throw new LogicException(sprintf('Trying to replace PhpDocChildNode with %s', get_class($new))); + } + + if ($old instanceof PhpDocTagValueNode && !$new instanceof PhpDocTagValueNode) { + throw new LogicException(sprintf('Trying to replace PhpDocTagValueNode with %s', get_class($new))); + } + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php b/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php new file mode 100644 index 0000000..bf7d784 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor.php @@ -0,0 +1,87 @@ + $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * NodeTraverser::REMOVE_NODE + * => $node is removed from the parent array + * * NodeTraverser::DONT_TRAVERSE_CHILDREN + * => Children of $node are not traversed. $node stays as-is + * * NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN + * => Further visitors for the current node are skipped, and its children are not + * traversed. $node stays as-is. + * * NodeTraverser::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return Node|Node[]|NodeTraverser::*|null Replacement node (or special return value) + */ + public function enterNode(Node $node); + + /** + * Called when leaving a node. + * + * Return value semantics: + * * null + * => $node stays as-is + * * NodeTraverser::REMOVE_NODE + * => $node is removed from the parent array + * * NodeTraverser::STOP_TRAVERSAL + * => Traversal is aborted. $node stays as-is + * * array (of Nodes) + * => The return value is merged into the parent array (at the position of the $node) + * * otherwise + * => $node is set to the return value + * + * @param Node $node Node + * + * @return Node|Node[]|NodeTraverser::REMOVE_NODE|NodeTraverser::STOP_TRAVERSAL|null Replacement node (or special return value) + */ + public function leaveNode(Node $node); + + /** + * Called once after traversal. + * + * Return value semantics: + * * null: $nodes stays as-is + * * otherwise: $nodes is set to the return value + * + * @param Node[] $nodes Array of nodes + * + * @return Node[]|null Array of nodes + */ + public function afterTraverse(array $nodes): ?array; + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php b/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php new file mode 100644 index 0000000..7200f3a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/NodeVisitor/CloningVisitor.php @@ -0,0 +1,20 @@ +setAttribute(Attribute::ORIGINAL_NODE, $originalNode); + + return $node; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php new file mode 100644 index 0000000..cf4f556 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagMethodValueNode.php @@ -0,0 +1,50 @@ +type = $type; + $this->parameter = $parameter; + $this->method = $method; + $this->isNegated = $isNegated; + $this->isEquality = $isEquality; + $this->description = $description; + } + + + public function __toString(): string + { + $isNegated = $this->isNegated ? '!' : ''; + $isEquality = $this->isEquality ? '=' : ''; + return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->method}() {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php new file mode 100644 index 0000000..4fb3180 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagPropertyValueNode.php @@ -0,0 +1,50 @@ +type = $type; + $this->parameter = $parameter; + $this->property = $property; + $this->isNegated = $isNegated; + $this->isEquality = $isEquality; + $this->description = $description; + } + + + public function __toString(): string + { + $isNegated = $this->isNegated ? '!' : ''; + $isEquality = $this->isEquality ? '=' : ''; + return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter}->{$this->property} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php new file mode 100644 index 0000000..d6423f5 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/AssertTagValueNode.php @@ -0,0 +1,46 @@ +type = $type; + $this->parameter = $parameter; + $this->isNegated = $isNegated; + $this->isEquality = $isEquality; + $this->description = $description; + } + + + public function __toString(): string + { + $isNegated = $this->isNegated ? '!' : ''; + $isEquality = $this->isEquality ? '=' : ''; + return trim("{$isNegated}{$isEquality}{$this->type} {$this->parameter} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php new file mode 100644 index 0000000..abf2f1a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/DeprecatedTagValueNode.php @@ -0,0 +1,27 @@ +description = $description; + } + + + public function __toString(): string + { + return trim($this->description); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php new file mode 100644 index 0000000..3a93f5a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineAnnotation.php @@ -0,0 +1,35 @@ + */ + public $arguments; + + /** + * @param list $arguments + */ + public function __construct(string $name, array $arguments) + { + $this->name = $name; + $this->arguments = $arguments; + } + + public function __toString(): string + { + $arguments = implode(', ', $this->arguments); + return $this->name . '(' . $arguments . ')'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php new file mode 100644 index 0000000..f30812c --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArgument.php @@ -0,0 +1,43 @@ +key = $key; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->key === null) { + return (string) $this->value; + } + + return $this->key . '=' . $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php new file mode 100644 index 0000000..e740567 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArray.php @@ -0,0 +1,32 @@ + */ + public $items; + + /** + * @param list $items + */ + public function __construct(array $items) + { + $this->items = $items; + } + + public function __toString(): string + { + $items = implode(', ', $this->items); + + return '{' . $items . '}'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php new file mode 100644 index 0000000..d2dbf2b --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineArrayItem.php @@ -0,0 +1,47 @@ +key = $key; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->key === null) { + return (string) $this->value; + } + + return $this->key . '=' . $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php new file mode 100644 index 0000000..84f7b18 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/Doctrine/DoctrineTagValueNode.php @@ -0,0 +1,36 @@ +annotation = $annotation; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->annotation} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php new file mode 100644 index 0000000..3bf53e1 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ExtendsTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php new file mode 100644 index 0000000..026aa15 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/GenericTagValueNode.php @@ -0,0 +1,26 @@ +value = $value; + } + + + public function __toString(): string + { + return $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php new file mode 100644 index 0000000..99043d9 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ImplementsTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php new file mode 100644 index 0000000..ca7b4f2 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/InvalidTagValueNode.php @@ -0,0 +1,53 @@ +value = $value; + $this->exceptionArgs = [ + $exception->getCurrentTokenValue(), + $exception->getCurrentTokenType(), + $exception->getCurrentOffset(), + $exception->getExpectedTokenType(), + $exception->getExpectedTokenValue(), + $exception->getCurrentTokenLine(), + ]; + } + + public function __get(string $name): ?ParserException + { + if ($name !== 'exception') { + trigger_error(sprintf('Undefined property: %s::$%s', self::class, $name), E_USER_WARNING); + return null; + } + + return new ParserException(...$this->exceptionArgs); + } + + public function __toString(): string + { + return $this->value; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php new file mode 100644 index 0000000..211510b --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueNode.php @@ -0,0 +1,58 @@ +isStatic = $isStatic; + $this->returnType = $returnType; + $this->methodName = $methodName; + $this->parameters = $parameters; + $this->description = $description; + $this->templateTypes = $templateTypes; + } + + + public function __toString(): string + { + $static = $this->isStatic ? 'static ' : ''; + $returnType = $this->returnType !== null ? "{$this->returnType} " : ''; + $parameters = implode(', ', $this->parameters); + $description = $this->description !== '' ? " {$this->description}" : ''; + $templateTypes = count($this->templateTypes) > 0 ? '<' . implode(', ', $this->templateTypes) . '>' : ''; + return "{$static}{$returnType}{$this->methodName}{$templateTypes}({$parameters}){$description}"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php new file mode 100644 index 0000000..7c17e44 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MethodTagValueParameterNode.php @@ -0,0 +1,49 @@ +type = $type; + $this->isReference = $isReference; + $this->isVariadic = $isVariadic; + $this->parameterName = $parameterName; + $this->defaultValue = $defaultValue; + } + + + public function __toString(): string + { + $type = $this->type !== null ? "{$this->type} " : ''; + $isReference = $this->isReference ? '&' : ''; + $isVariadic = $this->isVariadic ? '...' : ''; + $default = $this->defaultValue !== null ? " = {$this->defaultValue}" : ''; + return "{$type}{$isReference}{$isVariadic}{$this->parameterName}{$default}"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php new file mode 100644 index 0000000..d9b7d78 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/MixinTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamClosureThisTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamClosureThisTagValueNode.php new file mode 100644 index 0000000..0ac2131 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamClosureThisTagValueNode.php @@ -0,0 +1,35 @@ +type = $type; + $this->parameterName = $parameterName; + $this->description = $description; + } + + public function __toString(): string + { + return trim("{$this->type} {$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamImmediatelyInvokedCallableTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamImmediatelyInvokedCallableTagValueNode.php new file mode 100644 index 0000000..0f480f7 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamImmediatelyInvokedCallableTagValueNode.php @@ -0,0 +1,30 @@ +parameterName = $parameterName; + $this->description = $description; + } + + public function __toString(): string + { + return trim("{$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamLaterInvokedCallableTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamLaterInvokedCallableTagValueNode.php new file mode 100644 index 0000000..eab353f --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamLaterInvokedCallableTagValueNode.php @@ -0,0 +1,30 @@ +parameterName = $parameterName; + $this->description = $description; + } + + public function __toString(): string + { + return trim("{$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php new file mode 100644 index 0000000..9f374bf --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamOutTagValueNode.php @@ -0,0 +1,35 @@ +type = $type; + $this->parameterName = $parameterName; + $this->description = $description; + } + + public function __toString(): string + { + return trim("{$this->type} {$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php new file mode 100644 index 0000000..f93af0e --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ParamTagValueNode.php @@ -0,0 +1,46 @@ +type = $type; + $this->isReference = $isReference; + $this->isVariadic = $isVariadic; + $this->parameterName = $parameterName; + $this->description = $description; + } + + + public function __toString(): string + { + $reference = $this->isReference ? '&' : ''; + $variadic = $this->isVariadic ? '...' : ''; + return trim("{$this->type} {$reference}{$variadic}{$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php new file mode 100644 index 0000000..6162f92 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocChildNode.php @@ -0,0 +1,10 @@ +children = $children; + } + + + /** + * @return PhpDocTagNode[] + */ + public function getTags(): array + { + return array_filter($this->children, static function (PhpDocChildNode $child): bool { + return $child instanceof PhpDocTagNode; + }); + } + + + /** + * @return PhpDocTagNode[] + */ + public function getTagsByName(string $tagName): array + { + return array_filter($this->getTags(), static function (PhpDocTagNode $tag) use ($tagName): bool { + return $tag->name === $tagName; + }); + } + + + /** + * @return VarTagValueNode[] + */ + public function getVarTagValues(string $tagName = '@var'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof VarTagValueNode; + } + ); + } + + + /** + * @return ParamTagValueNode[] + */ + public function getParamTagValues(string $tagName = '@param'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ParamTagValueNode; + } + ); + } + + + /** + * @return TypelessParamTagValueNode[] + */ + public function getTypelessParamTagValues(string $tagName = '@param'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof TypelessParamTagValueNode; + } + ); + } + + + /** + * @return ParamImmediatelyInvokedCallableTagValueNode[] + */ + public function getParamImmediatelyInvokedCallableTagValues(string $tagName = '@param-immediately-invoked-callable'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ParamImmediatelyInvokedCallableTagValueNode; + } + ); + } + + + /** + * @return ParamLaterInvokedCallableTagValueNode[] + */ + public function getParamLaterInvokedCallableTagValues(string $tagName = '@param-later-invoked-callable'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ParamLaterInvokedCallableTagValueNode; + } + ); + } + + + /** + * @return ParamClosureThisTagValueNode[] + */ + public function getParamClosureThisTagValues(string $tagName = '@param-closure-this'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ParamClosureThisTagValueNode; + } + ); + } + + + /** + * @return TemplateTagValueNode[] + */ + public function getTemplateTagValues(string $tagName = '@template'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof TemplateTagValueNode; + } + ); + } + + + /** + * @return ExtendsTagValueNode[] + */ + public function getExtendsTagValues(string $tagName = '@extends'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ExtendsTagValueNode; + } + ); + } + + + /** + * @return ImplementsTagValueNode[] + */ + public function getImplementsTagValues(string $tagName = '@implements'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ImplementsTagValueNode; + } + ); + } + + + /** + * @return UsesTagValueNode[] + */ + public function getUsesTagValues(string $tagName = '@use'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof UsesTagValueNode; + } + ); + } + + + /** + * @return ReturnTagValueNode[] + */ + public function getReturnTagValues(string $tagName = '@return'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ReturnTagValueNode; + } + ); + } + + + /** + * @return ThrowsTagValueNode[] + */ + public function getThrowsTagValues(string $tagName = '@throws'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ThrowsTagValueNode; + } + ); + } + + + /** + * @return MixinTagValueNode[] + */ + public function getMixinTagValues(string $tagName = '@mixin'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof MixinTagValueNode; + } + ); + } + + /** + * @return RequireExtendsTagValueNode[] + */ + public function getRequireExtendsTagValues(string $tagName = '@phpstan-require-extends'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof RequireExtendsTagValueNode; + } + ); + } + + /** + * @return RequireImplementsTagValueNode[] + */ + public function getRequireImplementsTagValues(string $tagName = '@phpstan-require-implements'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof RequireImplementsTagValueNode; + } + ); + } + + /** + * @return DeprecatedTagValueNode[] + */ + public function getDeprecatedTagValues(): array + { + return array_filter( + array_column($this->getTagsByName('@deprecated'), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof DeprecatedTagValueNode; + } + ); + } + + + /** + * @return PropertyTagValueNode[] + */ + public function getPropertyTagValues(string $tagName = '@property'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof PropertyTagValueNode; + } + ); + } + + + /** + * @return PropertyTagValueNode[] + */ + public function getPropertyReadTagValues(string $tagName = '@property-read'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof PropertyTagValueNode; + } + ); + } + + + /** + * @return PropertyTagValueNode[] + */ + public function getPropertyWriteTagValues(string $tagName = '@property-write'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof PropertyTagValueNode; + } + ); + } + + + /** + * @return MethodTagValueNode[] + */ + public function getMethodTagValues(string $tagName = '@method'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof MethodTagValueNode; + } + ); + } + + + /** + * @return TypeAliasTagValueNode[] + */ + public function getTypeAliasTagValues(string $tagName = '@phpstan-type'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof TypeAliasTagValueNode; + } + ); + } + + + /** + * @return TypeAliasImportTagValueNode[] + */ + public function getTypeAliasImportTagValues(string $tagName = '@phpstan-import-type'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof TypeAliasImportTagValueNode; + } + ); + } + + + /** + * @return AssertTagValueNode[] + */ + public function getAssertTagValues(string $tagName = '@phpstan-assert'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof AssertTagValueNode; + } + ); + } + + + /** + * @return AssertTagPropertyValueNode[] + */ + public function getAssertPropertyTagValues(string $tagName = '@phpstan-assert'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof AssertTagPropertyValueNode; + } + ); + } + + + /** + * @return AssertTagMethodValueNode[] + */ + public function getAssertMethodTagValues(string $tagName = '@phpstan-assert'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof AssertTagMethodValueNode; + } + ); + } + + + /** + * @return SelfOutTagValueNode[] + */ + public function getSelfOutTypeTagValues(string $tagName = '@phpstan-this-out'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof SelfOutTagValueNode; + } + ); + } + + + /** + * @return ParamOutTagValueNode[] + */ + public function getParamOutTypeTagValues(string $tagName = '@param-out'): array + { + return array_filter( + array_column($this->getTagsByName($tagName), 'value'), + static function (PhpDocTagValueNode $value): bool { + return $value instanceof ParamOutTagValueNode; + } + ); + } + + + public function __toString(): string + { + $children = array_map( + static function (PhpDocChildNode $child): string { + $s = (string) $child; + return $s === '' ? '' : ' ' . $s; + }, + $this->children + ); + return "/**\n *" . implode("\n *", $children) . "\n */"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php new file mode 100644 index 0000000..d20746f --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagNode.php @@ -0,0 +1,36 @@ +name = $name; + $this->value = $value; + } + + + public function __toString(): string + { + if ($this->value instanceof DoctrineTagValueNode) { + return (string) $this->value; + } + + return trim("{$this->name} {$this->value}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php new file mode 100644 index 0000000..7723fa0 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PhpDocTagValueNode.php @@ -0,0 +1,10 @@ +text = $text; + } + + + public function __toString(): string + { + return $this->text; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php new file mode 100644 index 0000000..046003d --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/PropertyTagValueNode.php @@ -0,0 +1,36 @@ +type = $type; + $this->propertyName = $propertyName; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->propertyName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireExtendsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireExtendsTagValueNode.php new file mode 100644 index 0000000..91c2689 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireExtendsTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireImplementsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireImplementsTagValueNode.php new file mode 100644 index 0000000..65c9213 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/RequireImplementsTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php new file mode 100644 index 0000000..d53c8c7 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ReturnTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php new file mode 100644 index 0000000..83169af --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/SelfOutTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim($this->type . ' ' . $this->description); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php new file mode 100644 index 0000000..78b311e --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TemplateTagValueNode.php @@ -0,0 +1,45 @@ +name = $name; + $this->bound = $bound; + $this->default = $default; + $this->description = $description; + } + + + public function __toString(): string + { + $bound = $this->bound !== null ? " of {$this->bound}" : ''; + $default = $this->default !== null ? " = {$this->default}" : ''; + return trim("{$this->name}{$bound}{$default} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php new file mode 100644 index 0000000..62d2aed --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/ThrowsTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php new file mode 100644 index 0000000..ad6b85a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasImportTagValueNode.php @@ -0,0 +1,38 @@ +importedAlias = $importedAlias; + $this->importedFrom = $importedFrom; + $this->importedAs = $importedAs; + } + + public function __toString(): string + { + return trim( + "{$this->importedAlias} from {$this->importedFrom}" + . ($this->importedAs !== null ? " as {$this->importedAs}" : '') + ); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php new file mode 100644 index 0000000..4ccaaac --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypeAliasTagValueNode.php @@ -0,0 +1,32 @@ +alias = $alias; + $this->type = $type; + } + + + public function __toString(): string + { + return trim("{$this->alias} {$this->type}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php new file mode 100644 index 0000000..8b98295 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/TypelessParamTagValueNode.php @@ -0,0 +1,41 @@ +isReference = $isReference; + $this->isVariadic = $isVariadic; + $this->parameterName = $parameterName; + $this->description = $description; + } + + + public function __toString(): string + { + $reference = $this->isReference ? '&' : ''; + $variadic = $this->isVariadic ? '...' : ''; + return trim("{$reference}{$variadic}{$this->parameterName} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php new file mode 100644 index 0000000..cd573d9 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/UsesTagValueNode.php @@ -0,0 +1,32 @@ +type = $type; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("{$this->type} {$this->description}"); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php new file mode 100644 index 0000000..afb941a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/PhpDoc/VarTagValueNode.php @@ -0,0 +1,36 @@ +type = $type; + $this->variableName = $variableName; + $this->description = $description; + } + + + public function __toString(): string + { + return trim("$this->type " . trim("{$this->variableName} {$this->description}")); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php new file mode 100644 index 0000000..660c6c9 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeItemNode.php @@ -0,0 +1,49 @@ +keyName = $keyName; + $this->optional = $optional; + $this->valueType = $valueType; + } + + + public function __toString(): string + { + if ($this->keyName !== null) { + return sprintf( + '%s%s: %s', + (string) $this->keyName, + $this->optional ? '?' : '', + (string) $this->valueType + ); + } + + return (string) $this->valueType; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php new file mode 100644 index 0000000..806783f --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php @@ -0,0 +1,48 @@ +items = $items; + $this->sealed = $sealed; + $this->kind = $kind; + } + + + public function __toString(): string + { + $items = $this->items; + + if (! $this->sealed) { + $items[] = '...'; + } + + return $this->kind . '{' . implode(', ', $items) . '}'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php new file mode 100644 index 0000000..d203103 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayTypeNode.php @@ -0,0 +1,34 @@ +type = $type; + } + + + public function __toString(): string + { + if ( + $this->type instanceof CallableTypeNode + || $this->type instanceof ConstTypeNode + || $this->type instanceof NullableTypeNode + ) { + return '(' . $this->type . ')[]'; + } + + return $this->type . '[]'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php new file mode 100644 index 0000000..4c91319 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeNode.php @@ -0,0 +1,52 @@ +identifier = $identifier; + $this->parameters = $parameters; + $this->returnType = $returnType; + $this->templateTypes = $templateTypes; + } + + + public function __toString(): string + { + $returnType = $this->returnType; + if ($returnType instanceof self) { + $returnType = "({$returnType})"; + } + $template = $this->templateTypes !== [] + ? '<' . implode(', ', $this->templateTypes) . '>' + : ''; + $parameters = implode(', ', $this->parameters); + return "{$this->identifier}{$template}({$parameters}): {$returnType}"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php new file mode 100644 index 0000000..c78d4c7 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/CallableTypeParameterNode.php @@ -0,0 +1,48 @@ +type = $type; + $this->isReference = $isReference; + $this->isVariadic = $isVariadic; + $this->parameterName = $parameterName; + $this->isOptional = $isOptional; + } + + + public function __toString(): string + { + $type = "{$this->type} "; + $isReference = $this->isReference ? '&' : ''; + $isVariadic = $this->isVariadic ? '...' : ''; + $isOptional = $this->isOptional ? '=' : ''; + return trim("{$type}{$isReference}{$isVariadic}{$this->parameterName}") . $isOptional; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php new file mode 100644 index 0000000..fbfcae9 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeForParameterNode.php @@ -0,0 +1,49 @@ +parameterName = $parameterName; + $this->targetType = $targetType; + $this->if = $if; + $this->else = $else; + $this->negated = $negated; + } + + public function __toString(): string + { + return sprintf( + '(%s %s %s ? %s : %s)', + $this->parameterName, + $this->negated ? 'is not' : 'is', + $this->targetType, + $this->if, + $this->else + ); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php new file mode 100644 index 0000000..bfdb0db --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConditionalTypeNode.php @@ -0,0 +1,49 @@ +subjectType = $subjectType; + $this->targetType = $targetType; + $this->if = $if; + $this->else = $else; + $this->negated = $negated; + } + + public function __toString(): string + { + return sprintf( + '(%s %s %s ? %s : %s)', + $this->subjectType, + $this->negated ? 'is not' : 'is', + $this->targetType, + $this->if, + $this->else + ); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php new file mode 100644 index 0000000..0096055 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ConstTypeNode.php @@ -0,0 +1,26 @@ +constExpr = $constExpr; + } + + public function __toString(): string + { + return $this->constExpr->__toString(); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php new file mode 100644 index 0000000..44e1d16 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/GenericTypeNode.php @@ -0,0 +1,58 @@ +type = $type; + $this->genericTypes = $genericTypes; + $this->variances = $variances; + } + + + public function __toString(): string + { + $genericTypes = []; + + foreach ($this->genericTypes as $index => $type) { + $variance = $this->variances[$index] ?? self::VARIANCE_INVARIANT; + if ($variance === self::VARIANCE_INVARIANT) { + $genericTypes[] = (string) $type; + } elseif ($variance === self::VARIANCE_BIVARIANT) { + $genericTypes[] = '*'; + } else { + $genericTypes[] = sprintf('%s %s', $variance, $type); + } + } + + return $this->type . '<' . implode(', ', $genericTypes) . '>'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php new file mode 100644 index 0000000..29bac30 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IdentifierTypeNode.php @@ -0,0 +1,26 @@ +name = $name; + } + + + public function __toString(): string + { + return $this->name; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php new file mode 100644 index 0000000..fd761cf --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/IntersectionTypeNode.php @@ -0,0 +1,37 @@ +types = $types; + } + + + public function __toString(): string + { + return '(' . implode(' & ', array_map(static function (TypeNode $type): string { + if ($type instanceof NullableTypeNode) { + return '(' . $type . ')'; + } + + return (string) $type; + }, $this->types)) . ')'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php new file mode 100644 index 0000000..1ec47cf --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/InvalidTypeNode.php @@ -0,0 +1,38 @@ +exceptionArgs = [ + $exception->getCurrentTokenValue(), + $exception->getCurrentTokenType(), + $exception->getCurrentOffset(), + $exception->getExpectedTokenType(), + $exception->getExpectedTokenValue(), + $exception->getCurrentTokenLine(), + ]; + } + + public function getException(): ParserException + { + return new ParserException(...$this->exceptionArgs); + } + + public function __toString(): string + { + return '*Invalid type*'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php new file mode 100644 index 0000000..73f438c --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/NullableTypeNode.php @@ -0,0 +1,26 @@ +type = $type; + } + + + public function __toString(): string + { + return '?' . $this->type; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php new file mode 100644 index 0000000..2f01240 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeItemNode.php @@ -0,0 +1,48 @@ +keyName = $keyName; + $this->optional = $optional; + $this->valueType = $valueType; + } + + + public function __toString(): string + { + if ($this->keyName !== null) { + return sprintf( + '%s%s: %s', + (string) $this->keyName, + $this->optional ? '?' : '', + (string) $this->valueType + ); + } + + return (string) $this->valueType; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php new file mode 100644 index 0000000..f418bc3 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ObjectShapeNode.php @@ -0,0 +1,31 @@ +items = $items; + } + + public function __toString(): string + { + $items = $this->items; + + return 'object{' . implode(', ', $items) . '}'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php new file mode 100644 index 0000000..c27ec0a --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/OffsetAccessTypeNode.php @@ -0,0 +1,36 @@ +type = $type; + $this->offset = $offset; + } + + public function __toString(): string + { + if ( + $this->type instanceof CallableTypeNode + || $this->type instanceof NullableTypeNode + ) { + return '(' . $this->type . ')[' . $this->offset . ']'; + } + + return $this->type . '[' . $this->offset . ']'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php new file mode 100644 index 0000000..d94e6f8 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ThisTypeNode.php @@ -0,0 +1,17 @@ +types = $types; + } + + + public function __toString(): string + { + return '(' . implode(' | ', array_map(static function (TypeNode $type): string { + if ($type instanceof NullableTypeNode) { + return '(' . $type . ')'; + } + + return (string) $type; + }, $this->types)) . ')'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php b/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php new file mode 100644 index 0000000..32539fa --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Lexer/Lexer.php @@ -0,0 +1,198 @@ + '\'&\'', + self::TOKEN_UNION => '\'|\'', + self::TOKEN_INTERSECTION => '\'&\'', + self::TOKEN_NULLABLE => '\'?\'', + self::TOKEN_NEGATED => '\'!\'', + self::TOKEN_OPEN_PARENTHESES => '\'(\'', + self::TOKEN_CLOSE_PARENTHESES => '\')\'', + self::TOKEN_OPEN_ANGLE_BRACKET => '\'<\'', + self::TOKEN_CLOSE_ANGLE_BRACKET => '\'>\'', + self::TOKEN_OPEN_SQUARE_BRACKET => '\'[\'', + self::TOKEN_CLOSE_SQUARE_BRACKET => '\']\'', + self::TOKEN_OPEN_CURLY_BRACKET => '\'{\'', + self::TOKEN_CLOSE_CURLY_BRACKET => '\'}\'', + self::TOKEN_COMMA => '\',\'', + self::TOKEN_COLON => '\':\'', + self::TOKEN_VARIADIC => '\'...\'', + self::TOKEN_DOUBLE_COLON => '\'::\'', + self::TOKEN_DOUBLE_ARROW => '\'=>\'', + self::TOKEN_ARROW => '\'->\'', + self::TOKEN_EQUAL => '\'=\'', + self::TOKEN_OPEN_PHPDOC => '\'/**\'', + self::TOKEN_CLOSE_PHPDOC => '\'*/\'', + self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', + self::TOKEN_DOCTRINE_TAG => 'TOKEN_DOCTRINE_TAG', + self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', + self::TOKEN_FLOAT => 'TOKEN_FLOAT', + self::TOKEN_INTEGER => 'TOKEN_INTEGER', + self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', + self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', + self::TOKEN_DOCTRINE_ANNOTATION_STRING => 'TOKEN_DOCTRINE_ANNOTATION_STRING', + self::TOKEN_IDENTIFIER => 'type', + self::TOKEN_THIS_VARIABLE => '\'$this\'', + self::TOKEN_VARIABLE => 'variable', + self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', + self::TOKEN_OTHER => 'TOKEN_OTHER', + self::TOKEN_END => 'TOKEN_END', + self::TOKEN_WILDCARD => '*', + ]; + + public const VALUE_OFFSET = 0; + public const TYPE_OFFSET = 1; + public const LINE_OFFSET = 2; + + /** @var bool */ + private $parseDoctrineAnnotations; + + /** @var string|null */ + private $regexp; + + public function __construct(bool $parseDoctrineAnnotations = false) + { + $this->parseDoctrineAnnotations = $parseDoctrineAnnotations; + } + + /** + * @return list + */ + public function tokenize(string $s): array + { + if ($this->regexp === null) { + $this->regexp = $this->generateRegexp(); + } + + preg_match_all($this->regexp, $s, $matches, PREG_SET_ORDER); + + $tokens = []; + $line = 1; + foreach ($matches as $match) { + $type = (int) $match['MARK']; + $tokens[] = [$match[0], $type, $line]; + if ($type !== self::TOKEN_PHPDOC_EOL) { + continue; + } + + $line++; + } + + $tokens[] = ['', self::TOKEN_END, $line]; + + return $tokens; + } + + + private function generateRegexp(): string + { + $patterns = [ + self::TOKEN_HORIZONTAL_WS => '[\\x09\\x20]++', + + self::TOKEN_IDENTIFIER => '(?:[\\\\]?+[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF-]*+)++', + self::TOKEN_THIS_VARIABLE => '\\$this(?![0-9a-z_\\x80-\\xFF])', + self::TOKEN_VARIABLE => '\\$[a-z_\\x80-\\xFF][0-9a-z_\\x80-\\xFF]*+', + + // '&' followed by TOKEN_VARIADIC, TOKEN_VARIABLE, TOKEN_EQUAL, TOKEN_EQUAL or TOKEN_CLOSE_PARENTHESES + self::TOKEN_REFERENCE => '&(?=\\s*+(?:[.,=)]|(?:\\$(?!this(?![0-9a-z_\\x80-\\xFF])))))', + self::TOKEN_UNION => '\\|', + self::TOKEN_INTERSECTION => '&', + self::TOKEN_NULLABLE => '\\?', + self::TOKEN_NEGATED => '!', + + self::TOKEN_OPEN_PARENTHESES => '\\(', + self::TOKEN_CLOSE_PARENTHESES => '\\)', + self::TOKEN_OPEN_ANGLE_BRACKET => '<', + self::TOKEN_CLOSE_ANGLE_BRACKET => '>', + self::TOKEN_OPEN_SQUARE_BRACKET => '\\[', + self::TOKEN_CLOSE_SQUARE_BRACKET => '\\]', + self::TOKEN_OPEN_CURLY_BRACKET => '\\{', + self::TOKEN_CLOSE_CURLY_BRACKET => '\\}', + + self::TOKEN_COMMA => ',', + self::TOKEN_VARIADIC => '\\.\\.\\.', + self::TOKEN_DOUBLE_COLON => '::', + self::TOKEN_DOUBLE_ARROW => '=>', + self::TOKEN_ARROW => '->', + self::TOKEN_EQUAL => '=', + self::TOKEN_COLON => ':', + + self::TOKEN_OPEN_PHPDOC => '/\\*\\*(?=\\s)\\x20?+', + self::TOKEN_CLOSE_PHPDOC => '\\*/', + self::TOKEN_PHPDOC_TAG => '@(?:[a-z][a-z0-9-\\\\]+:)?[a-z][a-z0-9-\\\\]*+', + self::TOKEN_PHPDOC_EOL => '\\r?+\\n[\\x09\\x20]*+(?:\\*(?!/)\\x20?+)?', + + self::TOKEN_FLOAT => '[+\-]?(?:(?:[0-9]++(_[0-9]++)*\\.[0-9]*+(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]*+(_[0-9]++)*\\.[0-9]++(_[0-9]++)*(?:e[+\-]?[0-9]++(_[0-9]++)*)?)|(?:[0-9]++(_[0-9]++)*e[+\-]?[0-9]++(_[0-9]++)*))', + self::TOKEN_INTEGER => '[+\-]?(?:(?:0b[0-1]++(_[0-1]++)*)|(?:0o[0-7]++(_[0-7]++)*)|(?:0x[0-9a-f]++(_[0-9a-f]++)*)|(?:[0-9]++(_[0-9]++)*))', + self::TOKEN_SINGLE_QUOTED_STRING => '\'(?:\\\\[^\\r\\n]|[^\'\\r\\n\\\\])*+\'', + self::TOKEN_DOUBLE_QUOTED_STRING => '"(?:\\\\[^\\r\\n]|[^"\\r\\n\\\\])*+"', + + self::TOKEN_WILDCARD => '\\*', + ]; + + if ($this->parseDoctrineAnnotations) { + $patterns[self::TOKEN_DOCTRINE_TAG] = '@[a-z_\\\\][a-z0-9_\:\\\\]*[a-z_][a-z0-9_]*'; + $patterns[self::TOKEN_DOCTRINE_ANNOTATION_STRING] = '"(?:""|[^"])*+"'; + } + + // anything but TOKEN_CLOSE_PHPDOC or TOKEN_HORIZONTAL_WS or TOKEN_EOL + $patterns[self::TOKEN_OTHER] = '(?:(?!\\*/)[^\\s])++'; + + foreach ($patterns as $type => &$pattern) { + $pattern = '(?:' . $pattern . ')(*MARK:' . $type . ')'; + } + + return '~' . implode('|', $patterns) . '~Asi'; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php new file mode 100644 index 0000000..f6a7306 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/ConstExprParser.php @@ -0,0 +1,333 @@ +unescapeStrings = $unescapeStrings; + $this->quoteAwareConstExprString = $quoteAwareConstExprString; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; + $this->parseDoctrineStrings = false; + } + + /** + * @internal + */ + public function toDoctrine(): self + { + $self = new self( + $this->unescapeStrings, + $this->quoteAwareConstExprString, + [ + 'lines' => $this->useLinesAttributes, + 'indexes' => $this->useIndexAttributes, + ] + ); + $self->parseDoctrineStrings = true; + return $self; + } + + public function parse(TokenIterator $tokens, bool $trimStrings = false): Ast\ConstExpr\ConstExprNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_FLOAT)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprFloatNode(str_replace('_', '', $value)), + $startLine, + $startIndex + ); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $value)), + $startLine, + $startIndex + ); + } + + if ($this->parseDoctrineStrings && $tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($value)), + $startLine, + $startIndex + ); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING, Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + if ($this->parseDoctrineStrings) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_DOUBLE_QUOTED_STRING, + null, + $tokens->currentTokenLine() + ); + } + + $value = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + $this->parseDoctrineString($value, $tokens), + $startLine, + $startIndex + ); + } + $value = $tokens->currentTokenValue(); + $type = $tokens->currentTokenType(); + if ($trimStrings) { + if ($this->unescapeStrings) { + $value = StringUnescaper::unescapeString($value); + } else { + $value = substr($value, 1, -1); + } + } + $tokens->next(); + + if ($this->quoteAwareConstExprString) { + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\QuoteAwareConstExprStringNode( + $value, + $type === Lexer::TOKEN_SINGLE_QUOTED_STRING + ? Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED + : Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED + ), + $startLine, + $startIndex + ); + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprStringNode($value), + $startLine, + $startIndex + ); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { + $identifier = $tokens->currentTokenValue(); + $tokens->next(); + + switch (strtolower($identifier)) { + case 'true': + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprTrueNode(), + $startLine, + $startIndex + ); + case 'false': + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprFalseNode(), + $startLine, + $startIndex + ); + case 'null': + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprNullNode(), + $startLine, + $startIndex + ); + case 'array': + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); + return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_PARENTHESES, $startIndex); + } + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $classConstantName = ''; + $lastType = null; + while (true) { + if ($lastType !== Lexer::TOKEN_IDENTIFIER && $tokens->currentTokenType() === Lexer::TOKEN_IDENTIFIER) { + $classConstantName .= $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + $lastType = Lexer::TOKEN_IDENTIFIER; + + continue; + } + + if ($lastType !== Lexer::TOKEN_WILDCARD && $tokens->tryConsumeTokenType(Lexer::TOKEN_WILDCARD)) { + $classConstantName .= '*'; + $lastType = Lexer::TOKEN_WILDCARD; + + if ($tokens->getSkippedHorizontalWhiteSpaceIfAny() !== '') { + break; + } + + continue; + } + + if ($lastType === null) { + // trigger parse error if nothing valid was consumed + $tokens->consumeTokenType(Lexer::TOKEN_WILDCARD); + } + + break; + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstFetchNode($identifier, $classConstantName), + $startLine, + $startIndex + ); + + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstFetchNode('', $identifier), + $startLine, + $startIndex + ); + + } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + return $this->parseArray($tokens, Lexer::TOKEN_CLOSE_SQUARE_BRACKET, $startIndex); + } + + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + } + + + private function parseArray(TokenIterator $tokens, int $endToken, int $startIndex): Ast\ConstExpr\ConstExprArrayNode + { + $items = []; + + $startLine = $tokens->currentTokenLine(); + + if (!$tokens->tryConsumeTokenType($endToken)) { + do { + $items[] = $this->parseArrayItem($tokens); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA) && !$tokens->isCurrentTokenType($endToken)); + $tokens->consumeTokenType($endToken); + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprArrayNode($items), + $startLine, + $startIndex + ); + } + + + /** + * This method is supposed to be called with TokenIterator after reading TOKEN_DOUBLE_QUOTED_STRING and shifting + * to the next token. + */ + public function parseDoctrineString(string $text, TokenIterator $tokens): Ast\ConstExpr\DoctrineConstExprStringNode + { + // Because of how Lexer works, a valid Doctrine string + // can consist of a sequence of TOKEN_DOUBLE_QUOTED_STRING and TOKEN_DOCTRINE_ANNOTATION_STRING + while ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING, Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $text .= $tokens->currentTokenValue(); + $tokens->next(); + } + + return new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($text)); + } + + + private function parseArrayItem(TokenIterator $tokens): Ast\ConstExpr\ConstExprArrayItemNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + $expr = $this->parse($tokens); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_DOUBLE_ARROW)) { + $key = $expr; + $value = $this->parse($tokens); + + } else { + $key = null; + $value = $expr; + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\ConstExpr\ConstExprArrayItemNode($key, $value), + $startLine, + $startIndex + ); + } + + /** + * @template T of Ast\ConstExpr\ConstExprNode + * @param T $node + * @return T + */ + private function enrichWithAttributes(TokenIterator $tokens, Ast\ConstExpr\ConstExprNode $node, int $startLine, int $startIndex): Ast\ConstExpr\ConstExprNode + { + if ($this->useLinesAttributes) { + $node->setAttribute(Ast\Attribute::START_LINE, $startLine); + $node->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); + } + + if ($this->useIndexAttributes) { + $node->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $node->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); + } + + return $node; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php b/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php new file mode 100644 index 0000000..6ab5cc0 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/ParserException.php @@ -0,0 +1,106 @@ +currentTokenValue = $currentTokenValue; + $this->currentTokenType = $currentTokenType; + $this->currentOffset = $currentOffset; + $this->expectedTokenType = $expectedTokenType; + $this->expectedTokenValue = $expectedTokenValue; + $this->currentTokenLine = $currentTokenLine; + + parent::__construct(sprintf( + 'Unexpected token %s, expected %s%s at offset %d%s', + $this->formatValue($currentTokenValue), + Lexer::TOKEN_LABELS[$expectedTokenType], + $expectedTokenValue !== null ? sprintf(' (%s)', $this->formatValue($expectedTokenValue)) : '', + $currentOffset, + $currentTokenLine === null ? '' : sprintf(' on line %d', $currentTokenLine) + )); + } + + + public function getCurrentTokenValue(): string + { + return $this->currentTokenValue; + } + + + public function getCurrentTokenType(): int + { + return $this->currentTokenType; + } + + + public function getCurrentOffset(): int + { + return $this->currentOffset; + } + + + public function getExpectedTokenType(): int + { + return $this->expectedTokenType; + } + + + public function getExpectedTokenValue(): ?string + { + return $this->expectedTokenValue; + } + + + public function getCurrentTokenLine(): ?int + { + return $this->currentTokenLine; + } + + + private function formatValue(string $value): string + { + $json = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE); + assert($json !== false); + + return $json; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php new file mode 100644 index 0000000..e46e094 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php @@ -0,0 +1,1289 @@ +typeParser = $typeParser; + $this->constantExprParser = $constantExprParser; + $this->doctrineConstantExprParser = $constantExprParser->toDoctrine(); + $this->requireWhitespaceBeforeDescription = $requireWhitespaceBeforeDescription; + $this->preserveTypeAliasesWithInvalidTypes = $preserveTypeAliasesWithInvalidTypes; + $this->parseDoctrineAnnotations = $parseDoctrineAnnotations; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; + $this->textBetweenTagsBelongsToDescription = $textBetweenTagsBelongsToDescription; + } + + + public function parse(TokenIterator $tokens): Ast\PhpDoc\PhpDocNode + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PHPDOC); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $children = []; + + if ($this->parseDoctrineAnnotations) { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + while (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + if ( + $lastChild instanceof Ast\PhpDoc\PhpDocTagNode + && ( + $lastChild->value instanceof Doctrine\DoctrineTagValueNode + || $lastChild->value instanceof Ast\PhpDoc\GenericTagValueNode + ) + ) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + break; + } + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + continue; + } + + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + break; + } + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + break; + } + + $lastChild = $this->parseChild($tokens); + $children[] = $lastChild; + } + } + } else { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + $children[] = $this->parseChild($tokens); + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL) && !$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + $children[] = $this->parseChild($tokens); + } + } + } + + try { + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PHPDOC); + } catch (ParserException $e) { + $name = ''; + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if (count($children) > 0) { + $lastChild = $children[count($children) - 1]; + if ($lastChild instanceof Ast\PhpDoc\PhpDocTagNode) { + $name = $lastChild->name; + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + } + } + + $tag = new Ast\PhpDoc\PhpDocTagNode( + $name, + $this->enrichWithAttributes( + $tokens, + new Ast\PhpDoc\InvalidTagValueNode($e->getMessage(), $e), + $startLine, + $startIndex + ) + ); + + $tokens->forwardToTheEnd(); + + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocNode([$this->enrichWithAttributes($tokens, $tag, $startLine, $startIndex)]), 1, 0); + } + + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocNode(array_values($children)), 1, 0); + } + + + /** @phpstan-impure */ + private function parseChild(TokenIterator $tokens): Ast\PhpDoc\PhpDocChildNode + { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG)) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + return $this->enrichWithAttributes($tokens, $this->parseTag($tokens), $startLine, $startIndex); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_TAG)) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $tag = $tokens->currentTokenValue(); + $tokens->next(); + + $tagStartLine = $tokens->currentTokenLine(); + $tagStartIndex = $tokens->currentTokenIndex(); + + return $this->enrichWithAttributes($tokens, new Ast\PhpDoc\PhpDocTagNode( + $tag, + $this->enrichWithAttributes( + $tokens, + $this->parseDoctrineTagValue($tokens, $tag), + $tagStartLine, + $tagStartIndex + ) + ), $startLine, $startIndex); + } + + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $text = $this->parseText($tokens); + + return $this->enrichWithAttributes($tokens, $text, $startLine, $startIndex); + } + + /** + * @template T of Ast\Node + * @param T $tag + * @return T + */ + private function enrichWithAttributes(TokenIterator $tokens, Ast\Node $tag, int $startLine, int $startIndex): Ast\Node + { + if ($this->useLinesAttributes) { + $tag->setAttribute(Ast\Attribute::START_LINE, $startLine); + $tag->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); + } + + if ($this->useIndexAttributes) { + $tag->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $tag->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); + } + + return $tag; + } + + + private function parseText(TokenIterator $tokens): Ast\PhpDoc\PhpDocTextNode + { + $text = ''; + + $endTokens = [Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + if ($this->textBetweenTagsBelongsToDescription) { + $endTokens = [Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + } + + $savepoint = false; + + // if the next token is EOL, everything below is skipped and empty string is returned + while ($this->textBetweenTagsBelongsToDescription || !$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + $tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_EOL, ...$endTokens); + $text .= $tmpText; + + // stop if we're not at EOL - meaning it's the end of PHPDoc + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + break; + } + + if ($this->textBetweenTagsBelongsToDescription) { + if (!$savepoint) { + $tokens->pushSavePoint(); + $savepoint = true; + } elseif ($tmpText !== '') { + $tokens->dropSavePoint(); + $tokens->pushSavePoint(); + } + } + + $tokens->pushSavePoint(); + $tokens->next(); + + // if we're at EOL, check what's next + // if next is a PHPDoc tag, EOL, or end of PHPDoc, stop + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, ...$endTokens)) { + $tokens->rollback(); + break; + } + + // otherwise if the next is text, continue building the description string + + $tokens->dropSavePoint(); + $text .= $tokens->getDetectedNewline() ?? "\n"; + } + + if ($savepoint) { + $tokens->rollback(); + $text = rtrim($text, $tokens->getDetectedNewline() ?? "\n"); + } + + return new Ast\PhpDoc\PhpDocTextNode(trim($text, " \t")); + } + + + private function parseOptionalDescriptionAfterDoctrineTag(TokenIterator $tokens): string + { + $text = ''; + + $endTokens = [Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + if ($this->textBetweenTagsBelongsToDescription) { + $endTokens = [Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END]; + } + + $savepoint = false; + + // if the next token is EOL, everything below is skipped and empty string is returned + while ($this->textBetweenTagsBelongsToDescription || !$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + $tmpText = $tokens->getSkippedHorizontalWhiteSpaceIfAny() . $tokens->joinUntil(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, Lexer::TOKEN_PHPDOC_EOL, ...$endTokens); + $text .= $tmpText; + + // stop if we're not at EOL - meaning it's the end of PHPDoc + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + if (!$tokens->isPrecededByHorizontalWhitespace()) { + return trim($text . $this->parseText($tokens)->text, " \t"); + } + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG)) { + $tokens->pushSavePoint(); + $child = $this->parseChild($tokens); + if ($child instanceof Ast\PhpDoc\PhpDocTagNode) { + if ( + $child->value instanceof Ast\PhpDoc\GenericTagValueNode + || $child->value instanceof Doctrine\DoctrineTagValueNode + ) { + $tokens->rollback(); + break; + } + if ($child->value instanceof Ast\PhpDoc\InvalidTagValueNode) { + $tokens->rollback(); + $tokens->pushSavePoint(); + $tokens->next(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tokens->rollback(); + break; + } + $tokens->rollback(); + return trim($text . $this->parseText($tokens)->text, " \t"); + } + } + + $tokens->rollback(); + return trim($text . $this->parseText($tokens)->text, " \t"); + } + break; + } + + if ($this->textBetweenTagsBelongsToDescription) { + if (!$savepoint) { + $tokens->pushSavePoint(); + $savepoint = true; + } elseif ($tmpText !== '') { + $tokens->dropSavePoint(); + $tokens->pushSavePoint(); + } + } + + $tokens->pushSavePoint(); + $tokens->next(); + + // if we're at EOL, check what's next + // if next is a PHPDoc tag, EOL, or end of PHPDoc, stop + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG, ...$endTokens)) { + $tokens->rollback(); + break; + } + + // otherwise if the next is text, continue building the description string + + $tokens->dropSavePoint(); + $text .= $tokens->getDetectedNewline() ?? "\n"; + } + + if ($savepoint) { + $tokens->rollback(); + $text = rtrim($text, $tokens->getDetectedNewline() ?? "\n"); + } + + return trim($text, " \t"); + } + + + public function parseTag(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagNode + { + $tag = $tokens->currentTokenValue(); + $tokens->next(); + $value = $this->parseTagValue($tokens, $tag); + + return new Ast\PhpDoc\PhpDocTagNode($tag, $value); + } + + + public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\PhpDocTagValueNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + try { + $tokens->pushSavePoint(); + + switch ($tag) { + case '@param': + case '@phpstan-param': + case '@psalm-param': + case '@phan-param': + $tagValue = $this->parseParamTagValue($tokens); + break; + + case '@param-immediately-invoked-callable': + case '@phpstan-param-immediately-invoked-callable': + $tagValue = $this->parseParamImmediatelyInvokedCallableTagValue($tokens); + break; + + case '@param-later-invoked-callable': + case '@phpstan-param-later-invoked-callable': + $tagValue = $this->parseParamLaterInvokedCallableTagValue($tokens); + break; + + case '@param-closure-this': + case '@phpstan-param-closure-this': + $tagValue = $this->parseParamClosureThisTagValue($tokens); + break; + + case '@var': + case '@phpstan-var': + case '@psalm-var': + case '@phan-var': + $tagValue = $this->parseVarTagValue($tokens); + break; + + case '@return': + case '@phpstan-return': + case '@psalm-return': + case '@phan-return': + case '@phan-real-return': + $tagValue = $this->parseReturnTagValue($tokens); + break; + + case '@throws': + case '@phpstan-throws': + $tagValue = $this->parseThrowsTagValue($tokens); + break; + + case '@mixin': + case '@phan-mixin': + $tagValue = $this->parseMixinTagValue($tokens); + break; + + case '@psalm-require-extends': + case '@phpstan-require-extends': + $tagValue = $this->parseRequireExtendsTagValue($tokens); + break; + + case '@psalm-require-implements': + case '@phpstan-require-implements': + $tagValue = $this->parseRequireImplementsTagValue($tokens); + break; + + case '@deprecated': + $tagValue = $this->parseDeprecatedTagValue($tokens); + break; + + case '@property': + case '@property-read': + case '@property-write': + case '@phpstan-property': + case '@phpstan-property-read': + case '@phpstan-property-write': + case '@psalm-property': + case '@psalm-property-read': + case '@psalm-property-write': + case '@phan-property': + case '@phan-property-read': + case '@phan-property-write': + $tagValue = $this->parsePropertyTagValue($tokens); + break; + + case '@method': + case '@phpstan-method': + case '@psalm-method': + case '@phan-method': + $tagValue = $this->parseMethodTagValue($tokens); + break; + + case '@template': + case '@phpstan-template': + case '@psalm-template': + case '@phan-template': + case '@template-covariant': + case '@phpstan-template-covariant': + case '@psalm-template-covariant': + case '@template-contravariant': + case '@phpstan-template-contravariant': + case '@psalm-template-contravariant': + $tagValue = $this->typeParser->parseTemplateTagValue( + $tokens, + function ($tokens) { + return $this->parseOptionalDescription($tokens); + } + ); + break; + + case '@extends': + case '@phpstan-extends': + case '@phan-extends': + case '@phan-inherits': + case '@template-extends': + $tagValue = $this->parseExtendsTagValue('@extends', $tokens); + break; + + case '@implements': + case '@phpstan-implements': + case '@template-implements': + $tagValue = $this->parseExtendsTagValue('@implements', $tokens); + break; + + case '@use': + case '@phpstan-use': + case '@template-use': + $tagValue = $this->parseExtendsTagValue('@use', $tokens); + break; + + case '@phpstan-type': + case '@psalm-type': + case '@phan-type': + $tagValue = $this->parseTypeAliasTagValue($tokens); + break; + + case '@phpstan-import-type': + case '@psalm-import-type': + $tagValue = $this->parseTypeAliasImportTagValue($tokens); + break; + + case '@phpstan-assert': + case '@phpstan-assert-if-true': + case '@phpstan-assert-if-false': + case '@psalm-assert': + case '@psalm-assert-if-true': + case '@psalm-assert-if-false': + case '@phan-assert': + case '@phan-assert-if-true': + case '@phan-assert-if-false': + $tagValue = $this->parseAssertTagValue($tokens); + break; + + case '@phpstan-this-out': + case '@phpstan-self-out': + case '@psalm-this-out': + case '@psalm-self-out': + $tagValue = $this->parseSelfOutTagValue($tokens); + break; + + case '@param-out': + case '@phpstan-param-out': + case '@psalm-param-out': + $tagValue = $this->parseParamOutTagValue($tokens); + break; + + default: + if ($this->parseDoctrineAnnotations) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tagValue = $this->parseDoctrineTagValue($tokens, $tag); + } else { + $tagValue = new Ast\PhpDoc\GenericTagValueNode($this->parseOptionalDescriptionAfterDoctrineTag($tokens)); + } + break; + } + + $tagValue = new Ast\PhpDoc\GenericTagValueNode($this->parseOptionalDescription($tokens)); + + break; + } + + $tokens->dropSavePoint(); + + } catch (ParserException $e) { + $tokens->rollback(); + $tagValue = new Ast\PhpDoc\InvalidTagValueNode($this->parseOptionalDescription($tokens), $e); + } + + return $this->enrichWithAttributes($tokens, $tagValue, $startLine, $startIndex); + } + + + private function parseDoctrineTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\PhpDocTagValueNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + return new Doctrine\DoctrineTagValueNode( + $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineAnnotation($tag, $this->parseDoctrineArguments($tokens, false)), + $startLine, + $startIndex + ), + $this->parseOptionalDescriptionAfterDoctrineTag($tokens) + ); + } + + + /** + * @return list + */ + private function parseDoctrineArguments(TokenIterator $tokens, bool $deep): array + { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + return []; + } + + if (!$deep) { + $tokens->addEndOfLineToSkippedTokens(); + } + + $arguments = []; + + try { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); + + do { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { + break; + } + $arguments[] = $this->parseDoctrineArgument($tokens); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + } finally { + if (!$deep) { + $tokens->removeEndOfLineFromSkippedTokens(); + } + } + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + + return $arguments; + } + + + private function parseDoctrineArgument(TokenIterator $tokens): Doctrine\DoctrineArgument + { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + try { + $tokens->pushSavePoint(); + $currentValue = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + $key = $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($currentValue), + $startLine, + $startIndex + ); + $tokens->consumeTokenType(Lexer::TOKEN_EQUAL); + + $value = $this->parseDoctrineArgumentValue($tokens); + + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument($key, $value), + $startLine, + $startIndex + ); + } catch (ParserException $e) { + $tokens->rollback(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArgument(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + } + + + /** + * @return DoctrineValueType + */ + private function parseDoctrineArgumentValue(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_TAG, Lexer::TOKEN_DOCTRINE_TAG)) { + $name = $tokens->currentTokenValue(); + $tokens->next(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineAnnotation($name, $this->parseDoctrineArguments($tokens, true)), + $startLine, + $startIndex + ); + } + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET)) { + $items = []; + do { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { + break; + } + $items[] = $this->parseDoctrineArrayItem($tokens); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArray($items), + $startLine, + $startIndex + ); + } + + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $identifier = $this->enrichWithAttributes( + $tokens, + new Ast\Type\IdentifierTypeNode($currentTokenValue), + $startLine, + $startIndex + ); + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $tokens->dropSavePoint(); + return $identifier; + } + + $tokens->rollback(); // because of ConstFetchNode + } else { + $tokens->dropSavePoint(); // because of ConstFetchNode + } + + $currentTokenValue = $tokens->currentTokenValue(); + $currentTokenType = $tokens->currentTokenType(); + $currentTokenOffset = $tokens->currentTokenOffset(); + $currentTokenLine = $tokens->currentTokenLine(); + + try { + $constExpr = $this->doctrineConstantExprParser->parse($tokens, true); + if ($constExpr instanceof Ast\ConstExpr\ConstExprArrayNode) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + + return $constExpr; + } catch (LogicException $e) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + } + + + private function parseDoctrineArrayItem(TokenIterator $tokens): Doctrine\DoctrineArrayItem + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + try { + $tokens->pushSavePoint(); + + $key = $this->parseDoctrineArrayKey($tokens); + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL)) { + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_COLON)) { + $tokens->consumeTokenType(Lexer::TOKEN_EQUAL); // will throw exception + } + } + + $value = $this->parseDoctrineArgumentValue($tokens); + + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArrayItem($key, $value), + $startLine, + $startIndex + ); + } catch (ParserException $e) { + $tokens->rollback(); + + return $this->enrichWithAttributes( + $tokens, + new Doctrine\DoctrineArrayItem(null, $this->parseDoctrineArgumentValue($tokens)), + $startLine, + $startIndex + ); + } + } + + + /** + * @return ConstExprIntegerNode|ConstExprStringNode|IdentifierTypeNode|ConstFetchNode + */ + private function parseDoctrineArrayKey(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { + $key = new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $tokens->currentTokenValue())); + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOCTRINE_ANNOTATION_STRING)) { + $key = new Ast\ConstExpr\DoctrineConstExprStringNode(Ast\ConstExpr\DoctrineConstExprStringNode::unescape($tokens->currentTokenValue())); + + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + $value = $tokens->currentTokenValue(); + $tokens->next(); + $key = $this->doctrineConstantExprParser->parseDoctrineString($value, $tokens); + + } else { + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $tokens->dropSavePoint(); + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + } + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($currentTokenValue), + $startLine, + $startIndex + ); + } + + $tokens->rollback(); + $constExpr = $this->doctrineConstantExprParser->parse($tokens, true); + if (!$constExpr instanceof Ast\ConstExpr\ConstFetchNode) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_IDENTIFIER, + null, + $tokens->currentTokenLine() + ); + } + + return $constExpr; + } + + return $this->enrichWithAttributes($tokens, $key, $startLine, $startIndex); + } + + + /** + * @return Ast\PhpDoc\ParamTagValueNode|Ast\PhpDoc\TypelessParamTagValueNode + */ + private function parseParamTagValue(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode + { + if ( + $tokens->isCurrentTokenType(Lexer::TOKEN_REFERENCE, Lexer::TOKEN_VARIADIC, Lexer::TOKEN_VARIABLE) + ) { + $type = null; + } else { + $type = $this->typeParser->parse($tokens); + } + + $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); + $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + + if ($type !== null) { + return new Ast\PhpDoc\ParamTagValueNode($type, $isVariadic, $parameterName, $description, $isReference); + } + + return new Ast\PhpDoc\TypelessParamTagValueNode($isVariadic, $parameterName, $description, $isReference); + } + + + private function parseParamImmediatelyInvokedCallableTagValue(TokenIterator $tokens): Ast\PhpDoc\ParamImmediatelyInvokedCallableTagValueNode + { + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + + return new Ast\PhpDoc\ParamImmediatelyInvokedCallableTagValueNode($parameterName, $description); + } + + + private function parseParamLaterInvokedCallableTagValue(TokenIterator $tokens): Ast\PhpDoc\ParamLaterInvokedCallableTagValueNode + { + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + + return new Ast\PhpDoc\ParamLaterInvokedCallableTagValueNode($parameterName, $description); + } + + + private function parseParamClosureThisTagValue(TokenIterator $tokens): Ast\PhpDoc\ParamClosureThisTagValueNode + { + $type = $this->typeParser->parse($tokens); + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + + return new Ast\PhpDoc\ParamClosureThisTagValueNode($type, $parameterName, $description); + } + + + private function parseVarTagValue(TokenIterator $tokens): Ast\PhpDoc\VarTagValueNode + { + $type = $this->typeParser->parse($tokens); + $variableName = $this->parseOptionalVariableName($tokens); + $description = $this->parseOptionalDescription($tokens, $variableName === ''); + return new Ast\PhpDoc\VarTagValueNode($type, $variableName, $description); + } + + + private function parseReturnTagValue(TokenIterator $tokens): Ast\PhpDoc\ReturnTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens, true); + return new Ast\PhpDoc\ReturnTagValueNode($type, $description); + } + + + private function parseThrowsTagValue(TokenIterator $tokens): Ast\PhpDoc\ThrowsTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens, true); + return new Ast\PhpDoc\ThrowsTagValueNode($type, $description); + } + + private function parseMixinTagValue(TokenIterator $tokens): Ast\PhpDoc\MixinTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens, true); + return new Ast\PhpDoc\MixinTagValueNode($type, $description); + } + + private function parseRequireExtendsTagValue(TokenIterator $tokens): Ast\PhpDoc\RequireExtendsTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens, true); + return new Ast\PhpDoc\RequireExtendsTagValueNode($type, $description); + } + + private function parseRequireImplementsTagValue(TokenIterator $tokens): Ast\PhpDoc\RequireImplementsTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens, true); + return new Ast\PhpDoc\RequireImplementsTagValueNode($type, $description); + } + + private function parseDeprecatedTagValue(TokenIterator $tokens): Ast\PhpDoc\DeprecatedTagValueNode + { + $description = $this->parseOptionalDescription($tokens); + return new Ast\PhpDoc\DeprecatedTagValueNode($description); + } + + + private function parsePropertyTagValue(TokenIterator $tokens): Ast\PhpDoc\PropertyTagValueNode + { + $type = $this->typeParser->parse($tokens); + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + return new Ast\PhpDoc\PropertyTagValueNode($type, $parameterName, $description); + } + + + private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueNode + { + $staticKeywordOrReturnTypeOrMethodName = $this->typeParser->parse($tokens); + + if ($staticKeywordOrReturnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode && $staticKeywordOrReturnTypeOrMethodName->name === 'static') { + $isStatic = true; + $returnTypeOrMethodName = $this->typeParser->parse($tokens); + + } else { + $isStatic = false; + $returnTypeOrMethodName = $staticKeywordOrReturnTypeOrMethodName; + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { + $returnType = $returnTypeOrMethodName; + $methodName = $tokens->currentTokenValue(); + $tokens->next(); + + } elseif ($returnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode) { + $returnType = $isStatic ? $staticKeywordOrReturnTypeOrMethodName : null; + $methodName = $returnTypeOrMethodName->name; + $isStatic = false; + + } else { + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); // will throw exception + exit; + } + + $templateTypes = []; + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { + do { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $templateTypes[] = $this->enrichWithAttributes( + $tokens, + $this->typeParser->parseTemplateTagValue($tokens), + $startLine, + $startIndex + ); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); + } + + $parameters = []; + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { + $parameters[] = $this->parseMethodTagValueParameter($tokens); + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { + $parameters[] = $this->parseMethodTagValueParameter($tokens); + } + } + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + + $description = $this->parseOptionalDescription($tokens); + return new Ast\PhpDoc\MethodTagValueNode($isStatic, $returnType, $methodName, $parameters, $description, $templateTypes); + } + + private function parseMethodTagValueParameter(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueParameterNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + switch ($tokens->currentTokenType()) { + case Lexer::TOKEN_IDENTIFIER: + case Lexer::TOKEN_OPEN_PARENTHESES: + case Lexer::TOKEN_NULLABLE: + $parameterType = $this->typeParser->parse($tokens); + break; + + default: + $parameterType = null; + } + + $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); + $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); + + $parameterName = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL)) { + $defaultValue = $this->constantExprParser->parse($tokens); + + } else { + $defaultValue = null; + } + + return $this->enrichWithAttributes( + $tokens, + new Ast\PhpDoc\MethodTagValueParameterNode($parameterType, $isReference, $isVariadic, $parameterName, $defaultValue), + $startLine, + $startIndex + ); + } + + private function parseExtendsTagValue(string $tagName, TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $baseType = new IdentifierTypeNode($tokens->currentTokenValue()); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + $type = $this->typeParser->parseGeneric( + $tokens, + $this->typeParser->enrichWithAttributes($tokens, $baseType, $startLine, $startIndex) + ); + + $description = $this->parseOptionalDescription($tokens); + + switch ($tagName) { + case '@extends': + return new Ast\PhpDoc\ExtendsTagValueNode($type, $description); + case '@implements': + return new Ast\PhpDoc\ImplementsTagValueNode($type, $description); + case '@use': + return new Ast\PhpDoc\UsesTagValueNode($type, $description); + } + + throw new ShouldNotHappenException(); + } + + private function parseTypeAliasTagValue(TokenIterator $tokens): Ast\PhpDoc\TypeAliasTagValueNode + { + $alias = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + // support phan-type/psalm-type syntax + $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); + + if ($this->preserveTypeAliasesWithInvalidTypes) { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + try { + $type = $this->typeParser->parse($tokens); + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PHPDOC)) { + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL)) { + throw new ParserException( + $tokens->currentTokenValue(), + $tokens->currentTokenType(), + $tokens->currentTokenOffset(), + Lexer::TOKEN_PHPDOC_EOL, + null, + $tokens->currentTokenLine() + ); + } + } + + return new Ast\PhpDoc\TypeAliasTagValueNode($alias, $type); + } catch (ParserException $e) { + $this->parseOptionalDescription($tokens); + return new Ast\PhpDoc\TypeAliasTagValueNode( + $alias, + $this->enrichWithAttributes($tokens, new Ast\Type\InvalidTypeNode($e), $startLine, $startIndex) + ); + } + } + + $type = $this->typeParser->parse($tokens); + + return new Ast\PhpDoc\TypeAliasTagValueNode($alias, $type); + } + + private function parseTypeAliasImportTagValue(TokenIterator $tokens): Ast\PhpDoc\TypeAliasImportTagValueNode + { + $importedAlias = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + $tokens->consumeTokenValue(Lexer::TOKEN_IDENTIFIER, 'from'); + + $identifierStartLine = $tokens->currentTokenLine(); + $identifierStartIndex = $tokens->currentTokenIndex(); + $importedFrom = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + $importedFromType = $this->enrichWithAttributes( + $tokens, + new IdentifierTypeNode($importedFrom), + $identifierStartLine, + $identifierStartIndex + ); + + $importedAs = null; + if ($tokens->tryConsumeTokenValue('as')) { + $importedAs = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + return new Ast\PhpDoc\TypeAliasImportTagValueNode($importedAlias, $importedFromType, $importedAs); + } + + /** + * @return Ast\PhpDoc\AssertTagValueNode|Ast\PhpDoc\AssertTagPropertyValueNode|Ast\PhpDoc\AssertTagMethodValueNode + */ + private function parseAssertTagValue(TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode + { + $isNegated = $tokens->tryConsumeTokenType(Lexer::TOKEN_NEGATED); + $isEquality = $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); + $type = $this->typeParser->parse($tokens); + $parameter = $this->parseAssertParameter($tokens); + $description = $this->parseOptionalDescription($tokens); + + if (array_key_exists('method', $parameter)) { + return new Ast\PhpDoc\AssertTagMethodValueNode($type, $parameter['parameter'], $parameter['method'], $isNegated, $description, $isEquality); + } elseif (array_key_exists('property', $parameter)) { + return new Ast\PhpDoc\AssertTagPropertyValueNode($type, $parameter['parameter'], $parameter['property'], $isNegated, $description, $isEquality); + } + + return new Ast\PhpDoc\AssertTagValueNode($type, $parameter['parameter'], $isNegated, $description, $isEquality); + } + + /** + * @return array{parameter: string}|array{parameter: string, property: string}|array{parameter: string, method: string} + */ + private function parseAssertParameter(TokenIterator $tokens): array + { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_THIS_VARIABLE)) { + $parameter = '$this'; + $tokens->next(); + } else { + $parameter = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_ARROW)) { + $tokens->consumeTokenType(Lexer::TOKEN_ARROW); + + $propertyOrMethod = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + + return ['parameter' => $parameter, 'method' => $propertyOrMethod]; + } + + return ['parameter' => $parameter, 'property' => $propertyOrMethod]; + } + + return ['parameter' => $parameter]; + } + + private function parseSelfOutTagValue(TokenIterator $tokens): Ast\PhpDoc\SelfOutTagValueNode + { + $type = $this->typeParser->parse($tokens); + $description = $this->parseOptionalDescription($tokens); + + return new Ast\PhpDoc\SelfOutTagValueNode($type, $description); + } + + private function parseParamOutTagValue(TokenIterator $tokens): Ast\PhpDoc\ParamOutTagValueNode + { + $type = $this->typeParser->parse($tokens); + $parameterName = $this->parseRequiredVariableName($tokens); + $description = $this->parseOptionalDescription($tokens); + + return new Ast\PhpDoc\ParamOutTagValueNode($type, $parameterName, $description); + } + + private function parseOptionalVariableName(TokenIterator $tokens): string + { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)) { + $parameterName = $tokens->currentTokenValue(); + $tokens->next(); + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_THIS_VARIABLE)) { + $parameterName = '$this'; + $tokens->next(); + + } else { + $parameterName = ''; + } + + return $parameterName; + } + + + private function parseRequiredVariableName(TokenIterator $tokens): string + { + $parameterName = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); + + return $parameterName; + } + + private function parseOptionalDescription(TokenIterator $tokens, bool $limitStartToken = false): string + { + if ($limitStartToken) { + foreach (self::DISALLOWED_DESCRIPTION_START_TOKENS as $disallowedStartToken) { + if (!$tokens->isCurrentTokenType($disallowedStartToken)) { + continue; + } + + $tokens->consumeTokenType(Lexer::TOKEN_OTHER); // will throw exception + } + + if ( + $this->requireWhitespaceBeforeDescription + && !$tokens->isCurrentTokenType(Lexer::TOKEN_PHPDOC_EOL, Lexer::TOKEN_CLOSE_PHPDOC, Lexer::TOKEN_END) + && !$tokens->isPrecededByHorizontalWhitespace() + ) { + $tokens->consumeTokenType(Lexer::TOKEN_HORIZONTAL_WS); // will throw exception + } + } + + return $this->parseText($tokens)->text; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php b/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php new file mode 100644 index 0000000..7052405 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/StringUnescaper.php @@ -0,0 +1,96 @@ + '\\', + 'n' => "\n", + 'r' => "\r", + 't' => "\t", + 'f' => "\f", + 'v' => "\v", + 'e' => "\x1B", + ]; + + public static function unescapeString(string $string): string + { + $quote = $string[0]; + + if ($quote === '\'') { + return str_replace( + ['\\\\', '\\\''], + ['\\', '\''], + substr($string, 1, -1) + ); + } + + return self::parseEscapeSequences(substr($string, 1, -1), '"'); + } + + /** + * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L90-L130 + */ + private static function parseEscapeSequences(string $str, string $quote): string + { + $str = str_replace('\\' . $quote, $quote, $str); + + return preg_replace_callback( + '~\\\\([\\\\nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u\{([0-9a-fA-F]+)\})~', + static function ($matches) { + $str = $matches[1]; + + if (isset(self::REPLACEMENTS[$str])) { + return self::REPLACEMENTS[$str]; + } + if ($str[0] === 'x' || $str[0] === 'X') { + return chr((int) hexdec(substr($str, 1))); + } + if ($str[0] === 'u') { + return self::codePointToUtf8((int) hexdec($matches[2])); + } + + return chr((int) octdec($str)); + }, + $str + ); + } + + /** + * Implementation based on https://github.com/nikic/PHP-Parser/blob/b0edd4c41111042d43bb45c6c657b2e0db367d9e/lib/PhpParser/Node/Scalar/String_.php#L132-L154 + */ + private static function codePointToUtf8(int $num): string + { + if ($num <= 0x7F) { + return chr($num); + } + if ($num <= 0x7FF) { + return chr(($num >> 6) + 0xC0) + . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0xFFFF) { + return chr(($num >> 12) + 0xE0) + . chr((($num >> 6) & 0x3F) + 0x80) + . chr(($num & 0x3F) + 0x80); + } + if ($num <= 0x1FFFFF) { + return chr(($num >> 18) + 0xF0) + . chr((($num >> 12) & 0x3F) + 0x80) + . chr((($num >> 6) & 0x3F) + 0x80) + . chr(($num & 0x3F) + 0x80); + } + + // Invalid UTF-8 codepoint escape sequence: Codepoint too large + return "\xef\xbf\xbd"; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php b/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php new file mode 100644 index 0000000..9be7593 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/TokenIterator.php @@ -0,0 +1,383 @@ + */ + private $tokens; + + /** @var int */ + private $index; + + /** @var int[] */ + private $savePoints = []; + + /** @var list */ + private $skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS]; + + /** @var string|null */ + private $newline = null; + + /** + * @param list $tokens + */ + public function __construct(array $tokens, int $index = 0) + { + $this->tokens = $tokens; + $this->index = $index; + + $this->skipIrrelevantTokens(); + } + + + /** + * @return list + */ + public function getTokens(): array + { + return $this->tokens; + } + + + public function getContentBetween(int $startPos, int $endPos): string + { + if ($startPos < 0 || $endPos > count($this->tokens)) { + throw new LogicException(); + } + + $content = ''; + for ($i = $startPos; $i < $endPos; $i++) { + $content .= $this->tokens[$i][Lexer::VALUE_OFFSET]; + } + + return $content; + } + + + public function getTokenCount(): int + { + return count($this->tokens); + } + + + public function currentTokenValue(): string + { + return $this->tokens[$this->index][Lexer::VALUE_OFFSET]; + } + + + public function currentTokenType(): int + { + return $this->tokens[$this->index][Lexer::TYPE_OFFSET]; + } + + + public function currentTokenOffset(): int + { + $offset = 0; + for ($i = 0; $i < $this->index; $i++) { + $offset += strlen($this->tokens[$i][Lexer::VALUE_OFFSET]); + } + + return $offset; + } + + + public function currentTokenLine(): int + { + return $this->tokens[$this->index][Lexer::LINE_OFFSET]; + } + + + public function currentTokenIndex(): int + { + return $this->index; + } + + + public function endIndexOfLastRelevantToken(): int + { + $endIndex = $this->currentTokenIndex(); + $endIndex--; + while (in_array($this->tokens[$endIndex][Lexer::TYPE_OFFSET], $this->skippedTokenTypes, true)) { + if (!isset($this->tokens[$endIndex - 1])) { + break; + } + $endIndex--; + } + + return $endIndex; + } + + + public function isCurrentTokenValue(string $tokenValue): bool + { + return $this->tokens[$this->index][Lexer::VALUE_OFFSET] === $tokenValue; + } + + + public function isCurrentTokenType(int ...$tokenType): bool + { + return in_array($this->tokens[$this->index][Lexer::TYPE_OFFSET], $tokenType, true); + } + + + public function isPrecededByHorizontalWhitespace(): bool + { + return ($this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] ?? -1) === Lexer::TOKEN_HORIZONTAL_WS; + } + + + /** + * @throws ParserException + */ + public function consumeTokenType(int $tokenType): void + { + if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) { + $this->throwError($tokenType); + } + + if ($tokenType === Lexer::TOKEN_PHPDOC_EOL) { + if ($this->newline === null) { + $this->detectNewline(); + } + } + + $this->index++; + $this->skipIrrelevantTokens(); + } + + + /** + * @throws ParserException + */ + public function consumeTokenValue(int $tokenType, string $tokenValue): void + { + if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType || $this->tokens[$this->index][Lexer::VALUE_OFFSET] !== $tokenValue) { + $this->throwError($tokenType, $tokenValue); + } + + $this->index++; + $this->skipIrrelevantTokens(); + } + + + /** @phpstan-impure */ + public function tryConsumeTokenValue(string $tokenValue): bool + { + if ($this->tokens[$this->index][Lexer::VALUE_OFFSET] !== $tokenValue) { + return false; + } + + $this->index++; + $this->skipIrrelevantTokens(); + + return true; + } + + + /** @phpstan-impure */ + public function tryConsumeTokenType(int $tokenType): bool + { + if ($this->tokens[$this->index][Lexer::TYPE_OFFSET] !== $tokenType) { + return false; + } + + if ($tokenType === Lexer::TOKEN_PHPDOC_EOL) { + if ($this->newline === null) { + $this->detectNewline(); + } + } + + $this->index++; + $this->skipIrrelevantTokens(); + + return true; + } + + + private function detectNewline(): void + { + $value = $this->currentTokenValue(); + if (substr($value, 0, 2) === "\r\n") { + $this->newline = "\r\n"; + } elseif (substr($value, 0, 1) === "\n") { + $this->newline = "\n"; + } + } + + + public function getSkippedHorizontalWhiteSpaceIfAny(): string + { + if ($this->index > 0 && $this->tokens[$this->index - 1][Lexer::TYPE_OFFSET] === Lexer::TOKEN_HORIZONTAL_WS) { + return $this->tokens[$this->index - 1][Lexer::VALUE_OFFSET]; + } + + return ''; + } + + + /** @phpstan-impure */ + public function joinUntil(int ...$tokenType): string + { + $s = ''; + while (!in_array($this->tokens[$this->index][Lexer::TYPE_OFFSET], $tokenType, true)) { + $s .= $this->tokens[$this->index++][Lexer::VALUE_OFFSET]; + } + return $s; + } + + + public function next(): void + { + $this->index++; + $this->skipIrrelevantTokens(); + } + + + private function skipIrrelevantTokens(): void + { + if (!isset($this->tokens[$this->index])) { + return; + } + + while (in_array($this->tokens[$this->index][Lexer::TYPE_OFFSET], $this->skippedTokenTypes, true)) { + if (!isset($this->tokens[$this->index + 1])) { + break; + } + $this->index++; + } + } + + + public function addEndOfLineToSkippedTokens(): void + { + $this->skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS, Lexer::TOKEN_PHPDOC_EOL]; + } + + + public function removeEndOfLineFromSkippedTokens(): void + { + $this->skippedTokenTypes = [Lexer::TOKEN_HORIZONTAL_WS]; + } + + /** @phpstan-impure */ + public function forwardToTheEnd(): void + { + $lastToken = count($this->tokens) - 1; + $this->index = $lastToken; + } + + + public function pushSavePoint(): void + { + $this->savePoints[] = $this->index; + } + + + public function dropSavePoint(): void + { + array_pop($this->savePoints); + } + + + public function rollback(): void + { + $index = array_pop($this->savePoints); + assert($index !== null); + $this->index = $index; + } + + + /** + * @throws ParserException + */ + private function throwError(int $expectedTokenType, ?string $expectedTokenValue = null): void + { + throw new ParserException( + $this->currentTokenValue(), + $this->currentTokenType(), + $this->currentTokenOffset(), + $expectedTokenType, + $expectedTokenValue, + $this->currentTokenLine() + ); + } + + /** + * Check whether the position is directly preceded by a certain token type. + * + * During this check TOKEN_HORIZONTAL_WS and TOKEN_PHPDOC_EOL are skipped + */ + public function hasTokenImmediatelyBefore(int $pos, int $expectedTokenType): bool + { + $tokens = $this->tokens; + $pos--; + for (; $pos >= 0; $pos--) { + $token = $tokens[$pos]; + $type = $token[Lexer::TYPE_OFFSET]; + if ($type === $expectedTokenType) { + return true; + } + if (!in_array($type, [ + Lexer::TOKEN_HORIZONTAL_WS, + Lexer::TOKEN_PHPDOC_EOL, + ], true)) { + break; + } + } + return false; + } + + /** + * Check whether the position is directly followed by a certain token type. + * + * During this check TOKEN_HORIZONTAL_WS and TOKEN_PHPDOC_EOL are skipped + */ + public function hasTokenImmediatelyAfter(int $pos, int $expectedTokenType): bool + { + $tokens = $this->tokens; + $pos++; + for ($c = count($tokens); $pos < $c; $pos++) { + $token = $tokens[$pos]; + $type = $token[Lexer::TYPE_OFFSET]; + if ($type === $expectedTokenType) { + return true; + } + if (!in_array($type, [ + Lexer::TOKEN_HORIZONTAL_WS, + Lexer::TOKEN_PHPDOC_EOL, + ], true)) { + break; + } + } + + return false; + } + + public function getDetectedNewline(): ?string + { + return $this->newline; + } + + /** + * Whether the given position is immediately surrounded by parenthesis. + */ + public function hasParentheses(int $startPos, int $endPos): bool + { + return $this->hasTokenImmediatelyBefore($startPos, Lexer::TOKEN_OPEN_PARENTHESES) + && $this->hasTokenImmediatelyAfter($endPos, Lexer::TOKEN_CLOSE_PARENTHESES); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php new file mode 100644 index 0000000..2e40465 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php @@ -0,0 +1,1026 @@ +constExprParser = $constExprParser; + $this->quoteAwareConstExprString = $quoteAwareConstExprString; + $this->useLinesAttributes = $usedAttributes['lines'] ?? false; + $this->useIndexAttributes = $usedAttributes['indexes'] ?? false; + } + + /** @phpstan-impure */ + public function parse(TokenIterator $tokens): Ast\Type\TypeNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { + $type = $this->parseNullable($tokens); + + } else { + $type = $this->parseAtomic($tokens); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_UNION)) { + $type = $this->parseUnion($tokens, $type); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_INTERSECTION)) { + $type = $this->parseIntersection($tokens, $type); + } + } + + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + /** + * @internal + * @template T of Ast\Node + * @param T $type + * @return T + */ + public function enrichWithAttributes(TokenIterator $tokens, Ast\Node $type, int $startLine, int $startIndex): Ast\Node + { + if ($this->useLinesAttributes) { + $type->setAttribute(Ast\Attribute::START_LINE, $startLine); + $type->setAttribute(Ast\Attribute::END_LINE, $tokens->currentTokenLine()); + } + + if ($this->useIndexAttributes) { + $type->setAttribute(Ast\Attribute::START_INDEX, $startIndex); + $type->setAttribute(Ast\Attribute::END_INDEX, $tokens->endIndexOfLastRelevantToken()); + } + + return $type; + } + + /** @phpstan-impure */ + private function subParse(TokenIterator $tokens): Ast\Type\TypeNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { + $type = $this->parseNullable($tokens); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)) { + $type = $this->parseConditionalForParameter($tokens, $tokens->currentTokenValue()); + + } else { + $type = $this->parseAtomic($tokens); + + if ($tokens->isCurrentTokenValue('is')) { + $type = $this->parseConditional($tokens, $type); + } else { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_UNION)) { + $type = $this->subParseUnion($tokens, $type); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_INTERSECTION)) { + $type = $this->subParseIntersection($tokens, $type); + } + } + } + + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + + /** @phpstan-impure */ + private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $type = $this->subParse($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_THIS_VARIABLE)) { + $type = $this->enrichWithAttributes($tokens, new Ast\Type\ThisTypeNode(), $startLine, $startIndex); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $type = $this->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode($currentTokenValue), $startLine, $startIndex); + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + $tokens->dropSavePoint(); // because of ConstFetchNode + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { + $tokens->pushSavePoint(); + + $isHtml = $this->isHtml($tokens); + $tokens->rollback(); + if ($isHtml) { + return $type; + } + + $origType = $type; + $type = $this->tryParseCallable($tokens, $type, true); + if ($type === $origType) { + $type = $this->parseGeneric($tokens, $type); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + } + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $type = $this->tryParseCallable($tokens, $type, false); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + + } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + if ($type->name === 'object') { + $type = $this->parseObjectShape($tokens); + } else { + $type = $this->parseArrayShape($tokens, $type, $type->name); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess( + $tokens, + $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex) + ); + } + } + + return $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } else { + $tokens->rollback(); // because of ConstFetchNode + } + } else { + $tokens->dropSavePoint(); // because of ConstFetchNode + } + + $currentTokenValue = $tokens->currentTokenValue(); + $currentTokenType = $tokens->currentTokenType(); + $currentTokenOffset = $tokens->currentTokenOffset(); + $currentTokenLine = $tokens->currentTokenLine(); + + if ($this->constExprParser === null) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + + try { + $constExpr = $this->constExprParser->parse($tokens, true); + if ($constExpr instanceof Ast\ConstExpr\ConstExprArrayNode) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + + $type = $this->enrichWithAttributes( + $tokens, + new Ast\Type\ConstTypeNode($constExpr), + $startLine, + $startIndex + ); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + + return $type; + } catch (LogicException $e) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + } + + + /** @phpstan-impure */ + private function parseUnion(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode + { + $types = [$type]; + + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_UNION)) { + $types[] = $this->parseAtomic($tokens); + } + + return new Ast\Type\UnionTypeNode($types); + } + + + /** @phpstan-impure */ + private function subParseUnion(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode + { + $types = [$type]; + + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_UNION)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $types[] = $this->parseAtomic($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } + + return new Ast\Type\UnionTypeNode($types); + } + + + /** @phpstan-impure */ + private function parseIntersection(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode + { + $types = [$type]; + + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_INTERSECTION)) { + $types[] = $this->parseAtomic($tokens); + } + + return new Ast\Type\IntersectionTypeNode($types); + } + + + /** @phpstan-impure */ + private function subParseIntersection(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode + { + $types = [$type]; + + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_INTERSECTION)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $types[] = $this->parseAtomic($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } + + return new Ast\Type\IntersectionTypeNode($types); + } + + + /** @phpstan-impure */ + private function parseConditional(TokenIterator $tokens, Ast\Type\TypeNode $subjectType): Ast\Type\TypeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + $negated = false; + if ($tokens->isCurrentTokenValue('not')) { + $negated = true; + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + $targetType = $this->parse($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_NULLABLE); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $ifType = $this->parse($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $elseType = $this->subParse($tokens); + + return new Ast\Type\ConditionalTypeNode($subjectType, $targetType, $ifType, $elseType, $negated); + } + + /** @phpstan-impure */ + private function parseConditionalForParameter(TokenIterator $tokens, string $parameterName): Ast\Type\TypeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); + $tokens->consumeTokenValue(Lexer::TOKEN_IDENTIFIER, 'is'); + + $negated = false; + if ($tokens->isCurrentTokenValue('not')) { + $negated = true; + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + $targetType = $this->parse($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_NULLABLE); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $ifType = $this->parse($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $elseType = $this->subParse($tokens); + + return new Ast\Type\ConditionalTypeForParameterNode($parameterName, $targetType, $ifType, $elseType, $negated); + } + + + /** @phpstan-impure */ + private function parseNullable(TokenIterator $tokens): Ast\Type\TypeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_NULLABLE); + + $type = $this->parseAtomic($tokens); + + return new Ast\Type\NullableTypeNode($type); + } + + /** @phpstan-impure */ + public function isHtml(TokenIterator $tokens): bool + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET); + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) { + return false; + } + + $htmlTagName = $tokens->currentTokenValue(); + + $tokens->next(); + + if (!$tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) { + return false; + } + + $endTag = ''; + $endTagSearchOffset = - strlen($endTag); + + while (!$tokens->isCurrentTokenType(Lexer::TOKEN_END)) { + if ( + ( + $tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET) + && strpos($tokens->currentTokenValue(), '/' . $htmlTagName . '>') !== false + ) + || substr_compare($tokens->currentTokenValue(), $endTag, $endTagSearchOffset) === 0 + ) { + return true; + } + + $tokens->next(); + } + + return false; + } + + /** @phpstan-impure */ + public function parseGeneric(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $baseType): Ast\Type\GenericTypeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET); + + $startLine = $baseType->getAttribute(Ast\Attribute::START_LINE); + $startIndex = $baseType->getAttribute(Ast\Attribute::START_INDEX); + $genericTypes = []; + $variances = []; + + $isFirst = true; + while ($isFirst || $tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + // trailing comma case + if (!$isFirst && $tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) { + break; + } + $isFirst = false; + + [$genericTypes[], $variances[]] = $this->parseGenericTypeArgument($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } + + $type = new Ast\Type\GenericTypeNode($baseType, $genericTypes, $variances); + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes($tokens, $type, $startLine, $startIndex); + } + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); + + return $type; + } + + + /** + * @phpstan-impure + * @return array{Ast\Type\TypeNode, Ast\Type\GenericTypeNode::VARIANCE_*} + */ + public function parseGenericTypeArgument(TokenIterator $tokens): array + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_WILDCARD)) { + return [ + $this->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode('mixed'), $startLine, $startIndex), + Ast\Type\GenericTypeNode::VARIANCE_BIVARIANT, + ]; + } + + if ($tokens->tryConsumeTokenValue('contravariant')) { + $variance = Ast\Type\GenericTypeNode::VARIANCE_CONTRAVARIANT; + } elseif ($tokens->tryConsumeTokenValue('covariant')) { + $variance = Ast\Type\GenericTypeNode::VARIANCE_COVARIANT; + } else { + $variance = Ast\Type\GenericTypeNode::VARIANCE_INVARIANT; + } + + $type = $this->parse($tokens); + return [$type, $variance]; + } + + /** + * @throws ParserException + * @param ?callable(TokenIterator): string $parseDescription + */ + public function parseTemplateTagValue( + TokenIterator $tokens, + ?callable $parseDescription = null + ): TemplateTagValueNode + { + $name = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + + if ($tokens->tryConsumeTokenValue('of') || $tokens->tryConsumeTokenValue('as')) { + $bound = $this->parse($tokens); + + } else { + $bound = null; + } + + if ($tokens->tryConsumeTokenValue('=')) { + $default = $this->parse($tokens); + } else { + $default = null; + } + + if ($parseDescription !== null) { + $description = $parseDescription($tokens); + } else { + $description = ''; + } + + if ($name === '') { + throw new LogicException('Template tag name cannot be empty.'); + } + + return new Ast\PhpDoc\TemplateTagValueNode($name, $bound, $description, $default); + } + + + /** @phpstan-impure */ + private function parseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $identifier, bool $hasTemplate): Ast\Type\TypeNode + { + $templates = $hasTemplate + ? $this->parseCallableTemplates($tokens) + : []; + + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + $parameters = []; + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { + $parameters[] = $this->parseCallableParameter($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_PARENTHESES)) { + break; + } + $parameters[] = $this->parseCallableParameter($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } + } + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $returnType = $this->enrichWithAttributes($tokens, $this->parseCallableReturnType($tokens), $startLine, $startIndex); + + return new Ast\Type\CallableTypeNode($identifier, $parameters, $returnType, $templates); + } + + + /** + * @return Ast\PhpDoc\TemplateTagValueNode[] + * + * @phpstan-impure + */ + private function parseCallableTemplates(TokenIterator $tokens): array + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET); + + $templates = []; + + $isFirst = true; + while ($isFirst || $tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)) { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + // trailing comma case + if (!$isFirst && $tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET)) { + break; + } + $isFirst = false; + + $templates[] = $this->parseCallableTemplateArgument($tokens); + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } + + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET); + + return $templates; + } + + + private function parseCallableTemplateArgument(TokenIterator $tokens): Ast\PhpDoc\TemplateTagValueNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + return $this->enrichWithAttributes( + $tokens, + $this->parseTemplateTagValue($tokens), + $startLine, + $startIndex + ); + } + + + /** @phpstan-impure */ + private function parseCallableParameter(TokenIterator $tokens): Ast\Type\CallableTypeParameterNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + $type = $this->parse($tokens); + $isReference = $tokens->tryConsumeTokenType(Lexer::TOKEN_REFERENCE); + $isVariadic = $tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_VARIABLE)) { + $parameterName = $tokens->currentTokenValue(); + $tokens->consumeTokenType(Lexer::TOKEN_VARIABLE); + + } else { + $parameterName = ''; + } + + $isOptional = $tokens->tryConsumeTokenType(Lexer::TOKEN_EQUAL); + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\CallableTypeParameterNode($type, $isReference, $isVariadic, $parameterName, $isOptional), + $startLine, + $startIndex + ); + } + + + /** @phpstan-impure */ + private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_NULLABLE)) { + return $this->parseNullable($tokens); + + } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_OPEN_PARENTHESES)) { + $type = $this->subParse($tokens); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_PARENTHESES); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + + return $type; + } elseif ($tokens->tryConsumeTokenType(Lexer::TOKEN_THIS_VARIABLE)) { + $type = new Ast\Type\ThisTypeNode(); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + + return $type; + } else { + $currentTokenValue = $tokens->currentTokenValue(); + $tokens->pushSavePoint(); // because of ConstFetchNode + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_IDENTIFIER)) { + $type = new Ast\Type\IdentifierTypeNode($currentTokenValue); + + if (!$tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_COLON)) { + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_ANGLE_BRACKET)) { + $type = $this->parseGeneric( + $tokens, + $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ) + ); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + + } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + if ($type->name === 'object') { + $type = $this->parseObjectShape($tokens); + } else { + $type = $this->parseArrayShape($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ), $type->name); + } + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + )); + } + } + + return $type; + } else { + $tokens->rollback(); // because of ConstFetchNode + } + } else { + $tokens->dropSavePoint(); // because of ConstFetchNode + } + } + + $currentTokenValue = $tokens->currentTokenValue(); + $currentTokenType = $tokens->currentTokenType(); + $currentTokenOffset = $tokens->currentTokenOffset(); + $currentTokenLine = $tokens->currentTokenLine(); + + if ($this->constExprParser === null) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + + try { + $constExpr = $this->constExprParser->parse($tokens, true); + if ($constExpr instanceof Ast\ConstExpr\ConstExprArrayNode) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + + $type = $this->enrichWithAttributes( + $tokens, + new Ast\Type\ConstTypeNode($constExpr), + $startLine, + $startIndex + ); + if ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); + } + + return $type; + } catch (LogicException $e) { + throw new ParserException( + $currentTokenValue, + $currentTokenType, + $currentTokenOffset, + Lexer::TOKEN_IDENTIFIER, + null, + $currentTokenLine + ); + } + } + + + /** @phpstan-impure */ + private function tryParseCallable(TokenIterator $tokens, Ast\Type\IdentifierTypeNode $identifier, bool $hasTemplate): Ast\Type\TypeNode + { + try { + $tokens->pushSavePoint(); + $type = $this->parseCallable($tokens, $identifier, $hasTemplate); + $tokens->dropSavePoint(); + + } catch (ParserException $e) { + $tokens->rollback(); + $type = $identifier; + } + + return $type; + } + + + /** @phpstan-impure */ + private function tryParseArrayOrOffsetAccess(TokenIterator $tokens, Ast\Type\TypeNode $type): Ast\Type\TypeNode + { + $startLine = $type->getAttribute(Ast\Attribute::START_LINE); + $startIndex = $type->getAttribute(Ast\Attribute::START_INDEX); + try { + while ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { + $tokens->pushSavePoint(); + + $canBeOffsetAccessType = !$tokens->isPrecededByHorizontalWhitespace(); + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET); + + if ($canBeOffsetAccessType && !$tokens->isCurrentTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET)) { + $offset = $this->parse($tokens); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET); + $tokens->dropSavePoint(); + $type = new Ast\Type\OffsetAccessTypeNode($type, $offset); + + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ); + } + } else { + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_SQUARE_BRACKET); + $tokens->dropSavePoint(); + $type = new Ast\Type\ArrayTypeNode($type); + + if ($startLine !== null && $startIndex !== null) { + $type = $this->enrichWithAttributes( + $tokens, + $type, + $startLine, + $startIndex + ); + } + } + } + + } catch (ParserException $e) { + $tokens->rollback(); + } + + return $type; + } + + + /** + * @phpstan-impure + * @param Ast\Type\ArrayShapeNode::KIND_* $kind + */ + private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type, string $kind): Ast\Type\ArrayShapeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET); + + $items = []; + $sealed = true; + + do { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { + return new Ast\Type\ArrayShapeNode($items, true, $kind); + } + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_VARIADIC)) { + $sealed = false; + $tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA); + break; + } + + $items[] = $this->parseArrayShapeItem($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); + + return new Ast\Type\ArrayShapeNode($items, $sealed, $kind); + } + + + /** @phpstan-impure */ + private function parseArrayShapeItem(TokenIterator $tokens): Ast\Type\ArrayShapeItemNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + try { + $tokens->pushSavePoint(); + $key = $this->parseArrayShapeKey($tokens); + $optional = $tokens->tryConsumeTokenType(Lexer::TOKEN_NULLABLE); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + $value = $this->parse($tokens); + $tokens->dropSavePoint(); + + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\ArrayShapeItemNode($key, $optional, $value), + $startLine, + $startIndex + ); + } catch (ParserException $e) { + $tokens->rollback(); + $value = $this->parse($tokens); + + return $this->enrichWithAttributes( + $tokens, + new Ast\Type\ArrayShapeItemNode(null, false, $value), + $startLine, + $startIndex + ); + } + } + + /** + * @phpstan-impure + * @return Ast\ConstExpr\ConstExprIntegerNode|Ast\ConstExpr\ConstExprStringNode|Ast\Type\IdentifierTypeNode + */ + private function parseArrayShapeKey(TokenIterator $tokens) + { + $startIndex = $tokens->currentTokenIndex(); + $startLine = $tokens->currentTokenLine(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_INTEGER)) { + $key = new Ast\ConstExpr\ConstExprIntegerNode(str_replace('_', '', $tokens->currentTokenValue())); + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), "'")); + } + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), '"')); + } + + $tokens->next(); + + } else { + $key = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + return $this->enrichWithAttributes( + $tokens, + $key, + $startLine, + $startIndex + ); + } + + /** + * @phpstan-impure + */ + private function parseObjectShape(TokenIterator $tokens): Ast\Type\ObjectShapeNode + { + $tokens->consumeTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET); + + $items = []; + + do { + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + + if ($tokens->tryConsumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET)) { + return new Ast\Type\ObjectShapeNode($items); + } + + $items[] = $this->parseObjectShapeItem($tokens); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + } while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA)); + + $tokens->tryConsumeTokenType(Lexer::TOKEN_PHPDOC_EOL); + $tokens->consumeTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET); + + return new Ast\Type\ObjectShapeNode($items); + } + + /** @phpstan-impure */ + private function parseObjectShapeItem(TokenIterator $tokens): Ast\Type\ObjectShapeItemNode + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + $key = $this->parseObjectShapeKey($tokens); + $optional = $tokens->tryConsumeTokenType(Lexer::TOKEN_NULLABLE); + $tokens->consumeTokenType(Lexer::TOKEN_COLON); + $value = $this->parse($tokens); + + return $this->enrichWithAttributes($tokens, new Ast\Type\ObjectShapeItemNode($key, $optional, $value), $startLine, $startIndex); + } + + /** + * @phpstan-impure + * @return Ast\ConstExpr\ConstExprStringNode|Ast\Type\IdentifierTypeNode + */ + private function parseObjectShapeKey(TokenIterator $tokens) + { + $startLine = $tokens->currentTokenLine(); + $startIndex = $tokens->currentTokenIndex(); + + if ($tokens->isCurrentTokenType(Lexer::TOKEN_SINGLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::SINGLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), "'")); + } + $tokens->next(); + + } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_DOUBLE_QUOTED_STRING)) { + if ($this->quoteAwareConstExprString) { + $key = new Ast\ConstExpr\QuoteAwareConstExprStringNode(StringUnescaper::unescapeString($tokens->currentTokenValue()), Ast\ConstExpr\QuoteAwareConstExprStringNode::DOUBLE_QUOTED); + } else { + $key = new Ast\ConstExpr\ConstExprStringNode(trim($tokens->currentTokenValue(), '"')); + } + $tokens->next(); + + } else { + $key = new Ast\Type\IdentifierTypeNode($tokens->currentTokenValue()); + $tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER); + } + + return $this->enrichWithAttributes($tokens, $key, $startLine, $startIndex); + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php b/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php new file mode 100644 index 0000000..2684dfc --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Printer/DiffElem.php @@ -0,0 +1,44 @@ +type = $type; + $this->old = $old; + $this->new = $new; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php b/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php new file mode 100644 index 0000000..ab10be5 --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Printer/Differ.php @@ -0,0 +1,196 @@ +isEqual = $isEqual; + } + + /** + * Calculate diff (edit script) from $old to $new. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script) + */ + public function diff(array $old, array $new): array + { + [$trace, $x, $y] = $this->calculateTrace($old, $new); + return $this->extractDiff($trace, $x, $y, $old, $new); + } + + /** + * Calculate diff, including "replace" operations. + * + * If a sequence of remove operations is followed by the same number of add operations, these + * will be coalesced into replace operations. + * + * @param T[] $old Original array + * @param T[] $new New array + * + * @return DiffElem[] Diff (edit script), including replace operations + */ + public function diffWithReplacements(array $old, array $new): array + { + return $this->coalesceReplacements($this->diff($old, $new)); + } + + /** + * @param T[] $old + * @param T[] $new + * @return array{array>, int, int} + */ + private function calculateTrace(array $old, array $new): array + { + $n = count($old); + $m = count($new); + $max = $n + $m; + $v = [1 => 0]; + $trace = []; + for ($d = 0; $d <= $max; $d++) { + $trace[] = $v; + for ($k = -$d; $k <= $d; $k += 2) { + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $x = $v[$k + 1]; + } else { + $x = $v[$k - 1] + 1; + } + + $y = $x - $k; + while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) { + $x++; + $y++; + } + + $v[$k] = $x; + if ($x >= $n && $y >= $m) { + return [$trace, $x, $y]; + } + } + } + throw new Exception('Should not happen'); + } + + /** + * @param array> $trace + * @param T[] $old + * @param T[] $new + * @return DiffElem[] + */ + private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array + { + $result = []; + for ($d = count($trace) - 1; $d >= 0; $d--) { + $v = $trace[$d]; + $k = $x - $y; + + if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) { + $prevK = $k + 1; + } else { + $prevK = $k - 1; + } + + $prevX = $v[$prevK]; + $prevY = $prevX - $prevK; + + while ($x > $prevX && $y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]); + $x--; + $y--; + } + + if ($d === 0) { + break; + } + + while ($x > $prevX) { + $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null); + $x--; + } + + while ($y > $prevY) { + $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]); + $y--; + } + } + return array_reverse($result); + } + + /** + * Coalesce equal-length sequences of remove+add into a replace operation. + * + * @param DiffElem[] $diff + * @return DiffElem[] + */ + private function coalesceReplacements(array $diff): array + { + $newDiff = []; + $c = count($diff); + for ($i = 0; $i < $c; $i++) { + $diffType = $diff[$i]->type; + if ($diffType !== DiffElem::TYPE_REMOVE) { + $newDiff[] = $diff[$i]; + continue; + } + + $j = $i; + while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) { + $j++; + } + + $k = $j; + while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) { + $k++; + } + + if ($j - $i === $k - $j) { + $len = $j - $i; + for ($n = 0; $n < $len; $n++) { + $newDiff[] = new DiffElem( + DiffElem::TYPE_REPLACE, + $diff[$i + $n]->old, + $diff[$j + $n]->new + ); + } + } else { + for (; $i < $k; $i++) { + $newDiff[] = $diff[$i]; + } + } + $i = $k - 1; + } + return $newDiff; + } + +} diff --git a/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php b/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php new file mode 100644 index 0000000..044d07f --- /dev/null +++ b/vendor/phpstan/phpdoc-parser/src/Printer/Printer.php @@ -0,0 +1,858 @@ + */ + private $differ; + + /** + * Map From "{$class}->{$subNode}" to string that should be inserted + * between elements of this list subnode + * + * @var array + */ + private $listInsertionMap = [ + PhpDocNode::class . '->children' => "\n * ", + UnionTypeNode::class . '->types' => '|', + IntersectionTypeNode::class . '->types' => '&', + ArrayShapeNode::class . '->items' => ', ', + ObjectShapeNode::class . '->items' => ', ', + CallableTypeNode::class . '->parameters' => ', ', + CallableTypeNode::class . '->templateTypes' => ', ', + GenericTypeNode::class . '->genericTypes' => ', ', + ConstExprArrayNode::class . '->items' => ', ', + MethodTagValueNode::class . '->parameters' => ', ', + DoctrineArray::class . '->items' => ', ', + DoctrineAnnotation::class . '->arguments' => ', ', + ]; + + /** + * [$find, $extraLeft, $extraRight] + * + * @var array + */ + private $emptyListInsertionMap = [ + CallableTypeNode::class . '->parameters' => ['(', '', ''], + ArrayShapeNode::class . '->items' => ['{', '', ''], + ObjectShapeNode::class . '->items' => ['{', '', ''], + DoctrineArray::class . '->items' => ['{', '', ''], + DoctrineAnnotation::class . '->arguments' => ['(', '', ''], + ]; + + /** @var array>> */ + private $parenthesesMap = [ + CallableTypeNode::class . '->returnType' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + ], + ArrayTypeNode::class . '->type' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + ConstTypeNode::class, + NullableTypeNode::class, + ], + OffsetAccessTypeNode::class . '->type' => [ + CallableTypeNode::class, + UnionTypeNode::class, + IntersectionTypeNode::class, + NullableTypeNode::class, + ], + ]; + + /** @var array>> */ + private $parenthesesListMap = [ + IntersectionTypeNode::class . '->types' => [ + IntersectionTypeNode::class, + UnionTypeNode::class, + NullableTypeNode::class, + ], + UnionTypeNode::class . '->types' => [ + IntersectionTypeNode::class, + UnionTypeNode::class, + NullableTypeNode::class, + ], + ]; + + public function printFormatPreserving(PhpDocNode $node, PhpDocNode $originalNode, TokenIterator $originalTokens): string + { + $this->differ = new Differ(static function ($a, $b) { + if ($a instanceof Node && $b instanceof Node) { + return $a === $b->getAttribute(Attribute::ORIGINAL_NODE); + } + + return false; + }); + + $tokenIndex = 0; + $result = $this->printArrayFormatPreserving( + $node->children, + $originalNode->children, + $originalTokens, + $tokenIndex, + PhpDocNode::class, + 'children' + ); + if ($result !== null) { + return $result . $originalTokens->getContentBetween($tokenIndex, $originalTokens->getTokenCount()); + } + + return $this->print($node); + } + + public function print(Node $node): string + { + if ($node instanceof PhpDocNode) { + return "/**\n *" . implode("\n *", array_map( + function (PhpDocChildNode $child): string { + $s = $this->print($child); + return $s === '' ? '' : ' ' . $s; + }, + $node->children + )) . "\n */"; + } + if ($node instanceof PhpDocTextNode) { + return $node->text; + } + if ($node instanceof PhpDocTagNode) { + if ($node->value instanceof DoctrineTagValueNode) { + return $this->print($node->value); + } + + return trim(sprintf('%s %s', $node->name, $this->print($node->value))); + } + if ($node instanceof PhpDocTagValueNode) { + return $this->printTagValue($node); + } + if ($node instanceof TypeNode) { + return $this->printType($node); + } + if ($node instanceof ConstExprNode) { + return $this->printConstExpr($node); + } + if ($node instanceof MethodTagValueParameterNode) { + $type = $node->type !== null ? $this->print($node->type) . ' ' : ''; + $isReference = $node->isReference ? '&' : ''; + $isVariadic = $node->isVariadic ? '...' : ''; + $default = $node->defaultValue !== null ? ' = ' . $this->print($node->defaultValue) : ''; + return "{$type}{$isReference}{$isVariadic}{$node->parameterName}{$default}"; + } + if ($node instanceof CallableTypeParameterNode) { + $type = $this->print($node->type) . ' '; + $isReference = $node->isReference ? '&' : ''; + $isVariadic = $node->isVariadic ? '...' : ''; + $isOptional = $node->isOptional ? '=' : ''; + return trim("{$type}{$isReference}{$isVariadic}{$node->parameterName}") . $isOptional; + } + if ($node instanceof DoctrineAnnotation) { + return (string) $node; + } + if ($node instanceof DoctrineArgument) { + return (string) $node; + } + if ($node instanceof DoctrineArray) { + return (string) $node; + } + if ($node instanceof DoctrineArrayItem) { + return (string) $node; + } + + throw new LogicException(sprintf('Unknown node type %s', get_class($node))); + } + + private function printTagValue(PhpDocTagValueNode $node): string + { + // only nodes that contain another node are handled here + // the rest falls back on (string) $node + + if ($node instanceof AssertTagMethodValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter}->{$node->method}() {$node->description}"); + } + if ($node instanceof AssertTagPropertyValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter}->{$node->property} {$node->description}"); + } + if ($node instanceof AssertTagValueNode) { + $isNegated = $node->isNegated ? '!' : ''; + $isEquality = $node->isEquality ? '=' : ''; + $type = $this->printType($node->type); + return trim("{$isNegated}{$isEquality}{$type} {$node->parameter} {$node->description}"); + } + if ($node instanceof ExtendsTagValueNode || $node instanceof ImplementsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof MethodTagValueNode) { + $static = $node->isStatic ? 'static ' : ''; + $returnType = $node->returnType !== null ? $this->printType($node->returnType) . ' ' : ''; + $parameters = implode(', ', array_map(function (MethodTagValueParameterNode $parameter): string { + return $this->print($parameter); + }, $node->parameters)); + $description = $node->description !== '' ? " {$node->description}" : ''; + $templateTypes = count($node->templateTypes) > 0 ? '<' . implode(', ', array_map(function (TemplateTagValueNode $templateTag): string { + return $this->print($templateTag); + }, $node->templateTypes)) . '>' : ''; + return "{$static}{$returnType}{$node->methodName}{$templateTypes}({$parameters}){$description}"; + } + if ($node instanceof MixinTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof RequireExtendsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof RequireImplementsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof ParamOutTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->parameterName} {$node->description}"); + } + if ($node instanceof ParamTagValueNode) { + $reference = $node->isReference ? '&' : ''; + $variadic = $node->isVariadic ? '...' : ''; + $type = $this->printType($node->type); + return trim("{$type} {$reference}{$variadic}{$node->parameterName} {$node->description}"); + } + if ($node instanceof ParamImmediatelyInvokedCallableTagValueNode) { + return trim("{$node->parameterName} {$node->description}"); + } + if ($node instanceof ParamLaterInvokedCallableTagValueNode) { + return trim("{$node->parameterName} {$node->description}"); + } + if ($node instanceof ParamClosureThisTagValueNode) { + return trim("{$node->type} {$node->parameterName} {$node->description}"); + } + if ($node instanceof PropertyTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->propertyName} {$node->description}"); + } + if ($node instanceof ReturnTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof SelfOutTagValueNode) { + $type = $this->printType($node->type); + return trim($type . ' ' . $node->description); + } + if ($node instanceof TemplateTagValueNode) { + $bound = $node->bound !== null ? ' of ' . $this->printType($node->bound) : ''; + $default = $node->default !== null ? ' = ' . $this->printType($node->default) : ''; + return trim("{$node->name}{$bound}{$default} {$node->description}"); + } + if ($node instanceof ThrowsTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof TypeAliasImportTagValueNode) { + return trim( + "{$node->importedAlias} from " . $this->printType($node->importedFrom) + . ($node->importedAs !== null ? " as {$node->importedAs}" : '') + ); + } + if ($node instanceof TypeAliasTagValueNode) { + $type = $this->printType($node->type); + return trim("{$node->alias} {$type}"); + } + if ($node instanceof UsesTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} {$node->description}"); + } + if ($node instanceof VarTagValueNode) { + $type = $this->printType($node->type); + return trim("{$type} " . trim("{$node->variableName} {$node->description}")); + } + + return (string) $node; + } + + private function printType(TypeNode $node): string + { + if ($node instanceof ArrayShapeNode) { + $items = array_map(function (ArrayShapeItemNode $item): string { + return $this->printType($item); + }, $node->items); + + if (! $node->sealed) { + $items[] = '...'; + } + + return $node->kind . '{' . implode(', ', $items) . '}'; + } + if ($node instanceof ArrayShapeItemNode) { + if ($node->keyName !== null) { + return sprintf( + '%s%s: %s', + $this->print($node->keyName), + $node->optional ? '?' : '', + $this->printType($node->valueType) + ); + } + + return $this->printType($node->valueType); + } + if ($node instanceof ArrayTypeNode) { + return $this->printOffsetAccessType($node->type) . '[]'; + } + if ($node instanceof CallableTypeNode) { + if ($node->returnType instanceof CallableTypeNode || $node->returnType instanceof UnionTypeNode || $node->returnType instanceof IntersectionTypeNode) { + $returnType = $this->wrapInParentheses($node->returnType); + } else { + $returnType = $this->printType($node->returnType); + } + $template = $node->templateTypes !== [] + ? '<' . implode(', ', array_map(function (TemplateTagValueNode $templateNode): string { + return $this->print($templateNode); + }, $node->templateTypes)) . '>' + : ''; + $parameters = implode(', ', array_map(function (CallableTypeParameterNode $parameterNode): string { + return $this->print($parameterNode); + }, $node->parameters)); + return "{$node->identifier}{$template}({$parameters}): {$returnType}"; + } + if ($node instanceof ConditionalTypeForParameterNode) { + return sprintf( + '(%s %s %s ? %s : %s)', + $node->parameterName, + $node->negated ? 'is not' : 'is', + $this->printType($node->targetType), + $this->printType($node->if), + $this->printType($node->else) + ); + } + if ($node instanceof ConditionalTypeNode) { + return sprintf( + '(%s %s %s ? %s : %s)', + $this->printType($node->subjectType), + $node->negated ? 'is not' : 'is', + $this->printType($node->targetType), + $this->printType($node->if), + $this->printType($node->else) + ); + } + if ($node instanceof ConstTypeNode) { + return $this->printConstExpr($node->constExpr); + } + if ($node instanceof GenericTypeNode) { + $genericTypes = []; + + foreach ($node->genericTypes as $index => $type) { + $variance = $node->variances[$index] ?? GenericTypeNode::VARIANCE_INVARIANT; + if ($variance === GenericTypeNode::VARIANCE_INVARIANT) { + $genericTypes[] = $this->printType($type); + } elseif ($variance === GenericTypeNode::VARIANCE_BIVARIANT) { + $genericTypes[] = '*'; + } else { + $genericTypes[] = sprintf('%s %s', $variance, $this->print($type)); + } + } + + return $node->type . '<' . implode(', ', $genericTypes) . '>'; + } + if ($node instanceof IdentifierTypeNode) { + return $node->name; + } + if ($node instanceof IntersectionTypeNode || $node instanceof UnionTypeNode) { + $items = []; + foreach ($node->types as $type) { + if ( + $type instanceof IntersectionTypeNode + || $type instanceof UnionTypeNode + || $type instanceof NullableTypeNode + ) { + $items[] = $this->wrapInParentheses($type); + continue; + } + + $items[] = $this->printType($type); + } + + return implode($node instanceof IntersectionTypeNode ? '&' : '|', $items); + } + if ($node instanceof InvalidTypeNode) { + return (string) $node; + } + if ($node instanceof NullableTypeNode) { + if ($node->type instanceof IntersectionTypeNode || $node->type instanceof UnionTypeNode) { + return '?(' . $this->printType($node->type) . ')'; + } + + return '?' . $this->printType($node->type); + } + if ($node instanceof ObjectShapeNode) { + $items = array_map(function (ObjectShapeItemNode $item): string { + return $this->printType($item); + }, $node->items); + + return 'object{' . implode(', ', $items) . '}'; + } + if ($node instanceof ObjectShapeItemNode) { + if ($node->keyName !== null) { + return sprintf( + '%s%s: %s', + $this->print($node->keyName), + $node->optional ? '?' : '', + $this->printType($node->valueType) + ); + } + + return $this->printType($node->valueType); + } + if ($node instanceof OffsetAccessTypeNode) { + return $this->printOffsetAccessType($node->type) . '[' . $this->printType($node->offset) . ']'; + } + if ($node instanceof ThisTypeNode) { + return (string) $node; + } + + throw new LogicException(sprintf('Unknown node type %s', get_class($node))); + } + + private function wrapInParentheses(TypeNode $node): string + { + return '(' . $this->printType($node) . ')'; + } + + private function printOffsetAccessType(TypeNode $type): string + { + if ( + $type instanceof CallableTypeNode + || $type instanceof UnionTypeNode + || $type instanceof IntersectionTypeNode + || $type instanceof NullableTypeNode + ) { + return $this->wrapInParentheses($type); + } + + return $this->printType($type); + } + + private function printConstExpr(ConstExprNode $node): string + { + // this is fine - ConstExprNode classes do not contain nodes that need smart printer logic + return (string) $node; + } + + /** + * @param Node[] $nodes + * @param Node[] $originalNodes + */ + private function printArrayFormatPreserving(array $nodes, array $originalNodes, TokenIterator $originalTokens, int &$tokenIndex, string $parentNodeClass, string $subNodeName): ?string + { + $diff = $this->differ->diffWithReplacements($originalNodes, $nodes); + $mapKey = $parentNodeClass . '->' . $subNodeName; + $insertStr = $this->listInsertionMap[$mapKey] ?? null; + $result = ''; + $beforeFirstKeepOrReplace = true; + $delayedAdd = []; + + $insertNewline = false; + [$isMultiline, $beforeAsteriskIndent, $afterAsteriskIndent] = $this->isMultiline($tokenIndex, $originalNodes, $originalTokens); + + if ($insertStr === "\n * ") { + $insertStr = sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } + + foreach ($diff as $i => $diffElem) { + $diffType = $diffElem->type; + $newNode = $diffElem->new; + $originalNode = $diffElem->old; + if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) { + $beforeFirstKeepOrReplace = false; + if (!$newNode instanceof Node || !$originalNode instanceof Node) { + return null; + } + $itemStartPos = $originalNode->getAttribute(Attribute::START_INDEX); + $itemEndPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($itemStartPos < 0 || $itemEndPos < 0 || $itemStartPos < $tokenIndex) { + throw new LogicException(); + } + + $result .= $originalTokens->getContentBetween($tokenIndex, $itemStartPos); + + if (count($delayedAdd) > 0) { + foreach ($delayedAdd as $delayedAddNode) { + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($delayedAddNode), $this->parenthesesListMap[$mapKey], true); + if ($parenthesesNeeded) { + $result .= '('; + } + $result .= $this->printNodeFormatPreserving($delayedAddNode, $originalTokens); + if ($parenthesesNeeded) { + $result .= ')'; + } + + if ($insertNewline) { + $result .= $insertStr . sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } else { + $result .= $insertStr; + } + } + + $delayedAdd = []; + } + + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($newNode), $this->parenthesesListMap[$mapKey], true) + && !in_array(get_class($originalNode), $this->parenthesesListMap[$mapKey], true); + $addParentheses = $parenthesesNeeded && !$originalTokens->hasParentheses($itemStartPos, $itemEndPos); + if ($addParentheses) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($newNode, $originalTokens); + if ($addParentheses) { + $result .= ')'; + } + $tokenIndex = $itemEndPos + 1; + + } elseif ($diffType === DiffElem::TYPE_ADD) { + if ($insertStr === null) { + return null; + } + if (!$newNode instanceof Node) { + return null; + } + + if ($insertStr === ', ' && $isMultiline) { + $insertStr = ','; + $insertNewline = true; + } + + if ($beforeFirstKeepOrReplace) { + // Will be inserted at the next "replace" or "keep" element + $delayedAdd[] = $newNode; + continue; + } + + $itemEndPos = $tokenIndex - 1; + if ($insertNewline) { + $result .= $insertStr . sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } else { + $result .= $insertStr; + } + + $parenthesesNeeded = isset($this->parenthesesListMap[$mapKey]) + && in_array(get_class($newNode), $this->parenthesesListMap[$mapKey], true); + if ($parenthesesNeeded) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($newNode, $originalTokens); + if ($parenthesesNeeded) { + $result .= ')'; + } + + $tokenIndex = $itemEndPos + 1; + + } elseif ($diffType === DiffElem::TYPE_REMOVE) { + if (!$originalNode instanceof Node) { + return null; + } + + $itemStartPos = $originalNode->getAttribute(Attribute::START_INDEX); + $itemEndPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($itemStartPos < 0 || $itemEndPos < 0) { + throw new LogicException(); + } + + if ($i === 0) { + // If we're removing from the start, keep the tokens before the node and drop those after it, + // instead of the other way around. + $originalTokensArray = $originalTokens->getTokens(); + for ($j = $tokenIndex; $j < $itemStartPos; $j++) { + if ($originalTokensArray[$j][Lexer::TYPE_OFFSET] === Lexer::TOKEN_PHPDOC_EOL) { + break; + } + $result .= $originalTokensArray[$j][Lexer::VALUE_OFFSET]; + } + } + + $tokenIndex = $itemEndPos + 1; + } + } + + if (count($delayedAdd) > 0) { + if (!isset($this->emptyListInsertionMap[$mapKey])) { + return null; + } + + [$findToken, $extraLeft, $extraRight] = $this->emptyListInsertionMap[$mapKey]; + if ($findToken !== null) { + $originalTokensArray = $originalTokens->getTokens(); + for (; $tokenIndex < count($originalTokensArray); $tokenIndex++) { + $result .= $originalTokensArray[$tokenIndex][Lexer::VALUE_OFFSET]; + if ($originalTokensArray[$tokenIndex][Lexer::VALUE_OFFSET] !== $findToken) { + continue; + } + + $tokenIndex++; + break; + } + } + $first = true; + $result .= $extraLeft; + foreach ($delayedAdd as $delayedAddNode) { + if (!$first) { + $result .= $insertStr; + if ($insertNewline) { + $result .= sprintf('%s%s*%s', $originalTokens->getDetectedNewline() ?? "\n", $beforeAsteriskIndent, $afterAsteriskIndent); + } + } + + $result .= $this->printNodeFormatPreserving($delayedAddNode, $originalTokens); + $first = false; + } + $result .= $extraRight; + } + + return $result; + } + + /** + * @param Node[] $nodes + * @return array{bool, string, string} + */ + private function isMultiline(int $initialIndex, array $nodes, TokenIterator $originalTokens): array + { + $isMultiline = count($nodes) > 1; + $pos = $initialIndex; + $allText = ''; + /** @var Node|null $node */ + foreach ($nodes as $node) { + if (!$node instanceof Node) { + continue; + } + + $endPos = $node->getAttribute(Attribute::END_INDEX) + 1; + $text = $originalTokens->getContentBetween($pos, $endPos); + $allText .= $text; + if (strpos($text, "\n") === false) { + // We require that a newline is present between *every* item. If the formatting + // is inconsistent, with only some items having newlines, we don't consider it + // as multiline + $isMultiline = false; + } + $pos = $endPos; + } + + $c = preg_match_all('~\n(?[\\x09\\x20]*)\*(?\\x20*)~', $allText, $matches, PREG_SET_ORDER); + if ($c === 0) { + return [$isMultiline, '', '']; + } + + $before = ''; + $after = ''; + foreach ($matches as $match) { + if (strlen($match['before']) > strlen($before)) { + $before = $match['before']; + } + if (strlen($match['after']) <= strlen($after)) { + continue; + } + + $after = $match['after']; + } + + return [$isMultiline, $before, $after]; + } + + private function printNodeFormatPreserving(Node $node, TokenIterator $originalTokens): string + { + /** @var Node|null $originalNode */ + $originalNode = $node->getAttribute(Attribute::ORIGINAL_NODE); + if ($originalNode === null) { + return $this->print($node); + } + + $class = get_class($node); + if ($class !== get_class($originalNode)) { + throw new LogicException(); + } + + $startPos = $originalNode->getAttribute(Attribute::START_INDEX); + $endPos = $originalNode->getAttribute(Attribute::END_INDEX); + if ($startPos < 0 || $endPos < 0) { + throw new LogicException(); + } + + $result = ''; + $pos = $startPos; + $subNodeNames = array_keys(get_object_vars($node)); + foreach ($subNodeNames as $subNodeName) { + $subNode = $node->$subNodeName; + $origSubNode = $originalNode->$subNodeName; + + if ( + (!$subNode instanceof Node && $subNode !== null) + || (!$origSubNode instanceof Node && $origSubNode !== null) + ) { + if ($subNode === $origSubNode) { + // Unchanged, can reuse old code + continue; + } + + if (is_array($subNode) && is_array($origSubNode)) { + // Array subnode changed, we might be able to reconstruct it + $listResult = $this->printArrayFormatPreserving( + $subNode, + $origSubNode, + $originalTokens, + $pos, + $class, + $subNodeName + ); + + if ($listResult === null) { + return $this->print($node); + } + + $result .= $listResult; + continue; + } + + return $this->print($node); + } + + if ($origSubNode === null) { + if ($subNode === null) { + // Both null, nothing to do + continue; + } + + return $this->print($node); + } + + $subStartPos = $origSubNode->getAttribute(Attribute::START_INDEX); + $subEndPos = $origSubNode->getAttribute(Attribute::END_INDEX); + if ($subStartPos < 0 || $subEndPos < 0) { + throw new LogicException(); + } + + if ($subEndPos < $subStartPos) { + return $this->print($node); + } + + if ($subNode === null) { + return $this->print($node); + } + + $result .= $originalTokens->getContentBetween($pos, $subStartPos); + $mapKey = get_class($node) . '->' . $subNodeName; + $parenthesesNeeded = isset($this->parenthesesMap[$mapKey]) + && in_array(get_class($subNode), $this->parenthesesMap[$mapKey], true); + + if ($subNode->getAttribute(Attribute::ORIGINAL_NODE) !== null) { + $parenthesesNeeded = $parenthesesNeeded + && !in_array(get_class($subNode->getAttribute(Attribute::ORIGINAL_NODE)), $this->parenthesesMap[$mapKey], true); + } + + $addParentheses = $parenthesesNeeded && !$originalTokens->hasParentheses($subStartPos, $subEndPos); + if ($addParentheses) { + $result .= '('; + } + + $result .= $this->printNodeFormatPreserving($subNode, $originalTokens); + if ($addParentheses) { + $result .= ')'; + } + + $pos = $subEndPos + 1; + } + + return $result . $originalTokens->getContentBetween($pos, $endPos + 1); + } + +} diff --git a/vendor/slevomat/coding-standard/.editorconfig b/vendor/slevomat/coding-standard/.editorconfig new file mode 100644 index 0000000..a604040 --- /dev/null +++ b/vendor/slevomat/coding-standard/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = tab +insert_final_newline = true +tab_width = 4 +trim_trailing_whitespace = true diff --git a/vendor/slevomat/coding-standard/.typos.toml b/vendor/slevomat/coding-standard/.typos.toml new file mode 100644 index 0000000..5f43f72 --- /dev/null +++ b/vendor/slevomat/coding-standard/.typos.toml @@ -0,0 +1,10 @@ +[files] +extend-exclude = [ + ".git/", +] +ignore-hidden = false + +[default] +extend-ignore-re = [ + "const BA =", +] diff --git a/vendor/slevomat/coding-standard/CODE_OF_CONDUCT.md b/vendor/slevomat/coding-standard/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..162e250 --- /dev/null +++ b/vendor/slevomat/coding-standard/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project maintainer at . All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/node_modules/table/node_modules/color-name/LICENSE b/vendor/slevomat/coding-standard/LICENSE.md similarity index 95% rename from node_modules/table/node_modules/color-name/LICENSE rename to vendor/slevomat/coding-standard/LICENSE.md index c6b1001..5e1e4be 100644 --- a/node_modules/table/node_modules/color-name/LICENSE +++ b/vendor/slevomat/coding-standard/LICENSE.md @@ -1,8 +1,8 @@ -The MIT License (MIT) -Copyright (c) 2015 Dmitry Ivanov - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +The MIT License (MIT) +Copyright (c) 2015 Slevomat.cz, s.r.o. + +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/vendor/slevomat/coding-standard/README.md b/vendor/slevomat/coding-standard/README.md new file mode 100644 index 0000000..c13bde5 --- /dev/null +++ b/vendor/slevomat/coding-standard/README.md @@ -0,0 +1,319 @@ +# Slevomat Coding Standard + +[![Latest version](https://img.shields.io/packagist/v/slevomat/coding-standard.svg?colorB=007EC6)](https://packagist.org/packages/slevomat/coding-standard) +[![Downloads](https://img.shields.io/packagist/dt/slevomat/coding-standard.svg?colorB=007EC6)](https://packagist.org/packages/slevomat/coding-standard) +[![Build status](https://github.com/slevomat/coding-standard/workflows/Build/badge.svg?branch=master)](https://github.com/slevomat/coding-standard/actions?query=workflow%3ABuild+branch%3Amaster) +[![Code coverage](https://codecov.io/gh/slevomat/coding-standard/branch/master/graph/badge.svg)](https://codecov.io/gh/slevomat/coding-standard) +![PHPStan](https://img.shields.io/badge/style-level%207-brightgreen.svg?&label=phpstan) + +Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) provides sniffs that fall into three categories: + +* Functional - improving the safety and behaviour of code +* Cleaning - detecting dead code +* Formatting - rules for consistent code looks + +## Table of contents + +1. [Alphabetical list of sniffs](#alphabetical-list-of-sniffs) +2. [Installation](#installation) +3. [How to run the sniffs](#how-to-run-the-sniffs) + - [Choose which sniffs to run](#choose-which-sniffs-to-run) + - [Exclude sniffs you don't want to run](#exclude-sniffs-you-dont-want-to-run) +4. [Fixing errors automatically](#fixing-errors-automatically) +5. [Suppressing sniffs locally](#suppressing-sniffs-locally) +6. [Contributing](#contributing) + +## Alphabetical list of sniffs + +🔧 = [Automatic errors fixing](#fixing-errors-automatically) + +🚧 = [Sniff check can be suppressed locally](#suppressing-sniffs-locally) + + - [SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys](doc/arrays.md#slevomatcodingstandardarrayalphabeticallysortedbykeys) 🔧 + - [SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation](doc/arrays.md#slevomatcodingstandardarraysdisallowimplicitarraycreation) + - [SlevomatCodingStandard.Arrays.DisallowPartiallyKeyed](doc/arrays.md#slevomatcodingstandardarraysdisallowpartiallykeyed) 🚧 + - [SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement](doc/arrays.md#slevomatcodingstandardarraysmultilinearrayendbracketplacement-) 🔧 + - [SlevomatCodingStandard.Arrays.ArrayAccessSniff.php](doc/arrays.md#slevomatcodingstandardarraysarrayaccess-) 🔧 + - [SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace](doc/arrays.md#slevomatcodingstandardarrayssinglelinearraywhitespace-) 🔧 + - [SlevomatCodingStandard.Arrays.TrailingArrayComma](doc/arrays.md#slevomatcodingstandardarraystrailingarraycomma-) 🔧 + - [SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing](doc/attributes.md#slevomatcodingstandardattributesattributeandtargetspacing-) 🔧 + - [SlevomatCodingStandard.Attributes.AttributesOrder](doc/attributes.md#slevomatcodingstandardattributesattributesorder-) 🔧 + - [SlevomatCodingStandard.Attributes.DisallowAttributesJoining](doc/attributes.md#slevomatcodingstandardattributesdisallowattributesjoining-) 🔧 + - [SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine](doc/attributes.md#slevomatcodingstandardattributesdisallowmultipleattributesperline-) 🔧 + - [SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment](doc/attributes.md#slevomatcodingstandardattributesrequireattributeafterdoccomment-) 🔧 + - [SlevomatCodingStandard.Classes.BackedEnumTypeSpacing](doc/classes.md#slevomatcodingstandardclassesbackedenumtypespacing-) 🔧 + - [SlevomatCodingStandard.Classes.ClassConstantVisibility](doc/classes.md#slevomatcodingstandardclassesclassconstantvisibility-) 🔧 + - [SlevomatCodingStandard.Classes.ClassLength](doc/classes.md#slevomatcodingstandardclassesclasslength) + - [SlevomatCodingStandard.Classes.ClassMemberSpacing](doc/classes.md#slevomatcodingstandardclassesclassmemberspacing-) 🔧 + - [SlevomatCodingStandard.Classes.ClassStructure](doc/classes.md#slevomatcodingstandardclassesclassstructure-) 🔧 + - [SlevomatCodingStandard.Classes.ConstantSpacing](doc/classes.md#slevomatcodingstandardclassesconstantspacing-) 🔧 + - [SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion](doc/classes.md#slevomatcodingstandardclassesdisallowconstructorpropertypromotion) + - [SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants](doc/classes.md#slevomatcodingstandardclassesdisallowlatestaticbindingforconstants-) 🔧 + - [SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition](doc/classes.md#slevomatcodingstandardclassesdisallowmulticonstantdefinition-) 🔧 + - [SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition](doc/classes.md#slevomatcodingstandardclassesdisallowmultipropertydefinition-) 🔧 + - [SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch](doc/classes.md#slevomatcodingstandardclassesdisallowstringexpressionpropertyfetch-) 🔧 + - [SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces](doc/classes.md#slevomatcodingstandardclassesemptylinesaroundclassbraces-) 🔧 + - [SlevomatCodingStandard.Classes.EnumCaseSpacing](doc/classes.md#slevomatcodingstandardclassesenumcasespacing-) 🔧 + - [SlevomatCodingStandard.Classes.ForbiddenPublicProperty](doc/classes.md#slevomatcodingstandardclassesforbiddenpublicproperty) + - [SlevomatCodingStandard.Classes.MethodSpacing](doc/classes.md#slevomatcodingstandardclassesmethodspacing-) 🔧 + - [SlevomatCodingStandard.Classes.ModernClassNameReference](doc/classes.md#slevomatcodingstandardclassesmodernclassnamereference-) 🔧 + - [SlevomatCodingStandard.Classes.ParentCallSpacing](doc/classes.md#slevomatcodingstandardclassesparentcallspacing-) 🔧 + - [SlevomatCodingStandard.Classes.PropertyDeclaration](doc/classes.md#slevomatcodingstandardclassespropertydeclaration-) 🔧 + - [SlevomatCodingStandard.Classes.PropertySpacing](doc/classes.md#slevomatcodingstandardclassespropertyspacing-) 🔧 + - [SlevomatCodingStandard.Classes.RequireAbstractOrFinal](doc/classes.md#slevomatcodingstandardclassesrequireabstractorfinal-) 🔧 + - [SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion](doc/classes.md#slevomatcodingstandardclassesrequireconstructorpropertypromotion-) 🔧 + - [SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature](doc/classes.md#slevomatcodingstandardclassesrequiremultilinemethodsignature-) 🔧 + - [SlevomatCodingStandard.Classes.RequireSelfReference](doc/classes.md#slevomatcodingstandardclassesrequireselfreference-) 🔧 + - [SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature](doc/classes.md#slevomatcodingstandardclassesrequiresinglelinemethodsignature-) 🔧 + - [SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming](doc/classes.md#slevomatcodingstandardclassessuperfluousabstractclassnaming) + - [SlevomatCodingStandard.Classes.SuperfluousErrorNaming](doc/classes.md#slevomatcodingstandardclassessuperfluouserrornaming) + - [SlevomatCodingStandard.Classes.SuperfluousExceptionNaming](doc/classes.md#slevomatcodingstandardclassessuperfluousexceptionnaming) + - [SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming](doc/classes.md#slevomatcodingstandardclassessuperfluousinterfacenaming) + - [SlevomatCodingStandard.Classes.SuperfluousTraitNaming](doc/classes.md#slevomatcodingstandardclassessuperfluoustraitnaming) + - [SlevomatCodingStandard.Classes.TraitUseDeclaration](doc/classes.md#slevomatcodingstandardclassestraitusedeclaration-) 🔧 + - [SlevomatCodingStandard.Classes.TraitUseSpacing](doc/classes.md#slevomatcodingstandardclassestraitusespacing-) 🔧 + - [SlevomatCodingStandard.Classes.UselessLateStaticBinding](doc/classes.md#slevomatcodingstandardclassesuselesslatestaticbinding-) 🔧 + - [SlevomatCodingStandard.Commenting.AnnotationName](doc/commenting.md#slevomatcodingstandardcommentingannotationname-) + - [SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration](doc/commenting.md#slevomatcodingstandardcommentingdeprecatedannotationdeclaration) + - [SlevomatCodingStandard.Commenting.DisallowCommentAfterCode](doc/commenting.md#slevomatcodingstandardcommentingdisallowcommentaftercode-) 🔧 + - [SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment](doc/commenting.md#slevomatcodingstandardcommentingdisallowonelinepropertydoccomment-) 🔧 + - [SlevomatCodingStandard.Commenting.DocCommentSpacing](doc/commenting.md#slevomatcodingstandardcommentingdoccommentspacing-) 🔧 + - [SlevomatCodingStandard.Commenting.EmptyComment](doc/commenting.md#slevomatcodingstandardcommentingemptycomment-) 🔧 + - [SlevomatCodingStandard.Commenting.ForbiddenAnnotations](doc/commenting.md#slevomatcodingstandardcommentingforbiddenannotations-) 🔧 + - [SlevomatCodingStandard.Commenting.ForbiddenComments](doc/commenting.md#slevomatcodingstandardcommentingforbiddencomments-) 🔧 + - [SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration](doc/commenting.md#slevomatcodingstandardcommentinginlinedoccommentdeclaration-) 🔧 + - [SlevomatCodingStandard.Commenting.RequireOneLineDocComment](doc/commenting.md#slevomatcodingstandardcommentingrequireonelinedoccomment-) 🔧 + - [SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment](doc/commenting.md#slevomatcodingstandardcommentingrequireonelinepropertydoccomment-) 🔧 + - [SlevomatCodingStandard.Commenting.UselessFunctionDocComment](doc/commenting.md#slevomatcodingstandardcommentinguselessfunctiondoccomment-) 🔧 + - [SlevomatCodingStandard.Commenting.UselessInheritDocComment](doc/commenting.md#slevomatcodingstandardcommentinguselessinheritdoccomment-) 🔧 + - [SlevomatCodingStandard.Complexity.Cognitive](doc/complexity.md#slevomatcodingstandardcomplexitycognitive) + - [SlevomatCodingStandard.ControlStructures.AssignmentInCondition](doc/control-structures.md#slevomatcodingstandardcontrolstructuresassignmentincondition) + - [SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing](doc/control-structures.md#slevomatcodingstandardcontrolstructuresblockcontrolstructurespacing-) 🔧 + - [SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowcontinuewithoutintegeroperandinswitch-) 🔧 + - [SlevomatCodingStandard.ControlStructures.DisallowEmpty](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowempty) + - [SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallownullsafeobjectoperator) + - [SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowshortternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperatorSniff](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowtrailingmultilineternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.DisallowYodaComparison](doc/control-structures.md#slevomatcodingstandardcontrolstructuresdisallowyodacomparison-) 🔧 + - [SlevomatCodingStandard.ControlStructures.EarlyExit](doc/control-structures.md#slevomatcodingstandardcontrolstructuresearlyexit-) 🔧 + - [SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing](doc/control-structures.md#slevomatcodingstandardcontrolstructuresjumpstatementsspacing-) 🔧 + - [SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses](doc/control-structures.md#slevomatcodingstandardcontrolstructureslanguageconstructwithparentheses-) 🔧 + - [SlevomatCodingStandard.ControlStructures.NewWithParentheses](doc/control-structures.md#slevomatcodingstandardcontrolstructuresnewwithparentheses-) 🔧 + - [SlevomatCodingStandard.ControlStructures.NewWithoutParentheses](doc/control-structures.md#slevomatcodingstandardcontrolstructuresnewwithoutparentheses-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireMultiLineCondition](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequiremultilinecondition-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequiremultilineternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequirenullcoalesceequaloperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequirenullcoalesceoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequirenullsafeobjectoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequireshortternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequiresinglelinecondition-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequireternaryoperator-) 🔧 + - [SlevomatCodingStandard.ControlStructures.RequireYodaComparison](doc/control-structures.md#slevomatcodingstandardcontrolstructuresrequireyodacomparison-) 🔧 + - [SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn](doc/control-structures.md#slevomatcodingstandardcontrolstructuresuselessifconditionwithreturn-) 🔧 + - [SlevomatCodingStandard.ControlStructures.UselessTernaryOperator](doc/control-structures.md#slevomatcodingstandardcontrolstructuresuselessternaryoperator-) 🔧 + - [SlevomatCodingStandard.Exceptions.DeadCatch](doc/exceptions.md#slevomatcodingstandardexceptionsdeadcatch) + - [SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch](doc/exceptions.md#slevomatcodingstandardexceptionsdisallownoncapturingcatch) + - [SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly](doc/exceptions.md#slevomatcodingstandardexceptionsreferencethrowableonly-) 🔧🚧 + - [SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch](doc/exceptions.md#slevomatcodingstandardexceptionsrequirenoncapturingcatch-) 🔧 + - [SlevomatCodingStandard.Files.FileLength](doc/files.md#slevomatcodingstandardfilesfilelength) + - [SlevomatCodingStandard.Files.LineLength](doc/files.md#slevomatcodingstandardfileslinelength) + - [SlevomatCodingStandard.Files.TypeNameMatchesFileName](doc/files.md#slevomatcodingstandardfilestypenamematchesfilename) + - [SlevomatCodingStandard.Functions.ArrowFunctionDeclaration](doc/functions.md#slevomatcodingstandardfunctionsarrowfunctiondeclaration-) 🔧 + - [SlevomatCodingStandard.Functions.DisallowArrowFunction](doc/functions.md#slevomatcodingstandardfunctionsdisallowarrowfunction) + - [SlevomatCodingStandard.Functions.DisallowEmptyFunction](doc/functions.md#slevomatcodingstandardfunctionsdisallowemptyfunction) + - [SlevomatCodingStandard.Functions.DisallowNamedArguments](doc/functions.md#slevomatcodingstandardfunctionsdisallownamedarguments) + - [SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall](doc/functions.md#slevomatcodingstandardfunctionsdisallowtrailingcommaincall-) 🔧 + - [SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse](doc/functions.md#slevomatcodingstandardfunctionsdisallowtrailingcommainclosureuse-) 🔧 + - [SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration](doc/functions.md#slevomatcodingstandardfunctionsdisallowtrailingcommaindeclaration-) 🔧 + - [SlevomatCodingStandard.Functions.FunctionLength](doc/functions.md#slevomatcodingstandardfunctionsfunctionlength) + - [SlevomatCodingStandard.Functions.NamedArgumentSpacing](doc/functions.md#slevomatcodingstandardfunctionsnamedargumentspacing-) 🔧 + - [SlevomatCodingStandard.Functions.RequireArrowFunction](doc/functions.md#slevomatcodingstandardfunctionsrequirearrowfunction-) 🔧 + - [SlevomatCodingStandard.Functions.RequireMultiLineCall](doc/functions.md#slevomatcodingstandardfunctionsrequiremultilinecall-) 🔧 + - [SlevomatCodingStandard.Functions.RequireSingleLineCall](doc/functions.md#slevomatcodingstandardfunctionsrequiresinglelinecall-) 🔧 + - [SlevomatCodingStandard.Functions.RequireTrailingCommaInCall](doc/functions.md#slevomatcodingstandardfunctionsrequiretrailingcommaincall-) 🔧 + - [SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse](doc/functions.md#slevomatcodingstandardfunctionsrequiretrailingcommainclosureuse-) 🔧 + - [SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration](doc/functions.md#slevomatcodingstandardfunctionsrequiretrailingcommaindeclaration-) 🔧 + - [SlevomatCodingStandard.Functions.StaticClosure](doc/functions.md#slevomatcodingstandardfunctionsstaticclosure-) 🔧 + - [SlevomatCodingStandard.Functions.StrictCall](doc/functions.md#slevomatcodingstandardfunctionsstrictcall) + - [SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure](doc/functions.md#slevomatcodingstandardfunctionsunusedinheritedvariablepassedtoclosure-) 🔧 + - [SlevomatCodingStandard.Functions.UnusedParameter](doc/functions.md#slevomatcodingstandardfunctionsunusedparameter-) 🚧 + - [SlevomatCodingStandard.Functions.UselessParameterDefaultValue](doc/functions.md#slevomatcodingstandardfunctionsuselessparameterdefaultvalue-) 🚧 + - [SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses](doc/namespaces.md#slevomatcodingstandardnamespacesalphabeticallysorteduses-) 🔧 + - [SlevomatCodingStandard.Namespaces.DisallowGroupUse](doc/namespaces.md#slevomatcodingstandardnamespacesdisallowgroupuse) + - [SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation](doc/namespaces.md#slevomatcodingstandardnamespacesfullyqualifiedclassnameinannotation-) 🔧 + - [SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions](doc/namespaces.md#slevomatcodingstandardnamespacesfullyqualifiedexceptions-) 🔧 + - [SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants](doc/namespaces.md#slevomatcodingstandardnamespacesfullyqualifiedglobalconstants-) 🔧 + - [SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions](doc/namespaces.md#slevomatcodingstandardnamespacesfullyqualifiedglobalfunctions-) 🔧 + - [SlevomatCodingStandard.Namespaces.MultipleUsesPerLine](doc/namespaces.md#slevomatcodingstandardnamespacesmultipleusesperline) + - [SlevomatCodingStandard.Namespaces.NamespaceDeclaration](doc/namespaces.md#slevomatcodingstandardnamespacesnamespacedeclaration-) 🔧 + - [SlevomatCodingStandard.Namespaces.NamespaceSpacing](doc/namespaces.md#slevomatcodingstandardnamespacesnamespacespacing-) 🔧 + - [SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly](doc/namespaces.md#slevomatcodingstandardnamespacesreferenceusednamesonly-) 🔧 + - [SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile](doc/namespaces.md#slevomatcodingstandardnamespacesrequireonenamespaceinfile) + - [SlevomatCodingStandard.Namespaces.UnusedUses](doc/namespaces.md#slevomatcodingstandardnamespacesunuseduses-) 🔧 + - [SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash](doc/namespaces.md#slevomatcodingstandardnamespacesusedoesnotstartwithbackslash-) 🔧 + - [SlevomatCodingStandard.Namespaces.UseFromSameNamespace](doc/namespaces.md#slevomatcodingstandardnamespacesusefromsamenamespace-) 🔧 + - [SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces](doc/namespaces.md#slevomatcodingstandardnamespacesuseonlywhitelistednamespaces) + - [SlevomatCodingStandard.Namespaces.UseSpacing](doc/namespaces.md#slevomatcodingstandardnamespacesusespacing-) 🔧 + - [SlevomatCodingStandard.Namespaces.UselessAlias](doc/namespaces.md#slevomatcodingstandardnamespacesuselessalias-) 🔧 + - [SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator](doc/numbers.md#slevomatcodingstandardnumbersdisallownumericliteralseparator-) 🔧 + - [SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator](doc/numbers.md#slevomatcodingstandardnumbersrequirenumericliteralseparator) + - [SlevomatCodingStandard.Operators.DisallowEqualOperators](doc/operators.md#slevomatcodingstandardoperatorsdisallowequaloperators-) 🔧 + - [SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators](doc/operators.md#slevomatcodingstandardoperatorsdisallowincrementanddecrementoperators) + - [SlevomatCodingStandard.Operators.NegationOperatorSpacing](doc/operators.md#slevomatcodingstandardoperatorsnegationoperatorspacing-) 🔧 + - [SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator](doc/operators.md#slevomatcodingstandardoperatorsrequirecombinedassignmentoperator-) 🔧 + - [SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators](doc/operators.md#slevomatcodingstandardoperatorsrequireonlystandaloneincrementanddecrementoperators) + - [SlevomatCodingStandard.Operators.SpreadOperatorSpacing](doc/operators.md#slevomatcodingstandardoperatorsspreadoperatorspacing-) 🔧 + - [SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall](doc/php.md#slevomatcodingstandardphpdisallowdirectmagicinvokecall-) 🔧 + - [SlevomatCodingStandard.PHP.DisallowReference](doc/php.md#slevomatcodingstandardphpdisallowreference) + - [SlevomatCodingStandard.PHP.ForbiddenClasses](doc/php.md#slevomatcodingstandardphpforbiddenclasses-) 🔧 + - [SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking](doc/php.md#slevomatcodingstandardphpoptimizedfunctionswithoutunpacking) + - [SlevomatCodingStandard.PHP.ReferenceSpacing](doc/php.md#slevomatcodingstandardphpreferencespacing-) 🔧 + - [SlevomatCodingStandard.PHP.RequireExplicitAssertion](doc/php.md#slevomatcodingstandardphprequireexplicitassertion-) 🔧 + - [SlevomatCodingStandard.PHP.RequireNowdoc](doc/php.md#slevomatcodingstandardphprequirenowdoc-) 🔧 + - [SlevomatCodingStandard.PHP.ShortList](doc/php.md#slevomatcodingstandardphpshortlist-) 🔧 + - [SlevomatCodingStandard.PHP.TypeCast](doc/php.md#slevomatcodingstandardphptypecast-) 🔧 + - [SlevomatCodingStandard.PHP.UselessParentheses](doc/php.md#slevomatcodingstandardphpuselessparentheses-) 🔧 + - [SlevomatCodingStandard.PHP.UselessSemicolon](doc/php.md#slevomatcodingstandardphpuselesssemicolon-) 🔧 + - [SlevomatCodingStandard.Strings.DisallowVariableParsing](doc/strings.md#slevomatcodingstandardstringsdisallowvariableparsing) + - [SlevomatCodingStandard.TypeHints.DeclareStrictTypes](doc/type-hints.md#slevomatcodingstandardtypehintsdeclarestricttypes-) 🔧 + - [SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax](doc/type-hints.md#slevomatcodingstandardtypehintsdisallowarraytypehintsyntax-) 🔧 + - [SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsdisallowmixedtypehint) + - [SlevomatCodingStandard.TypeHints.LongTypeHints](doc/type-hints.md#slevomatcodingstandardtypehintslongtypehints-) 🔧 + - [SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition](doc/type-hints.md#slevomatcodingstandardtypehintsnulltypehintonlastposition-) 🔧 + - [SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue](doc/type-hints.md#slevomatcodingstandardtypehintsnullabletypefornulldefaultvalue-) 🔧🚧 + - [SlevomatCodingStandard.TypeHints.ParameterTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsparametertypehint-) 🔧🚧 + - [SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing](doc/type-hints.md#slevomatcodingstandardtypehintsparametertypehintspacing-) 🔧 + - [SlevomatCodingStandard.TypeHints.PropertyTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintspropertytypehint-) 🔧🚧 + - [SlevomatCodingStandard.TypeHints.ReturnTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsreturntypehint-) 🔧🚧 + - [SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing](doc/type-hints.md#slevomatcodingstandardtypehintsreturntypehintspacing-) 🔧 + - [SlevomatCodingStandard.TypeHints.UnionTypeHintFormat](doc/type-hints.md#slevomatcodingstandardtypehintsuniontypehintformat-) 🔧 + - [SlevomatCodingStandard.TypeHints.UselessConstantTypeHint](doc/type-hints.md#slevomatcodingstandardtypehintsuselessconstanttypehint-) 🔧 + - [SlevomatCodingStandard.Variables.DisallowVariableVariable](doc/variables.md#slevomatcodingstandardvariablesdisallowvariablevariable) + - [SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable](doc/variables.md#slevomatcodingstandardvariablesdisallowsuperglobalvariable) + - [SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable](doc/variables.md#slevomatcodingstandardvariablesduplicateassignmenttovariable) + - [SlevomatCodingStandard.Variables.UnusedVariable](doc/variables.md#slevomatcodingstandardvariablesunusedvariable) + - [SlevomatCodingStandard.Variables.UselessVariable](doc/variables.md#slevomatcodingstandardvariablesuselessvariable-) 🔧 + - [SlevomatCodingStandard.Whitespaces.DuplicateSpaces](doc/whitespaces.md#slevomatcodingstandardwhitespacesduplicatespaces-) 🔧 + +## Installation + +The recommended way to install Slevomat Coding Standard is [through Composer](http://getcomposer.org). + +```JSON +{ + "require-dev": { + "slevomat/coding-standard": "~8.0" + } +} +``` + +It's also recommended to install [php-parallel-lint/php-parallel-lint](https://github.com/php-parallel-lint/PHP-Parallel-Lint) which checks source code for syntax errors. Sniffs count on the processed code to be syntactically valid (no parse errors), otherwise they can behave unexpectedly. It is advised to run `PHP-Parallel-Lint` in your build tool before running `PHP_CodeSniffer` and exiting the build process early if `PHP-Parallel-Lint` fails. + +## How to run the sniffs + +You can choose one of two ways to run only selected sniffs from the standard on your codebase: + +### Choose which sniffs to run + +The recommended way is to write your own ruleset.xml by referencing only the selected sniffs. This is a sample ruleset.xml: + +```xml + + + + + + +``` + +Then run the `phpcs` executable the usual way: + +``` +vendor/bin/phpcs --standard=ruleset.xml --extensions=php --tab-width=4 -sp src tests +``` + +### Exclude sniffs you don't want to run + +You can also mention Slevomat Coding Standard in your project's `ruleset.xml` and exclude only some sniffs: + +```xml + + + + + + +``` + +However it is not a recommended way to use Slevomat Coding Standard, because your build can break when moving between minor versions of the standard (which can happen if you use `^` or `~` version constraint in `composer.json`). We regularly add new sniffs even in minor versions meaning your code won't most likely comply with new minor versions of the package. + +## Fixing errors automatically + +Sniffs in this standard marked by the 🔧 symbol support [automatic fixing of coding standard violations](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically). To fix your code automatically, run phpcbf instead of phpcs: + +``` +vendor/bin/phpcbf --standard=ruleset.xml --extensions=php --tab-width=4 -sp src tests +``` + +Always remember to back up your code before performing automatic fixes and check the results with your own eyes as the automatic fixer can sometimes produce unwanted results. + +## Suppressing sniffs locally + +Selected sniffs in this standard marked by the 🚧 symbol can be suppressed for a specific piece of code using an annotation. Consider the following example: + +```php +/** + * @param int $max + */ +public function createProgressBar($max = 0): ProgressBar +{ + +} +``` + +The parameter `$max` could have a native `int` scalar typehint. But because the method in the parent class does not have this typehint, so this one cannot have it either. PHP_CodeSniffer shows a following error: + +``` +---------------------------------------------------------------------- +FOUND 1 ERROR AFFECTING 1 LINE +---------------------------------------------------------------------- + 67 | ERROR | [x] Method ErrorsConsoleStyle::createProgressBar() + | | does not have native type hint for its parameter $max + | | but it should be possible to add it based on @param + | | annotation "int". + | | (SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint) +``` + +If we want to suppress this error instead of fixing it, we can take the error code (`SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint`) and use it with a `@phpcsSuppress` annotation like this: + +```php +/** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $max + */ +public function createProgressBar($max = 0): ProgressBar +{ + +} +``` + +## Contributing + +To make this repository work on your machine, clone it and run these two commands in the root directory of the repository: + +``` +composer install +bin/phing +``` + +After writing some code and editing or adding unit tests, run phing again to check that everything is OK: + +``` +bin/phing +``` + +We are always looking forward to your bugreports, feature requests and pull requests. Thank you. + +## Code of Conduct + +This project adheres to a [Contributor Code of Conduct](https://github.com/slevomat/coding-standard/blob/master/CODE_OF_CONDUCT.md). By participating in this project and its community, you are expected to uphold this code. diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php new file mode 100644 index 0000000..d5b6343 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php @@ -0,0 +1,66 @@ +node = $node; + $this->startPointer = $startPointer; + $this->endPointer = $endPointer; + } + + public function getNode(): PhpDocTagNode + { + return $this->node; + } + + public function getName(): string + { + return $this->node->name; + } + + /** + * @return T + */ + public function getValue(): PhpDocTagValueNode + { + /** @phpstan-ignore-next-line */ + return $this->node->value; + } + + public function getStartPointer(): int + { + return $this->startPointer; + } + + public function getEndPointer(): int + { + return $this->endPointer; + } + + public function isInvalid(): bool + { + return $this->node->value instanceof InvalidTagValueNode; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php new file mode 100644 index 0000000..108a4e3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php @@ -0,0 +1,366 @@ + + */ + public static function getAnnotations(File $phpcsFile, int $pointer, ?string $name = null): array + { + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $pointer); + if ($docCommentOpenPointer === null) { + return []; + } + + return SniffLocalCache::getAndSetIfNotCached( + $phpcsFile, + sprintf('annotations-%d-%s', $docCommentOpenPointer, $name ?? 'all'), + static function () use ($phpcsFile, $docCommentOpenPointer, $name): array { + $annotations = []; + + if ($name !== null) { + foreach (self::getAnnotations($phpcsFile, $docCommentOpenPointer) as $annotation) { + if ($annotation->getName() === $name) { + $annotations[] = $annotation; + } + } + } else { + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment !== null) { + foreach ($parsedDocComment->getNode()->getTags() as $node) { + $annotationStartPointer = $parsedDocComment->getNodeStartPointer($phpcsFile, $node); + $annotations[] = new Annotation( + $node, + $annotationStartPointer, + $parsedDocComment->getNodeEndPointer($phpcsFile, $node, $annotationStartPointer) + ); + } + } + } + + return $annotations; + } + ); + } + + /** + * @param class-string $type + * @return list + */ + public static function getAnnotationNodesByType(Node $node, string $type): array + { + static $visitor; + static $traverser; + + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { + + /** @var class-string */ + private $type; + + /** @var list */ + private $nodes = []; + + /** @var list */ + private $nodesToIgnore = []; + + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($this->type === IdentifierTypeNode::class) { + if ($node instanceof ArrayShapeItemNode || $node instanceof ObjectShapeItemNode) { + $this->nodesToIgnore[] = $node->keyName; + } elseif ($node instanceof DoctrineArgument) { + $this->nodesToIgnore[] = $node->key; + } + } + + if ($node instanceof $this->type && !in_array($node, $this->nodesToIgnore, true)) { + $this->nodes[] = $node; + } + + return null; + } + + /** + * @param class-string $type + */ + public function setType(string $type): void + { + $this->type = $type; + } + + public function clean(): void + { + $this->nodes = []; + $this->nodesToIgnore = []; + } + + /** + * @return list + */ + public function getNodes(): array + { + return $this->nodes; + } + + }; + } + + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); + } + + $visitor->setType($type); + $visitor->clean(); + + $traverser->traverse([$node]); + + return $visitor->getNodes(); + } + + public static function fixAnnotation( + ParsedDocComment $parsedDocComment, + Annotation $annotation, + Node $nodeToFix, + Node $fixedNode + ): string + { + $originalNode = $annotation->getNode(); + + /** @var PhpDocNode $newPhpDocNode */ + $newPhpDocNode = PhpDocParserHelper::cloneNode($parsedDocComment->getNode()); + + foreach ($newPhpDocNode->getTags() as $node) { + if ($node->getAttribute(Attribute::ORIGINAL_NODE) === $originalNode) { + self::changeAnnotationNode($node, $nodeToFix, $fixedNode); + break; + } + } + + return PhpDocParserHelper::getPrinter()->printFormatPreserving( + $newPhpDocNode, + $parsedDocComment->getNode(), + $parsedDocComment->getTokens() + ); + } + + /** + * @param array $traversableTypeHints + */ + public static function isAnnotationUseless( + File $phpcsFile, + int $functionPointer, + ?TypeHint $typeHint, + Annotation $annotation, + array $traversableTypeHints, + bool $enableUnionTypeHint = false, + bool $enableIntersectionTypeHint = false, + bool $enableStandaloneNullTrueFalseTypeHints = false + ): bool + { + if ($annotation->isInvalid()) { + return false; + } + + if ($typeHint === null) { + return false; + } + + /** @var ParamTagValueNode|TypelessParamTagValueNode|ReturnTagValueNode|VarTagValueNode $annotationValue */ + $annotationValue = $annotation->getValue(); + + if ($annotationValue->description !== '') { + return false; + } + + if ($annotationValue instanceof TypelessParamTagValueNode) { + return true; + } + + $annotationType = $annotationValue->type; + + if ( + TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $functionPointer, $typeHint->getTypeHintWithoutNullabilitySymbol()), + $traversableTypeHints + ) + && !( + $annotationType instanceof IdentifierTypeNode + && TypeHintHelper::isSimpleIterableTypeHint(strtolower($annotationType->name)) + ) + ) { + return false; + } + + if (AnnotationTypeHelper::containsStaticOrThisType($annotationType)) { + return false; + } + + if ( + AnnotationTypeHelper::containsJustTwoTypes($annotationType) + || ( + $enableUnionTypeHint + && ( + $annotationType instanceof UnionTypeNode + || ( + $annotationType instanceof IdentifierTypeNode + && TypeHintHelper::isUnofficialUnionTypeHint($annotationType->name) + ) + ) + ) + || ( + $enableIntersectionTypeHint + && $annotationType instanceof IntersectionTypeNode + ) + ) { + $annotationTypeHint = AnnotationTypeHelper::print($annotationType); + return TypeHintHelper::typeHintEqualsAnnotation( + $phpcsFile, + $functionPointer, + $typeHint->getTypeHint(), + $annotationTypeHint + ); + } + + if ($annotationType instanceof ObjectShapeNode) { + return false; + } + + if ($annotationType instanceof ConstTypeNode) { + return false; + } + + if ($annotationType instanceof GenericTypeNode) { + return false; + } + + if ($annotationType instanceof CallableTypeNode) { + return false; + } + + if ($annotationType instanceof ConditionalTypeNode) { + return false; + } + + if ($annotationType instanceof ConditionalTypeForParameterNode) { + return false; + } + + if ($annotationType instanceof IdentifierTypeNode) { + if (in_array( + strtolower($annotationType->name), + ['true', 'false', 'null'], + true + )) { + return $enableStandaloneNullTrueFalseTypeHints; + } + + if (in_array( + strtolower($annotationType->name), + ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'non-falsy-string', 'literal-string', 'positive-int', 'negative-int'], + true + )) { + return false; + } + } + + $annotationTypeHint = AnnotationTypeHelper::getTypeHintFromOneType($annotationType); + return TypeHintHelper::typeHintEqualsAnnotation( + $phpcsFile, + $functionPointer, + $typeHint->getTypeHintWithoutNullabilitySymbol(), + $annotationTypeHint + ); + } + + private static function changeAnnotationNode(PhpDocTagNode $tagNode, Node $nodeToChange, Node $changedNode): PhpDocTagNode + { + static $visitor; + static $traverser; + + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { + + /** @var Node */ + private $nodeToChange; + + /** @var Node */ + private $changedNode; + + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($node->getAttribute(Attribute::ORIGINAL_NODE) === $this->nodeToChange) { + return $this->changedNode; + } + + return null; + } + + public function setNodeToChange(Node $nodeToChange): void + { + $this->nodeToChange = $nodeToChange; + } + + public function setChangedNode(Node $changedNode): void + { + $this->changedNode = $changedNode; + } + + }; + } + + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); + } + + $visitor->setNodeToChange($nodeToChange); + $visitor->setChangedNode($changedNode); + + [$changedTagNode] = $traverser->traverse([$tagNode]); + + return $changedTagNode; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php new file mode 100644 index 0000000..058c5b3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php @@ -0,0 +1,409 @@ +print($typeNode); + } + + public static function containsStaticOrThisType(TypeNode $typeNode): bool + { + if ($typeNode instanceof ThisTypeNode) { + return true; + } + + if ($typeNode instanceof IdentifierTypeNode) { + return strtolower($typeNode->name) === 'static'; + } + + if ( + $typeNode instanceof UnionTypeNode + || $typeNode instanceof IntersectionTypeNode + ) { + foreach ($typeNode->types as $innerTypeNode) { + if (self::containsStaticOrThisType($innerTypeNode)) { + return true; + } + } + } + + return false; + } + + public static function containsOneType(TypeNode $typeNode): bool + { + if ($typeNode instanceof IdentifierTypeNode) { + return true; + } + + if ($typeNode instanceof ThisTypeNode) { + return true; + } + + if ($typeNode instanceof GenericTypeNode) { + return true; + } + + if ($typeNode instanceof CallableTypeNode) { + return true; + } + + if ($typeNode instanceof ObjectShapeNode) { + return true; + } + + if ($typeNode instanceof ArrayShapeNode) { + return true; + } + + if ($typeNode instanceof ArrayTypeNode) { + return true; + } + + if ($typeNode instanceof ConstTypeNode) { + if ($typeNode->constExpr instanceof ConstExprIntegerNode) { + return true; + } + + if ($typeNode->constExpr instanceof ConstExprFloatNode) { + return true; + } + + if ($typeNode->constExpr instanceof ConstExprStringNode) { + return true; + } + } + + return false; + } + + public static function containsJustTwoTypes(TypeNode $typeNode): bool + { + if ($typeNode instanceof NullableTypeNode && self::containsOneType($typeNode->type)) { + return true; + } + + if ( + !$typeNode instanceof UnionTypeNode + && !$typeNode instanceof IntersectionTypeNode + ) { + return false; + } + + return count($typeNode->types) === 2; + } + + /** + * @param array $traversableTypeHints + */ + public static function containsTraversableType(TypeNode $typeNode, File $phpcsFile, int $pointer, array $traversableTypeHints): bool + { + if ($typeNode instanceof GenericTypeNode) { + return true; + } + + if ($typeNode instanceof ObjectShapeNode) { + return false; + } + + if ($typeNode instanceof ArrayShapeNode) { + return true; + } + + if ($typeNode instanceof ArrayTypeNode) { + return true; + } + + if ($typeNode instanceof IdentifierTypeNode) { + $fullyQualifiedType = TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $pointer, $typeNode->name); + return TypeHintHelper::isTraversableType($fullyQualifiedType, $traversableTypeHints); + } + + if ( + $typeNode instanceof UnionTypeNode + || $typeNode instanceof IntersectionTypeNode + ) { + foreach ($typeNode->types as $innerTypeNode) { + if (self::containsTraversableType($innerTypeNode, $phpcsFile, $pointer, $traversableTypeHints)) { + return true; + } + } + } + + return + ( + $typeNode instanceof ConditionalTypeNode + || $typeNode instanceof ConditionalTypeForParameterNode + ) && ( + self::containsTraversableType($typeNode->if, $phpcsFile, $pointer, $traversableTypeHints) + || self::containsTraversableType($typeNode->else, $phpcsFile, $pointer, $traversableTypeHints) + ); + } + + /** + * @param array $traversableTypeHints + */ + public static function containsItemsSpecificationForTraversable( + TypeNode $typeNode, + File $phpcsFile, + int $pointer, + array $traversableTypeHints, + bool $inTraversable = false + ): bool + { + if ($typeNode instanceof GenericTypeNode) { + foreach ($typeNode->genericTypes as $genericType) { + if (!self::containsItemsSpecificationForTraversable($genericType, $phpcsFile, $pointer, $traversableTypeHints, true)) { + return false; + } + } + + return true; + } + + if ($typeNode instanceof ArrayShapeNode) { + foreach ($typeNode->items as $arrayShapeItemNode) { + if (!self::containsItemsSpecificationForTraversable( + $arrayShapeItemNode->valueType, + $phpcsFile, + $pointer, + $traversableTypeHints, + true + )) { + return false; + } + } + + return true; + } + + if ($typeNode instanceof NullableTypeNode) { + return self::containsItemsSpecificationForTraversable($typeNode->type, $phpcsFile, $pointer, $traversableTypeHints, true); + } + + if ($typeNode instanceof IdentifierTypeNode) { + if (TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $pointer, $typeNode->name)) { + // We can expect it's better type for traversable + return true; + } + + if (!$inTraversable) { + return false; + } + + return !TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $pointer, $typeNode->name), + $traversableTypeHints + ); + } + + if ($typeNode instanceof ConstTypeNode) { + return $inTraversable; + } + + if ($typeNode instanceof CallableTypeNode) { + return $inTraversable; + } + + if ($typeNode instanceof ArrayTypeNode) { + return self::containsItemsSpecificationForTraversable($typeNode->type, $phpcsFile, $pointer, $traversableTypeHints, true); + } + + if ( + $typeNode instanceof UnionTypeNode + || $typeNode instanceof IntersectionTypeNode + ) { + foreach ($typeNode->types as $innerTypeNode) { + if ( + !$inTraversable + && $innerTypeNode instanceof IdentifierTypeNode + && strtolower($innerTypeNode->name) === 'null' + ) { + continue; + } + + if (self::containsItemsSpecificationForTraversable( + $innerTypeNode, + $phpcsFile, + $pointer, + $traversableTypeHints, + $inTraversable + )) { + return true; + } + } + } + + if ($typeNode instanceof ConditionalTypeNode || $typeNode instanceof ConditionalTypeForParameterNode) { + return + self::containsItemsSpecificationForTraversable($typeNode->if, $phpcsFile, $pointer, $traversableTypeHints, $inTraversable) + || self::containsItemsSpecificationForTraversable( + $typeNode->else, + $phpcsFile, + $pointer, + $traversableTypeHints, + $inTraversable + ); + } + + return false; + } + + public static function getTypeHintFromOneType( + TypeNode $typeNode, + bool $enableUnionTypeHint = false, + bool $enableStandaloneNullTrueFalseTypeHints = false + ): string + { + if ($typeNode instanceof GenericTypeNode) { + $genericName = $typeNode->type->name; + + if (in_array(strtolower($genericName), ['non-empty-array', 'list', 'non-empty-list'], true)) { + return 'array'; + } + + return $genericName; + } + + if ($typeNode instanceof IdentifierTypeNode) { + if (strtolower($typeNode->name) === 'true') { + return $enableStandaloneNullTrueFalseTypeHints ? 'true' : 'bool'; + } + + if (strtolower($typeNode->name) === 'false') { + return $enableUnionTypeHint || $enableStandaloneNullTrueFalseTypeHints ? 'false' : 'bool'; + } + + if (in_array(strtolower($typeNode->name), ['positive-int', 'negative-int'], true)) { + return 'int'; + } + + if (in_array( + strtolower($typeNode->name), + ['class-string', 'trait-string', 'callable-string', 'numeric-string', 'non-empty-string', 'non-falsy-string', 'literal-string'], + true + )) { + return 'string'; + } + + return $typeNode->name; + } + + if ($typeNode instanceof CallableTypeNode) { + return $typeNode->identifier->name; + } + + if ($typeNode instanceof ArrayTypeNode) { + return 'array'; + } + + if ($typeNode instanceof ArrayShapeNode) { + return 'array'; + } + + if ($typeNode instanceof ObjectShapeNode) { + return 'object'; + } + + if ($typeNode instanceof ConstTypeNode) { + if ($typeNode->constExpr instanceof ConstExprIntegerNode) { + return 'int'; + } + + if ($typeNode->constExpr instanceof ConstExprFloatNode) { + return 'float'; + } + + if ($typeNode->constExpr instanceof ConstExprStringNode) { + return 'string'; + } + } + + return (string) $typeNode; + } + + /** + * @param UnionTypeNode|IntersectionTypeNode $typeNode + * @param array $traversableTypeHints + * @return list + */ + public static function getTraversableTypeHintsFromType( + TypeNode $typeNode, + File $phpcsFile, + int $pointer, + array $traversableTypeHints, + bool $enableUnionTypeHint = false + ): array + { + $typeHints = []; + + foreach ($typeNode->types as $type) { + if ( + $type instanceof GenericTypeNode + || $type instanceof ThisTypeNode + || $type instanceof IdentifierTypeNode + ) { + $typeHints[] = self::getTypeHintFromOneType($type); + } + } + + if (!$enableUnionTypeHint && count($typeHints) > 1) { + return []; + } + + foreach ($typeHints as $typeHint) { + if (!TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $pointer, $typeHint), + $traversableTypeHints + )) { + return []; + } + } + + return $typeHints; + } + + /** + * @param UnionTypeNode|IntersectionTypeNode $typeNode + */ + public static function getItemsSpecificationTypeFromType(TypeNode $typeNode): ?TypeNode + { + foreach ($typeNode->types as $type) { + if ($type instanceof ArrayTypeNode) { + return $type; + } + } + + return null; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php new file mode 100644 index 0000000..8bf354b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayHelper.php @@ -0,0 +1,232 @@ + + */ + public static function parse(File $phpcsFile, int $arrayPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $arrayToken = $tokens[$arrayPointer]; + [$arrayOpenerPointer, $arrayCloserPointer] = self::openClosePointers($arrayToken); + + $keyValues = []; + + $firstPointerOnNextLine = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $arrayOpenerPointer + 1); + $firstEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $arrayOpenerPointer + 1); + + $arrayKeyValueStartPointer = $firstPointerOnNextLine !== null && $firstPointerOnNextLine < $firstEffectivePointer + ? $firstPointerOnNextLine + : $firstEffectivePointer; + $arrayKeyValueEndPointer = $arrayKeyValueStartPointer; + + $indentation = $tokens[$arrayOpenerPointer]['line'] < $tokens[$firstEffectivePointer]['line'] + ? IndentationHelper::getIndentation($phpcsFile, $firstEffectivePointer) + : ''; + + for ($i = $arrayKeyValueStartPointer; $i < $arrayCloserPointer; $i++) { + $token = $tokens[$i]; + + if (in_array($token['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = self::openClosePointers($token)[1]; + continue; + } + + if (array_key_exists('scope_closer', $token) && $token['scope_closer'] > $i) { + $i = $token['scope_closer'] - 1; + continue; + } + + if (array_key_exists('parenthesis_closer', $token) && $token['parenthesis_closer'] > $i) { + $i = $token['parenthesis_closer'] - 1; + continue; + } + + $nextEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + + if ($nextEffectivePointer === $arrayCloserPointer) { + $arrayKeyValueEndPointer = self::getValueEndPointer($phpcsFile, $i, $arrayCloserPointer, $indentation); + break; + } + + if ($token['code'] !== T_COMMA || !ScopeHelper::isInSameScope($phpcsFile, $arrayOpenerPointer, $i)) { + $arrayKeyValueEndPointer = $i; + continue; + } + + $arrayKeyValueEndPointer = self::getValueEndPointer($phpcsFile, $i, $arrayCloserPointer, $indentation); + + $keyValues[] = new ArrayKeyValue($phpcsFile, $arrayKeyValueStartPointer, $arrayKeyValueEndPointer); + + $arrayKeyValueStartPointer = $arrayKeyValueEndPointer + 1; + $i = $arrayKeyValueEndPointer; + } + + $keyValues[] = new ArrayKeyValue($phpcsFile, $arrayKeyValueStartPointer, $arrayKeyValueEndPointer); + + return $keyValues; + } + + /** + * @param list $keyValues + */ + public static function getIndentation(array $keyValues): ?string + { + $indents = []; + foreach ($keyValues as $keyValue) { + $indent = $keyValue->getIndent() ?? 'null'; + $indents[$indent] = isset($indents[$indent]) + ? $indents[$indent] + 1 + : 1; + } + arsort($indents); + $indent = key($indents); + return $indent !== 'null' + ? (string) $indent + : null; + } + + /** + * @param list $keyValues + */ + public static function isKeyed(array $keyValues): bool + { + foreach ($keyValues as $keyValue) { + if ($keyValue->getKey() !== null) { + return true; + } + } + return false; + } + + /** + * @param list $keyValues + */ + public static function isKeyedAll(array $keyValues): bool + { + foreach ($keyValues as $keyValue) { + if (!$keyValue->isUnpacking() && $keyValue->getKey() === null) { + return false; + } + } + return true; + } + + /** + * Test if non-empty array with opening & closing brackets on separate lines + */ + public static function isMultiLine(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$pointer]; + [$pointerOpener, $pointerCloser] = self::openClosePointers($token); + $tokenOpener = $tokens[$pointerOpener]; + $tokenCloser = $tokens[$pointerCloser]; + + return $tokenOpener['line'] !== $tokenCloser['line']; + } + + /** + * Test if effective tokens between open & closing tokens + */ + public static function isNotEmpty(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$pointer]; + [$pointerOpener, $pointerCloser] = self::openClosePointers($token); + + /** @var int $pointerPreviousToClose */ + $pointerPreviousToClose = TokenHelper::findPreviousEffective($phpcsFile, $pointerCloser - 1); + + return $pointerPreviousToClose !== $pointerOpener; + } + + /** + * @param list $keyValues + */ + public static function isSortedByKey(array $keyValues): bool + { + $previousKey = ''; + foreach ($keyValues as $keyValue) { + if ($keyValue->isUnpacking()) { + continue; + } + + if (strnatcasecmp($previousKey, $keyValue->getKey()) === 1) { + return false; + } + + $previousKey = $keyValue->getKey(); + } + + return true; + } + + /** + * @param array|int|string> $token + * @return array{0: int, 1: int} + */ + public static function openClosePointers(array $token): array + { + $isShortArray = $token['code'] === T_OPEN_SHORT_ARRAY; + $pointerOpener = $isShortArray + ? $token['bracket_opener'] + : $token['parenthesis_opener']; + $pointerCloser = $isShortArray + ? $token['bracket_closer'] + : $token['parenthesis_closer']; + return [(int) $pointerOpener, (int) $pointerCloser]; + } + + private static function getValueEndPointer(File $phpcsFile, int $endPointer, int $arrayCloserPointer, string $indentation): int + { + $tokens = $phpcsFile->getTokens(); + + $nextEffectivePointer = TokenHelper::findNextEffective($phpcsFile, $endPointer + 1, $arrayCloserPointer + 1); + + if ($tokens[$nextEffectivePointer]['line'] === $tokens[$endPointer]['line']) { + return $nextEffectivePointer - 1; + } + + for ($i = $endPointer + 1; $i < $nextEffectivePointer; $i++) { + if ($tokens[$i]['line'] === $tokens[$endPointer]['line']) { + $endPointer = $i; + continue; + } + + $nextNonWhitespacePointer = TokenHelper::findNextNonWhitespace($phpcsFile, $i); + + if (!in_array($tokens[$nextNonWhitespacePointer]['code'], TokenHelper::$inlineCommentTokenCodes, true)) { + break; + } + + if ($indentation === IndentationHelper::getIndentation($phpcsFile, $nextNonWhitespacePointer)) { + $endPointer = $i - 1; + break; + } + + $i = TokenHelper::findLastTokenOnLine($phpcsFile, $i); + $endPointer = $i; + } + + return $endPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php new file mode 100644 index 0000000..3588426 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ArrayKeyValue.php @@ -0,0 +1,172 @@ +pointerStart = $pointerStart; + $this->pointerEnd = $pointerEnd; + $this->addValues($phpcsFile); + } + + public function getContent(File $phpcsFile, bool $normalize = false, ?string $indent = null): string + { + if ($normalize === false) { + return TokenHelper::getContent($phpcsFile, $this->pointerStart, $this->pointerEnd); + } + $content = ''; + $addCommaPtr = $this->pointerComma === null + ? TokenHelper::findPreviousEffective($phpcsFile, $this->pointerEnd) + : null; + $tokens = $phpcsFile->getTokens(); + for ($pointer = $this->pointerStart; $pointer <= $this->pointerEnd; $pointer++) { + $token = $tokens[$pointer]; + $content .= $token['content']; + if ($pointer === $addCommaPtr) { + $content .= ','; + } + } + + // Trim, but keep leading empty lines + $content = ltrim($content, " \t"); + $content = rtrim($content); + + if ($indent !== null && strpos($content, $phpcsFile->eolChar) !== 0) { + $content = $indent . $content; + } + + return $content; + } + + public function getIndent(): ?string + { + return $this->indent; + } + + public function getKey(): ?string + { + return $this->key; + } + + public function getPointerArrow(): ?int + { + return $this->pointerArrow; + } + + public function getPointerComma(): ?int + { + return $this->pointerComma; + } + + public function getPointerEnd(): int + { + return $this->pointerEnd; + } + + public function getPointerStart(): int + { + return $this->pointerStart; + } + + public function isUnpacking(): bool + { + return $this->unpacking; + } + + private function addValues(File $phpcsFile): void + { + $key = ''; + $tokens = $phpcsFile->getTokens(); + $firstNonWhitespace = null; + + for ($i = $this->pointerStart; $i <= $this->pointerEnd; $i++) { + $token = $tokens[$i]; + + if (in_array($token['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = ArrayHelper::openClosePointers($token)[1]; + continue; + } + + if ($token['code'] === T_DOUBLE_ARROW) { + $this->pointerArrow = $i; + continue; + } + + if ($token['code'] === T_COMMA) { + $this->pointerComma = $i; + continue; + + } + + if ($token['code'] === T_ELLIPSIS) { + $this->unpacking = true; + continue; + } + + if ($this->pointerArrow !== null) { + continue; + } + + if ($firstNonWhitespace === null && $token['code'] !== T_WHITESPACE) { + $firstNonWhitespace = $i; + } + + if (in_array($token['code'], TokenHelper::$inlineCommentTokenCodes, true) === false) { + $key .= $token['content']; + } + } + $haveIndent = $firstNonWhitespace !== null && TokenHelper::findFirstNonWhitespaceOnLine( + $phpcsFile, + $firstNonWhitespace + ) === $firstNonWhitespace; + $this->indent = $haveIndent + ? TokenHelper::getContent( + $phpcsFile, + TokenHelper::findFirstTokenOnLine($phpcsFile, $firstNonWhitespace), + $firstNonWhitespace - 1 + ) + : null; + $this->key = $this->pointerArrow !== null + ? trim($key) + : null; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Attribute.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Attribute.php new file mode 100644 index 0000000..bc6cb89 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Attribute.php @@ -0,0 +1,60 @@ +attributePointer = $attributePointer; + $this->name = $name; + $this->startPointer = $startPointer; + $this->endPointer = $endPointer; + $this->content = $content; + } + + public function getAttributePointer(): int + { + return $this->attributePointer; + } + + public function getName(): string + { + return $this->name; + } + + public function getStartPointer(): int + { + return $this->startPointer; + } + + public function getEndPointer(): int + { + return $this->endPointer; + } + + public function getContent(): ?string + { + return $this->content; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php new file mode 100644 index 0000000..c5ce72e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AttributeHelper.php @@ -0,0 +1,153 @@ + + */ + public static function getAttributes(File $phpcsFile, int $attributeOpenerPointer): array + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$attributeOpenerPointer]['code'] !== T_ATTRIBUTE) { + throw new InvalidArgumentException( + sprintf('Token %d must be attribute, %s given.', $attributeOpenerPointer, $tokens[$attributeOpenerPointer]['type']) + ); + } + + $attributeCloserPointer = $tokens[$attributeOpenerPointer]['attribute_closer']; + + $actualPointer = $attributeOpenerPointer; + $attributes = []; + + do { + $attributeNameStartPointer = TokenHelper::findNextEffective($phpcsFile, $actualPointer + 1, $attributeCloserPointer); + + if ($attributeNameStartPointer === null) { + break; + } + + $attributeNameEndPointer = TokenHelper::findNextExcluding( + $phpcsFile, + TokenHelper::getNameTokenCodes(), + $attributeNameStartPointer + 1 + ) - 1; + $attributeName = TokenHelper::getContent($phpcsFile, $attributeNameStartPointer, $attributeNameEndPointer); + + $pointerAfterAttributeName = TokenHelper::findNextEffective($phpcsFile, $attributeNameEndPointer + 1, $attributeCloserPointer); + + if ($pointerAfterAttributeName === null) { + $attributes[] = new Attribute( + $attributeOpenerPointer, + $attributeName, + $attributeNameStartPointer, + $attributeNameEndPointer + ); + break; + } + + if ($tokens[$pointerAfterAttributeName]['code'] === T_COMMA) { + $attributes[] = new Attribute( + $attributeOpenerPointer, + $attributeName, + $attributeNameStartPointer, + $attributeNameEndPointer + ); + + $actualPointer = $pointerAfterAttributeName; + } + + if ($tokens[$pointerAfterAttributeName]['code'] === T_OPEN_PARENTHESIS) { + $attributes[] = new Attribute( + $attributeOpenerPointer, + $attributeName, + $attributeNameStartPointer, + $tokens[$pointerAfterAttributeName]['parenthesis_closer'], + TokenHelper::getContent( + $phpcsFile, + $pointerAfterAttributeName, + $tokens[$pointerAfterAttributeName]['parenthesis_closer'] + ) + ); + + $actualPointer = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$pointerAfterAttributeName]['parenthesis_closer'] + 1, + $attributeCloserPointer + ); + + continue; + } + + } while ($actualPointer !== null); + + return $attributes; + } + + /** + * Attributes have syntax that when defined incorrectly or in older PHP version, they are treated as comments. + * An example of incorrect declaration is variables that are not properties. + */ + public static function isValidAttribute(File $phpcsFile, int $attributeOpenerPointer): bool + { + return self::getAttributeTarget($phpcsFile, $attributeOpenerPointer) !== null; + } + + public static function getAttributeTarget(File $phpcsFile, int $attributeOpenerPointer): ?int + { + $attributeTargetPointer = TokenHelper::findNext($phpcsFile, self::ATTRIBUTE_TARGETS, $attributeOpenerPointer); + + if ($attributeTargetPointer === null) { + return null; + } + + if ( + $phpcsFile->getTokens()[$attributeTargetPointer]['code'] === T_VARIABLE + && !PropertyHelper::isProperty($phpcsFile, $attributeTargetPointer) + && !ParameterHelper::isParameter($phpcsFile, $attributeTargetPointer) + ) { + return null; + } + + return $attributeTargetPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php new file mode 100644 index 0000000..b188b40 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CatchHelper.php @@ -0,0 +1,83 @@ +getTokens(); + + $endPointer = $tokens[$catchPointer]['scope_closer']; + + do { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $endPointer + 1); + + if ($nextPointer === null || !in_array($tokens[$nextPointer]['code'], [T_CATCH, T_FINALLY], true)) { + break; + } + + $endPointer = $tokens[$nextPointer]['scope_closer']; + + } while (true); + + return $endPointer; + } + + /** + * @param array|int|string> $catchToken + * @return list + */ + public static function findCaughtTypesInCatch(File $phpcsFile, array $catchToken): array + { + /** @var int $catchParenthesisOpenerPointer */ + $catchParenthesisOpenerPointer = $catchToken['parenthesis_opener']; + /** @var int $catchParenthesisCloserPointer */ + $catchParenthesisCloserPointer = $catchToken['parenthesis_closer']; + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + $nameEndPointer = $catchParenthesisOpenerPointer; + $tokens = $phpcsFile->getTokens(); + $caughtTypes = []; + do { + $nameStartPointer = TokenHelper::findNext( + $phpcsFile, + array_merge([T_BITWISE_OR], $nameTokenCodes), + $nameEndPointer + 1, + $catchParenthesisCloserPointer + ); + if ($nameStartPointer === null) { + break; + } + + if ($tokens[$nameStartPointer]['code'] === T_BITWISE_OR) { + /** @var int $nameStartPointer */ + $nameStartPointer = TokenHelper::findNextEffective($phpcsFile, $nameStartPointer + 1, $catchParenthesisCloserPointer); + } + + $pointerAfterNameEndPointer = TokenHelper::findNextExcluding($phpcsFile, $nameTokenCodes, $nameStartPointer + 1); + $nameEndPointer = $pointerAfterNameEndPointer === null ? $nameStartPointer : $pointerAfterNameEndPointer - 1; + + $caughtTypes[] = NamespaceHelper::resolveClassName( + $phpcsFile, + TokenHelper::getContent($phpcsFile, $nameStartPointer, $nameEndPointer), + $catchParenthesisOpenerPointer + ); + } while (true); + + return $caughtTypes; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php new file mode 100644 index 0000000..8683e71 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php @@ -0,0 +1,120 @@ +getTokens(); + + $classPointers = array_reverse(self::getAllClassPointers($phpcsFile)); + foreach ($classPointers as $classPointer) { + if ($tokens[$classPointer]['scope_opener'] < $pointer && $tokens[$classPointer]['scope_closer'] > $pointer) { + return $classPointer; + } + } + + return null; + } + + public static function isFinal(File $phpcsFile, int $classPointer): bool + { + return $phpcsFile->getTokens()[TokenHelper::findPreviousEffective($phpcsFile, $classPointer - 1)]['code'] === T_FINAL; + } + + public static function getFullyQualifiedName(File $phpcsFile, int $classPointer): string + { + $className = self::getName($phpcsFile, $classPointer); + + $tokens = $phpcsFile->getTokens(); + if ($tokens[$classPointer]['code'] === T_ANON_CLASS) { + return $className; + } + + $name = sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $className); + $namespace = NamespaceHelper::findCurrentNamespaceName($phpcsFile, $classPointer); + return $namespace !== null ? sprintf('%s%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $namespace, $name) : $name; + } + + public static function getName(File $phpcsFile, int $classPointer): string + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$classPointer]['code'] === T_ANON_CLASS) { + return 'class@anonymous'; + } + + return $tokens[TokenHelper::findNext($phpcsFile, T_STRING, $classPointer + 1, $tokens[$classPointer]['scope_opener'])]['content']; + } + + /** + * @return array + */ + public static function getAllNames(File $phpcsFile): array + { + $tokens = $phpcsFile->getTokens(); + + $names = []; + /** @var int $classPointer */ + foreach (self::getAllClassPointers($phpcsFile) as $classPointer) { + if ($tokens[$classPointer]['code'] === T_ANON_CLASS) { + continue; + } + + $names[$classPointer] = self::getName($phpcsFile, $classPointer); + } + + return $names; + } + + /** + * @return list + */ + public static function getTraitUsePointers(File $phpcsFile, int $classPointer): array + { + $useStatements = []; + + $tokens = $phpcsFile->getTokens(); + + $scopeLevel = $tokens[$classPointer]['level'] + 1; + for ($i = $tokens[$classPointer]['scope_opener'] + 1; $i < $tokens[$classPointer]['scope_closer']; $i++) { + if ($tokens[$i]['code'] !== T_USE) { + continue; + } + + if ($tokens[$i]['level'] !== $scopeLevel) { + continue; + } + + $useStatements[] = $i; + } + + return $useStatements; + } + + /** + * @return list + */ + private static function getAllClassPointers(File $phpcsFile): array + { + $lazyValue = static function () use ($phpcsFile): array { + return TokenHelper::findNextAll($phpcsFile, TokenHelper::$typeWithAnonymousClassKeywordTokenCodes, 0); + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'classPointers', $lazyValue); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Comment.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Comment.php new file mode 100644 index 0000000..7a9fd3f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Comment.php @@ -0,0 +1,33 @@ +pointer = $pointer; + $this->content = $content; + } + + public function getPointer(): int + { + return $this->pointer; + } + + public function getContent(): string + { + return $this->content; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CommentHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CommentHelper.php new file mode 100644 index 0000000..3b8cb92 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/CommentHelper.php @@ -0,0 +1,102 @@ +getTokens()[$commentPointer]['content']); + } + + public static function getCommentEndPointer(File $phpcsFile, int $commentStartPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if (array_key_exists('comment_closer', $tokens[$commentStartPointer])) { + return $tokens[$commentStartPointer]['comment_closer']; + } + + if (self::isLineComment($phpcsFile, $commentStartPointer)) { + return $commentStartPointer; + } + + if (strpos($tokens[$commentStartPointer]['content'], '/*') !== 0) { + // Part of block comment + return null; + } + + $commentEndPointer = $commentStartPointer; + + for ($i = $commentStartPointer + 1; $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['code'] === T_COMMENT) { + $commentEndPointer = $i; + continue; + } + + if (in_array($tokens[$i]['code'], Tokens::$phpcsCommentTokens, true)) { + $commentEndPointer = $i; + continue; + } + + break; + } + + return $commentEndPointer; + } + + public static function getMultilineCommentStartPointer(File $phpcsFile, int $commentEndPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $commentStartPointer = $commentEndPointer; + do { + $commentBefore = TokenHelper::findPrevious($phpcsFile, TokenHelper::$inlineCommentTokenCodes, $commentStartPointer - 1); + if ($commentBefore === null) { + break; + } + if ($tokens[$commentBefore]['line'] + 1 !== $tokens[$commentStartPointer]['line']) { + break; + } + + /** @var int $commentStartPointer */ + $commentStartPointer = $commentBefore; + } while (true); + + return $commentStartPointer; + } + + public static function getMultilineCommentEndPointer(File $phpcsFile, int $commentStartPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $commentEndPointer = $commentStartPointer; + do { + $commentAfter = TokenHelper::findNext($phpcsFile, TokenHelper::$inlineCommentTokenCodes, $commentEndPointer + 1); + if ($commentAfter === null) { + break; + } + if ($tokens[$commentAfter]['line'] - 1 !== $tokens[$commentEndPointer]['line']) { + break; + } + + /** @var int $commentEndPointer */ + $commentEndPointer = $commentAfter; + } while (true); + + return $commentEndPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php new file mode 100644 index 0000000..865e825 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConditionHelper.php @@ -0,0 +1,355 @@ +getTokens(); + + $conditionContent = strtolower( + trim(TokenHelper::getContent($phpcsFile, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer)) + ); + + if ($conditionContent === 'false' || $conditionContent === 'true') { + return true; + } + + $actualPointer = $conditionBoundaryStartPointer; + + do { + $actualPointer = TokenHelper::findNext( + $phpcsFile, + array_merge( + [T_OPEN_PARENTHESIS, T_LESS_THAN, T_GREATER_THAN], + Tokens::$booleanOperators, + Tokens::$equalityTokens + ), + $actualPointer, + $conditionBoundaryEndPointer + 1 + ); + + if ($actualPointer === null) { + break; + } + + if ($tokens[$actualPointer]['code'] === T_OPEN_PARENTHESIS) { + $actualPointer = $tokens[$actualPointer]['parenthesis_closer']; + continue; + } + + return true; + + } while (true); + + return false; + } + + public static function getNegativeCondition( + File $phpcsFile, + int $conditionBoundaryStartPointer, + int $conditionBoundaryEndPointer, + bool $nested = false + ): string + { + /** @var int $conditionStartPointer */ + $conditionStartPointer = TokenHelper::findNextEffective($phpcsFile, $conditionBoundaryStartPointer); + /** @var int $conditionEndPointer */ + $conditionEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $conditionBoundaryEndPointer); + + $tokens = $phpcsFile->getTokens(); + if ( + $tokens[$conditionStartPointer]['code'] === T_OPEN_PARENTHESIS + && $tokens[$conditionStartPointer]['parenthesis_closer'] === $conditionEndPointer + ) { + /** @var int $conditionStartPointer */ + $conditionStartPointer = TokenHelper::findNextEffective($phpcsFile, $conditionStartPointer + 1); + /** @var int $conditionEndPointer */ + $conditionEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $conditionEndPointer - 1); + } + + return sprintf( + '%s%s%s', + $conditionBoundaryStartPointer !== $conditionStartPointer + ? TokenHelper::getContent( + $phpcsFile, + $conditionBoundaryStartPointer, + $conditionStartPointer - 1 + ) + : '', + self::getNegativeConditionPart($phpcsFile, $conditionStartPointer, $conditionEndPointer, $nested), + $conditionBoundaryEndPointer !== $conditionEndPointer + ? TokenHelper::getContent( + $phpcsFile, + $conditionEndPointer + 1, + $conditionBoundaryEndPointer + ) + : '' + ); + } + + private static function getNegativeConditionPart( + File $phpcsFile, + int $conditionBoundaryStartPointer, + int $conditionBoundaryEndPointer, + bool $nested + ): string + { + $tokens = $phpcsFile->getTokens(); + + $condition = TokenHelper::getContent($phpcsFile, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer); + + if (strtolower($condition) === 'true') { + return 'false'; + } + if (strtolower($condition) === 'false') { + return 'true'; + } + + $pointerAfterConditionStart = TokenHelper::findNextEffective($phpcsFile, $conditionBoundaryStartPointer); + $booleanPointers = TokenHelper::findNextAll( + $phpcsFile, + Tokens::$booleanOperators, + $conditionBoundaryStartPointer, + $conditionBoundaryEndPointer + 1 + ); + + if ($tokens[$pointerAfterConditionStart]['code'] === T_BOOLEAN_NOT) { + $pointerAfterBooleanNot = TokenHelper::findNextEffective($phpcsFile, $pointerAfterConditionStart + 1); + if ($tokens[$pointerAfterBooleanNot]['code'] === T_OPEN_PARENTHESIS) { + if ($nested && $booleanPointers !== []) { + return self::removeBooleanNot($condition); + } + + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$pointerAfterBooleanNot]['parenthesis_closer'] + 1, + $conditionBoundaryEndPointer + 1 + ); + if ( + $pointerAfterParenthesisCloser === null + || $pointerAfterParenthesisCloser === $conditionBoundaryEndPointer + ) { + return TokenHelper::getContent( + $phpcsFile, + $pointerAfterBooleanNot + 1, + $tokens[$pointerAfterBooleanNot]['parenthesis_closer'] - 1 + ); + } + } + } + + if (count($booleanPointers) > 0) { + return self::getNegativeLogicalCondition($phpcsFile, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer); + } + + if ($tokens[$pointerAfterConditionStart]['code'] === T_BOOLEAN_NOT) { + return self::removeBooleanNot($condition); + } + + if (TokenHelper::findNext( + $phpcsFile, + [T_INSTANCEOF, T_BITWISE_AND, T_COALESCE, T_INLINE_THEN], + $conditionBoundaryStartPointer, + $conditionBoundaryEndPointer + 1 + ) !== null) { + return sprintf('!(%s)', $condition); + } + + if ($tokens[$pointerAfterConditionStart]['code'] === T_STRING) { + $pointerAfterConditionStart = TokenHelper::findNextEffective($phpcsFile, $pointerAfterConditionStart + 1); + if ( + $tokens[$pointerAfterConditionStart]['code'] === T_OPEN_PARENTHESIS + && $tokens[$pointerAfterConditionStart]['parenthesis_closer'] === $conditionBoundaryEndPointer + ) { + return sprintf('!%s', $condition); + } + } + + if (in_array($tokens[$pointerAfterConditionStart]['code'], [T_VARIABLE, T_SELF, T_STATIC, T_PARENT], true)) { + $identificatorEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $pointerAfterConditionStart); + $pointerAfterIdentificatorEnd = TokenHelper::findNextEffective($phpcsFile, $identificatorEndPointer + 1); + if ( + $tokens[$pointerAfterIdentificatorEnd]['code'] === T_OPEN_PARENTHESIS + && $tokens[$pointerAfterIdentificatorEnd]['parenthesis_closer'] === $conditionBoundaryEndPointer + ) { + return sprintf('!%s', $condition); + } + } + + $comparisonPointer = TokenHelper::findNext( + $phpcsFile, + [T_IS_EQUAL, T_IS_NOT_EQUAL, T_IS_IDENTICAL, T_IS_NOT_IDENTICAL, T_IS_SMALLER_OR_EQUAL, T_IS_GREATER_OR_EQUAL, T_LESS_THAN, T_GREATER_THAN], + $conditionBoundaryStartPointer, + $conditionBoundaryEndPointer + 1 + ); + if ($comparisonPointer !== null) { + $comparisonReplacements = [ + T_IS_EQUAL => '!=', + T_IS_NOT_EQUAL => '==', + T_IS_IDENTICAL => '!==', + T_IS_NOT_IDENTICAL => '===', + T_IS_GREATER_OR_EQUAL => '<', + T_IS_SMALLER_OR_EQUAL => '>', + T_GREATER_THAN => '<=', + T_LESS_THAN => '>=', + ]; + + $negativeCondition = ''; + for ($i = $conditionBoundaryStartPointer; $i <= $conditionBoundaryEndPointer; $i++) { + // Skip calls() + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $negativeCondition .= TokenHelper::getContent($phpcsFile, $i, $tokens[$i]['parenthesis_closer']); + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + $negativeCondition .= array_key_exists($tokens[$i]['code'], $comparisonReplacements) + ? $comparisonReplacements[$tokens[$i]['code']] + : $tokens[$i]['content']; + } + + return $negativeCondition; + } + + return sprintf('!%s', $condition); + } + + private static function removeBooleanNot(string $condition): string + { + return preg_replace('~^!\\s*~', '', $condition); + } + + private static function getNegativeLogicalCondition( + File $phpcsFile, + int $conditionBoundaryStartPointer, + int $conditionBoundaryEndPointer + ): string + { + if (TokenHelper::findNext($phpcsFile, T_LOGICAL_XOR, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer) !== null) { + return sprintf('!(%s)', TokenHelper::getContent($phpcsFile, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer)); + } + + $tokens = $phpcsFile->getTokens(); + + $booleanOperatorReplacements = [ + T_BOOLEAN_AND => '||', + T_BOOLEAN_OR => '&&', + T_LOGICAL_AND => 'or', + T_LOGICAL_OR => 'and', + ]; + + $negativeCondition = ''; + + $nestedConditionStartPointer = $conditionBoundaryStartPointer; + $actualPointer = $conditionBoundaryStartPointer; + $parenthesesLevel = 0; + + $operatorsOnLevel = []; + + do { + $actualPointer = TokenHelper::findNext( + $phpcsFile, + array_merge([T_OPEN_PARENTHESIS, T_CLOSE_PARENTHESIS], Tokens::$booleanOperators), + $actualPointer, + $conditionBoundaryEndPointer + 1 + ); + + if ($actualPointer === null) { + break; + } + + if ($tokens[$actualPointer]['code'] === T_OPEN_PARENTHESIS) { + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $actualPointer - 1); + if ($tokens[$pointerBeforeParenthesisOpener]['code'] === T_STRING) { + $actualPointer = $tokens[$actualPointer]['parenthesis_closer'] + 1; + continue; + } + + $parenthesesLevel++; + $actualPointer++; + continue; + } + + if ($tokens[$actualPointer]['code'] === T_CLOSE_PARENTHESIS) { + $parenthesesLevel--; + $actualPointer++; + continue; + } + + if ($parenthesesLevel !== 0) { + $actualPointer++; + continue; + } + + if ( + array_key_exists($parenthesesLevel, $operatorsOnLevel) + && $operatorsOnLevel[$parenthesesLevel] !== $tokens[$actualPointer]['code'] + ) { + return sprintf('!(%s)', TokenHelper::getContent($phpcsFile, $conditionBoundaryStartPointer, $conditionBoundaryEndPointer)); + } + + $operatorsOnLevel[$parenthesesLevel] = $tokens[$actualPointer]['code']; + + $negativeCondition .= self::getNegativeCondition($phpcsFile, $nestedConditionStartPointer, $actualPointer - 1, true); + $negativeCondition .= $booleanOperatorReplacements[$tokens[$actualPointer]['code']]; + + $nestedConditionStartPointer = $actualPointer + 1; + $actualPointer++; + + } while (true); + + return $negativeCondition . self::getNegativeCondition( + $phpcsFile, + $nestedConditionStartPointer, + $conditionBoundaryEndPointer, + true + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php new file mode 100644 index 0000000..99978a0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ConstantHelper.php @@ -0,0 +1,79 @@ +getTokens(); + return $tokens[TokenHelper::findNext($phpcsFile, T_STRING, $constantPointer + 1)]['content']; + } + + public static function getFullyQualifiedName(File $phpcsFile, int $constantPointer): string + { + $name = self::getName($phpcsFile, $constantPointer); + $namespace = NamespaceHelper::findCurrentNamespaceName($phpcsFile, $constantPointer); + + return $namespace !== null + ? sprintf('%s%s%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $namespace, NamespaceHelper::NAMESPACE_SEPARATOR, $name) + : $name; + } + + /** + * @return list + */ + public static function getAllNames(File $phpcsFile): array + { + $previousConstantPointer = 0; + + return array_map( + static function (int $constantPointer) use ($phpcsFile): string { + return self::getName($phpcsFile, $constantPointer); + }, + array_filter( + iterator_to_array(self::getAllConstantPointers($phpcsFile, $previousConstantPointer)), + static function (int $constantPointer) use ($phpcsFile): bool { + foreach (array_reverse($phpcsFile->getTokens()[$constantPointer]['conditions']) as $conditionTokenCode) { + return $conditionTokenCode === T_NAMESPACE; + } + + return true; + } + ) + ); + } + + /** + * @return Generator + */ + private static function getAllConstantPointers(File $phpcsFile, int &$previousConstantPointer): Generator + { + do { + $nextConstantPointer = TokenHelper::findNext($phpcsFile, T_CONST, $previousConstantPointer + 1); + if ($nextConstantPointer === null) { + break; + } + + $previousConstantPointer = $nextConstantPointer; + + yield $nextConstantPointer; + } while (true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php new file mode 100644 index 0000000..ffed995 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php @@ -0,0 +1,275 @@ +getTokens()[$docCommentOpenToken]['comment_closer'] + ) + ); + } + + /** + * @return list|null + */ + public static function getDocCommentDescription(File $phpcsFile, int $pointer): ?array + { + $docCommentOpenPointer = self::findDocCommentOpenPointer($phpcsFile, $pointer); + + if ($docCommentOpenPointer === null) { + return null; + } + + $tokens = $phpcsFile->getTokens(); + $descriptionStartPointer = TokenHelper::findNextExcluding( + $phpcsFile, + [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], + $docCommentOpenPointer + 1, + $tokens[$docCommentOpenPointer]['comment_closer'] + ); + + if ($descriptionStartPointer === null) { + return null; + } + + if ($tokens[$descriptionStartPointer]['code'] !== T_DOC_COMMENT_STRING) { + return null; + } + + $tokenAfterDescriptionPointer = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_TAG, T_DOC_COMMENT_CLOSE_TAG], + $descriptionStartPointer + 1, + $tokens[$docCommentOpenPointer]['comment_closer'] + 1 + ); + + /** @var list $comments */ + $comments = []; + for ($i = $descriptionStartPointer; $i < $tokenAfterDescriptionPointer; $i++) { + if ($tokens[$i]['code'] !== T_DOC_COMMENT_STRING) { + continue; + } + + $comments[] = new Comment($i, trim($tokens[$i]['content'])); + } + + return count($comments) > 0 ? $comments : null; + } + + public static function hasInheritdocAnnotation(File $phpcsFile, int $pointer): bool + { + $docCommentOpenPointer = self::findDocCommentOpenPointer($phpcsFile, $pointer); + + if ($docCommentOpenPointer === null) { + return false; + } + + $parsedDocComment = self::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment === null) { + return false; + } + + foreach ($parsedDocComment->getNode()->children as $child) { + if ($child instanceof PhpDocTextNode && stripos($child->text, '{@inheritdoc}') !== false) { + return true; + } + + if ($child instanceof PhpDocTagNode && strtolower($child->name) === '@inheritdoc') { + return true; + } + } + + return false; + } + + public static function hasDocCommentDescription(File $phpcsFile, int $pointer): bool + { + return self::getDocCommentDescription($phpcsFile, $pointer) !== null; + } + + public static function findDocCommentOpenPointer(File $phpcsFile, int $pointer): ?int + { + return SniffLocalCache::getAndSetIfNotCached( + $phpcsFile, + sprintf('doc-comment-open-pointer-%d', $pointer), + static function () use ($phpcsFile, $pointer): ?int { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_DOC_COMMENT_OPEN_TAG) { + return $pointer; + } + + $found = TokenHelper::findPrevious( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_SEMICOLON, T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET], + $pointer - 1 + ); + if ($found !== null && $tokens[$found]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + return $tokens[$found]['comment_opener']; + } + + return null; + } + ); + } + + public static function findDocCommentOwnerPointer(File $phpcsFile, int $docCommentOpenPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $docCommentCloserPointer = $tokens[$docCommentOpenPointer]['comment_closer']; + + if (self::isInline($phpcsFile, $docCommentOpenPointer)) { + return null; + } + + $docCommentOwnerPointer = null; + + for ($i = $docCommentCloserPointer + 1; $i < count($tokens); $i++) { + if ($tokens[$i]['code'] === T_ATTRIBUTE) { + $i = $tokens[$i]['attribute_closer']; + continue; + } + + if (in_array( + $tokens[$i]['code'], + [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_VAR, T_READONLY, T_FINAL, T_STATIC, T_ABSTRACT, T_WHITESPACE], + true + )) { + continue; + } + + if (in_array( + $tokens[$i]['code'], + array_merge([T_FUNCTION, T_VARIABLE, T_CONST], TokenHelper::$typeKeywordTokenCodes), + true + )) { + $docCommentOwnerPointer = $i; + } + + break; + } + + return $docCommentOwnerPointer; + } + + public static function isInline(File $phpcsFile, int $docCommentOpenPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextNonWhitespace($phpcsFile, $tokens[$docCommentOpenPointer]['comment_closer'] + 1); + + if ( + $nextPointer !== null + && in_array( + $tokens[$nextPointer]['code'], + [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_FINAL, T_STATIC, T_ABSTRACT, T_CONST, T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], + true + ) + ) { + return false; + } + + $parsedDocComment = self::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment === null) { + return false; + } + + foreach ($parsedDocComment->getNode()->getTags() as $annotation) { + if (preg_match('~^@(?:(?:phpstan|psalm)-)?var~i', $annotation->name) === 1) { + return true; + } + } + + return false; + } + + public static function parseDocComment(File $phpcsFile, int $docCommentOpenPointer): ?ParsedDocComment + { + return SniffLocalCache::getAndSetIfNotCached( + $phpcsFile, + sprintf('parsed-doc-comment-%d', $docCommentOpenPointer), + static function () use ($phpcsFile, $docCommentOpenPointer): ?ParsedDocComment { + $docComment = self::getDocComment($phpcsFile, $docCommentOpenPointer); + + $docCommentTokens = new TokenIterator(PhpDocParserHelper::getLexer()->tokenize($docComment)); + + try { + $parsedDocComment = PhpDocParserHelper::getParser()->parse($docCommentTokens); + + return new ParsedDocComment( + $docCommentOpenPointer, + $phpcsFile->getTokens()[$docCommentOpenPointer]['comment_closer'], + $parsedDocComment, + $docCommentTokens + ); + } catch (ParserException $e) { + return null; + } + } + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/EmptyFileException.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/EmptyFileException.php new file mode 100644 index 0000000..cbcdf74 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/EmptyFileException.php @@ -0,0 +1,33 @@ +filename = $filename; + } + + public function getFilename(): string + { + return $this->filename; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php new file mode 100644 index 0000000..d994bc6 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FixerHelper.php @@ -0,0 +1,55 @@ +fixer->replaceToken($startPointer, $content); + } + + public static function removeBetween(File $phpcsFile, int $startPointer, int $endPointer): void + { + self::removeBetweenIncluding($phpcsFile, $startPointer + 1, $endPointer - 1); + } + + public static function removeBetweenIncluding(File $phpcsFile, int $startPointer, int $endPointer): void + { + for ($i = $startPointer; $i <= $endPointer; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + public static function removeWhitespaceBefore(File $phpcsFile, int $pointer): void + { + for ($i = $pointer - 1; $i > 0; $i--) { + if (preg_match('~^\\s+$~', $phpcsFile->fixer->getTokenContent($i)) === 0) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + public static function removeWhitespaceAfter(File $phpcsFile, int $pointer): void + { + for ($i = $pointer + 1; $i < count($phpcsFile->getTokens()); $i++) { + if (preg_match('~^\\s+$~', $phpcsFile->fixer->getTokenContent($i)) === 0) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php new file mode 100644 index 0000000..633e80b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php @@ -0,0 +1,572 @@ +getTokens(); + return $tokens[TokenHelper::findNext( + $phpcsFile, + T_STRING, + $functionPointer + 1, + $tokens[$functionPointer]['parenthesis_opener'] + )]['content']; + } + + public static function getFullyQualifiedName(File $phpcsFile, int $functionPointer): string + { + $name = self::getName($phpcsFile, $functionPointer); + $namespace = NamespaceHelper::findCurrentNamespaceName($phpcsFile, $functionPointer); + + if (self::isMethod($phpcsFile, $functionPointer)) { + foreach (array_reverse( + $phpcsFile->getTokens()[$functionPointer]['conditions'], + true + ) as $conditionPointer => $conditionTokenCode) { + if ($conditionTokenCode === T_ANON_CLASS) { + return sprintf('class@anonymous::%s', $name); + } + + if (in_array($conditionTokenCode, [T_CLASS, T_INTERFACE, T_TRAIT, T_ENUM], true)) { + $name = sprintf( + '%s%s::%s', + NamespaceHelper::NAMESPACE_SEPARATOR, + ClassHelper::getName($phpcsFile, $conditionPointer), + $name + ); + break; + } + } + + return $namespace !== null ? sprintf('%s%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $namespace, $name) : $name; + } + + return $namespace !== null + ? sprintf('%s%s%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $namespace, NamespaceHelper::NAMESPACE_SEPARATOR, $name) + : $name; + } + + public static function isAbstract(File $phpcsFile, int $functionPointer): bool + { + return !isset($phpcsFile->getTokens()[$functionPointer]['scope_opener']); + } + + public static function isMethod(File $phpcsFile, int $functionPointer): bool + { + $functionPointerConditions = $phpcsFile->getTokens()[$functionPointer]['conditions']; + if ($functionPointerConditions === []) { + return false; + } + $lastFunctionPointerCondition = array_pop($functionPointerConditions); + return in_array($lastFunctionPointerCondition, Tokens::$ooScopeTokens, true); + } + + public static function findClassPointer(File $phpcsFile, int $functionPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$functionPointer]['code'] === T_CLOSURE) { + return null; + } + + foreach (array_reverse($tokens[$functionPointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (!in_array($conditionTokenCode, Tokens::$ooScopeTokens, true)) { + continue; + } + + return $conditionPointer; + } + + return null; + } + + /** + * @return list + */ + public static function getParametersNames(File $phpcsFile, int $functionPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $parametersNames = []; + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + $parametersNames[] = $tokens[$i]['content']; + } + + return $parametersNames; + } + + /** + * @return array + */ + public static function getParametersTypeHints(File $phpcsFile, int $functionPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $parametersTypeHints = []; + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + $parameterName = $tokens[$i]['content']; + + $pointerBeforeVariable = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge(TokenHelper::$ineffectiveTokenCodes, [T_BITWISE_AND, T_ELLIPSIS]), + $i - 1 + ); + + if (!in_array($tokens[$pointerBeforeVariable]['code'], TokenHelper::getTypeHintTokenCodes(), true)) { + $parametersTypeHints[$parameterName] = null; + continue; + } + + $typeHintEndPointer = $pointerBeforeVariable; + $typeHintStartPointer = TypeHintHelper::getStartPointer($phpcsFile, $typeHintEndPointer); + + $pointerBeforeTypeHint = TokenHelper::findPreviousEffective($phpcsFile, $typeHintStartPointer - 1); + $isNullable = $tokens[$pointerBeforeTypeHint]['code'] === T_NULLABLE; + if ($isNullable) { + $typeHintStartPointer = $pointerBeforeTypeHint; + } + + $typeHint = TokenHelper::getContent($phpcsFile, $typeHintStartPointer, $typeHintEndPointer); + + /** @var string $typeHint */ + $typeHint = preg_replace('~\s+~', '', $typeHint); + + if (!$isNullable) { + $isNullable = preg_match('~(?:^|\|)null(?:\||$)~i', $typeHint) === 1; + } + + $parametersTypeHints[$parameterName] = new TypeHint($typeHint, $isNullable, $typeHintStartPointer, $typeHintEndPointer); + } + + return $parametersTypeHints; + } + + public static function returnsValue(File $phpcsFile, int $functionPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $firstPointerInScope = $tokens[$functionPointer]['scope_opener'] + 1; + + for ($i = $firstPointerInScope; $i < $tokens[$functionPointer]['scope_closer']; $i++) { + if (!in_array($tokens[$i]['code'], [T_YIELD, T_YIELD_FROM], true)) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $i, $firstPointerInScope)) { + continue; + } + + return true; + } + + for ($i = $firstPointerInScope; $i < $tokens[$functionPointer]['scope_closer']; $i++) { + if ($tokens[$i]['code'] !== T_RETURN) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $i, $firstPointerInScope)) { + continue; + } + + $nextEffectiveTokenPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + return $tokens[$nextEffectiveTokenPointer]['code'] !== T_SEMICOLON; + } + + return false; + } + + public static function findReturnTypeHint(File $phpcsFile, int $functionPointer): ?TypeHint + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$functionPointer]['parenthesis_closer'] + 1); + + if ($tokens[$nextPointer]['code'] === T_USE) { + $useParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $nextPointer + 1); + $colonPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$useParenthesisOpener]['parenthesis_closer'] + 1); + } else { + $colonPointer = $nextPointer; + } + + if ($tokens[$colonPointer]['code'] !== T_COLON) { + return null; + } + + $typeHintStartPointer = TokenHelper::findNextEffective($phpcsFile, $colonPointer + 1); + $nullable = $tokens[$typeHintStartPointer]['code'] === T_NULLABLE; + + $pointerAfterTypeHint = self::isAbstract($phpcsFile, $functionPointer) + ? TokenHelper::findNext($phpcsFile, T_SEMICOLON, $typeHintStartPointer + 1) + : $tokens[$functionPointer]['scope_opener']; + + $typeHintEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $pointerAfterTypeHint - 1); + + $typeHint = TokenHelper::getContent($phpcsFile, $typeHintStartPointer, $typeHintEndPointer); + + /** @var string $typeHint */ + $typeHint = preg_replace('~\s+~', '', $typeHint); + + if (!$nullable) { + $nullable = preg_match('~(?:^|\|)null(?:\||$)~i', $typeHint) === 1; + } + + return new TypeHint($typeHint, $nullable, $typeHintStartPointer, $typeHintEndPointer); + } + + public static function hasReturnTypeHint(File $phpcsFile, int $functionPointer): bool + { + return self::findReturnTypeHint($phpcsFile, $functionPointer) !== null; + } + + /** + * @return list|Annotation> + */ + public static function getParametersAnnotations(File $phpcsFile, int $functionPointer): array + { + return AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, '@param'); + } + + /** + * @return array|Annotation|Annotation> + */ + public static function getValidParametersAnnotations(File $phpcsFile, int $functionPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $parametersAnnotations = []; + + if (self::getName($phpcsFile, $functionPointer) === '__construct') { + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $i, '@var'); + if ($varAnnotations === []) { + continue; + } + + $parametersAnnotations[$tokens[$i]['content']] = $varAnnotations[0]; + } + } + + foreach (self::getParametersAnnotations($phpcsFile, $functionPointer) as $parameterAnnotation) { + if ($parameterAnnotation->isInvalid()) { + continue; + } + + $parametersAnnotations[$parameterAnnotation->getValue()->parameterName] = $parameterAnnotation; + } + + return $parametersAnnotations; + } + + /** + * @return array|Annotation> + */ + public static function getValidPrefixedParametersAnnotations(File $phpcsFile, int $functionPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $parametersAnnotations = []; + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + if (self::getName($phpcsFile, $functionPointer) === '__construct') { + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + /** @var list> $varAnnotations */ + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $i, sprintf('@%s-var', $prefix)); + if ($varAnnotations === []) { + continue; + } + + $parametersAnnotations[$tokens[$i]['content']] = $varAnnotations[0]; + } + } + + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, sprintf('@%s-param', $prefix)); + foreach ($annotations as $parameterAnnotation) { + if ($parameterAnnotation->isInvalid()) { + continue; + } + + $parametersAnnotations[$parameterAnnotation->getValue()->parameterName] = $parameterAnnotation; + } + } + + return $parametersAnnotations; + } + + /** + * @return Annotation|null + */ + public static function findReturnAnnotation(File $phpcsFile, int $functionPointer): ?Annotation + { + /** @var list> $returnAnnotations */ + $returnAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer, '@return'); + + if ($returnAnnotations === []) { + return null; + } + + return $returnAnnotations[0]; + } + + /** + * @return list + */ + public static function getValidPrefixedReturnAnnotations(File $phpcsFile, int $functionPointer): array + { + $returnAnnotations = []; + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $functionPointer); + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + $prefixedAnnotationName = sprintf('@%s-return', $prefix); + + foreach ($annotations as $annotation) { + if ($annotation->isInvalid()) { + continue; + } + + if ($annotation->getName() === $prefixedAnnotationName) { + $returnAnnotations[] = $annotation; + } + } + } + + return $returnAnnotations; + } + + /** + * @return list + */ + public static function getAllFunctionNames(File $phpcsFile): array + { + $previousFunctionPointer = 0; + + return array_map( + static function (int $functionPointer) use ($phpcsFile): string { + return self::getName($phpcsFile, $functionPointer); + }, + array_filter( + iterator_to_array(self::getAllFunctionOrMethodPointers($phpcsFile, $previousFunctionPointer)), + static function (int $functionOrMethodPointer) use ($phpcsFile): bool { + return !self::isMethod($phpcsFile, $functionOrMethodPointer); + } + ) + ); + } + + /** + * @param int $flags optional bitmask of self::LINE_INCLUDE_* constants + */ + public static function getFunctionLengthInLines(File $file, int $functionPosition, int $flags = 0): int + { + if (self::isAbstract($file, $functionPosition)) { + return 0; + } + return self::getLineCount($file, $functionPosition, $flags); + } + + public static function getLineCount(File $file, int $tokenPosition, int $flags = 0): int + { + $includeWhitespace = ($flags & self::LINE_INCLUDE_WHITESPACE) === self::LINE_INCLUDE_WHITESPACE; + $includeComments = ($flags & self::LINE_INCLUDE_COMMENT) === self::LINE_INCLUDE_COMMENT; + + $tokens = $file->getTokens(); + $token = $tokens[$tokenPosition]; + + $tokenOpenerPosition = $token['scope_opener'] ?? $tokenPosition; + $tokenCloserPosition = $token['scope_closer'] ?? $file->numTokens - 1; + $tokenOpenerLine = $tokens[$tokenOpenerPosition]['line']; + $tokenCloserLine = $tokens[$tokenCloserPosition]['line']; + + $lineCount = 0; + $lastCommentLine = null; + $previousIncludedPosition = null; + + for ($position = $tokenOpenerPosition; $position <= $tokenCloserPosition - 1; $position++) { + $token = $tokens[$position]; + if ($includeComments === false) { + if (in_array($token['code'], Tokens::$commentTokens, true)) { + if ( + $previousIncludedPosition !== null && + substr_count($token['content'], $file->eolChar) > 0 && + $token['line'] === $tokens[$previousIncludedPosition]['line'] + ) { + // Comment with linebreak starting on same line as included Token + $lineCount++; + } + // Don't include comment + $lastCommentLine = $token['line']; + continue; + } + if ( + $previousIncludedPosition !== null && + $token['code'] === T_WHITESPACE && + $token['line'] === $lastCommentLine && + $token['line'] !== $tokens[$previousIncludedPosition]['line'] + ) { + // Whitespace after block comment... still on comment line... + // Ignore along with the comment + continue; + } + } + if ($token['code'] === T_WHITESPACE) { + $nextNonWhitespacePosition = $file->findNext(T_WHITESPACE, $position + 1, $tokenCloserPosition + 1, true); + if ( + $includeWhitespace === false && + $token['column'] === 1 && + $nextNonWhitespacePosition !== false && + $tokens[$nextNonWhitespacePosition]['line'] !== $token['line'] + ) { + // This line is nothing but whitepace + $position = $nextNonWhitespacePosition - 1; + continue; + } + if ($previousIncludedPosition === $tokenOpenerPosition && $token['line'] === $tokenOpenerLine) { + // Don't linclude line break after opening "{" + // Unless there was code or an (included) comment following the "{" + continue; + } + } + if ($token['code'] !== T_WHITESPACE) { + $previousIncludedPosition = $position; + } + $newLineFoundCount = substr_count($token['content'], $file->eolChar); + $lineCount += $newLineFoundCount; + } + if ($tokens[$previousIncludedPosition]['line'] === $tokenCloserLine) { + // There is code or comment on the closing "}" line... + $lineCount++; + } + return $lineCount; + } + + /** + * @return Generator + */ + private static function getAllFunctionOrMethodPointers(File $phpcsFile, int &$previousFunctionPointer): Generator + { + do { + $nextFunctionPointer = TokenHelper::findNext($phpcsFile, T_FUNCTION, $previousFunctionPointer + 1); + if ($nextFunctionPointer === null) { + break; + } + + $previousFunctionPointer = $nextFunctionPointer; + + yield $nextFunctionPointer; + } while (true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IdentificatorHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IdentificatorHelper.php new file mode 100644 index 0000000..b64d309 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IdentificatorHelper.php @@ -0,0 +1,216 @@ +getTokens(); + + $variableContent = ''; + for ($i = $startPointer; $i <= $endPointer; $i++) { + if (in_array($tokens[$i]['code'], TokenHelper::$ineffectiveTokenCodes, true)) { + continue; + } + + $variableContent .= $tokens[$i]['content']; + } + + return $variableContent; + } + + public static function findStartPointer(File $phpcsFile, int $endPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if (in_array($tokens[$endPointer]['code'], TokenHelper::getNameTokenCodes(), true)) { + /** @var int $previousPointer */ + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $endPointer - 1); + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + $pointerBeforeOperator = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + if ($tokens[$pointerBeforeOperator]['code'] !== T_CLOSE_PARENTHESIS) { + return self::getStartPointerBeforeOperator($phpcsFile, $previousPointer); + } + } + + return $endPointer; + } + + if (in_array($tokens[$endPointer]['code'], [T_CLOSE_CURLY_BRACKET, T_CLOSE_SQUARE_BRACKET], true)) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $tokens[$endPointer]['bracket_opener']); + } + + if ($tokens[$endPointer]['code'] === T_VARIABLE) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $endPointer); + } + + return null; + } + + public static function findEndPointer(File $phpcsFile, int $startPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + if (in_array($tokens[$startPointer]['code'], $nameTokenCodes, true)) { + $startPointer = TokenHelper::findNextExcluding($phpcsFile, $nameTokenCodes, $startPointer + 1) - 1; + } elseif ($tokens[$startPointer]['code'] === T_DOLLAR) { + $startPointer = TokenHelper::findNextEffective($phpcsFile, $startPointer + 1); + } + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $startPointer + 1); + + if ( + in_array($tokens[$startPointer]['code'], array_merge([T_SELF, T_STATIC, T_PARENT], $nameTokenCodes), true) + && $tokens[$nextPointer]['code'] === T_DOUBLE_COLON + ) { + return self::getEndPointerAfterOperator($phpcsFile, $nextPointer); + } + + if ($tokens[$startPointer]['code'] === T_VARIABLE) { + if (in_array($tokens[$nextPointer]['code'], [T_DOUBLE_COLON, T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], true)) { + return self::getEndPointerAfterOperator($phpcsFile, $nextPointer); + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_SQUARE_BRACKET) { + return self::getEndPointerAfterVariablePart($phpcsFile, $startPointer); + } + + return $startPointer; + } + + return null; + } + + private static function getStartPointerBeforeOperator(File $phpcsFile, int $operatorPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + /** @var int $previousPointer */ + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $operatorPointer - 1); + + if (in_array($tokens[$previousPointer]['code'], $nameTokenCodes, true)) { + $previousPointer = TokenHelper::findPreviousExcluding($phpcsFile, $nameTokenCodes, $previousPointer - 1) + 1; + } + + if ( + $tokens[$operatorPointer]['code'] === T_DOUBLE_COLON + && in_array($tokens[$previousPointer]['code'], array_merge([T_SELF, T_STATIC, T_PARENT], $nameTokenCodes), true) + ) { + return $previousPointer; + } + + if (in_array($tokens[$previousPointer]['code'], $nameTokenCodes, true)) { + /** @var int $possibleOperatorPointer */ + $possibleOperatorPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + if (in_array($tokens[$possibleOperatorPointer]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], true)) { + return self::getStartPointerBeforeOperator($phpcsFile, $possibleOperatorPointer); + } + } + + if (in_array($tokens[$previousPointer]['code'], [T_CLOSE_CURLY_BRACKET, T_CLOSE_SQUARE_BRACKET], true)) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $tokens[$previousPointer]['bracket_opener']); + } + + return self::getStartPointerBeforeVariablePart($phpcsFile, $previousPointer); + } + + private static function getStartPointerBeforeVariablePart(File $phpcsFile, int $variablePartPointer): int + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $previousPointer */ + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $variablePartPointer - 1); + + if ($tokens[$previousPointer]['code'] === T_DOLLAR) { + /** @var int $previousPointer */ + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + return self::getStartPointerBeforeOperator($phpcsFile, $previousPointer); + } + + if ($tokens[$previousPointer]['code'] === T_CLOSE_SQUARE_BRACKET) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $tokens[$previousPointer]['bracket_opener']); + } + + if ( + $tokens[$previousPointer]['code'] === T_CLOSE_CURLY_BRACKET + && !array_key_exists('scope_condition', $tokens[$previousPointer]) + ) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $tokens[$previousPointer]['bracket_opener']); + } + + if (in_array($tokens[$previousPointer]['code'], array_merge([T_VARIABLE], TokenHelper::getNameTokenCodes()), true)) { + return self::getStartPointerBeforeVariablePart($phpcsFile, $previousPointer); + } + + return $variablePartPointer; + } + + private static function getEndPointerAfterOperator(File $phpcsFile, int $operatorPointer): int + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $operatorPointer + 1); + + if ($tokens[$nextPointer]['code'] === T_DOLLAR) { + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $nextPointer + 1); + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_CURLY_BRACKET) { + return self::getEndPointerAfterVariablePart($phpcsFile, $tokens[$nextPointer]['bracket_closer']); + } + + return self::getEndPointerAfterVariablePart($phpcsFile, $nextPointer); + } + + private static function getEndPointerAfterVariablePart(File $phpcsFile, int $variablePartPointer): int + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $variablePartPointer + 1); + + if (in_array($tokens[$nextPointer]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + return self::getEndPointerAfterOperator($phpcsFile, $nextPointer); + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_SQUARE_BRACKET) { + return self::getEndPointerAfterVariablePart($phpcsFile, $tokens[$nextPointer]['bracket_closer']); + } + + return $variablePartPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php new file mode 100644 index 0000000..e6daae0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/IndentationHelper.php @@ -0,0 +1,106 @@ + $codePointers + */ + public static function fixIndentation(File $phpcsFile, array $codePointers, string $defaultIndentation): string + { + $tokens = $phpcsFile->getTokens(); + + $eolLength = strlen($phpcsFile->eolChar); + + $code = ''; + $inHeredoc = false; + + foreach ($codePointers as $no => $codePointer) { + $content = $tokens[$codePointer]['content']; + + if ( + !$inHeredoc + && ( + $no === 0 + || substr($tokens[$codePointer - 1]['content'], -$eolLength) === $phpcsFile->eolChar + ) + ) { + if ($content === $phpcsFile->eolChar) { + // Nothing + } elseif ($content[0] === self::TAB_INDENT) { + $content = substr($content, 1); + } elseif (substr($content, 0, self::DEFAULT_INDENTATION_WIDTH) === self::SPACES_INDENT) { + $content = substr($content, self::DEFAULT_INDENTATION_WIDTH); + } else { + $content = $defaultIndentation . ltrim($content); + } + } + + if (in_array($tokens[$codePointer]['code'], [T_START_HEREDOC, T_START_NOWDOC], true)) { + $inHeredoc = true; + } elseif (in_array($tokens[$codePointer]['code'], [T_END_HEREDOC, T_END_NOWDOC], true)) { + $inHeredoc = false; + } + + $code .= $content; + } + + return rtrim($code); + } + + public static function convertTabsToSpaces(File $phpcsFile, string $code): string + { + return preg_replace_callback('~^(\t+)~', static function (array $matches) use ($phpcsFile): string { + $indentation = str_repeat( + ' ', + $phpcsFile->config->tabWidth !== 0 ? $phpcsFile->config->tabWidth : self::DEFAULT_INDENTATION_WIDTH + ); + return str_repeat($indentation, strlen($matches[1])); + }, $code); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php new file mode 100644 index 0000000..708f7d9 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/NamespaceHelper.php @@ -0,0 +1,201 @@ + + */ + public static function getAllNamespacesPointers(File $phpcsFile): array + { + $tokens = $phpcsFile->getTokens(); + $lazyValue = static function () use ($phpcsFile, $tokens): array { + $all = TokenHelper::findNextAll($phpcsFile, T_NAMESPACE, 0); + $all = array_filter( + $all, + static function ($pointer) use ($phpcsFile, $tokens) { + $next = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + return $next === null || $tokens[$next]['code'] !== T_NS_SEPARATOR; + } + ); + + return array_values($all); + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'namespacePointers', $lazyValue); + } + + public static function isFullyQualifiedName(string $typeName): bool + { + return StringHelper::startsWith($typeName, self::NAMESPACE_SEPARATOR); + } + + public static function isFullyQualifiedPointer(File $phpcsFile, int $pointer): bool + { + return in_array($phpcsFile->getTokens()[$pointer]['code'], [T_NS_SEPARATOR, T_NAME_FULLY_QUALIFIED], true); + } + + public static function getFullyQualifiedTypeName(string $typeName): string + { + if (self::isFullyQualifiedName($typeName)) { + return $typeName; + } + + return sprintf('%s%s', self::NAMESPACE_SEPARATOR, $typeName); + } + + public static function hasNamespace(string $typeName): bool + { + $parts = self::getNameParts($typeName); + + return count($parts) > 1; + } + + /** + * @return list + */ + public static function getNameParts(string $name): array + { + $name = self::normalizeToCanonicalName($name); + + return explode(self::NAMESPACE_SEPARATOR, $name); + } + + public static function getLastNamePart(string $name): string + { + return array_slice(self::getNameParts($name), -1)[0]; + } + + public static function getName(File $phpcsFile, int $namespacePointer): string + { + /** @var int $namespaceNameStartPointer */ + $namespaceNameStartPointer = TokenHelper::findNextEffective($phpcsFile, $namespacePointer + 1); + $namespaceNameEndPointer = TokenHelper::findNextExcluding( + $phpcsFile, + TokenHelper::getNameTokenCodes(), + $namespaceNameStartPointer + 1 + ) - 1; + + return TokenHelper::getContent($phpcsFile, $namespaceNameStartPointer, $namespaceNameEndPointer); + } + + public static function findCurrentNamespacePointer(File $phpcsFile, int $pointer): ?int + { + $allNamespacesPointers = array_reverse(self::getAllNamespacesPointers($phpcsFile)); + foreach ($allNamespacesPointers as $namespacesPointer) { + if ($namespacesPointer < $pointer) { + return $namespacesPointer; + } + } + + return null; + } + + public static function findCurrentNamespaceName(File $phpcsFile, int $anyPointer): ?string + { + $namespacePointer = self::findCurrentNamespacePointer($phpcsFile, $anyPointer); + if ($namespacePointer === null) { + return null; + } + + return self::getName($phpcsFile, $namespacePointer); + } + + public static function getUnqualifiedNameFromFullyQualifiedName(string $name): string + { + $parts = self::getNameParts($name); + return $parts[count($parts) - 1]; + } + + public static function isQualifiedName(string $name): bool + { + return strpos($name, self::NAMESPACE_SEPARATOR) !== false; + } + + public static function normalizeToCanonicalName(string $fullyQualifiedName): string + { + return ltrim($fullyQualifiedName, self::NAMESPACE_SEPARATOR); + } + + public static function isTypeInNamespace(string $typeName, string $namespace): bool + { + return StringHelper::startsWith( + self::normalizeToCanonicalName($typeName) . '\\', + $namespace . '\\' + ); + } + + public static function resolveClassName(File $phpcsFile, string $nameAsReferencedInFile, int $currentPointer): string + { + return self::resolveName($phpcsFile, $nameAsReferencedInFile, ReferencedName::TYPE_CLASS, $currentPointer); + } + + public static function resolveName(File $phpcsFile, string $nameAsReferencedInFile, string $type, int $currentPointer): string + { + if (self::isFullyQualifiedName($nameAsReferencedInFile)) { + return $nameAsReferencedInFile; + } + + $useStatements = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $currentPointer); + + $uniqueId = UseStatement::getUniqueId($type, self::normalizeToCanonicalName($nameAsReferencedInFile)); + + if (isset($useStatements[$uniqueId])) { + return sprintf('%s%s', self::NAMESPACE_SEPARATOR, $useStatements[$uniqueId]->getFullyQualifiedTypeName()); + } + + $nameParts = self::getNameParts($nameAsReferencedInFile); + $firstPartUniqueId = UseStatement::getUniqueId($type, $nameParts[0]); + if (count($nameParts) > 1 && isset($useStatements[$firstPartUniqueId])) { + return sprintf( + '%s%s%s%s', + self::NAMESPACE_SEPARATOR, + $useStatements[$firstPartUniqueId]->getFullyQualifiedTypeName(), + self::NAMESPACE_SEPARATOR, + implode(self::NAMESPACE_SEPARATOR, array_slice($nameParts, 1)) + ); + } + + $name = sprintf('%s%s', self::NAMESPACE_SEPARATOR, $nameAsReferencedInFile); + + if ($type === ReferencedName::TYPE_CONSTANT && defined($name)) { + return $name; + } + + $namespaceName = self::findCurrentNamespaceName($phpcsFile, $currentPointer); + if ($namespaceName !== null) { + $name = sprintf('%s%s%s', self::NAMESPACE_SEPARATOR, $namespaceName, $name); + } + return $name; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParameterHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParameterHelper.php new file mode 100644 index 0000000..6c4c555 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParameterHelper.php @@ -0,0 +1,34 @@ +getTokens(); + + if (!array_key_exists('nested_parenthesis', $tokens[$variablePointer])) { + return false; + } + + $parenthesisOpenerPointer = array_reverse(array_keys($tokens[$variablePointer]['nested_parenthesis']))[0]; + if (!array_key_exists('parenthesis_owner', $tokens[$parenthesisOpenerPointer])) { + return false; + } + + $parenthesisOwnerPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_owner']; + return in_array($tokens[$parenthesisOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php new file mode 100644 index 0000000..2c4fa01 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ParsedDocComment.php @@ -0,0 +1,108 @@ +openPointer = $openPointer; + $this->closePointer = $closePointer; + $this->node = $node; + $this->tokens = $tokens; + } + + public function getOpenPointer(): int + { + return $this->openPointer; + } + + public function getClosePointer(): int + { + return $this->closePointer; + } + + public function getNode(): PhpDocNode + { + return $this->node; + } + + public function getTokens(): TokenIterator + { + return $this->tokens; + } + + public function getNodeStartPointer(File $phpcsFile, Node $node): int + { + $tokens = $phpcsFile->getTokens(); + + $tagStartLine = $tokens[$this->openPointer]['line'] + $node->getAttribute('startLine') - 1; + + $searchPointer = $this->openPointer + 1; + for ($i = $this->openPointer + 1; $i < $this->closePointer; $i++) { + if ($tagStartLine === $tokens[$i]['line']) { + $searchPointer = $i; + break; + } + } + + return TokenHelper::findNext($phpcsFile, array_merge(TokenHelper::$annotationTokenCodes, [T_DOC_COMMENT_STRING]), $searchPointer); + } + + public function getNodeEndPointer(File $phpcsFile, Node $node, int $nodeStartPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $content = trim($this->tokens->getContentBetween( + $node->getAttribute(Attribute::START_INDEX), + $node->getAttribute(Attribute::END_INDEX) + 1 + )); + $length = strlen($content); + + $searchPointer = $nodeStartPointer; + + $content = ''; + for ($i = $nodeStartPointer; $i < count($tokens); $i++) { + $content .= $tokens[$i]['content']; + + if (strlen($content) >= $length) { + $searchPointer = $i; + break; + } + } + + return TokenHelper::findPrevious( + $phpcsFile, + array_merge(TokenHelper::$annotationTokenCodes, [T_DOC_COMMENT_STRING]), + $searchPointer + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php new file mode 100644 index 0000000..6cc06d6 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PhpDocParserHelper.php @@ -0,0 +1,82 @@ + true, 'indexes' => true]; + + $constantExpressionParser = new ConstExprParser(true, true, $usedAttributes); + $parser = new PhpDocParser( + new TypeParser($constantExpressionParser, true, $usedAttributes), + $constantExpressionParser, + true, + true, + $usedAttributes, + true, + true + ); + } + + return $parser; + } + + public static function getPrinter(): Printer + { + static $printer; + + if ($printer === null) { + $printer = new Printer(); + } + + return $printer; + } + + /** + * @template T of Node + * @param T $node + * @return T + */ + public static function cloneNode(Node $node): Node + { + static $cloningTraverser; + + if ($cloningTraverser === null) { + $cloningTraverser = new NodeTraverser([new CloningVisitor()]); + } + + [$cloneNode] = $cloningTraverser->traverse([$node]); + + return $cloneNode; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PropertyHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PropertyHelper.php new file mode 100644 index 0000000..74a0726 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/PropertyHelper.php @@ -0,0 +1,140 @@ +getTokens(); + + $previousPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge(TokenHelper::$ineffectiveTokenCodes, TokenHelper::getTypeHintTokenCodes(), [T_NULLABLE]), + $variablePointer - 1 + ); + + if ($tokens[$previousPointer]['code'] === T_STATIC) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + if (in_array($tokens[$previousPointer]['code'], [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_VAR, T_READONLY], true)) { + $constructorPointer = TokenHelper::findPrevious($phpcsFile, T_FUNCTION, $previousPointer - 1); + + if ($constructorPointer === null) { + return true; + } + + return $tokens[$constructorPointer]['parenthesis_closer'] < $previousPointer || $promoted; + } + + if ( + !array_key_exists('conditions', $tokens[$variablePointer]) + || count($tokens[$variablePointer]['conditions']) === 0 + ) { + return false; + } + + $functionPointer = TokenHelper::findPrevious( + $phpcsFile, + array_merge(TokenHelper::$functionTokenCodes, [T_SEMICOLON, T_CLOSE_CURLY_BRACKET, T_OPEN_CURLY_BRACKET]), + $variablePointer - 1 + ); + if ( + $functionPointer !== null + && in_array($tokens[$functionPointer]['code'], TokenHelper::$functionTokenCodes, true) + ) { + return false; + } + + $conditionCode = array_values($tokens[$variablePointer]['conditions'])[count($tokens[$variablePointer]['conditions']) - 1]; + + return in_array($conditionCode, Tokens::$ooScopeTokens, true); + } + + public static function findTypeHint(File $phpcsFile, int $propertyPointer): ?TypeHint + { + $tokens = $phpcsFile->getTokens(); + + $propertyStartPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_VAR, T_STATIC, T_READONLY], + $propertyPointer - 1 + ); + + $typeHintEndPointer = TokenHelper::findPrevious( + $phpcsFile, + TokenHelper::getTypeHintTokenCodes(), + $propertyPointer - 1, + $propertyStartPointer + ); + if ($typeHintEndPointer === null) { + return null; + } + + $typeHintStartPointer = TypeHintHelper::getStartPointer($phpcsFile, $typeHintEndPointer); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $typeHintStartPointer - 1, $propertyStartPointer); + $nullable = $previousPointer !== null && $tokens[$previousPointer]['code'] === T_NULLABLE; + + if ($nullable) { + $typeHintStartPointer = $previousPointer; + } + + $typeHint = TokenHelper::getContent($phpcsFile, $typeHintStartPointer, $typeHintEndPointer); + + if (!$nullable) { + $nullable = preg_match('~(?:^|\|\s*)null(?:\s*\||$)~i', $typeHint) === 1; + } + + /** @var string $typeHint */ + $typeHint = preg_replace('~\s+~', '', $typeHint); + + return new TypeHint($typeHint, $nullable, $typeHintStartPointer, $typeHintEndPointer); + } + + public static function getFullyQualifiedName(File $phpcsFile, int $propertyPointer): string + { + $propertyToken = $phpcsFile->getTokens()[$propertyPointer]; + $propertyName = $propertyToken['content']; + + $classPointer = array_reverse(array_keys($propertyToken['conditions']))[0]; + if ($phpcsFile->getTokens()[$classPointer]['code'] === T_ANON_CLASS) { + return sprintf('class@anonymous::%s', $propertyName); + } + + $name = sprintf('%s%s::%s', NamespaceHelper::NAMESPACE_SEPARATOR, ClassHelper::getName($phpcsFile, $classPointer), $propertyName); + $namespace = NamespaceHelper::findCurrentNamespaceName($phpcsFile, $propertyPointer); + return $namespace !== null ? sprintf('%s%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $namespace, $name) : $name; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedName.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedName.php new file mode 100644 index 0000000..8890db4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedName.php @@ -0,0 +1,75 @@ +nameAsReferencedInFile = $nameAsReferencedInFile; + $this->startPointer = $startPointer; + $this->endPointer = $endPointer; + $this->type = $type; + } + + public function getNameAsReferencedInFile(): string + { + return $this->nameAsReferencedInFile; + } + + public function getStartPointer(): int + { + return $this->startPointer; + } + + public function getType(): string + { + return $this->type; + } + + public function getEndPointer(): int + { + return $this->endPointer; + } + + public function isClass(): bool + { + return $this->type === self::TYPE_CLASS; + } + + public function isConstant(): bool + { + return $this->type === self::TYPE_CONSTANT; + } + + public function isFunction(): bool + { + return $this->type === self::TYPE_FUNCTION; + } + + public function hasSameUseStatementType(UseStatement $useStatement): bool + { + return $this->getType() === $useStatement->getType(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php new file mode 100644 index 0000000..1e215f1 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedNameHelper.php @@ -0,0 +1,532 @@ + + */ + public static function getAllReferencedNames(File $phpcsFile, int $openTagPointer): array + { + $lazyValue = static function () use ($phpcsFile, $openTagPointer): array { + return self::createAllReferencedNames($phpcsFile, $openTagPointer); + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'references', $lazyValue); + } + + /** + * @return list + */ + public static function getAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array + { + $lazyValue = static function () use ($phpcsFile, $openTagPointer): array { + return self::createAllReferencedNamesInAttributes($phpcsFile, $openTagPointer); + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'referencesFromAttributes', $lazyValue); + } + + public static function getReferenceName(File $phpcsFile, int $nameStartPointer, int $nameEndPointer): string + { + $tokens = $phpcsFile->getTokens(); + + $referencedName = ''; + for ($i = $nameStartPointer; $i <= $nameEndPointer; $i++) { + if (in_array($tokens[$i]['code'], Tokens::$emptyTokens, true)) { + continue; + } + + $referencedName .= $tokens[$i]['content']; + } + + return $referencedName; + } + + public static function getReferencedNameEndPointer(File $phpcsFile, int $startPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + $nameTokenCodesWithWhitespace = array_merge($nameTokenCodes, Tokens::$emptyTokens); + + $lastNamePointer = $startPointer; + for ($i = $startPointer + 1; $i < count($tokens); $i++) { + if (!in_array($tokens[$i]['code'], $nameTokenCodesWithWhitespace, true)) { + break; + } + + if (!in_array($tokens[$i]['code'], $nameTokenCodes, true)) { + continue; + } + + $lastNamePointer = $i; + } + + return $lastNamePointer; + } + + /** + * @return list + */ + private static function createAllReferencedNames(File $phpcsFile, int $openTagPointer): array + { + $referencedNames = []; + + $beginSearchAtPointer = $openTagPointer + 1; + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + $nameTokenCodes[] = T_DOUBLE_QUOTED_STRING; + $nameTokenCodes[] = T_HEREDOC; + + $tokens = $phpcsFile->getTokens(); + while (true) { + $nameStartPointer = TokenHelper::findNext($phpcsFile, $nameTokenCodes, $beginSearchAtPointer); + if ($nameStartPointer === null) { + break; + } + + // Find referenced names inside double quotes string + if (self::isNeedParsedContent($tokens[$nameStartPointer]['code'])) { + $content = $tokens[$nameStartPointer]['content']; + $currentPointer = $nameStartPointer + 1; + while (self::isNeedParsedContent($tokens[$currentPointer]['code'])) { + $content .= $tokens[$currentPointer]['content']; + $currentPointer++; + } + + $names = self::getReferencedNamesFromString($content); + foreach ($names as $name) { + $referencedNames[] = new ReferencedName($name, $nameStartPointer, $nameStartPointer, ReferencedName::TYPE_CLASS); + } + + $beginSearchAtPointer = $currentPointer; + continue; + } + + // Attributes are parsed in specific method + $attributeStartPointerBefore = TokenHelper::findPrevious($phpcsFile, T_ATTRIBUTE, $nameStartPointer - 1, $beginSearchAtPointer); + if ($attributeStartPointerBefore !== null) { + if ($tokens[$attributeStartPointerBefore]['attribute_closer'] > $nameStartPointer) { + $beginSearchAtPointer = $tokens[$attributeStartPointerBefore]['attribute_closer'] + 1; + continue; + } + } + + if (!self::isReferencedName($phpcsFile, $nameStartPointer)) { + /** @var int $beginSearchAtPointer */ + $beginSearchAtPointer = TokenHelper::findNextExcluding( + $phpcsFile, + array_merge(TokenHelper::$ineffectiveTokenCodes, $nameTokenCodes), + $nameStartPointer + 1 + ); + continue; + } + + $nameEndPointer = self::getReferencedNameEndPointer($phpcsFile, $nameStartPointer); + + $referencedNames[] = new ReferencedName( + self::getReferenceName($phpcsFile, $nameStartPointer, $nameEndPointer), + $nameStartPointer, + $nameEndPointer, + self::getReferenceType($phpcsFile, $nameStartPointer, $nameEndPointer) + ); + $beginSearchAtPointer = $nameEndPointer + 1; + } + return $referencedNames; + } + + private static function getReferenceType(File $phpcsFile, int $nameStartPointer, int $nameEndPointer): string + { + $tokens = $phpcsFile->getTokens(); + + $nextTokenAfterEndPointer = TokenHelper::findNextEffective($phpcsFile, $nameEndPointer + 1); + $previousTokenBeforeStartPointer = TokenHelper::findPreviousEffective($phpcsFile, $nameStartPointer - 1); + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + if ($tokens[$nextTokenAfterEndPointer]['code'] === T_OPEN_PARENTHESIS) { + return $tokens[$previousTokenBeforeStartPointer]['code'] === T_NEW + ? ReferencedName::TYPE_CLASS + : ReferencedName::TYPE_FUNCTION; + } + + if ( + $tokens[$previousTokenBeforeStartPointer]['code'] === T_TYPE_UNION + || $tokens[$nextTokenAfterEndPointer]['code'] === T_TYPE_UNION + ) { + return ReferencedName::TYPE_CLASS; + } + + if ( + $tokens[$previousTokenBeforeStartPointer]['code'] === T_TYPE_INTERSECTION + || $tokens[$nextTokenAfterEndPointer]['code'] === T_TYPE_INTERSECTION + ) { + return ReferencedName::TYPE_CLASS; + } + + if ($tokens[$nextTokenAfterEndPointer]['code'] === T_BITWISE_AND) { + $tokenAfterNextToken = TokenHelper::findNextEffective($phpcsFile, $nextTokenAfterEndPointer + 1); + + return in_array($tokens[$tokenAfterNextToken]['code'], [T_VARIABLE, T_ELLIPSIS], true) + ? ReferencedName::TYPE_CLASS + : ReferencedName::TYPE_CONSTANT; + } + + if ( + in_array($tokens[$nextTokenAfterEndPointer]['code'], [ + T_VARIABLE, + // Variadic parameter + T_ELLIPSIS, + ], true) + ) { + return ReferencedName::TYPE_CLASS; + } + + if ($tokens[$previousTokenBeforeStartPointer]['code'] === T_COLON) { + $previousTokenPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousTokenBeforeStartPointer - 1); + + if ( + $tokens[$previousTokenPointer]['code'] === T_PARAM_NAME + && $tokens[$nextTokenAfterEndPointer]['code'] !== T_DOUBLE_COLON + ) { + return ReferencedName::TYPE_CONSTANT; + } + + // Return type hint + return ReferencedName::TYPE_CLASS; + } + + if ( + in_array($tokens[$previousTokenBeforeStartPointer]['code'], [ + T_EXTENDS, + T_IMPLEMENTS, + T_INSTANCEOF, + // Trait + T_USE, + T_NEW, + // Nullable type hint + T_NULLABLE, + ], true) + || $tokens[$nextTokenAfterEndPointer]['code'] === T_DOUBLE_COLON + ) { + return ReferencedName::TYPE_CLASS; + } + + if ($tokens[$previousTokenBeforeStartPointer]['code'] === T_COMMA) { + $previousTokenPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge([T_COMMA], $nameTokenCodes, TokenHelper::$ineffectiveTokenCodes), + $previousTokenBeforeStartPointer - 1 + ); + + return in_array($tokens[$previousTokenPointer]['code'], [ + T_IMPLEMENTS, + T_EXTENDS, + T_USE, + ], true) + ? ReferencedName::TYPE_CLASS + : ReferencedName::TYPE_CONSTANT; + } + + if (in_array($tokens[$previousTokenBeforeStartPointer]['code'], [T_BITWISE_OR, T_OPEN_PARENTHESIS], true)) { + $catchPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge([T_BITWISE_OR, T_OPEN_PARENTHESIS], $nameTokenCodes, TokenHelper::$ineffectiveTokenCodes), + $previousTokenBeforeStartPointer - 1 + ); + + if ($tokens[$catchPointer]['code'] === T_CATCH) { + return ReferencedName::TYPE_CLASS; + } + } + + return ReferencedName::TYPE_CONSTANT; + } + + private static function isReferencedName(File $phpcsFile, int $startPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $startPointer + 1); + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $startPointer - 1); + + if ($nextPointer !== null && $tokens[$nextPointer]['code'] === T_DOUBLE_COLON) { + return !in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], true); + } + + if ( + count($tokens[$startPointer]['conditions']) > 0 + && array_values(array_reverse($tokens[$startPointer]['conditions']))[0] === T_USE + ) { + // Method imported from trait + return false; + } + + $previousToken = $tokens[$previousPointer]; + + $skipTokenCodes = [ + T_FUNCTION, + T_AS, + T_DOUBLE_COLON, + T_OBJECT_OPERATOR, + T_NULLSAFE_OBJECT_OPERATOR, + T_NAMESPACE, + T_CONST, + T_ENUM_CASE, + ]; + + if ($previousToken['code'] === T_USE) { + $classPointer = TokenHelper::findPrevious($phpcsFile, [T_CLASS, T_TRAIT, T_ANON_CLASS, T_ENUM], $startPointer - 1); + if ($classPointer !== null) { + $classToken = $tokens[$classPointer]; + return $startPointer > $classToken['scope_opener'] && $startPointer < $classToken['scope_closer']; + } + + return false; + } + + if ( + $previousToken['code'] === T_OPEN_PARENTHESIS + && isset($previousToken['parenthesis_owner']) + && $tokens[$previousToken['parenthesis_owner']]['code'] === T_DECLARE + ) { + return false; + } + + if ( + $previousToken['code'] === T_COMMA + && TokenHelper::findPreviousLocal($phpcsFile, T_DECLARE, $previousPointer - 1) !== null + ) { + return false; + } + + if ($previousToken['code'] === T_COMMA) { + $constPointer = TokenHelper::findPreviousLocal($phpcsFile, T_CONST, $previousPointer - 1); + if ( + $constPointer !== null + && TokenHelper::findNext($phpcsFile, [T_OPEN_SHORT_ARRAY, T_ARRAY], $constPointer + 1, $startPointer) === null + ) { + return false; + } + } elseif ($previousToken['code'] === T_BITWISE_AND) { + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + $isFunctionPointerBefore = TokenHelper::findPreviousLocal($phpcsFile, T_FUNCTION, $previousPointer - 1) !== null; + + if ($tokens[$pointerBefore]['code'] !== T_VARIABLE && $isFunctionPointerBefore) { + return false; + } + } elseif ($previousToken['code'] === T_GOTO) { + return false; + } + + $isProbablyReferencedName = !in_array( + $previousToken['code'], + array_merge($skipTokenCodes, TokenHelper::$typeKeywordTokenCodes), + true + ); + + if (!$isProbablyReferencedName) { + return false; + } + + $endPointer = self::getReferencedNameEndPointer($phpcsFile, $startPointer); + $referencedName = self::getReferenceName($phpcsFile, $startPointer, $endPointer); + + if (TypeHintHelper::isSimpleTypeHint($referencedName) || $referencedName === 'object') { + return $tokens[$nextPointer]['code'] === T_OPEN_PARENTHESIS; + } + + return true; + } + + /** + * @return list + */ + private static function createAllReferencedNamesInAttributes(File $phpcsFile, int $openTagPointer): array + { + $referencedNames = []; + + $tokens = $phpcsFile->getTokens(); + + $attributePointers = TokenHelper::findNextAll($phpcsFile, T_ATTRIBUTE, $openTagPointer + 1); + + foreach ($attributePointers as $attributeStartPointer) { + $searchStartPointer = $attributeStartPointer + 1; + $searchEndPointer = $tokens[$attributeStartPointer]['attribute_closer']; + + $searchPointer = $searchStartPointer; + $searchTokens = array_merge(TokenHelper::getNameTokenCodes(), [T_OPEN_PARENTHESIS, T_CLOSE_PARENTHESIS]); + $level = 0; + do { + $pointer = TokenHelper::findNext($phpcsFile, $searchTokens, $searchPointer, $searchEndPointer); + + if ($pointer === null) { + break; + } + + if ($tokens[$pointer]['code'] === T_OPEN_PARENTHESIS) { + $level++; + $searchPointer = $pointer + 1; + continue; + } + + if ($tokens[$pointer]['code'] === T_CLOSE_PARENTHESIS) { + $level--; + $searchPointer = $pointer + 1; + continue; + } + + $referencedNameEndPointer = self::getReferencedNameEndPointer($phpcsFile, $pointer); + + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + + if (in_array($tokens[$pointerBefore]['code'], [T_OPEN_TAG, T_ATTRIBUTE], true)) { + $referenceType = ReferencedName::TYPE_CLASS; + } elseif ($tokens[$pointerBefore]['code'] === T_COMMA && $level === 0) { + $referenceType = ReferencedName::TYPE_CLASS; + } elseif (self::isReferencedName($phpcsFile, $pointer)) { + $referenceType = self::getReferenceType($phpcsFile, $pointer, $referencedNameEndPointer); + } else { + $searchPointer = $pointer + 1; + continue; + } + + $referencedName = self::getReferenceName($phpcsFile, $pointer, $referencedNameEndPointer); + + $referencedNames[] = new ReferencedName( + $referencedName, + $attributeStartPointer, + $tokens[$attributeStartPointer]['attribute_closer'], + $referenceType + ); + + $searchPointer = $referencedNameEndPointer + 1; + + } while (true); + } + + return $referencedNames; + } + + /** + * @param int|string $code + */ + private static function isNeedParsedContent($code): bool + { + return in_array($code, [T_DOUBLE_QUOTED_STRING, T_HEREDOC], true); + } + + /** + * @return list + */ + private static function getReferencedNamesFromString(string $content): array + { + $referencedNames = []; + $subTokens = token_get_all(' $token) { + if (is_array($token) && $token[0] === T_DOUBLE_COLON) { + $referencedName = ''; + $tmpPosition = $position - 1; + while (true) { + if (!is_array($subTokens[$tmpPosition]) || !in_array($subTokens[$tmpPosition][0], [T_NS_SEPARATOR, T_STRING], true)) { + break; + } + + $referencedName = $subTokens[$tmpPosition][1] . $referencedName; + $tmpPosition--; + } + + $referencedNames[] = $referencedName; + } elseif (is_array($token) && $token[0] === T_NEW) { + $referencedName = ''; + $tmpPosition = $position + 1; + while (true) { + if (!is_array($subTokens[$tmpPosition])) { + break; + } + if ($subTokens[$tmpPosition][0] === T_WHITESPACE) { + $tmpPosition++; + continue; + } + if (!in_array( + $subTokens[$tmpPosition][0], + [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED, T_NAME_RELATIVE], + true + )) { + break; + } + + $referencedName .= $subTokens[$tmpPosition][1]; + $tmpPosition++; + } + if ($referencedName !== '') { + $referencedNames[] = $referencedName; + } + } + } + + return $referencedNames; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php new file mode 100644 index 0000000..68c65b7 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php @@ -0,0 +1,65 @@ +getTokens(); + + $getScope = static function (int $pointer) use ($tokens): int { + $scope = 0; + + foreach (array_reverse($tokens[$pointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (!in_array($conditionTokenCode, TokenHelper::$functionTokenCodes, true)) { + continue; + } + + $scope = $tokens[$conditionPointer]['level'] + 1; + break; + } + + return $scope; + }; + + return $getScope($firstPointer) === $getScope($secondPointer); + } + + public static function getRootPointer(File $phpcsFile, int $pointer): int + { + $rootPointer = TokenHelper::findNext($phpcsFile, T_OPEN_TAG, 0); + + $rootPointers = array_reverse(self::getAllRootPointers($phpcsFile)); + foreach ($rootPointers as $currentRootPointer) { + if ($currentRootPointer < $pointer) { + $rootPointer = $currentRootPointer; + break; + } + } + + return $rootPointer; + } + + /** + * @return list + */ + public static function getAllRootPointers(File $phpcsFile): array + { + $lazyValue = static function () use ($phpcsFile): array { + return TokenHelper::findNextAll($phpcsFile, T_OPEN_TAG, 0); + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'openTagPointers', $lazyValue); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php new file mode 100644 index 0000000..fac1f79 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php @@ -0,0 +1,49 @@ +> + */ + private static $cache = []; + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint + * @return mixed + */ + public static function getAndSetIfNotCached(File $phpcsFile, string $key, Closure $lazyValue) + { + $fixerLoops = $phpcsFile->fixer !== null ? $phpcsFile->fixer->loops : 0; + $internalKey = sprintf('%s-%s', $phpcsFile->getFilename(), $key); + + self::setIfNotCached($fixerLoops, $internalKey, $lazyValue); + + return self::$cache[$fixerLoops][$internalKey] ?? null; + } + + private static function setIfNotCached(int $fixerLoops, string $internalKey, Closure $lazyValue): void + { + if (array_key_exists($fixerLoops, self::$cache) && array_key_exists($internalKey, self::$cache[$fixerLoops])) { + return; + } + + self::$cache[$fixerLoops][$internalKey] = $lazyValue(); + + if ($fixerLoops > 0) { + unset(self::$cache[$fixerLoops - 1]); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php new file mode 100644 index 0000000..ade9c26 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffSettingsHelper.php @@ -0,0 +1,90 @@ + $settings + * @return list + */ + public static function normalizeArray(array $settings): array + { + $settings = array_map(static function (string $value): string { + return trim($value); + }, $settings); + $settings = array_filter($settings, static function (string $value): bool { + return $value !== ''; + }); + return array_values($settings); + } + + /** + * @param array $settings + * @return array + */ + public static function normalizeAssociativeArray(array $settings): array + { + $normalizedSettings = []; + foreach ($settings as $key => $value) { + if (is_string($key)) { + $key = trim($key); + } + if (is_string($value)) { + $value = trim($value); + } + if ($key === '' || $value === '') { + continue; + } + $normalizedSettings[$key] = $value; + } + + return $normalizedSettings; + } + + public static function isValidRegularExpression(string $expression): bool + { + return preg_match('~^(?:\(.*\)|\{.*\}|\[.*\])[a-z]*\z~i', $expression) !== 0 + || preg_match('~^([^a-z\s\\\\]).*\\1[a-z]*\z~i', $expression) !== 0; + } + + public static function isEnabledByPhpVersion(?bool $value, int $phpVersionLimit): bool + { + if ($value !== null) { + return $value; + } + + $phpVersion = Config::getConfigData('php_version') !== null ? (int) Config::getConfigData('php_version') : PHP_VERSION_ID; + return $phpVersion >= $phpVersionLimit; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/StringHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/StringHelper.php new file mode 100644 index 0000000..52db3a8 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/StringHelper.php @@ -0,0 +1,25 @@ +> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $pointer, self::ANNOTATION); + + return array_reduce( + $annotations, + static function (bool $carry, Annotation $annotation) use ($suppressName): bool { + $annotationSuppressName = explode(' ', $annotation->getValue()->value)[0]; + + if ( + $suppressName === $annotationSuppressName + || strpos($suppressName, sprintf('%s.', $annotationSuppressName)) === 0 + ) { + $carry = true; + } + + return $carry; + }, + false + ); + } + + public static function removeSuppressAnnotation(File $phpcsFile, int $pointer, string $suppressName): void + { + $suppressAnnotation = null; + /** @var Annotation $annotation */ + foreach (AnnotationHelper::getAnnotations($phpcsFile, $pointer, self::ANNOTATION) as $annotation) { + if ($annotation->getValue()->value === $suppressName) { + $suppressAnnotation = $annotation; + break; + } + } + + assert($suppressAnnotation !== null); + + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBefore */ + $pointerBefore = TokenHelper::findPrevious( + $phpcsFile, + [T_DOC_COMMENT_OPEN_TAG, T_DOC_COMMENT_STAR], + $suppressAnnotation->getStartPointer() - 1 + ); + + $changeStart = $tokens[$pointerBefore]['code'] === T_DOC_COMMENT_STAR ? $pointerBefore : $suppressAnnotation->getStartPointer(); + + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], + $suppressAnnotation->getEndPointer() + 1 + ) - 1; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TernaryOperatorHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TernaryOperatorHelper.php new file mode 100644 index 0000000..ce1f675 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TernaryOperatorHelper.php @@ -0,0 +1,182 @@ +getTokens(); + + $pointer = $inlineThenPointer; + do { + $pointer = TokenHelper::findNext( + $phpcsFile, + [T_INLINE_ELSE, T_OPEN_PARENTHESIS, T_OPEN_SHORT_ARRAY, T_OPEN_SQUARE_BRACKET], + $pointer + 1 + ); + + if ($tokens[$pointer]['code'] === T_OPEN_PARENTHESIS) { + $pointer = $tokens[$pointer]['parenthesis_closer']; + continue; + } + + if (in_array($tokens[$pointer]['code'], [T_OPEN_SHORT_ARRAY, T_OPEN_SQUARE_BRACKET], true)) { + $pointer = $tokens[$pointer]['bracket_closer']; + continue; + } + + if (ScopeHelper::isInSameScope($phpcsFile, $inlineThenPointer, $pointer)) { + break; + } + } while ($pointer !== null); + + return $pointer; + } + + public static function getStartPointer(File $phpcsFile, int $inlineThenPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeCondition = $inlineThenPointer; + do { + $pointerBeforeCondition = TokenHelper::findPrevious( + $phpcsFile, + [T_EQUAL, T_DOUBLE_ARROW, T_COMMA, T_RETURN, T_THROW, T_CASE, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO, T_OPEN_SQUARE_BRACKET, T_OPEN_SHORT_ARRAY, T_OPEN_PARENTHESIS], + $pointerBeforeCondition - 1 + ); + + if ( + in_array($tokens[$pointerBeforeCondition]['code'], [T_OPEN_SQUARE_BRACKET, T_OPEN_SHORT_ARRAY], true) + && $tokens[$pointerBeforeCondition]['bracket_closer'] < $inlineThenPointer + ) { + continue; + } + + if ( + $tokens[$pointerBeforeCondition]['code'] === T_OPEN_PARENTHESIS + && $tokens[$pointerBeforeCondition]['parenthesis_closer'] < $inlineThenPointer + ) { + continue; + } + + break; + + } while (true); + + return TokenHelper::findNextEffective($phpcsFile, $pointerBeforeCondition + 1); + } + + public static function getEndPointer(File $phpcsFile, int $inlineThenPointer, int $inlineElsePointer): int + { + $tokens = $phpcsFile->getTokens(); + + $pointerAfterInlineElseEnd = $inlineElsePointer; + do { + $pointerAfterInlineElseEnd = TokenHelper::findNext( + $phpcsFile, + [T_SEMICOLON, T_COLON, T_COMMA, T_DOUBLE_ARROW, T_CLOSE_PARENTHESIS, T_CLOSE_SHORT_ARRAY, T_CLOSE_SQUARE_BRACKET, T_COALESCE], + $pointerAfterInlineElseEnd + 1 + ); + + if ($pointerAfterInlineElseEnd === null) { + continue; + } + + if ($tokens[$pointerAfterInlineElseEnd]['code'] === T_CLOSE_PARENTHESIS) { + if ($tokens[$pointerAfterInlineElseEnd]['parenthesis_opener'] < $inlineThenPointer) { + break; + } + } elseif (in_array($tokens[$pointerAfterInlineElseEnd]['code'], [T_CLOSE_SHORT_ARRAY, T_CLOSE_SQUARE_BRACKET], true)) { + if ($tokens[$pointerAfterInlineElseEnd]['bracket_opener'] < $inlineThenPointer) { + break; + } + } elseif ($tokens[$pointerAfterInlineElseEnd]['code'] === T_COMMA) { + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_PARENTHESIS, T_OPEN_SHORT_ARRAY], + $pointerAfterInlineElseEnd - 1, + $inlineThenPointer + ); + + if ($previousPointer === null) { + break; + } + + if ( + $tokens[$previousPointer]['code'] === T_OPEN_PARENTHESIS + && $tokens[$previousPointer]['parenthesis_closer'] < $pointerAfterInlineElseEnd + ) { + break; + } + + if ( + $tokens[$previousPointer]['code'] === T_OPEN_SHORT_ARRAY + && $tokens[$previousPointer]['bracket_closer'] < $pointerAfterInlineElseEnd + ) { + break; + } + + } elseif ($tokens[$pointerAfterInlineElseEnd]['code'] === T_DOUBLE_ARROW) { + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + T_OPEN_SHORT_ARRAY, + $pointerAfterInlineElseEnd - 1, + $inlineThenPointer + ); + if ($previousPointer === null) { + break; + } + } elseif (ScopeHelper::isInSameScope($phpcsFile, $inlineElsePointer, $pointerAfterInlineElseEnd)) { + break; + } + } while ($pointerAfterInlineElseEnd !== null); + + if ($pointerAfterInlineElseEnd !== null) { + return TokenHelper::findPreviousEffective($phpcsFile, $pointerAfterInlineElseEnd - 1); + } + + return TokenHelper::findPreviousEffective($phpcsFile, count($tokens) - 1); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php new file mode 100644 index 0000000..4773a92 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenHelper.php @@ -0,0 +1,534 @@ + */ + public static $arrayTokenCodes = [ + T_ARRAY, + T_OPEN_SHORT_ARRAY, + ]; + + /** @var array */ + public static $typeKeywordTokenCodes = [ + T_CLASS, + T_TRAIT, + T_INTERFACE, + T_ENUM, + ]; + + /** @var array */ + public static $typeWithAnonymousClassKeywordTokenCodes = [ + T_CLASS, + T_ANON_CLASS, + T_TRAIT, + T_INTERFACE, + T_ENUM, + ]; + + /** @var array */ + public static $ineffectiveTokenCodes = [ + T_WHITESPACE, + T_COMMENT, + T_DOC_COMMENT, + T_DOC_COMMENT_OPEN_TAG, + T_DOC_COMMENT_CLOSE_TAG, + T_DOC_COMMENT_STAR, + T_DOC_COMMENT_STRING, + T_DOC_COMMENT_TAG, + T_DOC_COMMENT_WHITESPACE, + T_PHPCS_DISABLE, + T_PHPCS_ENABLE, + T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE, + T_PHPCS_SET, + ]; + + /** @var array */ + public static $annotationTokenCodes = [ + T_DOC_COMMENT_TAG, + T_PHPCS_DISABLE, + T_PHPCS_ENABLE, + T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE, + T_PHPCS_SET, + ]; + + /** @var array */ + public static $inlineCommentTokenCodes = [ + T_COMMENT, + T_PHPCS_DISABLE, + T_PHPCS_ENABLE, + T_PHPCS_IGNORE, + T_PHPCS_IGNORE_FILE, + T_PHPCS_SET, + ]; + + /** @var array */ + public static $earlyExitTokenCodes = [ + T_RETURN, + T_CONTINUE, + T_BREAK, + T_THROW, + T_EXIT, + ]; + + /** @var array */ + public static $functionTokenCodes = [ + T_FUNCTION, + T_CLOSURE, + T_FN, + ]; + + /** @var array */ + public static $propertyModifiersTokenCodes = [ + T_VAR, + T_PUBLIC, + T_PROTECTED, + T_PRIVATE, + T_READONLY, + T_STATIC, + ]; + + /** + * @param int|string|array $types + */ + public static function findNext(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findNext($types, $startPointer, $endPointer, false); + return $token === false ? null : $token; + } + + /** + * @param int|string|array $types + * @return list + */ + public static function findNextAll(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): array + { + $pointers = []; + + $actualStartPointer = $startPointer; + while (true) { + $pointer = self::findNext($phpcsFile, $types, $actualStartPointer, $endPointer); + if ($pointer === null) { + break; + } + + $pointers[] = $pointer; + $actualStartPointer = $pointer + 1; + } + + return $pointers; + } + + /** + * @param int|string|array $types + */ + public static function findNextContent(File $phpcsFile, $types, string $content, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findNext($types, $startPointer, $endPointer, false, $content); + return $token === false ? null : $token; + } + + /** + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findNextEffective(File $phpcsFile, int $startPointer, ?int $endPointer = null): ?int + { + return self::findNextExcluding($phpcsFile, self::$ineffectiveTokenCodes, $startPointer, $endPointer); + } + + /** + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findNextNonWhitespace(File $phpcsFile, int $startPointer, ?int $endPointer = null): ?int + { + return self::findNextExcluding($phpcsFile, T_WHITESPACE, $startPointer, $endPointer); + } + + /** + * @param int|string|array $types + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findNextExcluding(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findNext($types, $startPointer, $endPointer, true); + return $token === false ? null : $token; + } + + /** + * @param int|string|array $types + */ + public static function findNextLocal(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findNext($types, $startPointer, $endPointer, false, null, true); + return $token === false ? null : $token; + } + + /** + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findNextAnyToken(File $phpcsFile, int $startPointer, ?int $endPointer = null): ?int + { + return self::findNextExcluding($phpcsFile, [], $startPointer, $endPointer); + } + + /** + * @param int|string|array $types + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findPrevious(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, false); + return $token === false ? null : $token; + } + + /** + * @param int|string|array $types + */ + public static function findPreviousContent(File $phpcsFile, $types, string $content, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, false, $content); + return $token === false ? null : $token; + } + + /** + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findPreviousEffective(File $phpcsFile, int $startPointer, ?int $endPointer = null): ?int + { + return self::findPreviousExcluding($phpcsFile, self::$ineffectiveTokenCodes, $startPointer, $endPointer); + } + + /** + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findPreviousNonWhitespace(File $phpcsFile, int $startPointer, ?int $endPointer = null): ?int + { + return self::findPreviousExcluding($phpcsFile, T_WHITESPACE, $startPointer, $endPointer); + } + + /** + * @param int|string|array $types + * @param int $startPointer Search starts at this token, inclusive + * @param int|null $endPointer Search ends at this token, exclusive + */ + public static function findPreviousExcluding(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, true); + return $token === false ? null : $token; + } + + /** + * @param int|string|array $types + */ + public static function findPreviousLocal(File $phpcsFile, $types, int $startPointer, ?int $endPointer = null): ?int + { + /** @var int|false $token */ + $token = $phpcsFile->findPrevious($types, $startPointer, $endPointer, false, null, true); + return $token === false ? null : $token; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findFirstTokenOnLine(File $phpcsFile, int $pointer): int + { + if ($pointer === 0) { + return $pointer; + } + + $tokens = $phpcsFile->getTokens(); + + $line = $tokens[$pointer]['line']; + + do { + $pointer--; + } while ($tokens[$pointer]['line'] === $line); + + return $pointer + 1; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findLastTokenOnLine(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $line = $tokens[$pointer]['line']; + + do { + $pointer++; + } while (array_key_exists($pointer, $tokens) && $tokens[$pointer]['line'] === $line); + + return $pointer - 1; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findLastTokenOnPreviousLine(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $line = $tokens[$pointer]['line']; + + do { + $pointer--; + } while ($tokens[$pointer]['line'] === $line); + + return $pointer; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findFirstTokenOnNextLine(File $phpcsFile, int $pointer): ?int + { + $tokens = $phpcsFile->getTokens(); + if ($pointer >= count($tokens)) { + return null; + } + + $line = $tokens[$pointer]['line']; + + do { + $pointer++; + if (!array_key_exists($pointer, $tokens)) { + return null; + } + } while ($tokens[$pointer]['line'] === $line); + + return $pointer; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findFirstNonWhitespaceOnLine(File $phpcsFile, int $pointer): int + { + if ($pointer === 0) { + return $pointer; + } + + $tokens = $phpcsFile->getTokens(); + + $line = $tokens[$pointer]['line']; + + do { + $pointer--; + } while ($pointer >= 0 && $tokens[$pointer]['line'] === $line); + + return self::findNextExcluding($phpcsFile, [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], $pointer + 1); + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findFirstNonWhitespaceOnNextLine(File $phpcsFile, int $pointer): ?int + { + $newLinePointer = self::findNextContent($phpcsFile, [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], $phpcsFile->eolChar, $pointer); + if ($newLinePointer === null) { + return null; + } + + $nextPointer = self::findNextExcluding($phpcsFile, [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], $newLinePointer + 1); + + $tokens = $phpcsFile->getTokens(); + if ($nextPointer !== null && $tokens[$pointer]['line'] === $tokens[$nextPointer]['line'] - 1) { + return $nextPointer; + } + + return null; + } + + /** + * @param int $pointer Search starts at this token, inclusive + */ + public static function findFirstNonWhitespaceOnPreviousLine(File $phpcsFile, int $pointer): ?int + { + $newLinePointerOnPreviousLine = self::findPreviousContent( + $phpcsFile, + [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], + $phpcsFile->eolChar, + $pointer + ); + if ($newLinePointerOnPreviousLine === null) { + return null; + } + + $newLinePointerBeforePreviousLine = self::findPreviousContent( + $phpcsFile, + [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], + $phpcsFile->eolChar, + $newLinePointerOnPreviousLine - 1 + ); + if ($newLinePointerBeforePreviousLine === null) { + return null; + } + + $nextPointer = self::findNextExcluding($phpcsFile, [T_WHITESPACE, T_DOC_COMMENT_WHITESPACE], $newLinePointerBeforePreviousLine + 1); + + $tokens = $phpcsFile->getTokens(); + if ($nextPointer !== null && $tokens[$pointer]['line'] === $tokens[$nextPointer]['line'] + 1) { + return $nextPointer; + } + + return null; + } + + public static function getContent(File $phpcsFile, int $startPointer, ?int $endPointer = null): string + { + $tokens = $phpcsFile->getTokens(); + $endPointer = $endPointer ?? self::getLastTokenPointer($phpcsFile); + + $content = ''; + for ($i = $startPointer; $i <= $endPointer; $i++) { + $content .= $tokens[$i]['content']; + } + + return $content; + } + + public static function getLastTokenPointer(File $phpcsFile): int + { + $tokenCount = count($phpcsFile->getTokens()); + if ($tokenCount === 0) { + throw new EmptyFileException($phpcsFile->getFilename()); + } + return $tokenCount - 1; + } + + /** + * @return array + */ + public static function getNameTokenCodes(): array + { + return [T_STRING, T_NS_SEPARATOR, T_NAME_FULLY_QUALIFIED, T_NAME_QUALIFIED, T_NAME_RELATIVE]; + } + + /** + * @return array + */ + public static function getOnlyNameTokenCodes(): array + { + return [T_STRING, T_NAME_FULLY_QUALIFIED, T_NAME_QUALIFIED, T_NAME_RELATIVE]; + } + + /** + * @return array + */ + public static function getOnlyTypeHintTokenCodes(): array + { + static $typeHintTokenCodes = null; + + if ($typeHintTokenCodes === null) { + $typeHintTokenCodes = array_merge( + self::getNameTokenCodes(), + [ + T_SELF, + T_PARENT, + T_ARRAY_HINT, + T_CALLABLE, + T_FALSE, + T_TRUE, + T_NULL, + ] + ); + } + + return $typeHintTokenCodes; + } + + /** + * @return array + */ + public static function getTypeHintTokenCodes(): array + { + static $typeHintTokenCodes = null; + + if ($typeHintTokenCodes === null) { + $typeHintTokenCodes = array_merge( + self::getOnlyTypeHintTokenCodes(), + [T_TYPE_UNION, T_TYPE_INTERSECTION] + ); + } + + return $typeHintTokenCodes; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenPointerOutOfBoundsException.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenPointerOutOfBoundsException.php new file mode 100644 index 0000000..32ff536 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TokenPointerOutOfBoundsException.php @@ -0,0 +1,47 @@ +pointer = $pointer; + $this->lastTokenPointer = $lastTokenPointer; + } + + public function getPointer(): int + { + return $this->pointer; + } + + public function getLastTokenPointer(): int + { + return $this->lastTokenPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHelper.php new file mode 100644 index 0000000..8539c98 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHelper.php @@ -0,0 +1,35 @@ +typeHint = $typeHint; + $this->nullable = $nullable; + $this->startPointer = $startPointer; + $this->endPointer = $endPointer; + } + + public function getTypeHint(): string + { + return $this->typeHint; + } + + public function getTypeHintWithoutNullabilitySymbol(): string + { + return strpos($this->typeHint, '?') === 0 ? substr($this->typeHint, 1) : $this->typeHint; + } + + public function isNullable(): bool + { + return $this->nullable; + } + + public function getStartPointer(): int + { + return $this->startPointer; + } + + public function getEndPointer(): int + { + return $this->endPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php new file mode 100644 index 0000000..abde19b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/TypeHintHelper.php @@ -0,0 +1,417 @@ + 'int', + 'boolean' => 'bool', + ]; + return array_key_exists($typeHint, $longToShort) ? $longToShort[$typeHint] : $typeHint; + } + + public static function isUnofficialUnionTypeHint(string $typeHint): bool + { + return in_array($typeHint, ['scalar', 'numeric'], true); + } + + public static function isVoidTypeHint(string $typeHint): bool + { + return $typeHint === 'void'; + } + + public static function isNeverTypeHint(string $typeHint): bool + { + return in_array($typeHint, ['never', 'never-return', 'never-returns', 'no-return'], true); + } + + /** + * @return list + */ + public static function convertUnofficialUnionTypeHintToOfficialTypeHints(string $typeHint): array + { + $conversion = [ + 'scalar' => ['string', 'int', 'float', 'bool'], + 'numeric' => ['int', 'float'], + ]; + + return $conversion[$typeHint]; + } + + public static function isTypeDefinedInAnnotation(File $phpcsFile, int $pointer, string $typeHint): bool + { + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $pointer); + + if ($docCommentOpenPointer === null) { + return false; + } + + return self::isTemplate($phpcsFile, $docCommentOpenPointer, $typeHint) + || self::isAlias($phpcsFile, $docCommentOpenPointer, $typeHint); + } + + public static function getFullyQualifiedTypeHint(File $phpcsFile, int $pointer, string $typeHint): string + { + if (self::isSimpleTypeHint($typeHint)) { + return self::convertLongSimpleTypeHintToShort($typeHint); + } + + return NamespaceHelper::resolveClassName($phpcsFile, $typeHint, $pointer); + } + + /** + * @return list + */ + public static function getSimpleTypeHints(): array + { + static $simpleTypeHints; + + if ($simpleTypeHints === null) { + $simpleTypeHints = [ + 'int', + 'integer', + 'false', + 'float', + 'string', + 'bool', + 'boolean', + 'callable', + 'self', + 'array', + 'iterable', + 'void', + 'never', + ]; + } + + return $simpleTypeHints; + } + + /** + * @return list + */ + public static function getSimpleIterableTypeHints(): array + { + return [ + 'array', + 'iterable', + ]; + } + + public static function isSimpleUnofficialTypeHints(string $typeHint): bool + { + static $simpleUnofficialTypeHints; + + if ($simpleUnofficialTypeHints === null) { + $simpleUnofficialTypeHints = [ + 'null', + 'mixed', + 'scalar', + 'numeric', + 'true', + 'object', + 'resource', + 'static', + '$this', + 'class-string', + 'trait-string', + 'callable-string', + 'numeric-string', + 'non-empty-string', + 'non-falsy-string', + 'literal-string', + 'array-key', + 'list', + 'empty', + 'positive-int', + 'negative-int', + 'min', + 'max', + ]; + } + + return in_array($typeHint, $simpleUnofficialTypeHints, true); + } + + /** + * @param list $traversableTypeHints + */ + public static function isTraversableType(string $type, array $traversableTypeHints): bool + { + return self::isSimpleIterableTypeHint($type) || in_array($type, $traversableTypeHints, true); + } + + public static function typeHintEqualsAnnotation( + File $phpcsFile, + int $functionPointer, + string $typeHint, + string $typeHintInAnnotation + ): bool + { + /** @var list $typeHintParts */ + $typeHintParts = preg_split('~([&|])~', self::normalize($typeHint), -1, PREG_SPLIT_DELIM_CAPTURE); + /** @var list $typeHintInAnnotationParts */ + $typeHintInAnnotationParts = preg_split('~([&|])~', self::normalize($typeHintInAnnotation), -1, PREG_SPLIT_DELIM_CAPTURE); + + if (count($typeHintParts) !== count($typeHintInAnnotationParts)) { + return false; + } + + for ($i = 0; $i < count($typeHintParts); $i++) { + if ( + ( + $typeHintParts[$i] === '|' + || $typeHintParts[$i] === '&' + ) + && $typeHintParts[$i] !== $typeHintInAnnotationParts[$i] + ) { + return false; + } + + if (self::getFullyQualifiedTypeHint($phpcsFile, $functionPointer, $typeHintParts[$i]) !== self::getFullyQualifiedTypeHint( + $phpcsFile, + $functionPointer, + $typeHintInAnnotationParts[$i] + )) { + return false; + } + } + + return true; + } + + public static function getStartPointer(File $phpcsFile, int $endPointer): int + { + $previousPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge([T_WHITESPACE], TokenHelper::getTypeHintTokenCodes()), + $endPointer - 1 + ); + return TokenHelper::findNextNonWhitespace($phpcsFile, $previousPointer + 1); + } + + private static function isTemplate(File $phpcsFile, int $docCommentOpenPointer, string $typeHint): bool + { + static $templateAnnotationNames = null; + if ($templateAnnotationNames === null) { + foreach (['template', 'template-covariant'] as $annotationName) { + $templateAnnotationNames[] = sprintf('@%s', $annotationName); + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefixAnnotationName) { + $templateAnnotationNames[] = sprintf('@%s-%s', $prefixAnnotationName, $annotationName); + } + } + } + + $containsTypeHintInTemplateAnnotation = static function (int $docCommentOpenPointer) use ($phpcsFile, $templateAnnotationNames, $typeHint): bool { + foreach ($templateAnnotationNames as $templateAnnotationName) { + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, $templateAnnotationName); + + foreach ($annotations as $templateAnnotation) { + if ($templateAnnotation->isInvalid()) { + continue; + } + + if ($templateAnnotation->getValue()->name === $typeHint) { + return true; + } + } + } + + return false; + }; + + $tokens = $phpcsFile->getTokens(); + + $docCommentOwnerPointer = DocCommentHelper::findDocCommentOwnerPointer($phpcsFile, $docCommentOpenPointer); + if ($docCommentOwnerPointer !== null) { + if (in_array($tokens[$docCommentOwnerPointer]['code'], TokenHelper::$typeKeywordTokenCodes, true)) { + return $containsTypeHintInTemplateAnnotation($docCommentOpenPointer); + } + + if ($tokens[$docCommentOwnerPointer]['code'] === T_FUNCTION && $containsTypeHintInTemplateAnnotation($docCommentOpenPointer)) { + return true; + } + } + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $docCommentOpenPointer); + + if ($classPointer === null) { + return false; + } + + $classDocCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $classPointer); + if ($classDocCommentOpenPointer === null) { + return false; + } + + return $containsTypeHintInTemplateAnnotation($classDocCommentOpenPointer); + } + + private static function isAlias(File $phpcsFile, int $docCommentOpenPointer, string $typeHint): bool + { + static $aliasAnnotationNames = null; + if ($aliasAnnotationNames === null) { + foreach (['type', 'import-type'] as $annotationName) { + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefixAnnotationName) { + $aliasAnnotationNames[] = sprintf('@%s-%s', $prefixAnnotationName, $annotationName); + } + } + } + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $docCommentOpenPointer); + + if ($classPointer === null) { + return false; + } + + $classDocCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $classPointer); + if ($classDocCommentOpenPointer === null) { + return false; + } + + foreach ($aliasAnnotationNames as $aliasAnnotationName) { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $classDocCommentOpenPointer, $aliasAnnotationName); + + foreach ($annotations as $aliasAnnotation) { + $aliasAnnotationValue = $aliasAnnotation->getValue(); + + if ($aliasAnnotationValue instanceof TypeAliasTagValueNode && $aliasAnnotationValue->alias === $typeHint) { + return true; + } + + if (!($aliasAnnotationValue instanceof TypeAliasImportTagValueNode)) { + continue; + } + + if ($aliasAnnotationValue->importedAs === $typeHint) { + return true; + } + + if ($aliasAnnotationValue->importedAlias === $typeHint) { + return true; + } + } + } + + return false; + } + + private static function normalize(string $typeHint): string + { + if (StringHelper::startsWith($typeHint, '?')) { + $typeHint = substr($typeHint, 1) . '|null'; + } + + if (self::isNeverTypeHint($typeHint)) { + return 'never'; + } + + /** @var list $parts */ + $parts = preg_split('~([&|])~', $typeHint, -1, PREG_SPLIT_DELIM_CAPTURE); + + $hints = []; + $delimiter = '|'; + foreach ($parts as $part) { + if ($part === '|' || $part === '&') { + $delimiter = $part; + continue; + } + + $hints[] = $part; + } + + if (in_array('mixed', $hints, true)) { + return 'mixed'; + } + + $convertedHints = []; + foreach ($hints as $hint) { + if (self::isUnofficialUnionTypeHint($hint) && $delimiter !== '&') { + $convertedHints = array_merge($convertedHints, self::convertUnofficialUnionTypeHintToOfficialTypeHints($hint)); + } else { + $convertedHints[] = $hint; + } + } + + $convertedHints = array_unique($convertedHints); + + if (count($convertedHints) > 1) { + $convertedHints = array_map(static function (string $part): string { + return self::isVoidTypeHint($part) ? 'null' : $part; + }, $convertedHints); + } + + sort($convertedHints); + + return implode($delimiter, $convertedHints); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatement.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatement.php new file mode 100644 index 0000000..fb5eb51 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatement.php @@ -0,0 +1,135 @@ +nameAsReferencedInFile = $nameAsReferencedInFile; + $this->normalizedNameAsReferencedInFile = self::normalizedNameAsReferencedInFile($type, $nameAsReferencedInFile); + $this->fullyQualifiedTypeName = $fullyQualifiedClassName; + $this->usePointer = $usePointer; + $this->type = $type; + $this->alias = $alias; + } + + public function getNameAsReferencedInFile(): string + { + return $this->nameAsReferencedInFile; + } + + public function getCanonicalNameAsReferencedInFile(): string + { + return $this->normalizedNameAsReferencedInFile; + } + + public function getFullyQualifiedTypeName(): string + { + return $this->fullyQualifiedTypeName; + } + + public function getPointer(): int + { + return $this->usePointer; + } + + public function getType(): string + { + return $this->type; + } + + public function getAlias(): ?string + { + return $this->alias; + } + + public function isClass(): bool + { + return $this->type === self::TYPE_CLASS; + } + + public function isConstant(): bool + { + return $this->type === self::TYPE_CONSTANT; + } + + public function isFunction(): bool + { + return $this->type === self::TYPE_FUNCTION; + } + + public function hasSameType(self $that): bool + { + return $this->type === $that->type; + } + + public static function getUniqueId(string $type, string $name): string + { + $normalizedName = self::normalizedNameAsReferencedInFile($type, $name); + + if ($type === self::TYPE_CLASS) { + return $normalizedName; + } + + return sprintf('%s %s', $type, $normalizedName); + } + + public static function normalizedNameAsReferencedInFile(string $type, string $name): string + { + if ($type === self::TYPE_CONSTANT) { + return $name; + } + + return strtolower($name); + } + + public static function getTypeName(string $type): ?string + { + if ($type === self::TYPE_CONSTANT) { + return 'const'; + } + + if ($type === self::TYPE_FUNCTION) { + return 'function'; + } + + return null; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php new file mode 100644 index 0000000..9ef25bc --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php @@ -0,0 +1,270 @@ +getTokens(); + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + + // Anonymous function use + if ($tokens[$nextPointer]['code'] === T_OPEN_PARENTHESIS) { + return false; + } + + if ( + $tokens[$nextPointer]['code'] === T_STRING + && in_array(strtolower($tokens[$nextPointer]['content']), ['function', 'const'], true) + ) { + return true; + } + + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_TAG, T_DECLARE, T_NAMESPACE, T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET], + $usePointer + ); + + if (in_array($tokens[$previousPointer]['code'], [T_OPEN_TAG, T_DECLARE, T_NAMESPACE], true)) { + return true; + } + + if (array_key_exists('scope_condition', $tokens[$previousPointer])) { + $scopeConditionPointer = $tokens[$previousPointer]['scope_condition']; + + if ( + $tokens[$previousPointer]['code'] === T_OPEN_CURLY_BRACKET + && in_array($tokens[$scopeConditionPointer]['code'], TokenHelper::$typeWithAnonymousClassKeywordTokenCodes, true) + ) { + return false; + } + + // Trait use after another trait use + if ($tokens[$scopeConditionPointer]['code'] === T_USE) { + return false; + } + + // Trait use after method or import use after function + if ($tokens[$scopeConditionPointer]['code'] === T_FUNCTION) { + return ClassHelper::getClassPointer($phpcsFile, $usePointer) === null; + } + } + + return true; + } + + public static function isTraitUse(File $phpcsFile, int $usePointer): bool + { + $tokens = $phpcsFile->getTokens(); + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + + // Anonymous function use + if ($tokens[$nextPointer]['code'] === T_OPEN_PARENTHESIS) { + return false; + } + + return !self::isImportUse($phpcsFile, $usePointer); + } + + public static function getAlias(File $phpcsFile, int $usePointer): ?string + { + $endPointer = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_COMMA], $usePointer + 1); + $asPointer = TokenHelper::findNext($phpcsFile, T_AS, $usePointer + 1, $endPointer); + + if ($asPointer === null) { + return null; + } + + $tokens = $phpcsFile->getTokens(); + return $tokens[TokenHelper::findNext($phpcsFile, T_STRING, $asPointer + 1)]['content']; + } + + public static function getNameAsReferencedInClassFromUse(File $phpcsFile, int $usePointer): string + { + $alias = self::getAlias($phpcsFile, $usePointer); + if ($alias !== null) { + return $alias; + } + + $name = self::getFullyQualifiedTypeNameFromUse($phpcsFile, $usePointer); + return NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($name); + } + + public static function getFullyQualifiedTypeNameFromUse(File $phpcsFile, int $usePointer): string + { + $tokens = $phpcsFile->getTokens(); + + $nameEndPointer = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_AS, T_COMMA], $usePointer + 1) - 1; + if (in_array($tokens[$nameEndPointer]['code'], TokenHelper::$ineffectiveTokenCodes, true)) { + $nameEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $nameEndPointer); + } + $nameStartPointer = TokenHelper::findPreviousExcluding($phpcsFile, TokenHelper::getNameTokenCodes(), $nameEndPointer - 1) + 1; + + $name = TokenHelper::getContent($phpcsFile, $nameStartPointer, $nameEndPointer); + + return NamespaceHelper::normalizeToCanonicalName($name); + } + + /** + * @return array + */ + public static function getUseStatementsForPointer(File $phpcsFile, int $pointer): array + { + $allUseStatements = self::getFileUseStatements($phpcsFile); + + if (count($allUseStatements) === 1) { + return current($allUseStatements); + } + + foreach (array_reverse($allUseStatements, true) as $pointerBeforeUseStatements => $useStatements) { + if ($pointerBeforeUseStatements < $pointer) { + return $useStatements; + } + } + + return []; + } + + /** + * @return array> + */ + public static function getFileUseStatements(File $phpcsFile): array + { + $lazyValue = static function () use ($phpcsFile): array { + $useStatements = []; + $tokens = $phpcsFile->getTokens(); + + $namespaceAndOpenTagPointers = TokenHelper::findNextAll($phpcsFile, [T_OPEN_TAG, T_NAMESPACE], 0); + $openTagPointer = $namespaceAndOpenTagPointers[0]; + + foreach (self::getUseStatementPointers($phpcsFile, $openTagPointer) as $usePointer) { + $pointerBeforeUseStatements = $openTagPointer; + if (count($namespaceAndOpenTagPointers) > 1) { + foreach (array_reverse($namespaceAndOpenTagPointers) as $namespaceAndOpenTagPointer) { + if ($namespaceAndOpenTagPointer < $usePointer) { + $pointerBeforeUseStatements = $namespaceAndOpenTagPointer; + break; + } + } + } + + $nextTokenFromUsePointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + $type = UseStatement::TYPE_CLASS; + if ($tokens[$nextTokenFromUsePointer]['code'] === T_STRING) { + if ($tokens[$nextTokenFromUsePointer]['content'] === 'const') { + $type = UseStatement::TYPE_CONSTANT; + } elseif ($tokens[$nextTokenFromUsePointer]['content'] === 'function') { + $type = UseStatement::TYPE_FUNCTION; + } + } + $name = self::getNameAsReferencedInClassFromUse($phpcsFile, $usePointer); + $useStatement = new UseStatement( + $name, + self::getFullyQualifiedTypeNameFromUse($phpcsFile, $usePointer), + $usePointer, + $type, + self::getAlias($phpcsFile, $usePointer) + ); + $useStatements[$pointerBeforeUseStatements][UseStatement::getUniqueId($type, $name)] = $useStatement; + } + + return $useStatements; + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'useStatements', $lazyValue); + } + + public static function getUseStatementPointer(File $phpcsFile, int $pointer): ?int + { + $pointers = self::getUseStatementPointers($phpcsFile, 0); + + foreach (array_reverse($pointers) as $pointerBeforeUseStatements) { + if ($pointerBeforeUseStatements < $pointer) { + return $pointerBeforeUseStatements; + } + } + + return null; + } + + /** + * Searches for all use statements in a file, skips bodies of classes and traits. + * + * @return list + */ + private static function getUseStatementPointers(File $phpcsFile, int $openTagPointer): array + { + $lazy = static function () use ($phpcsFile, $openTagPointer): array { + $tokens = $phpcsFile->getTokens(); + $pointer = $openTagPointer + 1; + $pointers = []; + while (true) { + $typesToFind = array_merge([T_USE], TokenHelper::$typeKeywordTokenCodes); + $pointer = TokenHelper::findNext($phpcsFile, $typesToFind, $pointer); + if ($pointer === null) { + break; + } + + $token = $tokens[$pointer]; + if (in_array($token['code'], TokenHelper::$typeKeywordTokenCodes, true)) { + $pointer = $token['scope_closer'] + 1; + continue; + } + + if (self::isGroupUse($phpcsFile, $pointer)) { + $pointer++; + continue; + } + + if (!self::isImportUse($phpcsFile, $pointer)) { + $pointer++; + continue; + } + + $pointers[] = $pointer; + $pointer++; + } + + return $pointers; + }; + + return SniffLocalCache::getAndSetIfNotCached($phpcsFile, 'useStatementPointers', $lazy); + } + + private static function isGroupUse(File $phpcsFile, int $usePointer): bool + { + $tokens = $phpcsFile->getTokens(); + $semicolonOrGroupUsePointer = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_OPEN_USE_GROUP], $usePointer + 1); + + return $tokens[$semicolonOrGroupUsePointer]['code'] === T_OPEN_USE_GROUP; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/VariableHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/VariableHelper.php new file mode 100644 index 0000000..676b0ab --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/VariableHelper.php @@ -0,0 +1,178 @@ +getTokens(); + + if ($tokens[$variablePointer]['content'] !== $tokens[$variableToCheckPointer]['content']) { + return false; + } + + if ($tokens[$variableToCheckPointer - 1]['code'] === T_DOUBLE_COLON) { + $pointerAfterVariable = TokenHelper::findNextEffective($phpcsFile, $variableToCheckPointer + 1); + return $tokens[$pointerAfterVariable]['code'] === T_OPEN_PARENTHESIS; + } + + return !ParameterHelper::isParameter($phpcsFile, $variableToCheckPointer); + } + + public static function isUsedInCompactFunction(File $phpcsFile, int $variablePointer, int $stringPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $stringContent = $tokens[$stringPointer]['content']; + if (strtolower($stringContent) !== 'compact') { + return false; + } + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return false; + } + + $variableNameWithoutDollar = substr($tokens[$variablePointer]['content'], 1); + for ($i = $parenthesisOpenerPointer + 1; $i < $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; $i++) { + if (preg_match('~^([\'"])' . $variableNameWithoutDollar . '\\1$~', $tokens[$i]['content']) !== 0) { + return true; + } + } + + return false; + } + + public static function isUsedInScopeInString(File $phpcsFile, string $variableName, int $stringPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $stringContent = $tokens[$stringPointer]['content']; + + if (preg_match('~(\\\\)?(' . preg_quote($variableName, '~') . ')\b~', $stringContent, $matches) !== 0) { + if ($matches[1] === '') { + return true; + } + + if (strlen($matches[1]) % 2 === 1) { + return true; + } + } + + $variableNameWithoutDollar = substr($variableName, 1); + return preg_match('~\$\{' . preg_quote($variableNameWithoutDollar, '~') . '(<=\}|\b)~', $stringContent) !== 0; + } + + private static function isUsedInScopeInternal( + File $phpcsFile, + int $scopeOwnerPointer, + int $variablePointer, + ?int $startCheckPointer + ): bool + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$scopeOwnerPointer]['code'] === T_OPEN_TAG) { + $scopeCloserPointer = count($tokens) - 1; + } elseif ($tokens[$scopeOwnerPointer]['code'] === T_FN) { + $scopeCloserPointer = $tokens[$scopeOwnerPointer]['scope_closer']; + } else { + $scopeCloserPointer = $tokens[$scopeOwnerPointer]['scope_closer'] - 1; + } + + if ($tokens[$scopeOwnerPointer]['code'] === T_OPEN_TAG) { + $firstPointerInScope = $scopeOwnerPointer + 1; + } elseif ($tokens[$scopeOwnerPointer]['code'] === T_FN) { + $firstPointerInScope = $tokens[$scopeOwnerPointer]['scope_opener']; + } else { + $firstPointerInScope = $tokens[$scopeOwnerPointer]['scope_opener'] + 1; + } + + if ($startCheckPointer === null) { + $startCheckPointer = $firstPointerInScope; + } + + for ($i = $startCheckPointer; $i <= $scopeCloserPointer; $i++) { + if (!ScopeHelper::isInSameScope($phpcsFile, $i, $firstPointerInScope)) { + continue; + } + + if ( + $tokens[$i]['code'] === T_VARIABLE + && self::isUsedAsVariable($phpcsFile, $variablePointer, $i) + ) { + return true; + } + + if ($tokens[$i]['code'] === T_STRING) { + if (self::isGetDefinedVarsCall($phpcsFile, $i)) { + return true; + } + + if (self::isUsedInCompactFunction($phpcsFile, $variablePointer, $i)) { + return true; + } + } + + if ( + in_array($tokens[$i]['code'], [T_DOUBLE_QUOTED_STRING, T_HEREDOC], true) + && self::isUsedInScopeInString($phpcsFile, $tokens[$variablePointer]['content'], $i) + ) { + return true; + } + } + + return false; + } + + private static function isGetDefinedVarsCall(File $phpcsFile, int $stringPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $stringContent = $tokens[$stringPointer]['content']; + if (strtolower($stringContent) !== 'get_defined_vars') { + return false; + } + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + return $tokens[$parenthesisOpenerPointer]['code'] === T_OPEN_PARENTHESIS; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php new file mode 100644 index 0000000..9b0c3ad --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/YodaHelper.php @@ -0,0 +1,358 @@ +|int|string>> $leftSideTokens + * @param array|int|string>> $rightSideTokens + */ + public static function fix(File $phpcsFile, array $leftSideTokens, array $rightSideTokens): void + { + $phpcsFile->fixer->beginChangeset(); + self::replace($phpcsFile, $leftSideTokens, $rightSideTokens); + self::replace($phpcsFile, $rightSideTokens, $leftSideTokens); + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param array|int|string>> $tokens + * @return array|int|string>> + */ + public static function getLeftSideTokens(array $tokens, int $comparisonTokenPointer): array + { + $parenthesisDepth = 0; + $shortArrayDepth = 0; + $examinedTokenPointer = $comparisonTokenPointer; + $sideTokens = []; + $stopTokenCodes = self::getStopTokenCodes(); + while (true) { + $examinedTokenPointer--; + $examinedToken = $tokens[$examinedTokenPointer]; + /** @var string|int $examinedTokenCode */ + $examinedTokenCode = $examinedToken['code']; + if ($parenthesisDepth === 0 && $shortArrayDepth === 0 && isset($stopTokenCodes[$examinedTokenCode])) { + break; + } + + if ($examinedTokenCode === T_CLOSE_SHORT_ARRAY) { + $shortArrayDepth++; + } elseif ($examinedTokenCode === T_OPEN_SHORT_ARRAY) { + if ($shortArrayDepth === 0) { + break; + } + + $shortArrayDepth--; + } + + if ($examinedTokenCode === T_CLOSE_PARENTHESIS) { + $parenthesisDepth++; + } elseif ($examinedTokenCode === T_OPEN_PARENTHESIS) { + if ($parenthesisDepth === 0) { + break; + } + + $parenthesisDepth--; + } + + $sideTokens[$examinedTokenPointer] = $examinedToken; + } + + return self::trimWhitespaceTokens(array_reverse($sideTokens, true)); + } + + /** + * @param array|int|string>> $tokens + * @return array|int|string>> + */ + public static function getRightSideTokens(array $tokens, int $comparisonTokenPointer): array + { + $parenthesisDepth = 0; + $shortArrayDepth = 0; + $examinedTokenPointer = $comparisonTokenPointer; + $sideTokens = []; + $stopTokenCodes = self::getStopTokenCodes(); + while (true) { + $examinedTokenPointer++; + $examinedToken = $tokens[$examinedTokenPointer]; + /** @var string|int $examinedTokenCode */ + $examinedTokenCode = $examinedToken['code']; + if ($parenthesisDepth === 0 && $shortArrayDepth === 0 && isset($stopTokenCodes[$examinedTokenCode])) { + break; + } + + if ($examinedTokenCode === T_OPEN_SHORT_ARRAY) { + $shortArrayDepth++; + } elseif ($examinedTokenCode === T_CLOSE_SHORT_ARRAY) { + if ($shortArrayDepth === 0) { + break; + } + + $shortArrayDepth--; + } + + if ($examinedTokenCode === T_OPEN_PARENTHESIS) { + $parenthesisDepth++; + } elseif ($examinedTokenCode === T_CLOSE_PARENTHESIS) { + if ($parenthesisDepth === 0) { + break; + } + + $parenthesisDepth--; + } + + $sideTokens[$examinedTokenPointer] = $examinedToken; + } + + return self::trimWhitespaceTokens($sideTokens); + } + + /** + * @param array|int|string>> $tokens + * @param array|int|string>> $sideTokens + */ + public static function getDynamismForTokens(array $tokens, array $sideTokens): ?int + { + $sideTokens = array_values(array_filter($sideTokens, static function (array $token): bool { + return !in_array( + $token['code'], + [T_WHITESPACE, T_COMMENT, T_DOC_COMMENT, T_NS_SEPARATOR, T_PLUS, T_MINUS, T_INT_CAST, T_DOUBLE_CAST, T_STRING_CAST, T_ARRAY_CAST, T_OBJECT_CAST, T_BOOL_CAST, T_UNSET_CAST], + true + ); + })); + + $sideTokensCount = count($sideTokens); + + $dynamism = self::getTokenDynamism(); + + if ($sideTokensCount > 0) { + if ($sideTokens[0]['code'] === T_VARIABLE) { + // Expression starts with a variable - wins over everything else + return self::DYNAMISM_VARIABLE; + } + + if ($sideTokens[$sideTokensCount - 1]['code'] === T_CLOSE_PARENTHESIS) { + if (array_key_exists('parenthesis_owner', $sideTokens[$sideTokensCount - 1])) { + /** @var int $parenthesisOwner */ + $parenthesisOwner = $sideTokens[$sideTokensCount - 1]['parenthesis_owner']; + if ($tokens[$parenthesisOwner]['code'] === T_ARRAY) { + // Array + return $dynamism[T_ARRAY]; + } + } + + // Function or method call + return self::DYNAMISM_FUNCTION_CALL; + } + + if ($sideTokensCount === 1 && $sideTokens[0]['code'] === T_STRING) { + // Constant + return self::DYNAMISM_CONSTANT; + } + } + + if ($sideTokensCount > 2 && $sideTokens[$sideTokensCount - 2]['code'] === T_DOUBLE_COLON) { + if ($sideTokens[$sideTokensCount - 1]['code'] === T_VARIABLE) { + // Static property access + return self::DYNAMISM_VARIABLE; + } + + if ($sideTokens[$sideTokensCount - 1]['code'] === T_STRING) { + // Class constant + return self::DYNAMISM_CONSTANT; + } + } + + if (array_key_exists(0, $sideTokens)) { + /** @var int $sideTokenCode */ + $sideTokenCode = $sideTokens[0]['code']; + if (array_key_exists($sideTokenCode, $dynamism)) { + return $dynamism[$sideTokenCode]; + } + } + + return null; + } + + /** + * @param array|int|string>> $tokens + * @return array|int|string>> + */ + public static function trimWhitespaceTokens(array $tokens): array + { + foreach ($tokens as $pointer => $token) { + if ($token['code'] !== T_WHITESPACE) { + break; + } + + unset($tokens[$pointer]); + } + + foreach (array_reverse($tokens, true) as $pointer => $token) { + if ($token['code'] !== T_WHITESPACE) { + break; + } + + unset($tokens[$pointer]); + } + + return $tokens; + } + + /** + * @param array|int|string>> $oldTokens + * @param array|int|string>> $newTokens + */ + private static function replace(File $phpcsFile, array $oldTokens, array $newTokens): void + { + reset($oldTokens); + /** @var int $firstOldPointer */ + $firstOldPointer = key($oldTokens); + end($oldTokens); + /** @var int $lastOldPointer */ + $lastOldPointer = key($oldTokens); + + $content = implode('', array_map(static function (array $token): string { + /** @var string $content */ + $content = $token['content']; + return $content; + }, $newTokens)); + + FixerHelper::change($phpcsFile, $firstOldPointer, $lastOldPointer, $content); + } + + /** + * @return array + */ + private static function getTokenDynamism(): array + { + static $tokenDynamism; + + if ($tokenDynamism === null) { + $tokenDynamism = [ + T_TRUE => 0, + T_FALSE => 0, + T_NULL => 0, + T_DNUMBER => 0, + T_LNUMBER => 0, + T_OPEN_SHORT_ARRAY => 0, + // Do not stack error messages when the old-style array syntax is used + T_ARRAY => 0, + T_CONSTANT_ENCAPSED_STRING => 0, + T_VARIABLE => self::DYNAMISM_VARIABLE, + T_STRING => self::DYNAMISM_FUNCTION_CALL, + ]; + + $tokenDynamism += array_fill_keys(array_keys(Tokens::$castTokens), 3); + } + + return $tokenDynamism; + } + + /** + * @return array + */ + private static function getStopTokenCodes(): array + { + static $stopTokenCodes; + + if ($stopTokenCodes === null) { + $stopTokenCodes = [ + T_BOOLEAN_AND => true, + T_BOOLEAN_OR => true, + T_SEMICOLON => true, + T_OPEN_TAG => true, + T_INLINE_THEN => true, + T_INLINE_ELSE => true, + T_LOGICAL_AND => true, + T_LOGICAL_OR => true, + T_LOGICAL_XOR => true, + T_COALESCE => true, + T_CASE => true, + T_COLON => true, + T_RETURN => true, + T_COMMA => true, + T_CLOSE_CURLY_BRACKET => true, + T_MATCH_ARROW => true, + T_FN_ARROW => true, + ]; + + $stopTokenCodes += array_fill_keys(array_keys(Tokens::$assignmentTokens), true); + $stopTokenCodes += array_fill_keys(array_keys(Tokens::$commentTokens), true); + } + + return $stopTokenCodes; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php new file mode 100644 index 0000000..27f47b0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/AlphabeticallySortedByKeysSniff.php @@ -0,0 +1,85 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + if (ArrayHelper::isMultiLine($phpcsFile, $stackPointer) === false) { + return; + } + + // "Parse" the array... get info for each key/value pair + $keyValues = ArrayHelper::parse($phpcsFile, $stackPointer); + + if (ArrayHelper::isKeyedAll($keyValues) === false) { + return; + } + + if (ArrayHelper::isSortedByKey($keyValues)) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Keyed multi-line arrays must be sorted alphabetically.', + $stackPointer, + self::CODE_INCORRECT_KEY_ORDER + ); + if ($fix) { + $this->fix($phpcsFile, $keyValues); + } + } + + /** + * @param list $keyValues + */ + private function fix(File $phpcsFile, array $keyValues): void + { + $pointerStart = $keyValues[0]->getPointerStart(); + $pointerEnd = $keyValues[count($keyValues) - 1]->getPointerEnd(); + + // determine indent to use + $indent = ArrayHelper::getIndentation($keyValues); + + usort($keyValues, static function ($a1, $a2) { + return strnatcasecmp((string) $a1->getKey(), (string) $a2->getKey()); + }); + + $content = implode('', array_map(static function (ArrayKeyValue $keyValue) use ($phpcsFile, $indent) { + return $keyValue->getContent($phpcsFile, true, $indent) . $phpcsFile->eolChar; + }, $keyValues)); + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::change($phpcsFile, $pointerStart, $pointerEnd, $content); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php new file mode 100644 index 0000000..e5d9ffa --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/ArrayAccessSniff.php @@ -0,0 +1,76 @@ + + */ + public function register(): array + { + return [T_OPEN_SQUARE_BRACKET]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousToken = TokenHelper::findPreviousNonWhitespace($phpcsFile, $stackPointer - 1); + + if ( + $previousToken === null + || $previousToken === $stackPointer - 1) { + return; + } + + if ($tokens[$previousToken]['code'] === T_VARIABLE) { + $this->addError( + $phpcsFile, + $stackPointer, + 'There should be no space between array variable and array access operator.', + self::CODE_NO_SPACE_BEFORE_BRACKETS + ); + } + + if ($tokens[$previousToken]['code'] !== T_CLOSE_SQUARE_BRACKET) { + return; + } + + $this->addError( + $phpcsFile, + $stackPointer, + 'There should be no space between array access operators.', + self::CODE_NO_SPACE_BETWEEN_BRACKETS + ); + } + + private function addError(File $phpcsFile, int $stackPointer, string $error, string $code): void + { + $fix = $phpcsFile->addFixableError($error, $stackPointer, $code); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($stackPointer - 1, ''); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php new file mode 100644 index 0000000..59997e6 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowImplicitArrayCreationSniff.php @@ -0,0 +1,280 @@ + + */ + public function register(): array + { + return [ + T_OPEN_SQUARE_BRACKET, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $bracketOpenerPointer + */ + public function process(File $phpcsFile, $bracketOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$bracketOpenerPointer]['bracket_closer'] + 1); + if ($tokens[$assignmentPointer]['code'] !== T_EQUAL) { + return; + } + + /** @var int $variablePointer */ + $variablePointer = TokenHelper::findPreviousEffective($phpcsFile, $bracketOpenerPointer - 1); + if ($tokens[$variablePointer]['code'] !== T_VARIABLE) { + return; + } + + if (in_array($tokens[$variablePointer]['content'], [ + '$GLOBALS', + '$_SERVER', + '$_REQUEST', + '$_POST', + '$_GET', + '$_FILES', + '$_ENV', + '$_COOKIE', + '$_SESSION', + '$this', + ], true)) { + return; + } + + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + if (in_array($tokens[$pointerBeforeVariable]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + return; + } + + $scopeOwnerPointer = null; + foreach (array_reverse($tokens[$variablePointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (!in_array($conditionTokenCode, TokenHelper::$functionTokenCodes, true)) { + continue; + } + + $scopeOwnerPointer = $conditionPointer; + break; + } + + if ($scopeOwnerPointer === null) { + $scopeOwnerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $variablePointer - 1); + } + + $scopeOpenerPointer = $tokens[$scopeOwnerPointer]['code'] === T_OPEN_TAG + ? $scopeOwnerPointer + : $tokens[$scopeOwnerPointer]['scope_opener']; + $scopeCloserPointer = $tokens[$scopeOwnerPointer]['code'] === T_OPEN_TAG + ? count($tokens) - 1 + : $tokens[$scopeOwnerPointer]['scope_closer']; + + if (in_array($tokens[$scopeOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + if ($this->isParameter($phpcsFile, $scopeOwnerPointer, $variablePointer)) { + return; + } + + if ( + $tokens[$scopeOwnerPointer]['code'] === T_CLOSURE + && $this->isInheritedVariable($phpcsFile, $scopeOwnerPointer, $variablePointer) + ) { + return; + } + } + + if ($this->hasExplicitCreation($phpcsFile, $scopeOpenerPointer, $scopeCloserPointer, $variablePointer)) { + return; + } + + $phpcsFile->addError('Implicit array creation is disallowed.', $variablePointer, self::CODE_IMPLICIT_ARRAY_CREATION_USED); + } + + private function isParameter(File $phpcsFile, int $functionPointer, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + $variableName = $tokens[$variablePointer]['content']; + + $parameterPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$functionPointer]['parenthesis_opener'] + 1, + $tokens[$functionPointer]['parenthesis_closer'] + ); + return $parameterPointer !== null; + } + + private function isInheritedVariable(File $phpcsFile, int $closurePointer, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + $variableName = $tokens[$variablePointer]['content']; + + $usePointer = TokenHelper::findNext( + $phpcsFile, + T_USE, + $tokens[$closurePointer]['parenthesis_closer'] + 1, + $tokens[$closurePointer]['scope_opener'] + ); + if ($usePointer === null) { + return false; + } + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + + $inheritedVariablePointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $parenthesisOpenerPointer + 1, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ); + return $inheritedVariablePointer !== null; + } + + private function hasExplicitCreation(File $phpcsFile, int $scopeOpenerPointer, int $scopeCloserPointer, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $variableName = $tokens[$variablePointer]['content']; + + for ($i = $scopeOpenerPointer + 1; $i < $variablePointer; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $variablePointer, $i)) { + continue; + } + + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$assignmentPointer]['code'] === T_EQUAL) { + return true; + } + + $staticPointer = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if ($tokens[$staticPointer]['code'] === T_STATIC) { + return true; + } + + if ($this->isCreatedInForeach($phpcsFile, $i, $scopeCloserPointer)) { + return true; + } + + if ($this->isCreatedInList($phpcsFile, $i, $scopeOpenerPointer)) { + return true; + } + + if ($this->isCreatedByReferencedParameterInFunctionCall($phpcsFile, $i, $scopeOpenerPointer)) { + return true; + } + + if ($this->isImportedUsingGlobalStatement($phpcsFile, $i)) { + return true; + } + } + + return false; + } + + private function isCreatedInList(File $phpcsFile, int $variablePointer, int $scopeOpenerPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_PARENTHESIS, T_OPEN_SHORT_ARRAY, T_OPEN_SQUARE_BRACKET], + $variablePointer - 1, + $scopeOpenerPointer + ); + if ($parenthesisOpenerPointer === null) { + return false; + } + + if ($tokens[$parenthesisOpenerPointer]['code'] === T_OPEN_PARENTHESIS) { + if ($tokens[$parenthesisOpenerPointer]['parenthesis_closer'] < $variablePointer) { + return false; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + return $tokens[$pointerBeforeParenthesisOpener]['code'] === T_LIST; + } + + return $tokens[$parenthesisOpenerPointer]['bracket_closer'] > $variablePointer; + } + + private function isCreatedInForeach(File $phpcsFile, int $variablePointer, int $scopeCloserPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisCloserPointer = TokenHelper::findNext($phpcsFile, T_CLOSE_PARENTHESIS, $variablePointer + 1, $scopeCloserPointer); + return $parenthesisCloserPointer !== null + && array_key_exists('parenthesis_owner', $tokens[$parenthesisCloserPointer]) + && $tokens[$tokens[$parenthesisCloserPointer]['parenthesis_owner']]['code'] === T_FOREACH + && $tokens[$parenthesisCloserPointer]['parenthesis_opener'] < $variablePointer; + } + + private function isCreatedByReferencedParameterInFunctionCall(File $phpcsFile, int $variablePointer, int $scopeOpenerPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_PARENTHESIS, $variablePointer - 1, $scopeOpenerPointer); + + if ( + $parenthesisOpenerPointer === null + || $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] < $variablePointer + ) { + return false; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + return $tokens[$pointerBeforeParenthesisOpener]['code'] === T_STRING; + } + + private function isImportedUsingGlobalStatement(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $startOfStatement = $phpcsFile->findStartOfStatement($variablePointer, T_COMMA); + + return $tokens[$startOfStatement]['code'] === T_GLOBAL; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php new file mode 100644 index 0000000..28af0d8 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/DisallowPartiallyKeyedSniff.php @@ -0,0 +1,42 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $keyValues = ArrayHelper::parse($phpcsFile, $stackPointer); + + if (!ArrayHelper::isKeyed($keyValues)) { + return; + } + + if (ArrayHelper::isKeyedAll($keyValues)) { + return; + } + + $phpcsFile->addError('Partially keyed array disallowed.', $stackPointer, self::CODE_DISALLOWED_PARTIALLY_KEYED); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php new file mode 100644 index 0000000..46980e9 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/MultiLineArrayEndBracketPlacementSniff.php @@ -0,0 +1,60 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (ArrayHelper::isMultiLine($phpcsFile, $stackPointer) === false) { + return; + } + + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); + + $nextEffective = TokenHelper::findNextEffective($phpcsFile, $arrayOpenerPointer + 1, $arrayCloserPointer); + if ($nextEffective === null || in_array($tokens[$nextEffective]['code'], TokenHelper::$arrayTokenCodes, true) === false) { + return; + } + + [$nextPointerOpener, $nextPointerCloser] = ArrayHelper::openClosePointers($tokens[$nextEffective]); + + $arraysStartAtSameLine = $tokens[$arrayOpenerPointer]['line'] === $tokens[$nextPointerOpener]['line']; + $arraysEndAtSameLine = $tokens[$arrayCloserPointer]['line'] === $tokens[$nextPointerCloser]['line']; + if (!$arraysStartAtSameLine || $arraysEndAtSameLine) { + return; + } + + $error = "Expected nested array to end at the same line as it's parent. Either put the nested array's end at the same line as the parent's end, or put the nested array start on it's own line."; + $fix = $phpcsFile->addFixableError($error, $arrayOpenerPointer, self::CODE_ARRAY_END_WRONG_PLACEMENT); + if (!$fix) { + return; + } + + $phpcsFile->fixer->addContent($arrayOpenerPointer, $phpcsFile->eolChar); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php new file mode 100644 index 0000000..98ce9ea --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/SingleLineArrayWhitespaceSniff.php @@ -0,0 +1,228 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): int + { + $this->spacesAroundBrackets = SniffSettingsHelper::normalizeInteger($this->spacesAroundBrackets); + + $tokens = $phpcsFile->getTokens(); + + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); + + // Check only single-line arrays. + if ($tokens[$arrayOpenerPointer]['line'] !== $tokens[$arrayCloserPointer]['line']) { + return $arrayCloserPointer; + } + + $pointerContent = TokenHelper::findNextNonWhitespace($phpcsFile, $arrayOpenerPointer + 1, $arrayCloserPointer + 1); + if ($pointerContent === $arrayCloserPointer) { + // Empty array, but if the brackets aren't together, there's a problem. + if ($this->enableEmptyArrayCheck) { + $this->checkWhitespaceInEmptyArray($phpcsFile, $arrayOpenerPointer, $arrayCloserPointer); + } + + // We can return here because there is nothing else to check. + // All code below can assume that the array is not empty. + return $arrayCloserPointer + 1; + } + + $this->checkWhitespaceAfterOpeningBracket($phpcsFile, $arrayOpenerPointer); + $this->checkWhitespaceBeforeClosingBracket($phpcsFile, $arrayCloserPointer); + + for ($i = $arrayOpenerPointer + 1; $i < $arrayCloserPointer; $i++) { + // Skip bracketed statements, like function calls. + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $i = $tokens[$i]['parenthesis_closer']; + + continue; + } + + // Skip nested arrays as they will be processed separately + if (in_array($tokens[$i]['code'], TokenHelper::$arrayTokenCodes, true)) { + $i = ArrayHelper::openClosePointers($tokens[$i])[1]; + + continue; + } + + if ($tokens[$i]['code'] !== T_COMMA) { + continue; + } + + // Before checking this comma, make sure we are not at the end of the array. + $next = TokenHelper::findNextNonWhitespace($phpcsFile, $i + 1, $arrayCloserPointer); + if ($next === null) { + return $arrayOpenerPointer + 1; + } + + $this->checkWhitespaceBeforeComma($phpcsFile, $i); + $this->checkWhitespaceAfterComma($phpcsFile, $i); + } + + return $arrayOpenerPointer + 1; + } + + private function checkWhitespaceInEmptyArray(File $phpcsFile, int $arrayStart, int $arrayEnd): void + { + if ($arrayEnd - $arrayStart === 1) { + return; + } + + $error = 'Empty array declaration must have no space between the parentheses.'; + $fix = $phpcsFile->addFixableError($error, $arrayStart, self::CODE_SPACE_IN_EMPTY_ARRAY); + if (!$fix) { + return; + } + + $phpcsFile->fixer->replaceToken($arrayStart + 1, ''); + } + + private function checkWhitespaceAfterOpeningBracket(File $phpcsFile, int $arrayStart): void + { + $tokens = $phpcsFile->getTokens(); + + $whitespacePointer = $arrayStart + 1; + + $spaceLength = 0; + if ($tokens[$whitespacePointer]['code'] === T_WHITESPACE) { + $spaceLength = $tokens[$whitespacePointer]['length']; + } + + if ($spaceLength === $this->spacesAroundBrackets) { + return; + } + + $error = sprintf('Expected %d spaces after array opening bracket, %d found.', $this->spacesAroundBrackets, $spaceLength); + $fix = $phpcsFile->addFixableError($error, $arrayStart, self::CODE_SPACE_AFTER_ARRAY_OPEN); + if (!$fix) { + return; + } + + if ($spaceLength === 0) { + $phpcsFile->fixer->addContent($arrayStart, str_repeat(' ', $this->spacesAroundBrackets)); + } else { + $phpcsFile->fixer->replaceToken($whitespacePointer, str_repeat(' ', $this->spacesAroundBrackets)); + } + } + + private function checkWhitespaceBeforeClosingBracket(File $phpcsFile, int $arrayEnd): void + { + $tokens = $phpcsFile->getTokens(); + + $whitespacePointer = $arrayEnd - 1; + + $spaceLength = 0; + if ($tokens[$whitespacePointer]['code'] === T_WHITESPACE) { + $spaceLength = $tokens[$whitespacePointer]['length']; + } + + if ($spaceLength === $this->spacesAroundBrackets) { + return; + } + + $error = sprintf('Expected %d spaces before array closing bracket, %d found.', $this->spacesAroundBrackets, $spaceLength); + $fix = $phpcsFile->addFixableError($error, $arrayEnd, self::CODE_SPACE_BEFORE_ARRAY_CLOSE); + if (!$fix) { + return; + } + + if ($spaceLength === 0) { + $phpcsFile->fixer->addContentBefore($arrayEnd, str_repeat(' ', $this->spacesAroundBrackets)); + } else { + $phpcsFile->fixer->replaceToken($whitespacePointer, str_repeat(' ', $this->spacesAroundBrackets)); + } + } + + private function checkWhitespaceBeforeComma(File $phpcsFile, int $comma): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$comma - 1]['code'] !== T_WHITESPACE) { + return; + } + + if ($tokens[$comma - 2]['code'] === T_COMMA) { + return; + } + + $error = sprintf( + 'Expected 0 spaces between "%s" and comma, %d found.', + $tokens[$comma - 2]['content'], + $tokens[$comma - 1]['length'] + ); + $fix = $phpcsFile->addFixableError($error, $comma, self::CODE_SPACE_BEFORE_COMMA); + if (!$fix) { + return; + } + + $phpcsFile->fixer->replaceToken($comma - 1, ''); + } + + private function checkWhitespaceAfterComma(File $phpcsFile, int $comma): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$comma + 1]['code'] !== T_WHITESPACE) { + $error = sprintf('Expected 1 space between comma and "%s", 0 found.', $tokens[$comma + 1]['content']); + $fix = $phpcsFile->addFixableError($error, $comma, self::CODE_SPACE_AFTER_COMMA); + if ($fix) { + $phpcsFile->fixer->addContent($comma, ' '); + } + + return; + } + + $spaceLength = $tokens[$comma + 1]['length']; + if ($spaceLength === 1) { + return; + } + + $error = sprintf('Expected 1 space between comma and "%s", %d found.', $tokens[$comma + 2]['content'], $spaceLength); + $fix = $phpcsFile->addFixableError($error, $comma, self::CODE_SPACE_AFTER_COMMA); + if (!$fix) { + return; + } + + $phpcsFile->fixer->replaceToken($comma + 1, ' '); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php new file mode 100644 index 0000000..3ced790 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php @@ -0,0 +1,80 @@ + + */ + public function register(): array + { + return TokenHelper::$arrayTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $this->enableAfterHeredoc = SniffSettingsHelper::isEnabledByPhpVersion($this->enableAfterHeredoc, 70300); + + $tokens = $phpcsFile->getTokens(); + + [$arrayOpenerPointer, $arrayCloserPointer] = ArrayHelper::openClosePointers($tokens[$stackPointer]); + + if ($tokens[$arrayOpenerPointer]['line'] === $tokens[$arrayCloserPointer]['line']) { + return; + } + + /** @var int $pointerPreviousToClose */ + $pointerPreviousToClose = TokenHelper::findPreviousEffective($phpcsFile, $arrayCloserPointer - 1); + $tokenPreviousToClose = $tokens[$pointerPreviousToClose]; + + if ( + $pointerPreviousToClose === $arrayOpenerPointer + || $tokenPreviousToClose['code'] === T_COMMA + || $tokens[$arrayCloserPointer]['line'] === $tokenPreviousToClose['line'] + ) { + return; + } + + if ( + !$this->enableAfterHeredoc + && in_array($tokenPreviousToClose['code'], [T_END_HEREDOC, T_END_NOWDOC], true) + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multi-line arrays must have a trailing comma after the last element.', + $pointerPreviousToClose, + self::CODE_MISSING_TRAILING_COMMA + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($pointerPreviousToClose, ','); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php new file mode 100644 index 0000000..143391b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributeAndTargetSpacingSniff.php @@ -0,0 +1,120 @@ + + */ + public function register(): array + { + return [T_ATTRIBUTE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $attributeOpenerPointer + */ + public function process(File $phpcsFile, $attributeOpenerPointer): void + { + $this->linesCount = SniffSettingsHelper::normalizeInteger($this->linesCount); + + if (!AttributeHelper::isValidAttribute($phpcsFile, $attributeOpenerPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $attributeCloserPointer = $tokens[$attributeOpenerPointer]['attribute_closer']; + + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $attributeCloserPointer + 1); + + while ($tokens[$pointerAfter]['code'] === T_COMMENT) { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $pointerAfter + 1); + } + + if ($tokens[$pointerAfter]['code'] === T_ATTRIBUTE) { + return; + } + + $areOnSameLine = $tokens[$pointerAfter]['line'] === $tokens[$attributeCloserPointer]['line']; + + if ($areOnSameLine) { + if ($this->allowOnSameLine) { + return; + } + + $errorMessage = $this->linesCount === 1 + ? 'Expected 1 blank line between attribute and its target, both are on same line.' + : sprintf('Expected %1$d blank lines between attribute and its target, both are on same line.', $this->linesCount); + } else { + $actualLinesCount = $tokens[$pointerAfter]['line'] - $tokens[$attributeCloserPointer]['line'] - 1; + + if ($this->linesCount === $actualLinesCount) { + return; + } + + $errorMessage = $this->linesCount === 1 + ? sprintf('Expected 1 blank line between attribute and its target, found %1$d.', $actualLinesCount) + : sprintf('Expected %1$d blank lines between attribute and its target, found %2$d.', $this->linesCount, $actualLinesCount); + } + + $fix = $phpcsFile->addFixableError( + $errorMessage, + $attributeOpenerPointer, + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_ATTRIBUTE_AND_TARGET + ); + + if (!$fix) { + return; + } + + if ($areOnSameLine) { + $indentation = IndentationHelper::getIndentation( + $phpcsFile, + TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $pointerAfter) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeWhitespaceAfter($phpcsFile, $attributeCloserPointer); + $phpcsFile->fixer->addContentBefore($pointerAfter, str_repeat($phpcsFile->eolChar, $this->linesCount + 1) . $indentation); + + $phpcsFile->fixer->endChangeset(); + + return; + } + + $firstTokenOnLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $pointerAfter); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $attributeCloserPointer, $firstTokenOnLine); + + $phpcsFile->fixer->addContentBefore($firstTokenOnLine, str_repeat($phpcsFile->eolChar, $this->linesCount + 1)); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributesOrderSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributesOrderSniff.php new file mode 100644 index 0000000..337c98e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/AttributesOrderSniff.php @@ -0,0 +1,197 @@ + */ + public $order = []; + + /** @var bool */ + public $orderAlphabetically = false; + + /** + * @return array + */ + public function register(): array + { + return [T_ATTRIBUTE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $attributeOpenerPointer + */ + public function process(File $phpcsFile, $attributeOpenerPointer): void + { + if (!AttributeHelper::isValidAttribute($phpcsFile, $attributeOpenerPointer)) { + return; + } + + if ($this->order === [] && !$this->orderAlphabetically) { + throw new UnexpectedValueException('Neither manual or alphabetical order is set.'); + } + + if ($this->order !== [] && $this->orderAlphabetically) { + throw new UnexpectedValueException('Only one order can be set.'); + } + + $this->order = $this->normalizeOrder($this->order); + + $tokens = $phpcsFile->getTokens(); + + $pointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $attributeOpenerPointer - 1); + + if ($tokens[$pointerBefore]['code'] === T_ATTRIBUTE_END) { + return; + } + + $attributesGroups = [AttributeHelper::getAttributes($phpcsFile, $attributeOpenerPointer)]; + + $lastAttributeCloserPointer = $tokens[$attributeOpenerPointer]['attribute_closer']; + + do { + $nextPointer = TokenHelper::findNextNonWhitespace($phpcsFile, $lastAttributeCloserPointer + 1); + + if ($tokens[$nextPointer]['code'] !== T_ATTRIBUTE) { + break; + } + + $attributesGroups[] = AttributeHelper::getAttributes($phpcsFile, $nextPointer); + + $lastAttributeCloserPointer = $tokens[$nextPointer]['attribute_closer']; + + } while (true); + + if ($this->orderAlphabetically) { + $actualOrder = $attributesGroups; + $expectedOrder = $actualOrder; + + uasort($expectedOrder, static function (array $attributesGroup1, array $attributesGroup2): int { + return strnatcmp($attributesGroup1[0]->getName(), $attributesGroup2[0]->getName()); + }); + + } else { + $actualOrder = []; + + foreach ($attributesGroups as $attributesGroupNo => $attributesGroup) { + $attributeName = $this->normalizeAttributeName($attributesGroup[0]->getName()); + + foreach ($this->order as $orderPosition => $attributeNameOnPosition) { + if ( + $attributeName === $attributeNameOnPosition + || ( + substr($attributeNameOnPosition, -1) === '\\' + && strpos($attributeName, $attributeNameOnPosition) === 0 + ) + || ( + substr($attributeNameOnPosition, -1) === '*' + && strpos($attributeName, substr($attributeNameOnPosition, 0, -1)) === 0 + ) + ) { + $actualOrder[$attributesGroupNo] = $orderPosition; + continue 2; + } + } + + // Unknown order - add to the end + $actualOrder[$attributesGroupNo] = 999; + } + + $expectedOrder = $actualOrder; + asort($expectedOrder); + } + + if ($expectedOrder === $actualOrder) { + return; + } + + $fix = $phpcsFile->addFixableError('Incorrect order of attributes.', $attributeOpenerPointer, self::CODE_INCORRECT_ORDER); + + if (!$fix) { + return; + } + + $attributesGroupsContent = []; + foreach ($attributesGroups as $attributesGroupNo => $attributesGroup) { + $attributesGroupsContent[$attributesGroupNo] = TokenHelper::getContent( + $phpcsFile, + $attributesGroup[0]->getAttributePointer(), + $tokens[$attributesGroup[0]->getAttributePointer()]['attribute_closer'] + ); + } + + $areOnSameLine = $tokens[$attributeOpenerPointer]['line'] === $tokens[$lastAttributeCloserPointer]['line']; + + $attributesStartPointer = $attributeOpenerPointer; + $attributesEndPointer = $lastAttributeCloserPointer; + $indentation = IndentationHelper::getIndentation($phpcsFile, $attributeOpenerPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $attributesStartPointer, $attributesEndPointer); + + foreach (array_keys($expectedOrder) as $position => $attributesGroupNo) { + if ($areOnSameLine) { + if ($position !== 0) { + $phpcsFile->fixer->addContent($attributesStartPointer, ' '); + } + + $phpcsFile->fixer->addContent($attributesStartPointer, $attributesGroupsContent[$attributesGroupNo]); + } else { + if ($position !== 0) { + $phpcsFile->fixer->addContent($attributesStartPointer, $indentation); + } + + $phpcsFile->fixer->addContent($attributesStartPointer, $attributesGroupsContent[$attributesGroupNo]); + + if ($position !== count($attributesGroups) - 1) { + $phpcsFile->fixer->addNewline($attributesStartPointer); + } + } + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $order + * @return list + */ + private function normalizeOrder(array $order): array + { + foreach ($order as $itemNo => $item) { + $order[$itemNo] = $this->normalizeAttributeName(trim($item)); + } + + return $order; + } + + private function normalizeAttributeName(string $name): string + { + return ltrim($name, '\\'); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowAttributesJoiningSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowAttributesJoiningSniff.php new file mode 100644 index 0000000..a86f110 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowAttributesJoiningSniff.php @@ -0,0 +1,72 @@ + + */ + public function register(): array + { + return [T_ATTRIBUTE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $attributeOpenerPointer + */ + public function process(File $phpcsFile, $attributeOpenerPointer): void + { + if (!AttributeHelper::isValidAttribute($phpcsFile, $attributeOpenerPointer)) { + return; + } + + $attributes = AttributeHelper::getAttributes($phpcsFile, $attributeOpenerPointer); + $attributeCount = count($attributes); + + if ($attributeCount === 1) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('%d attributes are joined.', $attributeCount), + $attributeOpenerPointer, + self::CODE_DISALLOWED_ATTRIBUTES_JOINING + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + for ($i = 1; $i < count($attributes); $i++) { + $previousAttribute = $attributes[$i - 1]; + $attribute = $attributes[$i]; + + $phpcsFile->fixer->addContent($previousAttribute->getEndPointer(), ']'); + + for ($j = $previousAttribute->getEndPointer() + 1; $j < $attribute->getStartPointer(); $j++) { + if ($phpcsFile->fixer->getTokenContent($j) === ',') { + $phpcsFile->fixer->replaceToken($j, ''); + } + } + + $phpcsFile->fixer->addContentBefore($attribute->getStartPointer(), '#['); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowMultipleAttributesPerLineSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowMultipleAttributesPerLineSniff.php new file mode 100644 index 0000000..ca6f920 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/DisallowMultipleAttributesPerLineSniff.php @@ -0,0 +1,82 @@ + + */ + public function register(): array + { + return [T_ATTRIBUTE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $attributeOpenerPointer + */ + public function process(File $phpcsFile, $attributeOpenerPointer): void + { + if (!AttributeHelper::isValidAttribute($phpcsFile, $attributeOpenerPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $attributeCloserPointer = $tokens[$attributeOpenerPointer]['attribute_closer']; + + $nextAttributeOpenerPointer = TokenHelper::findNext($phpcsFile, T_ATTRIBUTE, $attributeCloserPointer + 1); + + if ($nextAttributeOpenerPointer === null) { + return; + } + + if ($tokens[$attributeCloserPointer]['line'] !== $tokens[$nextAttributeOpenerPointer]['line']) { + return; + } + + $attributeTargetPointer = AttributeHelper::getAttributeTarget($phpcsFile, $attributeOpenerPointer); + $nextAttributeTargetPointer = AttributeHelper::getAttributeTarget($phpcsFile, $nextAttributeOpenerPointer); + + if ($attributeTargetPointer !== $nextAttributeTargetPointer) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multiple attributes per line are disallowed.', + $nextAttributeOpenerPointer, + self::CODE_DISALLOWED_MULTIPLE_ATTRIBUTES_PER_LINE + ); + + if (!$fix) { + return; + } + + $nonWhitespacePointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $nextAttributeOpenerPointer - 1); + $indentation = IndentationHelper::getIndentation( + $phpcsFile, + TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $attributeOpenerPointer) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $nonWhitespacePointerBefore, $nextAttributeOpenerPointer); + + $phpcsFile->fixer->addContentBefore($nextAttributeOpenerPointer, $phpcsFile->eolChar . $indentation); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php new file mode 100644 index 0000000..9729e99 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Attributes/RequireAttributeAfterDocCommentSniff.php @@ -0,0 +1,86 @@ + + */ + public function register(): array + { + return [T_ATTRIBUTE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $attributeOpenerPointer + */ + public function process(File $phpcsFile, $attributeOpenerPointer): void + { + if (!AttributeHelper::isValidAttribute($phpcsFile, $attributeOpenerPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $docCommentOpenerPointer = TokenHelper::findNextExcluding( + $phpcsFile, + T_WHITESPACE, + $tokens[$attributeOpenerPointer]['attribute_closer'] + 1 + ); + + if ($tokens[$docCommentOpenerPointer]['code'] !== T_DOC_COMMENT_OPEN_TAG) { + return; + } + + $docCommentStartPointer = TokenHelper::findFirstTokenOnLine($phpcsFile, $docCommentOpenerPointer); + $docCommentEndPointer = TokenHelper::findLastTokenOnLine($phpcsFile, $tokens[$docCommentOpenerPointer]['comment_closer']); + $docComment = TokenHelper::getContent($phpcsFile, $docCommentStartPointer, $docCommentEndPointer); + + $firstAttributeOpenerPointer = $attributeOpenerPointer; + do { + $nonWhitespacePointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $firstAttributeOpenerPointer - 1); + + if ($tokens[$nonWhitespacePointerBefore]['code'] !== T_ATTRIBUTE_END) { + break; + } + + $firstAttributeOpenerPointer = $tokens[$nonWhitespacePointerBefore]['attribute_opener']; + } while (true); + + $attributeStartPointer = TokenHelper::findFirstTokenOnLine($phpcsFile, $firstAttributeOpenerPointer); + + $fix = $phpcsFile->addFixableError( + 'Attribute should be placed after documentation comment.', + $attributeOpenerPointer, + self::CODE_ATTRIBUTE_BEFORE_DOC_COMMENT + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContentBefore($attributeStartPointer, $docComment); + + FixerHelper::removeBetweenIncluding($phpcsFile, $docCommentStartPointer, $docCommentEndPointer); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractMethodSignature.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractMethodSignature.php new file mode 100644 index 0000000..5e00be6 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractMethodSignature.php @@ -0,0 +1,69 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @return array + */ + protected function getSignatureStartAndEndPointers(File $phpcsFile, int $methodPointer): array + { + $signatureStartPointer = TokenHelper::findFirstTokenOnLine($phpcsFile, $methodPointer); + + /** @var int $pointerAfterSignatureEnd */ + $pointerAfterSignatureEnd = TokenHelper::findNext($phpcsFile, [T_OPEN_CURLY_BRACKET, T_SEMICOLON], $methodPointer + 1); + if ($phpcsFile->getTokens()[$pointerAfterSignatureEnd]['code'] === T_SEMICOLON) { + return [$signatureStartPointer, $pointerAfterSignatureEnd]; + } + + /** @var int $signatureEndPointer */ + $signatureEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $pointerAfterSignatureEnd - 1); + + return [$signatureStartPointer, $signatureEndPointer]; + } + + protected function getSignature(File $phpcsFile, int $signatureStartPointer, int $signatureEndPointer): string + { + $signature = TokenHelper::getContent($phpcsFile, $signatureStartPointer, $signatureEndPointer); + $signature = preg_replace(sprintf('~%s[ \t]*~', $phpcsFile->eolChar), ' ', $signature); + assert(is_string($signature)); + + $signature = str_replace(['( ', ' )'], ['(', ')'], $signature); + $signature = rtrim($signature); + + return $signature; + } + + protected function getSignatureWithoutTabs(File $phpcsFile, string $signature): string + { + return IndentationHelper::convertTabsToSpaces($phpcsFile, $signature); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php new file mode 100644 index 0000000..eeb2f68 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/AbstractPropertyConstantAndEnumCaseSpacing.php @@ -0,0 +1,137 @@ +minLinesCountBeforeWithComment = SniffSettingsHelper::normalizeInteger($this->minLinesCountBeforeWithComment); + $this->maxLinesCountBeforeWithComment = SniffSettingsHelper::normalizeInteger($this->maxLinesCountBeforeWithComment); + $this->minLinesCountBeforeWithoutComment = SniffSettingsHelper::normalizeInteger($this->minLinesCountBeforeWithoutComment); + $this->maxLinesCountBeforeWithoutComment = SniffSettingsHelper::normalizeInteger($this->maxLinesCountBeforeWithoutComment); + + $tokens = $phpcsFile->getTokens(); + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $pointer); + + $semicolonPointer = TokenHelper::findNext($phpcsFile, [T_SEMICOLON], $pointer + 1); + assert($semicolonPointer !== null); + + $firstOnLinePointer = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $semicolonPointer); + assert($firstOnLinePointer !== null); + + $nextFunctionPointer = TokenHelper::findNext( + $phpcsFile, + [T_FUNCTION, T_ENUM_CASE, T_CONST, T_VARIABLE, T_USE], + $firstOnLinePointer + 1 + ); + if ( + $nextFunctionPointer === null + || $tokens[$nextFunctionPointer]['code'] === T_FUNCTION + || $tokens[$nextFunctionPointer]['conditions'] !== $tokens[$pointer]['conditions'] + ) { + return $nextFunctionPointer ?? $firstOnLinePointer; + } + + $types = [T_COMMENT, T_DOC_COMMENT_OPEN_TAG, T_ATTRIBUTE, T_ENUM_CASE, T_CONST, T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC, T_USE]; + $nextPointer = TokenHelper::findNext($phpcsFile, $types, $firstOnLinePointer + 1, $tokens[$classPointer]['scope_closer']); + + if (!$this->isNextMemberValid($phpcsFile, $nextPointer)) { + return $nextPointer; + } + + $linesBetween = $tokens[$nextPointer]['line'] - $tokens[$semicolonPointer]['line'] - 1; + if (in_array($tokens[$nextPointer]['code'], [T_DOC_COMMENT_OPEN_TAG, T_COMMENT, T_ATTRIBUTE], true)) { + $minExpectedLines = $this->minLinesCountBeforeWithComment; + $maxExpectedLines = $this->maxLinesCountBeforeWithComment; + } else { + $minExpectedLines = $this->minLinesCountBeforeWithoutComment; + $maxExpectedLines = $this->maxLinesCountBeforeWithoutComment; + } + + if ($linesBetween >= $minExpectedLines && $linesBetween <= $maxExpectedLines) { + return $firstOnLinePointer; + } + + $fix = $this->addError($phpcsFile, $pointer, $minExpectedLines, $maxExpectedLines, $linesBetween); + if (!$fix) { + return $firstOnLinePointer; + } + + if ($linesBetween > $maxExpectedLines) { + $lastPointerOnLine = TokenHelper::findLastTokenOnLine($phpcsFile, $semicolonPointer); + $firstPointerOnNextLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $nextPointer); + + $phpcsFile->fixer->beginChangeset(); + + if ($maxExpectedLines > 0) { + $phpcsFile->fixer->addContent($lastPointerOnLine, str_repeat($phpcsFile->eolChar, $maxExpectedLines)); + } + + FixerHelper::removeBetween($phpcsFile, $lastPointerOnLine, $firstPointerOnNextLine); + + $phpcsFile->fixer->endChangeset(); + } else { + $phpcsFile->fixer->beginChangeset(); + + for ($i = 0; $i < $minExpectedLines; $i++) { + $phpcsFile->fixer->addNewlineBefore($firstOnLinePointer); + } + + $phpcsFile->fixer->endChangeset(); + } + + return $firstOnLinePointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/BackedEnumTypeSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/BackedEnumTypeSpacingSniff.php new file mode 100644 index 0000000..0af9932 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/BackedEnumTypeSpacingSniff.php @@ -0,0 +1,121 @@ + + */ + public function register(): array + { + return [T_ENUM]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $enumPointer + */ + public function process(File $phpcsFile, $enumPointer): void + { + $this->spacesCountBeforeColon = SniffSettingsHelper::normalizeInteger($this->spacesCountBeforeColon); + $this->spacesCountBeforeType = SniffSettingsHelper::normalizeInteger($this->spacesCountBeforeType); + + $tokens = $phpcsFile->getTokens(); + + $colonPointer = TokenHelper::findNext($phpcsFile, T_COLON, $enumPointer + 1, $tokens[$enumPointer]['scope_opener']); + + if ($colonPointer === null) { + return; + } + + $this->checkSpacesBeforeColon($phpcsFile, $colonPointer); + $this->checkSpacesBeforeType($phpcsFile, $colonPointer); + } + + public function checkSpacesBeforeColon(File $phpcsFile, int $colonPointer): void + { + $namePointer = TokenHelper::findPreviousEffective($phpcsFile, $colonPointer - 1); + + $whitespace = TokenHelper::getContent($phpcsFile, $namePointer + 1, $colonPointer - 1); + + if ($this->spacesCountBeforeColon === strlen($whitespace)) { + return; + } + + $fix = $phpcsFile->addFixableError( + $this->formatErrorMessage('before colon', $this->spacesCountBeforeColon), + $colonPointer, + self::CODE_INCORRECT_SPACES_BEFORE_COLON + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $namePointer, $colonPointer); + + $phpcsFile->fixer->addContentBefore($colonPointer, str_repeat(' ', $this->spacesCountBeforeColon)); + + $phpcsFile->fixer->endChangeset(); + } + + public function checkSpacesBeforeType(File $phpcsFile, int $colonPointer): void + { + $typePointer = TokenHelper::findNextEffective($phpcsFile, $colonPointer + 1); + + $whitespace = TokenHelper::getContent($phpcsFile, $colonPointer + 1, $typePointer - 1); + + if ($this->spacesCountBeforeType === strlen($whitespace)) { + return; + } + + $fix = $phpcsFile->addFixableError( + $this->formatErrorMessage('before type', $this->spacesCountBeforeType), + $typePointer, + self::CODE_INCORRECT_SPACES_BEFORE_TYPE + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $colonPointer, $typePointer); + + $phpcsFile->fixer->addContentBefore($typePointer, str_repeat(' ', $this->spacesCountBeforeType)); + + $phpcsFile->fixer->endChangeset(); + } + + private function formatErrorMessage(string $suffix, int $requiredSpaces): string + { + return $requiredSpaces === 0 + ? sprintf('There must be no whitespace %s.', $suffix) + : sprintf('There must be exactly %d whitespace%s %s.', $requiredSpaces, $requiredSpaces !== 1 ? 's' : '', $suffix); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php new file mode 100644 index 0000000..19ee9f1 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassConstantVisibilitySniff.php @@ -0,0 +1,87 @@ + + */ + public function register(): array + { + return [ + T_CONST, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $constantPointer + */ + public function process(File $phpcsFile, $constantPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (count($tokens[$constantPointer]['conditions']) === 0) { + return; + } + + /** @var int $classPointer */ + $classPointer = array_keys($tokens[$constantPointer]['conditions'])[count($tokens[$constantPointer]['conditions']) - 1]; + if (!in_array($tokens[$classPointer]['code'], Tokens::$ooScopeTokens, true)) { + return; + } + + $visibilityPointer = TokenHelper::findPreviousEffective($phpcsFile, $constantPointer - 1); + if ($tokens[$visibilityPointer]['code'] === T_FINAL) { + $visibilityPointer = TokenHelper::findPreviousEffective($phpcsFile, $visibilityPointer - 1); + } + + if (in_array($tokens[$visibilityPointer]['code'], [T_PUBLIC, T_PROTECTED, T_PRIVATE], true)) { + return; + } + + $equalSignPointer = TokenHelper::findNext($phpcsFile, T_EQUAL, $constantPointer + 1); + $namePointer = TokenHelper::findPreviousEffective($phpcsFile, $equalSignPointer - 1); + + $message = sprintf( + 'Constant %s::%s visibility missing.', + ClassHelper::getFullyQualifiedName($phpcsFile, $classPointer), + $tokens[$namePointer]['content'] + ); + + if ($this->fixable) { + $fix = $phpcsFile->addFixableError($message, $constantPointer, self::CODE_MISSING_CONSTANT_VISIBILITY); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore($constantPointer, 'public '); + $phpcsFile->fixer->endChangeset(); + } + } else { + $phpcsFile->addError($message, $constantPointer, self::CODE_MISSING_CONSTANT_VISIBILITY); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassLengthSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassLengthSniff.php new file mode 100644 index 0000000..bdc035d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassLengthSniff.php @@ -0,0 +1,64 @@ + + */ + public function register(): array + { + return array_values(Tokens::$ooScopeTokens); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->maxLinesLength = SniffSettingsHelper::normalizeInteger($this->maxLinesLength); + $flags = array_keys(array_filter([ + FunctionHelper::LINE_INCLUDE_COMMENT => $this->includeComments, + FunctionHelper::LINE_INCLUDE_WHITESPACE => $this->includeWhitespace, + ])); + $flags = array_reduce($flags, static function ($carry, $flag): int { + return $carry | $flag; + }, 0); + + $length = FunctionHelper::getLineCount($phpcsFile, $pointer, $flags); + + if ($length <= $this->maxLinesLength) { + return; + } + + $errorMessage = sprintf('Your class is too long. Currently using %d lines. Can be up to %d lines.', $length, $this->maxLinesLength); + + $phpcsFile->addError($errorMessage, $pointer, self::CODE_CLASS_TOO_LONG); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassMemberSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassMemberSpacingSniff.php new file mode 100644 index 0000000..ffac3ad --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassMemberSpacingSniff.php @@ -0,0 +1,278 @@ + + */ + public function register(): array + { + return TokenHelper::$typeWithAnonymousClassKeywordTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $this->linesCountBetweenMembers = SniffSettingsHelper::normalizeInteger($this->linesCountBetweenMembers); + + $tokens = $phpcsFile->getTokens(); + + $memberPointer = null; + $previousMemberPointer = null; + + do { + $previousMemberPointer = $memberPointer; + + $memberPointer = $this->findNextMember( + $phpcsFile, + $classPointer, + $previousMemberPointer ?? $tokens[$classPointer]['scope_opener'] + ); + + if ($memberPointer === null) { + break; + } + + if ($previousMemberPointer === null) { + continue; + } + + if ($tokens[$previousMemberPointer]['code'] === $tokens[$memberPointer]['code']) { + continue; + } + + $previousMemberEndPointer = $this->getMemberEndPointer($phpcsFile, $previousMemberPointer); + + $hasCommentWithNewLineAfterPreviousMember = false; + + $commentPointerAfterPreviousMember = TokenHelper::findNextNonWhitespace($phpcsFile, $previousMemberEndPointer + 1); + if ( + in_array($tokens[$commentPointerAfterPreviousMember]['code'], TokenHelper::$inlineCommentTokenCodes, true) + && ( + $tokens[$previousMemberEndPointer]['line'] === $tokens[$commentPointerAfterPreviousMember]['line'] + || $tokens[$previousMemberEndPointer]['line'] + 1 === $tokens[$commentPointerAfterPreviousMember]['line'] + ) + ) { + $previousMemberEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $commentPointerAfterPreviousMember); + + if (StringHelper::endsWith($tokens[$commentPointerAfterPreviousMember]['content'], $phpcsFile->eolChar)) { + $hasCommentWithNewLineAfterPreviousMember = true; + } + } + + $memberStartPointer = $this->getMemberStartPointer($phpcsFile, $memberPointer); + + $actualLinesCount = $tokens[$memberStartPointer]['line'] - $tokens[$previousMemberEndPointer]['line'] - 1; + + if ($actualLinesCount === $this->linesCountBetweenMembers) { + continue; + } + + $errorMessage = $this->linesCountBetweenMembers === 1 + ? 'Expected 1 blank line between class members, found %2$d.' + : 'Expected %1$d blank lines between class members, found %2$d.'; + + $fix = $phpcsFile->addFixableError( + sprintf($errorMessage, $this->linesCountBetweenMembers, $actualLinesCount), + $memberPointer, + self::CODE_INCORRECT_COUNT_OF_BLANK_LINES_BETWEEN_MEMBERS + ); + if (!$fix) { + continue; + } + + $newLines = str_repeat( + $phpcsFile->eolChar, + $this->linesCountBetweenMembers + ($hasCommentWithNewLineAfterPreviousMember ? 0 : 1) + ); + + $firstPointerOnMemberLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $memberStartPointer); + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($previousMemberEndPointer, $newLines); + + FixerHelper::removeBetween($phpcsFile, $previousMemberEndPointer, $firstPointerOnMemberLine); + + $phpcsFile->fixer->endChangeset(); + + } while (true); + } + + private function findNextMember(File $phpcsFile, int $classPointer, int $previousMemberPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $memberPointer = $previousMemberPointer; + do { + $memberPointer = TokenHelper::findNext( + $phpcsFile, + [T_USE, T_CONST, T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC, T_FUNCTION, T_ENUM_CASE], + $memberPointer + 1, + $tokens[$classPointer]['scope_closer'] + ); + + if ($memberPointer === null) { + return null; + } + + if ($tokens[$memberPointer]['code'] === T_USE) { + if (!UseStatementHelper::isTraitUse($phpcsFile, $memberPointer)) { + continue; + } + } elseif (in_array($tokens[$memberPointer]['code'], [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC], true)) { + $asPointer = TokenHelper::findPreviousEffective($phpcsFile, $memberPointer - 1); + if ($tokens[$asPointer]['code'] === T_AS) { + continue; + } + + $propertyPointer = TokenHelper::findNext($phpcsFile, [T_VARIABLE, T_FUNCTION, T_CONST, T_ENUM_CASE], $memberPointer + 1); + if ( + $propertyPointer === null + || $tokens[$propertyPointer]['code'] !== T_VARIABLE + || !PropertyHelper::isProperty($phpcsFile, $propertyPointer) + ) { + continue; + } + + $memberPointer = $propertyPointer; + } + + if (ScopeHelper::isInSameScope($phpcsFile, $memberPointer, $previousMemberPointer)) { + break; + } + + } while (true); + + return $memberPointer; + } + + private function getMemberStartPointer(File $phpcsFile, int $memberPointer): int + { + $tokens = $phpcsFile->getTokens(); + + $memberFirstCodePointer = $this->getMemberFirstCodePointer($phpcsFile, $memberPointer); + + do { + $pointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $memberFirstCodePointer - 1); + + if ($tokens[$pointerBefore]['code'] === T_ATTRIBUTE_END) { + $memberFirstCodePointer = $tokens[$pointerBefore]['attribute_opener']; + continue; + } + + if ( + in_array($tokens[$pointerBefore]['code'], Tokens::$commentTokens, true) + && $tokens[$pointerBefore]['line'] + 1 === $tokens[$memberFirstCodePointer]['line'] + ) { + $pointerBeforeComment = TokenHelper::findPreviousEffective($phpcsFile, $pointerBefore - 1); + if ($tokens[$pointerBeforeComment]['line'] !== $tokens[$pointerBefore]['line']) { + $memberFirstCodePointer = array_key_exists('comment_opener', $tokens[$pointerBefore]) + ? $tokens[$pointerBefore]['comment_opener'] + : CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBefore); + continue; + } + } + + break; + + } while (true); + + return $memberFirstCodePointer; + } + + private function getMemberFirstCodePointer(File $phpcsFile, int $memberPointer): int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$memberPointer]['code'] === T_USE) { + return $memberPointer; + } + + $firstCodePointer = $memberPointer; + $previousFirstCodePointer = $memberPointer; + do { + /** @var int $firstCodePointer */ + $firstCodePointer = TokenHelper::findPrevious( + $phpcsFile, + [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_ABSTRACT, T_FINAL, T_SEMICOLON, T_CLOSE_CURLY_BRACKET], + $firstCodePointer - 1 + ); + + if (in_array($tokens[$firstCodePointer]['code'], [T_SEMICOLON, T_CLOSE_CURLY_BRACKET], true)) { + break; + } + + $previousFirstCodePointer = $firstCodePointer; + + } while (true); + + return $previousFirstCodePointer; + } + + private function getMemberEndPointer(File $phpcsFile, int $memberPointer): int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$memberPointer]['code'] === T_USE) { + $pointer = TokenHelper::findNextLocal($phpcsFile, [T_SEMICOLON, T_OPEN_CURLY_BRACKET], $memberPointer + 1); + + return $tokens[$pointer]['code'] === T_OPEN_CURLY_BRACKET + ? $tokens[$pointer]['bracket_closer'] + : $pointer; + } + + if ($tokens[$memberPointer]['code'] === T_FUNCTION && !FunctionHelper::isAbstract($phpcsFile, $memberPointer)) { + return $tokens[$memberPointer]['scope_closer']; + } + + return TokenHelper::findNext($phpcsFile, T_SEMICOLON, $memberPointer + 1); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php new file mode 100644 index 0000000..e01288b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php @@ -0,0 +1,666 @@ + [ + self::GROUP_PUBLIC_CONSTANTS, + self::GROUP_PROTECTED_CONSTANTS, + self::GROUP_PRIVATE_CONSTANTS, + ], + self::GROUP_SHORTCUT_STATIC_PROPERTIES => [ + self::GROUP_PUBLIC_STATIC_PROPERTIES, + self::GROUP_PROTECTED_STATIC_PROPERTIES, + self::GROUP_PRIVATE_STATIC_PROPERTIES, + ], + self::GROUP_SHORTCUT_PROPERTIES => [ + self::GROUP_SHORTCUT_STATIC_PROPERTIES, + self::GROUP_PUBLIC_PROPERTIES, + self::GROUP_PROTECTED_PROPERTIES, + self::GROUP_PRIVATE_PROPERTIES, + ], + self::GROUP_SHORTCUT_PUBLIC_METHODS => [ + self::GROUP_PUBLIC_FINAL_METHODS, + self::GROUP_PUBLIC_STATIC_FINAL_METHODS, + self::GROUP_PUBLIC_ABSTRACT_METHODS, + self::GROUP_PUBLIC_STATIC_ABSTRACT_METHODS, + self::GROUP_PUBLIC_STATIC_METHODS, + self::GROUP_PUBLIC_METHODS, + ], + self::GROUP_SHORTCUT_PROTECTED_METHODS => [ + self::GROUP_PROTECTED_FINAL_METHODS, + self::GROUP_PROTECTED_STATIC_FINAL_METHODS, + self::GROUP_PROTECTED_ABSTRACT_METHODS, + self::GROUP_PROTECTED_STATIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_STATIC_METHODS, + self::GROUP_PROTECTED_METHODS, + ], + self::GROUP_SHORTCUT_PRIVATE_METHODS => [ + self::GROUP_PRIVATE_STATIC_METHODS, + self::GROUP_PRIVATE_METHODS, + ], + self::GROUP_SHORTCUT_FINAL_METHODS => [ + self::GROUP_PUBLIC_FINAL_METHODS, + self::GROUP_PROTECTED_FINAL_METHODS, + self::GROUP_PUBLIC_STATIC_FINAL_METHODS, + self::GROUP_PROTECTED_STATIC_FINAL_METHODS, + ], + self::GROUP_SHORTCUT_ABSTRACT_METHODS => [ + self::GROUP_PUBLIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_ABSTRACT_METHODS, + self::GROUP_PUBLIC_STATIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_STATIC_ABSTRACT_METHODS, + ], + self::GROUP_SHORTCUT_STATIC_METHODS => [ + self::GROUP_STATIC_CONSTRUCTORS, + self::GROUP_PUBLIC_STATIC_FINAL_METHODS, + self::GROUP_PROTECTED_STATIC_FINAL_METHODS, + self::GROUP_PUBLIC_STATIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_STATIC_ABSTRACT_METHODS, + self::GROUP_PUBLIC_STATIC_METHODS, + self::GROUP_PROTECTED_STATIC_METHODS, + self::GROUP_PRIVATE_STATIC_METHODS, + ], + self::GROUP_SHORTCUT_METHODS => [ + self::GROUP_SHORTCUT_FINAL_METHODS, + self::GROUP_SHORTCUT_ABSTRACT_METHODS, + self::GROUP_SHORTCUT_STATIC_METHODS, + self::GROUP_CONSTRUCTOR, + self::GROUP_DESTRUCTOR, + self::GROUP_PUBLIC_METHODS, + self::GROUP_PROTECTED_METHODS, + self::GROUP_PRIVATE_METHODS, + self::GROUP_MAGIC_METHODS, + ], + ]; + + private const SPECIAL_METHODS = [ + '__construct' => self::GROUP_CONSTRUCTOR, + '__destruct' => self::GROUP_DESTRUCTOR, + '__call' => self::GROUP_MAGIC_METHODS, + '__callstatic' => self::GROUP_MAGIC_METHODS, + '__get' => self::GROUP_MAGIC_METHODS, + '__set' => self::GROUP_MAGIC_METHODS, + '__isset' => self::GROUP_MAGIC_METHODS, + '__unset' => self::GROUP_MAGIC_METHODS, + '__sleep' => self::GROUP_MAGIC_METHODS, + '__wakeup' => self::GROUP_MAGIC_METHODS, + '__serialize' => self::GROUP_MAGIC_METHODS, + '__unserialize' => self::GROUP_MAGIC_METHODS, + '__tostring' => self::GROUP_MAGIC_METHODS, + '__invoke' => self::GROUP_MAGIC_METHODS, + '__set_state' => self::GROUP_MAGIC_METHODS, + '__clone' => self::GROUP_MAGIC_METHODS, + '__debuginfo' => self::GROUP_MAGIC_METHODS, + ]; + + /** @var list */ + public $groups = []; + + /** @var array|null */ + private $normalizedGroups; + + /** + * @return array + */ + public function register(): array + { + return array_values(Tokens::$ooScopeTokens); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): int + { + $tokens = $phpcsFile->getTokens(); + /** @var array{scope_closer: int, level: int} $rootScopeToken */ + $rootScopeToken = $tokens[$pointer]; + + $groupsOrder = $this->getNormalizedGroups(); + + $groupLastMemberPointer = $rootScopeToken['scope_opener']; + $expectedGroup = null; + $groupsFirstMembers = []; + while (true) { + $nextGroup = $this->findNextGroup($phpcsFile, $groupLastMemberPointer, $rootScopeToken); + if ($nextGroup === null) { + break; + } + + [$groupFirstMemberPointer, $groupLastMemberPointer, $group] = $nextGroup; + + if ($groupsOrder[$group] >= ($groupsOrder[$expectedGroup] ?? 0)) { + $groupsFirstMembers[$group] = $groupFirstMemberPointer; + $expectedGroup = $group; + + continue; + } + + $expectedGroups = array_filter( + $groupsOrder, + static function (int $order) use ($groupsOrder, $expectedGroup): bool { + return $order >= $groupsOrder[$expectedGroup]; + } + ); + $fix = $phpcsFile->addFixableError( + sprintf( + 'The placement of "%s" group is invalid. Last group was "%s" and one of these is expected after it: %s', + $group, + $expectedGroup, + implode(', ', array_keys($expectedGroups)) + ), + $groupFirstMemberPointer, + self::CODE_INCORRECT_GROUP_ORDER + ); + if (!$fix) { + continue; + } + + foreach ($groupsFirstMembers as $memberGroup => $firstMemberPointer) { + if ($groupsOrder[$memberGroup] <= $groupsOrder[$group]) { + continue; + } + + $this->fixIncorrectGroupOrder($phpcsFile, $groupFirstMemberPointer, $groupLastMemberPointer, $firstMemberPointer); + + // run the sniff again to fix the rest of the groups + return $pointer - 1; + } + } + + return $pointer + 1; + } + + /** + * @param array{scope_closer: int, level: int} $rootScopeToken + * @return array{int, int, string}|null + */ + private function findNextGroup(File $phpcsFile, int $pointer, array $rootScopeToken): ?array + { + $tokens = $phpcsFile->getTokens(); + $groupTokenTypes = [T_USE, T_ENUM_CASE, T_CONST, T_VARIABLE, T_FUNCTION]; + + $currentTokenPointer = $pointer; + while (true) { + $currentTokenPointer = TokenHelper::findNext( + $phpcsFile, + $groupTokenTypes, + ($currentToken['scope_closer'] ?? $currentTokenPointer) + 1, + $rootScopeToken['scope_closer'] + ); + if ($currentTokenPointer === null) { + break; + } + + $currentToken = $tokens[$currentTokenPointer]; + + if ($currentToken['code'] === T_VARIABLE && !PropertyHelper::isProperty($phpcsFile, $currentTokenPointer)) { + continue; + } + + if ($currentToken['level'] - $rootScopeToken['level'] !== 1) { + continue; + } + + $group = $this->getGroupForToken($phpcsFile, $currentTokenPointer); + + if (!isset($currentGroup)) { + $currentGroup = $group; + $groupFirstMemberPointer = $currentTokenPointer; + } + + if ($group !== $currentGroup) { + break; + } + + $groupLastMemberPointer = $currentTokenPointer; + } + + if (!isset($currentGroup)) { + return null; + } + + assert(isset($groupFirstMemberPointer) === true); + assert(isset($groupLastMemberPointer) === true); + + return [$groupFirstMemberPointer, $groupLastMemberPointer, $currentGroup]; + } + + private function getGroupForToken(File $phpcsFile, int $pointer): string + { + $tokens = $phpcsFile->getTokens(); + + switch ($tokens[$pointer]['code']) { + case T_USE: + return self::GROUP_USES; + case T_ENUM_CASE: + return self::GROUP_ENUM_CASES; + case T_CONST: + switch ($this->getVisibilityForToken($phpcsFile, $pointer)) { + case T_PUBLIC: + return self::GROUP_PUBLIC_CONSTANTS; + case T_PROTECTED: + return self::GROUP_PROTECTED_CONSTANTS; + } + + return self::GROUP_PRIVATE_CONSTANTS; + case T_FUNCTION: + $name = strtolower(FunctionHelper::getName($phpcsFile, $pointer)); + if (array_key_exists($name, self::SPECIAL_METHODS)) { + return self::SPECIAL_METHODS[$name]; + } + + $visibility = $this->getVisibilityForToken($phpcsFile, $pointer); + $isStatic = $this->isMemberStatic($phpcsFile, $pointer); + $isFinal = $this->isMethodFinal($phpcsFile, $pointer); + + if ($this->isMethodAbstract($phpcsFile, $pointer)) { + if ($visibility === T_PUBLIC) { + return $isStatic ? self::GROUP_PUBLIC_STATIC_ABSTRACT_METHODS : self::GROUP_PUBLIC_ABSTRACT_METHODS; + } + + return $isStatic ? self::GROUP_PROTECTED_STATIC_ABSTRACT_METHODS : self::GROUP_PROTECTED_ABSTRACT_METHODS; + } + + if ($isStatic && $visibility === T_PUBLIC && $this->isStaticConstructor($phpcsFile, $pointer)) { + return self::GROUP_STATIC_CONSTRUCTORS; + } + + switch ($visibility) { + case T_PUBLIC: + if ($isFinal) { + return $isStatic ? self::GROUP_PUBLIC_STATIC_FINAL_METHODS : self::GROUP_PUBLIC_FINAL_METHODS; + } + + return $isStatic ? self::GROUP_PUBLIC_STATIC_METHODS : self::GROUP_PUBLIC_METHODS; + case T_PROTECTED: + if ($isFinal) { + return $isStatic ? self::GROUP_PROTECTED_STATIC_FINAL_METHODS : self::GROUP_PROTECTED_FINAL_METHODS; + } + + return $isStatic ? self::GROUP_PROTECTED_STATIC_METHODS : self::GROUP_PROTECTED_METHODS; + } + + return $isStatic ? self::GROUP_PRIVATE_STATIC_METHODS : self::GROUP_PRIVATE_METHODS; + default: + $isStatic = $this->isMemberStatic($phpcsFile, $pointer); + $visibility = $this->getVisibilityForToken($phpcsFile, $pointer); + + switch ($visibility) { + case T_PUBLIC: + return $isStatic ? self::GROUP_PUBLIC_STATIC_PROPERTIES : self::GROUP_PUBLIC_PROPERTIES; + case T_PROTECTED: + return $isStatic + ? self::GROUP_PROTECTED_STATIC_PROPERTIES + : self::GROUP_PROTECTED_PROPERTIES; + default: + return $isStatic ? self::GROUP_PRIVATE_STATIC_PROPERTIES : self::GROUP_PRIVATE_PROPERTIES; + } + } + } + + private function getVisibilityForToken(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + array_merge(Tokens::$scopeModifiers, [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON]), + $pointer - 1 + ); + + /** @var int $visibilityPointer */ + $visibilityPointer = in_array($tokens[$previousPointer]['code'], Tokens::$scopeModifiers, true) + ? $tokens[$previousPointer]['code'] + : T_PUBLIC; + return $visibilityPointer; + } + + private function isMemberStatic(File $phpcsFile, int $pointer): bool + { + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON, T_STATIC], + $pointer - 1 + ); + return $phpcsFile->getTokens()[$previousPointer]['code'] === T_STATIC; + } + + private function isMethodFinal(File $phpcsFile, int $pointer): bool + { + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON, T_FINAL], + $pointer - 1 + ); + return $phpcsFile->getTokens()[$previousPointer]['code'] === T_FINAL; + } + + private function isMethodAbstract(File $phpcsFile, int $pointer): bool + { + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON, T_ABSTRACT], + $pointer - 1 + ); + return $phpcsFile->getTokens()[$previousPointer]['code'] === T_ABSTRACT; + } + + private function isStaticConstructor(File $phpcsFile, int $pointer): bool + { + $parentClassName = $this->getParentClassName($phpcsFile, $pointer); + + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $pointer); + if ($returnTypeHint !== null) { + return in_array($returnTypeHint->getTypeHintWithoutNullabilitySymbol(), ['self', $parentClassName], true); + } + + $returnAnnotation = FunctionHelper::findReturnAnnotation($phpcsFile, $pointer); + if ($returnAnnotation === null) { + return false; + } + + return in_array((string) $returnAnnotation->getValue()->type, ['static', 'self', $parentClassName], true); + } + + private function getParentClassName(File $phpcsFile, int $pointer): string + { + $classPointer = TokenHelper::findPrevious($phpcsFile, Tokens::$ooScopeTokens, $pointer - 1); + assert($classPointer !== null); + + return ClassHelper::getName($phpcsFile, $classPointer); + } + + private function fixIncorrectGroupOrder( + File $file, + int $groupFirstMemberPointer, + int $groupLastMemberPointer, + int $nextGroupMemberPointer + ): void + { + $previousMemberEndPointer = $this->findPreviousMemberEndPointer($file, $groupFirstMemberPointer); + + $groupStartPointer = $this->findGroupStartPointer($file, $groupFirstMemberPointer, $previousMemberEndPointer); + $groupEndPointer = $this->findGroupEndPointer($file, $groupLastMemberPointer); + $groupContent = TokenHelper::getContent($file, $groupStartPointer, $groupEndPointer); + + $nextGroupMemberStartPointer = $this->findGroupStartPointer($file, $nextGroupMemberPointer); + + $file->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($file, $groupStartPointer, $groupEndPointer); + + $linesBetween = $this->removeBlankLinesAfterMember($file, $previousMemberEndPointer, $groupStartPointer); + + $newLines = str_repeat($file->eolChar, $linesBetween); + $file->fixer->addContentBefore($nextGroupMemberStartPointer, $groupContent . $newLines); + + $file->fixer->endChangeset(); + } + + private function findPreviousMemberEndPointer(File $phpcsFile, int $memberPointer): int + { + $endTypes = [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON]; + $previousMemberEndPointer = TokenHelper::findPrevious($phpcsFile, $endTypes, $memberPointer - 1); + assert($previousMemberEndPointer !== null); + + return $previousMemberEndPointer; + } + + private function findGroupStartPointer(File $phpcsFile, int $memberPointer, ?int $previousMemberEndPointer = null): int + { + $startPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $memberPointer - 1); + if ($startPointer === null) { + if ($previousMemberEndPointer === null) { + $previousMemberEndPointer = $this->findPreviousMemberEndPointer($phpcsFile, $memberPointer); + } + + $startPointer = TokenHelper::findNextEffective($phpcsFile, $previousMemberEndPointer + 1); + assert($startPointer !== null); + } + + $types = [T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_SEMICOLON]; + + return (int) $phpcsFile->findFirstOnLine($types, $startPointer, true); + } + + private function findGroupEndPointer(File $phpcsFile, int $memberPointer): int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$memberPointer]['code'] === T_FUNCTION && !FunctionHelper::isAbstract($phpcsFile, $memberPointer)) { + $endPointer = $tokens[$memberPointer]['scope_closer']; + } elseif ($tokens[$memberPointer]['code'] === T_USE && array_key_exists('scope_closer', $tokens[$memberPointer])) { + $endPointer = $tokens[$memberPointer]['scope_closer']; + } else { + $endPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $memberPointer + 1); + assert($endPointer !== null); + } + + return $endPointer; + } + + private function removeBlankLinesAfterMember(File $phpcsFile, int $memberEndPointer, int $endPointer): int + { + $whitespacePointer = $memberEndPointer; + + $linesToRemove = 0; + while (true) { + $whitespacePointer = TokenHelper::findNext($phpcsFile, T_WHITESPACE, $whitespacePointer, $endPointer); + if ($whitespacePointer === null) { + break; + } + + $linesToRemove++; + $phpcsFile->fixer->replaceToken($whitespacePointer, ''); + $whitespacePointer++; + } + + return $linesToRemove; + } + + /** + * @return array + */ + private function getNormalizedGroups(): array + { + if ($this->normalizedGroups === null) { + $supportedGroups = [ + self::GROUP_USES, + self::GROUP_ENUM_CASES, + self::GROUP_PUBLIC_CONSTANTS, + self::GROUP_PROTECTED_CONSTANTS, + self::GROUP_PRIVATE_CONSTANTS, + self::GROUP_PUBLIC_PROPERTIES, + self::GROUP_PUBLIC_STATIC_PROPERTIES, + self::GROUP_PROTECTED_PROPERTIES, + self::GROUP_PROTECTED_STATIC_PROPERTIES, + self::GROUP_PRIVATE_PROPERTIES, + self::GROUP_PRIVATE_STATIC_PROPERTIES, + self::GROUP_PUBLIC_STATIC_FINAL_METHODS, + self::GROUP_PUBLIC_STATIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_STATIC_FINAL_METHODS, + self::GROUP_PROTECTED_STATIC_ABSTRACT_METHODS, + self::GROUP_PUBLIC_FINAL_METHODS, + self::GROUP_PUBLIC_ABSTRACT_METHODS, + self::GROUP_PROTECTED_FINAL_METHODS, + self::GROUP_PROTECTED_ABSTRACT_METHODS, + self::GROUP_CONSTRUCTOR, + self::GROUP_STATIC_CONSTRUCTORS, + self::GROUP_DESTRUCTOR, + self::GROUP_PUBLIC_METHODS, + self::GROUP_PUBLIC_STATIC_METHODS, + self::GROUP_PROTECTED_METHODS, + self::GROUP_PROTECTED_STATIC_METHODS, + self::GROUP_PRIVATE_METHODS, + self::GROUP_PRIVATE_STATIC_METHODS, + self::GROUP_MAGIC_METHODS, + ]; + + $normalizedGroupsWithShortcuts = []; + $order = 1; + foreach (SniffSettingsHelper::normalizeArray($this->groups) as $groupsString) { + /** @var list $groups */ + $groups = preg_split('~\\s*,\\s*~', strtolower($groupsString)); + foreach ($groups as $groupOrShortcut) { + $groupOrShortcut = preg_replace('~\\s+~', ' ', $groupOrShortcut); + + if ( + !in_array($groupOrShortcut, $supportedGroups, true) + && !array_key_exists($groupOrShortcut, self::SHORTCUTS) + ) { + throw new UnsupportedClassGroupException($groupOrShortcut); + } + + $normalizedGroupsWithShortcuts[$groupOrShortcut] = $order; + } + + $order++; + } + + $normalizedGroups = []; + foreach ($normalizedGroupsWithShortcuts as $groupOrShortcut => $groupOrder) { + if (in_array($groupOrShortcut, $supportedGroups, true)) { + $normalizedGroups[$groupOrShortcut] = $groupOrder; + } else { + foreach ($this->unpackShortcut($groupOrShortcut, $supportedGroups) as $group) { + if ( + array_key_exists($group, $normalizedGroupsWithShortcuts) + || array_key_exists($group, $normalizedGroups) + ) { + continue; + } + + $normalizedGroups[$group] = $groupOrder; + } + } + } + + if ($normalizedGroups === []) { + $normalizedGroups = array_flip($supportedGroups); + } else { + $missingGroups = array_diff($supportedGroups, array_keys($normalizedGroups)); + if ($missingGroups !== []) { + throw new MissingClassGroupsException($missingGroups); + } + } + + $this->normalizedGroups = $normalizedGroups; + } + + return $this->normalizedGroups; + } + + /** + * @param array $supportedGroups + * @return array + */ + private function unpackShortcut(string $shortcut, array $supportedGroups): array + { + $groups = []; + + foreach (self::SHORTCUTS[$shortcut] as $groupOrShortcut) { + if (in_array($groupOrShortcut, $supportedGroups, true)) { + $groups[] = $groupOrShortcut; + } elseif ( + !array_key_exists($groupOrShortcut, self::SHORTCUTS) + && in_array($groupOrShortcut, self::SHORTCUTS[self::GROUP_SHORTCUT_FINAL_METHODS], true) + ) { + // Nothing + } else { + $groups = array_merge($groups, $this->unpackShortcut($groupOrShortcut, $supportedGroups)); + } + } + + return $groups; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php new file mode 100644 index 0000000..70defe2 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php @@ -0,0 +1,79 @@ + + */ + public function register(): array + { + return [T_CONST]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $constantPointer + */ + public function process(File $phpcsFile, $constantPointer): int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$constantPointer]['conditions'] === []) { + return $constantPointer; + } + + /** @var int $classPointer */ + $classPointer = array_keys($tokens[$constantPointer]['conditions'])[count($tokens[$constantPointer]['conditions']) - 1]; + if (!in_array($tokens[$classPointer]['code'], Tokens::$ooScopeTokens, true)) { + return $constantPointer; + } + + return parent::process($phpcsFile, $constantPointer); + } + + protected function isNextMemberValid(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_CONST) { + return true; + } + + $nextPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_ENUM_CASE, T_CONST, T_VARIABLE, T_USE], $pointer + 1); + + return $tokens[$nextPointer]['code'] === T_CONST; + } + + protected function addError(File $phpcsFile, int $pointer, int $minExpectedLines, int $maxExpectedLines, int $found): bool + { + if ($minExpectedLines === $maxExpectedLines) { + $errorMessage = $minExpectedLines === 1 + ? 'Expected 1 blank line after constant, found %3$d.' + : 'Expected %2$d blank lines after constant, found %3$d.'; + } else { + $errorMessage = 'Expected %1$d to %2$d blank lines after constant, found %3$d.'; + } + $error = sprintf($errorMessage, $minExpectedLines, $maxExpectedLines, $found); + + return $phpcsFile->addFixableError($error, $pointer, self::CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_CONSTANT); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowConstructorPropertyPromotionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowConstructorPropertyPromotionSniff.php new file mode 100644 index 0000000..fd41063 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowConstructorPropertyPromotionSniff.php @@ -0,0 +1,69 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $namePointer = TokenHelper::findNextEffective($phpcsFile, $functionPointer + 1); + + if (strtolower($tokens[$namePointer]['content']) !== '__construct') { + return; + } + + $modifierPointers = TokenHelper::findNextAll( + $phpcsFile, + [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY], + $tokens[$functionPointer]['parenthesis_opener'] + 1, + $tokens[$functionPointer]['parenthesis_closer'] + ); + + if ($modifierPointers === []) { + return; + } + + foreach ($modifierPointers as $modifierPointer) { + $variablePointer = TokenHelper::findNext($phpcsFile, T_VARIABLE, $modifierPointer + 1); + + $phpcsFile->addError( + sprintf( + 'Constructor property promotion is disallowed, promotion of property %s found.', + $tokens[$variablePointer]['content'] + ), + $variablePointer, + self::CODE_DISALLOWED_CONSTRUCTOR_PROPERTY_PROMOTION + ); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowLateStaticBindingForConstantsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowLateStaticBindingForConstantsSniff.php new file mode 100644 index 0000000..2863e08 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowLateStaticBindingForConstantsSniff.php @@ -0,0 +1,71 @@ + + */ + public function register(): array + { + return [ + T_STATIC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $staticPointer + */ + public function process(File $phpcsFile, $staticPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $doubleColonPointer = TokenHelper::findNextEffective($phpcsFile, $staticPointer + 1); + if ($tokens[$doubleColonPointer]['code'] !== T_DOUBLE_COLON) { + return; + } + + $stringPointer = TokenHelper::findNextEffective($phpcsFile, $doubleColonPointer + 1); + if ($tokens[$stringPointer]['code'] !== T_STRING) { + return; + } + + if (strtolower($tokens[$stringPointer]['content']) === 'class') { + return; + } + + $pointerAfterString = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + if ($tokens[$pointerAfterString]['code'] === T_OPEN_PARENTHESIS) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Late static binding for constants is disallowed.', + $staticPointer, + self::CODE_DISALLOWED_LATE_STATIC_BINDING_FOR_CONSTANT + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($staticPointer, 'self'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiConstantDefinitionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiConstantDefinitionSniff.php new file mode 100644 index 0000000..73238b0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiConstantDefinitionSniff.php @@ -0,0 +1,128 @@ + + */ + public function register(): array + { + return [T_CONST]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $constantPointer + */ + public function process(File $phpcsFile, $constantPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $constantPointer + 1); + $commaPointers = []; + $nextPointer = $constantPointer; + do { + $nextPointer = TokenHelper::findNext($phpcsFile, [T_COMMA, T_OPEN_SHORT_ARRAY], $nextPointer + 1, $semicolonPointer); + + if ($nextPointer === null) { + break; + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_SHORT_ARRAY) { + $nextPointer = $tokens[$nextPointer]['bracket_closer']; + continue; + } + + $commaPointers[] = $nextPointer; + + } while (true); + + if (count($commaPointers) === 0) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use of multi constant definition is disallowed.', + $constantPointer, + self::CODE_DISALLOWED_MULTI_CONSTANT_DEFINITION + ); + if (!$fix) { + return; + } + + $possibleVisibilityPointer = TokenHelper::findPreviousEffective($phpcsFile, $constantPointer - 1); + $visibilityPointer = in_array($tokens[$possibleVisibilityPointer]['code'], Tokens::$scopeModifiers, true) + ? $possibleVisibilityPointer + : null; + $visibility = $visibilityPointer !== null ? $tokens[$possibleVisibilityPointer]['content'] : null; + + $pointerAfterConst = TokenHelper::findNextEffective($phpcsFile, $constantPointer + 1); + $pointerBeforeSemicolon = TokenHelper::findPreviousEffective($phpcsFile, $semicolonPointer - 1); + + $indentation = IndentationHelper::getIndentation($phpcsFile, $visibilityPointer ?? $constantPointer); + + $docCommentPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $constantPointer); + $docComment = $docCommentPointer !== null + ? trim(TokenHelper::getContent($phpcsFile, $docCommentPointer, $tokens[$docCommentPointer]['comment_closer'])) + : null; + + $data = []; + foreach ($commaPointers as $commaPointer) { + $data[$commaPointer] = [ + 'pointerBeforeComma' => TokenHelper::findPreviousEffective($phpcsFile, $commaPointer - 1), + 'pointerAfterComma' => TokenHelper::findNextEffective($phpcsFile, $commaPointer + 1), + ]; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($constantPointer, ' '); + + FixerHelper::removeBetween($phpcsFile, $constantPointer, $pointerAfterConst); + + foreach ($commaPointers as $commaPointer) { + FixerHelper::removeBetween($phpcsFile, $data[$commaPointer]['pointerBeforeComma'], $commaPointer); + + $phpcsFile->fixer->replaceToken( + $commaPointer, + sprintf( + ';%s%s%s%sconst ', + $phpcsFile->eolChar, + $docComment !== null + ? sprintf('%s%s%s', $indentation, $docComment, $phpcsFile->eolChar) + : '', + $indentation, + $visibility !== null ? sprintf('%s ', $visibility) : '' + ) + ); + + FixerHelper::removeBetween($phpcsFile, $commaPointer, $data[$commaPointer]['pointerAfterComma']); + } + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeSemicolon, $semicolonPointer); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiPropertyDefinitionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiPropertyDefinitionSniff.php new file mode 100644 index 0000000..ed126df --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowMultiPropertyDefinitionSniff.php @@ -0,0 +1,168 @@ + + */ + public function register(): array + { + return [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $visibilityPointer + */ + public function process(File $phpcsFile, $visibilityPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $asPointer = TokenHelper::findPreviousEffective($phpcsFile, $visibilityPointer - 1); + if ($tokens[$asPointer]['code'] === T_AS) { + return; + } + + $propertyPointer = TokenHelper::findNext($phpcsFile, [T_VARIABLE, T_FUNCTION], $visibilityPointer + 1); + if ( + $propertyPointer === null + || $tokens[$propertyPointer]['code'] !== T_VARIABLE + || !PropertyHelper::isProperty($phpcsFile, $propertyPointer) + ) { + return; + } + + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $propertyPointer + 1); + $commaPointers = []; + $nextPointer = $propertyPointer; + do { + $nextPointer = TokenHelper::findNext($phpcsFile, [T_COMMA, T_OPEN_SHORT_ARRAY, T_ARRAY], $nextPointer + 1, $semicolonPointer); + + if ($nextPointer === null) { + break; + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_SHORT_ARRAY) { + $nextPointer = $tokens[$nextPointer]['bracket_closer']; + continue; + } + + if ($tokens[$nextPointer]['code'] === T_ARRAY) { + $nextPointer = $tokens[$nextPointer]['parenthesis_closer']; + continue; + } + + $commaPointers[] = $nextPointer; + + } while (true); + + if (count($commaPointers) === 0) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use of multi property definition is disallowed.', + $visibilityPointer, + self::CODE_DISALLOWED_MULTI_PROPERTY_DEFINITION + ); + if (!$fix) { + return; + } + + $visibility = $tokens[$visibilityPointer]['content']; + + $pointerAfterVisibility = TokenHelper::findNextEffective($phpcsFile, $visibilityPointer + 1); + $pointerBeforeSemicolon = TokenHelper::findPreviousEffective($phpcsFile, $semicolonPointer - 1); + + $indentation = IndentationHelper::getIndentation($phpcsFile, $visibilityPointer); + + $nameTokenCodes = TokenHelper::getNameTokenCodes(); + + $typeHint = null; + $typeHintStartPointer = TokenHelper::findNext($phpcsFile, $nameTokenCodes, $visibilityPointer + 1, $propertyPointer); + $typeHintEndPointer = null; + $pointerAfterTypeHint = null; + if ($typeHintStartPointer !== null) { + $typeHintEndPointer = TokenHelper::findNextExcluding($phpcsFile, $nameTokenCodes, $typeHintStartPointer + 1) - 1; + $typeHint = TokenHelper::getContent($phpcsFile, $typeHintStartPointer, $typeHintEndPointer); + + $pointerAfterTypeHint = TokenHelper::findNextEffective($phpcsFile, $typeHintEndPointer + 1); + } + + $docCommentPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + $docComment = $docCommentPointer !== null + ? trim(TokenHelper::getContent($phpcsFile, $docCommentPointer, $tokens[$docCommentPointer]['comment_closer'])) + : null; + + $data = []; + foreach ($commaPointers as $commaPointer) { + $data[$commaPointer] = [ + 'pointerBeforeComma' => TokenHelper::findPreviousEffective($phpcsFile, $commaPointer - 1), + 'pointerAfterComma' => TokenHelper::findNextEffective($phpcsFile, $commaPointer + 1), + ]; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($visibilityPointer, ' '); + + FixerHelper::removeBetween($phpcsFile, $visibilityPointer, $pointerAfterVisibility); + + if ($typeHint !== null) { + $phpcsFile->fixer->addContent($typeHintEndPointer, ' '); + FixerHelper::removeBetween($phpcsFile, $typeHintEndPointer, $pointerAfterTypeHint); + } + + foreach ($commaPointers as $commaPointer) { + FixerHelper::removeBetween($phpcsFile, $data[$commaPointer]['pointerBeforeComma'], $commaPointer); + + $phpcsFile->fixer->replaceToken( + $commaPointer, + sprintf( + ';%s%s%s%s%s ', + $phpcsFile->eolChar, + $docComment !== null + ? sprintf('%s%s%s', $indentation, $docComment, $phpcsFile->eolChar) + : '', + $indentation, + $visibility, + $typeHint !== null ? sprintf(' %s', $typeHint) : '' + ) + ); + + FixerHelper::removeBetween($phpcsFile, $commaPointer, $data[$commaPointer]['pointerAfterComma']); + } + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeSemicolon, $semicolonPointer); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php new file mode 100644 index 0000000..d34e684 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/DisallowStringExpressionPropertyFetchSniff.php @@ -0,0 +1,84 @@ + + */ + public function register(): array + { + return [T_OBJECT_OPERATOR]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $objectOperatorPointer + */ + public function process(File $phpcsFile, $objectOperatorPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $curlyBracketOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $objectOperatorPointer + 1); + + if ($tokens[$curlyBracketOpenerPointer]['code'] !== T_OPEN_CURLY_BRACKET) { + return; + } + + $curlyBracketCloserPointer = $tokens[$curlyBracketOpenerPointer]['bracket_closer']; + + if (TokenHelper::findNextExcluding( + $phpcsFile, + T_CONSTANT_ENCAPSED_STRING, + $curlyBracketOpenerPointer + 1, + $curlyBracketCloserPointer + ) !== null) { + return; + } + + $pointerAfterCurlyBracketCloser = TokenHelper::findNextEffective($phpcsFile, $curlyBracketCloserPointer + 1); + + if ($tokens[$pointerAfterCurlyBracketCloser]['code'] === T_OPEN_PARENTHESIS) { + return; + } + + if (preg_match( + '~^(["\'])([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\1$~', + $tokens[$curlyBracketOpenerPointer + 1]['content'], + $matches + ) !== 1) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'String expression property fetch is disallowed, use identifier property fetch.', + $curlyBracketOpenerPointer, + self::CODE_DISALLOWED_STRING_EXPRESSION_PROPERTY_FETCH + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $curlyBracketOpenerPointer, $curlyBracketCloserPointer, $matches[2]); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EmptyLinesAroundClassBracesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EmptyLinesAroundClassBracesSniff.php new file mode 100644 index 0000000..160d1d4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EmptyLinesAroundClassBracesSniff.php @@ -0,0 +1,159 @@ + + */ + public function register(): array + { + return array_values(Tokens::$ooScopeTokens); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPointer + */ + public function process(File $phpcsFile, $stackPointer): void + { + $this->linesCountAfterOpeningBrace = SniffSettingsHelper::normalizeInteger($this->linesCountAfterOpeningBrace); + $this->linesCountBeforeClosingBrace = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeClosingBrace); + + $this->processOpeningBrace($phpcsFile, $stackPointer); + $this->processClosingBrace($phpcsFile, $stackPointer); + } + + private function processOpeningBrace(File $phpcsFile, int $stackPointer): void + { + $tokens = $phpcsFile->getTokens(); + $typeToken = $tokens[$stackPointer]; + $openerPointer = $typeToken['scope_opener']; + $openerToken = $tokens[$openerPointer]; + $nextPointerAfterOpeningBrace = TokenHelper::findNextNonWhitespace($phpcsFile, $openerPointer + 1); + $nextTokenAfterOpeningBrace = $tokens[$nextPointerAfterOpeningBrace]; + $lines = $nextTokenAfterOpeningBrace['line'] - $openerToken['line'] - 1; + + if ($lines === $this->linesCountAfterOpeningBrace) { + return; + } + + if ($this->linesCountAfterOpeningBrace === 1) { + $fix = $phpcsFile->addFixableError( + sprintf('There must be one empty line after %s opening brace.', $typeToken['content']), + $openerPointer, + $lines === 0 + ? self::CODE_NO_EMPTY_LINE_AFTER_OPENING_BRACE + : self::CODE_MULTIPLE_EMPTY_LINES_AFTER_OPENING_BRACE + ); + } else { + $fix = $phpcsFile->addFixableError(sprintf( + 'There must be exactly %d empty lines after %s opening brace.', + $this->linesCountAfterOpeningBrace, + $typeToken['content'] + ), $openerPointer, self::CODE_INCORRECT_EMPTY_LINES_AFTER_OPENING_BRACE); + } + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($lines < $this->linesCountAfterOpeningBrace) { + for ($i = $lines; $i < $this->linesCountAfterOpeningBrace; $i++) { + $phpcsFile->fixer->addNewline($openerPointer); + } + } else { + for ($i = $openerPointer + $this->linesCountAfterOpeningBrace + 2; $i < $nextPointerAfterOpeningBrace; $i++) { + if ($phpcsFile->fixer->getTokenContent($i) !== $phpcsFile->eolChar) { + break; + } + $phpcsFile->fixer->replaceToken($i, ''); + } + } + + $phpcsFile->fixer->endChangeset(); + } + + private function processClosingBrace(File $phpcsFile, int $stackPointer): void + { + $tokens = $phpcsFile->getTokens(); + $typeToken = $tokens[$stackPointer]; + $closerPointer = $typeToken['scope_closer']; + $closerToken = $tokens[$closerPointer]; + $previousPointerBeforeClosingBrace = TokenHelper::findPreviousNonWhitespace($phpcsFile, $closerPointer - 1); + $previousTokenBeforeClosingBrace = $tokens[$previousPointerBeforeClosingBrace]; + $lines = $closerToken['line'] - $previousTokenBeforeClosingBrace['line'] - 1; + + if ($lines === $this->linesCountBeforeClosingBrace) { + return; + } + + if ($this->linesCountBeforeClosingBrace === 1) { + $fix = $phpcsFile->addFixableError( + sprintf('There must be one empty line before %s closing brace.', $typeToken['content']), + $closerPointer, + $lines === 0 + ? self::CODE_NO_EMPTY_LINE_BEFORE_CLOSING_BRACE + : self::CODE_MULTIPLE_EMPTY_LINES_BEFORE_CLOSING_BRACE + ); + } else { + $fix = $phpcsFile->addFixableError(sprintf( + 'There must be exactly %d empty lines before %s closing brace.', + $this->linesCountBeforeClosingBrace, + $typeToken['content'] + ), $closerPointer, self::CODE_INCORRECT_EMPTY_LINES_BEFORE_CLOSING_BRACE); + } + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($lines < $this->linesCountBeforeClosingBrace) { + for ($i = $lines; $i < $this->linesCountBeforeClosingBrace; $i++) { + $phpcsFile->fixer->addNewlineBefore($closerPointer); + } + } else { + FixerHelper::removeBetween( + $phpcsFile, + $previousPointerBeforeClosingBrace + $this->linesCountBeforeClosingBrace + 1, + $closerPointer + ); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php new file mode 100644 index 0000000..286d6ec --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/EnumCaseSpacingSniff.php @@ -0,0 +1,54 @@ + + */ + public function register(): array + { + return [T_ENUM_CASE]; + } + + protected function isNextMemberValid(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_ENUM_CASE) { + return true; + } + + $nextPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_CONST, T_VARIABLE, T_USE, T_ENUM_CASE], $pointer + 1); + + return $tokens[$nextPointer]['code'] === T_ENUM_CASE; + } + + protected function addError(File $phpcsFile, int $pointer, int $minExpectedLines, int $maxExpectedLines, int $found): bool + { + if ($minExpectedLines === $maxExpectedLines) { + $errorMessage = $minExpectedLines === 1 + ? 'Expected 1 blank line after enum case, found %3$d.' + : 'Expected %2$d blank lines after enum case, found %3$d.'; + } else { + $errorMessage = 'Expected %1$d to %2$d blank lines after enum case, found %3$d.'; + } + $error = sprintf($errorMessage, $minExpectedLines, $maxExpectedLines, $found); + + return $phpcsFile->addFixableError($error, $pointer, self::CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_ENUM_CASE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php new file mode 100644 index 0000000..5863606 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php @@ -0,0 +1,77 @@ + + */ + public function register(): array + { + return [T_VARIABLE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $variablePointer + */ + public function process(File $file, $variablePointer): void + { + if (!PropertyHelper::isProperty($file, $variablePointer, $this->checkPromoted)) { + return; + } + + // skip Sniff classes, they have public properties for configuration (unfortunately) + if ($this->isSniffClass($file, $variablePointer)) { + return; + } + + $scopeModifierToken = $this->getPropertyScopeModifier($file, $variablePointer); + if ($scopeModifierToken['code'] === T_PROTECTED || $scopeModifierToken['code'] === T_PRIVATE) { + return; + } + + $errorMessage = 'Do not use public properties. Use method access instead.'; + $file->addError($errorMessage, $variablePointer, self::CODE_FORBIDDEN_PUBLIC_PROPERTY); + } + + private function isSniffClass(File $file, int $position): bool + { + $classTokenPosition = ClassHelper::getClassPointer($file, $position); + $classNameToken = ClassHelper::getName($file, $classTokenPosition); + + return StringHelper::endsWith($classNameToken, 'Sniff'); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint + * @return array{code: int|string} + */ + private function getPropertyScopeModifier(File $file, int $position): array + { + $scopeModifierPosition = TokenHelper::findPrevious($file, array_merge([T_VAR], Tokens::$scopeModifiers), $position - 1); + + return $file->getTokens()[$scopeModifierPosition]; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MethodSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MethodSpacingSniff.php new file mode 100644 index 0000000..afe4c7b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MethodSpacingSniff.php @@ -0,0 +1,133 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $methodPointer + */ + public function process(File $phpcsFile, $methodPointer): void + { + $this->minLinesCount = SniffSettingsHelper::normalizeInteger($this->minLinesCount); + $this->maxLinesCount = SniffSettingsHelper::normalizeInteger($this->maxLinesCount); + + if (!FunctionHelper::isMethod($phpcsFile, $methodPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $methodEndPointer = array_key_exists('scope_closer', $tokens[$methodPointer]) + ? $tokens[$methodPointer]['scope_closer'] + : TokenHelper::findNext($phpcsFile, T_SEMICOLON, $methodPointer + 1); + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $methodPointer); + + $nextMethodPointer = TokenHelper::findNext($phpcsFile, T_FUNCTION, $methodEndPointer + 1, $tokens[$classPointer]['scope_closer']); + if ($nextMethodPointer === null) { + return; + } + + $nextMethodDocCommentStartPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $nextMethodPointer); + if ( + $nextMethodDocCommentStartPointer !== null + && $tokens[$tokens[$nextMethodDocCommentStartPointer]['comment_closer']]['line'] + 1 !== $tokens[$nextMethodPointer]['line'] + ) { + $nextMethodDocCommentStartPointer = null; + } + + $nextMethodFirstLinePointer = $tokens[$nextMethodPointer]['line'] === $tokens[$methodEndPointer]['line'] + ? TokenHelper::findNextEffective($phpcsFile, $methodEndPointer + 1) + : TokenHelper::findFirstTokenOnLine($phpcsFile, $nextMethodDocCommentStartPointer ?? $nextMethodPointer); + + if (TokenHelper::findNextNonWhitespace($phpcsFile, $methodEndPointer + 1, $nextMethodFirstLinePointer) !== null) { + return; + } + + $linesBetween = $tokens[$nextMethodFirstLinePointer]['line'] !== $tokens[$methodEndPointer]['line'] + ? $tokens[$nextMethodFirstLinePointer]['line'] - $tokens[$methodEndPointer]['line'] - 1 + : null; + + if ($linesBetween !== null && $linesBetween >= $this->minLinesCount && $linesBetween <= $this->maxLinesCount) { + return; + } + + if ($this->minLinesCount === $this->maxLinesCount) { + $errorMessage = $this->minLinesCount === 1 + ? 'Expected 1 blank line after method, found %3$d.' + : 'Expected %2$d blank lines after method, found %3$d.'; + } else { + $errorMessage = 'Expected %1$d to %2$d blank lines after method, found %3$d.'; + } + + $fix = $phpcsFile->addFixableError( + sprintf($errorMessage, $this->minLinesCount, $this->maxLinesCount, $linesBetween ?? 0), + $methodPointer, + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_METHODS + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($linesBetween === null) { + $phpcsFile->fixer->addContent( + $methodEndPointer, + $phpcsFile->eolChar . str_repeat($phpcsFile->eolChar, $this->minLinesCount) . IndentationHelper::getIndentation( + $phpcsFile, + TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $methodPointer) + ) + ); + + FixerHelper::removeBetween($phpcsFile, $methodEndPointer, $nextMethodFirstLinePointer); + + } elseif ($linesBetween > $this->maxLinesCount) { + $phpcsFile->fixer->addContent($methodEndPointer, str_repeat($phpcsFile->eolChar, $this->maxLinesCount + 1)); + + $firstPointerOnNextMethodLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $nextMethodFirstLinePointer); + + FixerHelper::removeBetween($phpcsFile, $methodEndPointer, $firstPointerOnNextMethodLine); + } else { + $phpcsFile->fixer->addContent($methodEndPointer, str_repeat($phpcsFile->eolChar, $this->minLinesCount - $linesBetween)); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php new file mode 100644 index 0000000..2faddec --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/MissingClassGroupsException.php @@ -0,0 +1,23 @@ + $groups */ + public function __construct(array $groups) + { + parent::__construct( + sprintf( + 'You need configure all class groups. These groups are missing from your configuration: %s.', + implode(', ', $groups) + ) + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php new file mode 100644 index 0000000..e58a453 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ModernClassNameReferenceSniff.php @@ -0,0 +1,178 @@ + + */ + public function register(): array + { + $tokens = TokenHelper::getOnlyNameTokenCodes(); + $tokens[] = T_CLASS_C; + + return $tokens; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->enableOnObjects = SniffSettingsHelper::isEnabledByPhpVersion($this->enableOnObjects, 80000); + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_CLASS_C) { + $this->checkMagicConstant($phpcsFile, $pointer); + return; + } + + $this->checkFunctionCall($phpcsFile, $pointer); + } + + private function checkMagicConstant(File $phpcsFile, int $pointer): void + { + $fix = $phpcsFile->addFixableError( + 'Class name referenced via magic constant.', + $pointer, + self::CODE_CLASS_NAME_REFERENCED_VIA_MAGIC_CONSTANT + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($pointer, 'self::class'); + $phpcsFile->fixer->endChangeset(); + } + + private function checkFunctionCall(File $phpcsFile, int $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $functionName = ltrim(strtolower($tokens[$functionPointer]['content']), '\\'); + + $functionNames = [ + 'get_class', + 'get_parent_class', + 'get_called_class', + ]; + + if (!in_array($functionName, $functionNames, true)) { + return; + } + + $openParenthesisPointer = TokenHelper::findNextEffective($phpcsFile, $functionPointer + 1); + if ($tokens[$openParenthesisPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $functionPointer - 1); + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON, T_FUNCTION], true)) { + return; + } + + $parameterPointer = TokenHelper::findNextEffective( + $phpcsFile, + $openParenthesisPointer + 1, + $tokens[$openParenthesisPointer]['parenthesis_closer'] + ); + + $isObjectParameter = static function () use ($phpcsFile, $tokens, $openParenthesisPointer, $parameterPointer): bool { + if ($tokens[$parameterPointer]['code'] !== T_VARIABLE) { + return false; + } + + $pointerAfterParameterPointer = TokenHelper::findNextEffective($phpcsFile, $parameterPointer + 1); + return $pointerAfterParameterPointer === $tokens[$openParenthesisPointer]['parenthesis_closer']; + }; + + $isThisParameter = static function () use ($tokens, $parameterPointer, $isObjectParameter): bool { + if (!$isObjectParameter()) { + return false; + } + + $parameterName = strtolower($tokens[$parameterPointer]['content']); + return $parameterName === '$this'; + }; + + if ($functionName === 'get_class') { + if ($parameterPointer === null) { + $fixedContent = 'self::class'; + } elseif ($isThisParameter()) { + $fixedContent = 'static::class'; + } elseif ($this->enableOnObjects && $isObjectParameter()) { + $fixedContent = sprintf('%s::class', $tokens[$parameterPointer]['content']); + } else { + return; + } + + } elseif ($functionName === 'get_parent_class') { + if ($parameterPointer !== null) { + if (!$isThisParameter()) { + return; + } + + /** @var int $classPointer */ + $classPointer = FunctionHelper::findClassPointer($phpcsFile, $functionPointer); + if (!ClassHelper::isFinal($phpcsFile, $classPointer)) { + return; + } + } + + $fixedContent = 'parent::class'; + } else { + $fixedContent = 'static::class'; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Class name referenced via call of function %s().', $functionName), + $functionPointer, + self::CODE_CLASS_NAME_REFERENCED_VIA_FUNCTION_CALL + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + if ($tokens[$functionPointer - 1]['code'] === T_NS_SEPARATOR) { + $phpcsFile->fixer->replaceToken($functionPointer - 1, ''); + } + + FixerHelper::change($phpcsFile, $functionPointer, $tokens[$openParenthesisPointer]['parenthesis_closer'], $fixedContent); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php new file mode 100644 index 0000000..2755349 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ParentCallSpacingSniff.php @@ -0,0 +1,122 @@ +linesCountBefore = SniffSettingsHelper::normalizeInteger($this->linesCountBefore); + $this->linesCountBeforeFirst = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirst); + $this->linesCountAfter = SniffSettingsHelper::normalizeInteger($this->linesCountAfter); + $this->linesCountAfterLast = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLast); + + $tokens = $phpcsFile->getTokens(); + + if (array_key_exists('nested_parenthesis', $tokens[$parentPointer])) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $parentPointer - 1); + if (in_array($tokens[$previousPointer]['code'], array_merge(Tokens::$castTokens, [T_ASPERAND]), true)) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + $tokensToIgnore = array_merge( + Tokens::$assignmentTokens, + Tokens::$equalityTokens, + Tokens::$booleanOperators, + [T_RETURN, T_YIELD, T_YIELD_FROM, T_COLON, T_STRING_CONCAT, T_INLINE_THEN, T_INLINE_ELSE, T_COALESCE, T_MATCH_ARROW] + ); + if (in_array($tokens[$previousPointer]['code'], $tokensToIgnore, true)) { + return; + } + + $previousShortArrayOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_SHORT_ARRAY, $parentPointer - 1); + if ($previousShortArrayOpenerPointer !== null && $tokens[$previousShortArrayOpenerPointer]['bracket_closer'] > $parentPointer) { + return; + } + + parent::process($phpcsFile, $parentPointer); + } + + /** + * @return list + */ + protected function getSupportedKeywords(): array + { + return [self::KEYWORD_PARENT]; + } + + /** + * @return list + */ + protected function getKeywordsToCheck(): array + { + return [self::KEYWORD_PARENT]; + } + + protected function getLinesCountBefore(): int + { + return $this->linesCountBefore; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + */ + protected function getLinesCountBeforeFirst(File $phpcsFile, int $parentPointer): int + { + return $this->linesCountBeforeFirst; + } + + protected function getLinesCountAfter(): int + { + return $this->linesCountAfter; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + */ + protected function getLinesCountAfterLast(File $phpcsFile, int $parentPointer, int $parentEndPointer): int + { + return $this->linesCountAfterLast; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php new file mode 100644 index 0000000..48dd3cc --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php @@ -0,0 +1,401 @@ +|null */ + public $modifiersOrder = []; + + /** @var bool */ + public $checkPromoted = false; + + /** @var bool */ + public $enableMultipleSpacesBetweenModifiersCheck = false; + + /** @var array>|null */ + private $normalizedModifiersOrder = null; + + /** + * @return array + */ + public function register(): array + { + return TokenHelper::$propertyModifiersTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $modifierPointer + */ + public function process(File $phpcsFile, $modifierPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $asPointer = TokenHelper::findPreviousEffective($phpcsFile, $modifierPointer - 1); + if ($tokens[$asPointer]['code'] === T_AS) { + return; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $modifierPointer + 1); + if (in_array($tokens[$nextPointer]['code'], TokenHelper::$propertyModifiersTokenCodes, true)) { + // We don't want to report the same property twice + return; + } + + if ($tokens[$nextPointer]['code'] === T_DOUBLE_COLON) { + // Ignore static:: + return; + } + + $propertyPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_CONST, T_VARIABLE], $modifierPointer + 1); + + if ($propertyPointer === null || $tokens[$propertyPointer]['code'] !== T_VARIABLE) { + return; + } + + if (!PropertyHelper::isProperty($phpcsFile, $propertyPointer, $this->checkPromoted)) { + return; + } + + $firstModifierPointer = $modifierPointer; + do { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $firstModifierPointer - 1); + if (!in_array($tokens[$previousPointer]['code'], TokenHelper::$propertyModifiersTokenCodes, true)) { + break; + } + + $firstModifierPointer = $previousPointer; + } while (true); + + $this->checkModifiersOrder($phpcsFile, $propertyPointer, $firstModifierPointer, $modifierPointer); + $this->checkSpacesBetweenModifiers($phpcsFile, $propertyPointer, $firstModifierPointer, $modifierPointer); + $this->checkTypeHintSpacing($phpcsFile, $propertyPointer, $modifierPointer); + } + + private function checkModifiersOrder(File $phpcsFile, int $propertyPointer, int $firstModifierPointer, int $lastModifierPointer): void + { + $modifiersPointers = TokenHelper::findNextAll( + $phpcsFile, + TokenHelper::$propertyModifiersTokenCodes, + $firstModifierPointer, + $lastModifierPointer + 1 + ); + + if (count($modifiersPointers) < 2) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $modifiersGroups = $this->getNormalizedModifiersOrder(); + + $expectedModifiersPositions = []; + foreach ($modifiersPointers as $modifierPointer) { + for ($i = 0; $i < count($modifiersGroups); $i++) { + if (in_array($tokens[$modifierPointer]['code'], $modifiersGroups[$i], true)) { + $expectedModifiersPositions[$modifierPointer] = $i; + continue 2; + } + } + + // Modifier position is not defined so add it to the end + $expectedModifiersPositions[$modifierPointer] = count($modifiersGroups); + } + + $error = false; + + for ($i = 1; $i < count($modifiersPointers); $i++) { + for ($j = 0; $j < $i; $j++) { + if ($expectedModifiersPositions[$modifiersPointers[$i]] < $expectedModifiersPositions[$modifiersPointers[$j]]) { + $error = true; + break; + } + } + } + + if (!$error) { + return; + } + + $actualModifiers = array_map(static function (int $modifierPointer) use ($tokens): string { + return $tokens[$modifierPointer]['content']; + }, $modifiersPointers); + $actualModifiersFormatted = implode(' ', $actualModifiers); + + asort($expectedModifiersPositions); + $expectedModifiers = array_map(static function (int $modifierPointer) use ($tokens): string { + return $tokens[$modifierPointer]['content']; + }, array_keys($expectedModifiersPositions)); + $expectedModifiersFormatted = implode(' ', $expectedModifiers); + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Incorrect order of modifiers "%s" of property %s, expected "%s".', + $actualModifiersFormatted, + $tokens[$propertyPointer]['content'], + $expectedModifiersFormatted + ), + $firstModifierPointer, + self::CODE_INCORRECT_ORDER_OF_MODIFIERS + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $firstModifierPointer, $lastModifierPointer, $expectedModifiersFormatted); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkSpacesBetweenModifiers( + File $phpcsFile, + int $propertyPointer, + int $firstModifierPointer, + int $lastModifierPointer + ): void + { + if (!$this->enableMultipleSpacesBetweenModifiersCheck) { + return; + } + + $modifiersPointers = TokenHelper::findNextAll( + $phpcsFile, + TokenHelper::$propertyModifiersTokenCodes, + $firstModifierPointer, + $lastModifierPointer + 1 + ); + + if (count($modifiersPointers) < 2) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $error = false; + for ($i = 0; $i < count($modifiersPointers) - 1; $i++) { + $whitespace = TokenHelper::getContent($phpcsFile, $modifiersPointers[$i] + 1, $modifiersPointers[$i + 1] - 1); + if ($whitespace !== ' ') { + $error = true; + break; + } + } + + if (!$error) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('There must be exactly one space between modifiers of property %s.', $tokens[$propertyPointer]['content']), + $firstModifierPointer, + self::CODE_MULTIPLE_SPACES_BETWEEN_MODIFIERS + ); + if (!$fix) { + return; + } + + $expectedModifiers = array_map(static function (int $modifierPointer) use ($tokens): string { + return $tokens[$modifierPointer]['content']; + }, $modifiersPointers); + $expectedModifiersFormatted = implode(' ', $expectedModifiers); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $firstModifierPointer, $lastModifierPointer, $expectedModifiersFormatted); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkTypeHintSpacing(File $phpcsFile, int $propertyPointer, int $lastModifierPointer): void + { + $typeHintEndPointer = TokenHelper::findPrevious( + $phpcsFile, + TokenHelper::getTypeHintTokenCodes(), + $propertyPointer - 1, + $lastModifierPointer + ); + if ($typeHintEndPointer === null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $typeHintStartPointer = TypeHintHelper::getStartPointer($phpcsFile, $typeHintEndPointer); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $typeHintStartPointer - 1, $lastModifierPointer); + $nullabilitySymbolPointer = $previousPointer !== null && $tokens[$previousPointer]['code'] === T_NULLABLE ? $previousPointer : null; + + $propertyName = $tokens[$propertyPointer]['content']; + + if ($tokens[$lastModifierPointer + 1]['code'] !== T_WHITESPACE) { + $errorMessage = sprintf('There must be exactly one space before type hint nullability symbol of property %s.', $propertyName); + $errorCode = self::CODE_NO_SPACE_BEFORE_NULLABILITY_SYMBOL; + + $fix = $phpcsFile->addFixableError($errorMessage, $typeHintEndPointer, $errorCode); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($lastModifierPointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$lastModifierPointer + 1]['content'] !== ' ') { + if ($nullabilitySymbolPointer !== null) { + $errorMessage = sprintf( + 'There must be exactly one space before type hint nullability symbol of property %s.', + $propertyName + ); + $errorCode = self::CODE_MULTIPLE_SPACES_BEFORE_NULLABILITY_SYMBOL; + } else { + $errorMessage = sprintf('There must be exactly one space before type hint of property %s.', $propertyName); + $errorCode = self::CODE_MULTIPLE_SPACES_BEFORE_TYPE_HINT; + } + + $fix = $phpcsFile->addFixableError($errorMessage, $lastModifierPointer, $errorCode); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($lastModifierPointer + 1, ' '); + $phpcsFile->fixer->endChangeset(); + } + } + + if ($tokens[$typeHintEndPointer + 1]['code'] !== T_WHITESPACE) { + $fix = $phpcsFile->addFixableError( + sprintf('There must be exactly one space between type hint and property %s.', $propertyName), + $typeHintEndPointer, + self::CODE_NO_SPACE_BETWEEN_TYPE_HINT_AND_PROPERTY + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($typeHintEndPointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$typeHintEndPointer + 1]['content'] !== ' ') { + $fix = $phpcsFile->addFixableError( + sprintf('There must be exactly one space between type hint and property %s.', $propertyName), + $typeHintEndPointer, + self::CODE_MULTIPLE_SPACES_BETWEEN_TYPE_HINT_AND_PROPERTY + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($typeHintEndPointer + 1, ' '); + $phpcsFile->fixer->endChangeset(); + } + } + + if ($nullabilitySymbolPointer === null) { + return; + } + + if ($nullabilitySymbolPointer + 1 === $typeHintStartPointer) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('There must be no whitespace between type hint nullability symbol and type hint of property %s.', $propertyName), + $typeHintStartPointer, + self::CODE_WHITESPACE_AFTER_NULLABILITY_SYMBOL + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($nullabilitySymbolPointer + 1, ''); + $phpcsFile->fixer->endChangeset(); + } + + /** + * @return array> + */ + private function getNormalizedModifiersOrder(): array + { + if ($this->normalizedModifiersOrder === null) { + $modifiersGroups = SniffSettingsHelper::normalizeArray($this->modifiersOrder); + + if ($modifiersGroups === []) { + $modifiersGroups = [ + 'var, public, protected, private', + 'static, readonly', + ]; + } + + $this->normalizedModifiersOrder = []; + + $mapping = [ + 'var' => T_VAR, + 'public' => T_PUBLIC, + 'protected' => T_PROTECTED, + 'private' => T_PRIVATE, + 'static' => T_STATIC, + 'readonly' => T_READONLY, + ]; + + foreach ($modifiersGroups as $modifiersGroupNo => $modifiersGroup) { + $this->normalizedModifiersOrder[$modifiersGroupNo] = []; + + /** @var list $modifiers */ + $modifiers = preg_split('~\\s*,\\s*~', strtolower($modifiersGroup)); + + foreach ($modifiers as $modifier) { + if (!array_key_exists($modifier, $mapping)) { + throw new UnexpectedValueException(sprintf('Unknown property modifier "%s".', $modifier)); + } + + $this->normalizedModifiersOrder[$modifiersGroupNo][] = $mapping[$modifier]; + } + } + } + + return $this->normalizedModifiersOrder; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php new file mode 100644 index 0000000..e7adf96 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/PropertySpacingSniff.php @@ -0,0 +1,87 @@ + + */ + public function register(): array + { + return [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $asPointer = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + if ($tokens[$asPointer]['code'] === T_AS) { + return $pointer; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + if (in_array($tokens[$nextPointer]['code'], [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC], true)) { + // We don't want to report the same property twice + return $nextPointer; + } + + $propertyPointer = TokenHelper::findNext($phpcsFile, [T_VARIABLE, T_FUNCTION, T_CONST, T_USE], $pointer + 1); + if ( + $propertyPointer === null + || $tokens[$propertyPointer]['code'] !== T_VARIABLE + || !PropertyHelper::isProperty($phpcsFile, $propertyPointer) + ) { + return $propertyPointer ?? $pointer; + } + + return parent::process($phpcsFile, $propertyPointer); + } + + protected function isNextMemberValid(File $phpcsFile, int $pointer): bool + { + $nextPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_VARIABLE], $pointer + 1); + + return $nextPointer !== null && $phpcsFile->getTokens()[$nextPointer]['code'] === T_VARIABLE; + } + + protected function addError(File $phpcsFile, int $pointer, int $minExpectedLines, int $maxExpectedLines, int $found): bool + { + if ($minExpectedLines === $maxExpectedLines) { + $errorMessage = $minExpectedLines === 1 + ? 'Expected 1 blank line after property, found %3$d.' + : 'Expected %2$d blank lines after property, found %3$d.'; + } else { + $errorMessage = 'Expected %1$d to %2$d blank lines after property, found %3$d.'; + } + $error = sprintf($errorMessage, $minExpectedLines, $maxExpectedLines, $found); + + return $phpcsFile->addFixableError($error, $pointer, self::CODE_INCORRECT_COUNT_OF_BLANK_LINES_AFTER_PROPERTY); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireAbstractOrFinalSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireAbstractOrFinalSniff.php new file mode 100644 index 0000000..6b21041 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireAbstractOrFinalSniff.php @@ -0,0 +1,62 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $classPointer - 1); + + if ($tokens[$previousPointer]['code'] === T_READONLY) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + if (in_array($tokens[$previousPointer]['code'], [T_ABSTRACT, T_FINAL], true)) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'All classes should be declared using either the "abstract" or "final" keyword.', + $classPointer, + self::CODE_NO_ABSTRACT_OR_FINAL + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore($classPointer, 'final '); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php new file mode 100644 index 0000000..d1736c8 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireConstructorPropertyPromotionSniff.php @@ -0,0 +1,398 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $namePointer = TokenHelper::findNextEffective($phpcsFile, $functionPointer + 1); + + if (strtolower($tokens[$namePointer]['content']) !== '__construct') { + return; + } + + if (FunctionHelper::isAbstract($phpcsFile, $functionPointer)) { + return; + } + + $parameterPointers = $this->getParameterPointers($phpcsFile, $functionPointer); + + if (count($parameterPointers) === 0) { + return; + } + + $parameterWithoutPromotionPointers = []; + foreach ($parameterPointers as $parameterPointer) { + $pointerBefore = TokenHelper::findPrevious($phpcsFile, [T_COMMA, T_OPEN_PARENTHESIS], $parameterPointer - 1); + + $visibilityPointer = TokenHelper::findNextEffective($phpcsFile, $pointerBefore + 1); + + if (in_array($tokens[$visibilityPointer]['code'], Tokens::$scopeModifiers, true)) { + continue; + } + + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $parameterPointer - 1); + + if ($tokens[$pointerBefore]['code'] === T_ELLIPSIS) { + continue; + } + + if ($tokens[$pointerBefore]['code'] === T_BITWISE_AND) { + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $pointerBefore - 1); + } + + if ($tokens[$pointerBefore]['code'] === T_CALLABLE) { + continue; + } + + $parameterWithoutPromotionPointers[] = $parameterPointer; + } + + if (count($parameterWithoutPromotionPointers) === 0) { + return; + } + + /** @var int $classPointer */ + $classPointer = FunctionHelper::findClassPointer($phpcsFile, $functionPointer); + + $propertyPointers = $this->getPropertyPointers($phpcsFile, $classPointer); + + if (count($propertyPointers) === 0) { + return; + } + + foreach ($parameterWithoutPromotionPointers as $parameterPointer) { + $parameterName = $tokens[$parameterPointer]['content']; + + foreach ($propertyPointers as $propertyPointer) { + $propertyName = $tokens[$propertyPointer]['content']; + + if ($parameterName !== $propertyName) { + continue; + } + + if ($this->isPropertyDocCommentUseful($phpcsFile, $propertyPointer)) { + continue; + } + + if ($this->isPropertyWithAttribute($phpcsFile, $propertyPointer)) { + continue; + } + + $propertyTypeHint = PropertyHelper::findTypeHint($phpcsFile, $propertyPointer); + $parameterTypeHint = FunctionHelper::getParametersTypeHints($phpcsFile, $functionPointer)[$parameterName]; + if (!$this->areTypeHintEqual($parameterTypeHint, $propertyTypeHint)) { + continue; + } + + $assignmentPointer = $this->getAssignment($phpcsFile, $functionPointer, $parameterName); + if ($assignmentPointer === null) { + continue; + } + + if ($this->isParameterModifiedBeforeAssignment($phpcsFile, $functionPointer, $parameterName, $assignmentPointer)) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Required promotion of property %s.', $propertyName), + $propertyPointer, + self::CODE_REQUIRED_CONSTRUCTOR_PROPERTY_PROMOTION + ); + + if (!$fix) { + continue; + } + + $propertyDocCommentOpenerPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + $pointerBeforeProperty = TokenHelper::findFirstTokenOnLine( + $phpcsFile, + $propertyDocCommentOpenerPointer ?? $propertyPointer + ); + $propertyEndPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $propertyPointer + 1); + + $visibilityPointer = TokenHelper::findPrevious( + $phpcsFile, + Tokens::$scopeModifiers, + $propertyPointer - 1, + $pointerBeforeProperty + ); + $visibility = $tokens[$visibilityPointer]['content']; + + $readonlyPointer = TokenHelper::findPrevious($phpcsFile, T_READONLY, $propertyPointer - 1, $pointerBeforeProperty); + $isReadonly = $readonlyPointer !== null; + + $propertyEqualPointer = TokenHelper::findNext($phpcsFile, T_EQUAL, $propertyPointer + 1, $propertyEndPointer); + $propertyDefaultValue = $propertyEqualPointer !== null + ? trim(TokenHelper::getContent($phpcsFile, $propertyEqualPointer + 1, $propertyEndPointer - 1)) + : null; + + $propertyEndPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $propertyPointer + 1); + $pointerAfterProperty = TokenHelper::findFirstTokenOnLine( + $phpcsFile, + TokenHelper::findNextNonWhitespace($phpcsFile, $propertyEndPointer + 1) + ); + + $pointerBeforeParameterStart = TokenHelper::findPrevious($phpcsFile, [T_COMMA, T_OPEN_PARENTHESIS], $parameterPointer - 1); + $parameterStartPointer = TokenHelper::findNextEffective($phpcsFile, $pointerBeforeParameterStart + 1); + + $parameterEqualPointer = TokenHelper::findNextEffective($phpcsFile, $parameterPointer + 1); + $parameterHasDefaultValue = $tokens[$parameterEqualPointer]['code'] === T_EQUAL; + + $pointerBeforeAssignment = TokenHelper::findFirstTokenOnLine($phpcsFile, $assignmentPointer - 1); + $pointerAfterAssignment = TokenHelper::findLastTokenOnLine($phpcsFile, $assignmentPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $pointerBeforeProperty, $pointerAfterProperty - 1); + + if ($isReadonly) { + $phpcsFile->fixer->addContentBefore($parameterStartPointer, 'readonly '); + } + + $phpcsFile->fixer->addContentBefore($parameterStartPointer, sprintf('%s ', $visibility)); + + if (!$parameterHasDefaultValue && $propertyDefaultValue !== null) { + $phpcsFile->fixer->addContent($parameterPointer, sprintf(' = %s', $propertyDefaultValue)); + } + + FixerHelper::removeBetweenIncluding($phpcsFile, $pointerBeforeAssignment, $pointerAfterAssignment); + + $phpcsFile->fixer->endChangeset(); + } + } + } + + private function getAssignment(File $phpcsFile, int $constructorPointer, string $parameterName): ?int + { + $tokens = $phpcsFile->getTokens(); + + $parameterNameWithoutDollar = substr($parameterName, 1); + + for ($i = $tokens[$constructorPointer]['scope_opener'] + 1; $i < $tokens[$constructorPointer]['scope_closer']; $i++) { + if ($tokens[$i]['content'] !== '$this') { + continue; + } + + $objectOperatorPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$objectOperatorPointer]['code'] !== T_OBJECT_OPERATOR) { + continue; + } + + $namePointer = TokenHelper::findNextEffective($phpcsFile, $objectOperatorPointer + 1); + if ($tokens[$namePointer]['content'] !== $parameterNameWithoutDollar) { + continue; + } + + $equalPointer = TokenHelper::findNextEffective($phpcsFile, $namePointer + 1); + if ($tokens[$equalPointer]['code'] !== T_EQUAL) { + continue; + } + + $variablePointer = TokenHelper::findNextEffective($phpcsFile, $equalPointer + 1); + if ($tokens[$variablePointer]['content'] !== $parameterName) { + continue; + } + + $semicolonPointer = TokenHelper::findNextEffective($phpcsFile, $variablePointer + 1); + if ($tokens[$semicolonPointer]['code'] !== T_SEMICOLON) { + continue; + } + + foreach (array_reverse($tokens[$semicolonPointer]['conditions']) as $conditionTokenCode) { + if (in_array($conditionTokenCode, [T_IF, T_ELSEIF, T_ELSE, T_SWITCH], true)) { + return null; + } + } + + return $i; + } + + return null; + } + + /** + * @return list + */ + private function getParameterPointers(File $phpcsFile, int $functionPointer): array + { + $tokens = $phpcsFile->getTokens(); + return TokenHelper::findNextAll( + $phpcsFile, + T_VARIABLE, + $tokens[$functionPointer]['parenthesis_opener'] + 1, + $tokens[$functionPointer]['parenthesis_closer'] + ); + } + + /** + * @return list + */ + private function getPropertyPointers(File $phpcsFile, int $classPointer): array + { + $tokens = $phpcsFile->getTokens(); + + return array_filter( + TokenHelper::findNextAll( + $phpcsFile, + T_VARIABLE, + $tokens[$classPointer]['scope_opener'] + 1, + $tokens[$classPointer]['scope_closer'] + ), + static function (int $variablePointer) use ($phpcsFile): bool { + return PropertyHelper::isProperty($phpcsFile, $variablePointer); + } + ); + } + + private function isPropertyDocCommentUseful(File $phpcsFile, int $propertyPointer): bool + { + if (DocCommentHelper::hasDocCommentDescription($phpcsFile, $propertyPointer)) { + return true; + } + + foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotation) { + $annotationValue = $annotation->getValue(); + if (!$annotationValue instanceof VarTagValueNode) { + return true; + } + + if ($annotationValue->description !== '') { + return true; + } + } + + return false; + } + + private function isPropertyWithAttribute(File $phpcsFile, int $propertyPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_ATTRIBUTE_END, T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET], + $propertyPointer - 1 + ); + + return $tokens[$previousPointer]['code'] === T_ATTRIBUTE_END; + } + + private function areTypeHintEqual(?TypeHint $parameterTypeHint, ?TypeHint $propertyTypeHint): bool + { + if ($parameterTypeHint === null && $propertyTypeHint === null) { + return true; + } + + if ($parameterTypeHint === null || $propertyTypeHint === null) { + return false; + } + + return $parameterTypeHint->getTypeHint() === $propertyTypeHint->getTypeHint(); + } + + private function isParameterModifiedBeforeAssignment( + File $phpcsFile, + int $functionPointer, + string $parameterName, + int $assignmentPointer + ): bool + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $assignmentPointer - 1; $i > $tokens[$functionPointer]['scope_opener']; $i--) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] !== $parameterName) { + continue; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if (in_array($tokens[$nextPointer]['code'], Tokens::$assignmentTokens, true)) { + return true; + } + + if ($tokens[$nextPointer]['code'] === T_INC) { + return true; + } + + $previousPointer = TokenHelper::findNextEffective($phpcsFile, $i - 1); + if ($tokens[$previousPointer]['code'] === T_DEC) { + return true; + } + } + + return false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php new file mode 100644 index 0000000..abac22a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireMultiLineMethodSignatureSniff.php @@ -0,0 +1,176 @@ + */ + public $includedMethodPatterns = []; + + /** @var list|null */ + public $includedMethodNormalizedPatterns; + + /** @var list */ + public $excludedMethodPatterns = []; + + /** @var list|null */ + public $excludedMethodNormalizedPatterns; + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $methodPointer + */ + public function process(File $phpcsFile, $methodPointer): void + { + $this->minLineLength = SniffSettingsHelper::normalizeNullableInteger($this->minLineLength); + $this->minParametersCount = SniffSettingsHelper::normalizeNullableInteger($this->minParametersCount); + + if ($this->minLineLength !== null && $this->minParametersCount !== null) { + throw new UnexpectedValueException('Either minLineLength or minParametersCount can be set.'); + } + + // Maintain backward compatibility if no configuration provided + if ($this->minLineLength === null && $this->minParametersCount === null) { + $this->minLineLength = self::DEFAULT_MIN_LINE_LENGTH; + } + + if (!FunctionHelper::isMethod($phpcsFile, $methodPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + [$signatureStartPointer, $signatureEndPointer] = $this->getSignatureStartAndEndPointers($phpcsFile, $methodPointer); + + if ($tokens[$signatureStartPointer]['line'] < $tokens[$signatureEndPointer]['line']) { + return; + } + + $parameters = $phpcsFile->getMethodParameters($methodPointer); + $parametersCount = count($parameters); + if ($parametersCount === 0) { + return; + } + + $signature = $this->getSignature($phpcsFile, $signatureStartPointer, $signatureEndPointer); + $signatureWithoutTabIndentation = $this->getSignatureWithoutTabs($phpcsFile, $signature); + $methodName = FunctionHelper::getName($phpcsFile, $methodPointer); + + if ( + count($this->includedMethodPatterns) !== 0 + && !$this->isMethodNameInPatterns($methodName, $this->getIncludedMethodNormalizedPatterns()) + ) { + return; + } + + if ( + count($this->excludedMethodPatterns) !== 0 + && $this->isMethodNameInPatterns($methodName, $this->getExcludedMethodNormalizedPatterns()) + ) { + return; + } + + if ($this->minLineLength !== null && $this->minLineLength !== 0 && strlen($signatureWithoutTabIndentation) < $this->minLineLength) { + return; + } + + if ($this->minParametersCount !== null && $parametersCount < $this->minParametersCount) { + return; + } + + $error = sprintf('Signature of method "%s" should be split to more lines so each parameter is on its own line.', $methodName); + $fix = $phpcsFile->addFixableError($error, $methodPointer, self::CODE_REQUIRED_MULTI_LINE_SIGNATURE); + if (!$fix) { + return; + } + + $indentation = $tokens[$signatureStartPointer]['content']; + + $phpcsFile->fixer->beginChangeset(); + + foreach ($parameters as $parameter) { + $pointerBeforeParameter = TokenHelper::findPrevious( + $phpcsFile, + T_COMMA, + $parameter['token'] - 1, + $tokens[$methodPointer]['parenthesis_opener'] + ); + if ($pointerBeforeParameter === null) { + $pointerBeforeParameter = $tokens[$methodPointer]['parenthesis_opener']; + } + + $phpcsFile->fixer->addContent($pointerBeforeParameter, $phpcsFile->eolChar . IndentationHelper::addIndentation($indentation)); + + FixerHelper::removeWhitespaceAfter($phpcsFile, $pointerBeforeParameter); + } + + $phpcsFile->fixer->addContentBefore($tokens[$methodPointer]['parenthesis_closer'], $phpcsFile->eolChar . $indentation); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $normalizedPatterns + */ + private function isMethodNameInPatterns(string $methodName, array $normalizedPatterns): bool + { + foreach ($normalizedPatterns as $pattern) { + if (!SniffSettingsHelper::isValidRegularExpression($pattern)) { + throw new Exception(sprintf('%s is not valid PCRE pattern.', $pattern)); + } + + if (preg_match($pattern, $methodName) !== 0) { + return true; + } + } + + return false; + } + + /** + * @return list + */ + private function getIncludedMethodNormalizedPatterns(): array + { + if ($this->includedMethodNormalizedPatterns === null) { + $this->includedMethodNormalizedPatterns = SniffSettingsHelper::normalizeArray($this->includedMethodPatterns); + } + return $this->includedMethodNormalizedPatterns; + } + + /** + * @return list + */ + private function getExcludedMethodNormalizedPatterns(): array + { + if ($this->excludedMethodNormalizedPatterns === null) { + $this->excludedMethodNormalizedPatterns = SniffSettingsHelper::normalizeArray($this->excludedMethodPatterns); + } + return $this->excludedMethodNormalizedPatterns; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php new file mode 100644 index 0000000..50c7b33 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSelfReferenceSniff.php @@ -0,0 +1,118 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $referencedNames = array_merge( + ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer), + ReferencedNameHelper::getAllReferencedNamesInAttributes($phpcsFile, $openTagPointer) + ); + + foreach ($referencedNames as $referencedName) { + if (!$referencedName->isClass()) { + continue; + } + + $anonymousClassPointer = TokenHelper::findPrevious($phpcsFile, T_ANON_CLASS, $referencedName->getStartPointer() - 1); + + if ( + $anonymousClassPointer !== null + && $tokens[$anonymousClassPointer]['scope_closer'] > $referencedName->getEndPointer() + ) { + continue; + } + + $classPointer = ClassHelper::getClassPointer($phpcsFile, $referencedName->getStartPointer()); + if ($classPointer === null) { + continue; + } + + $className = ClassHelper::getFullyQualifiedName($phpcsFile, $classPointer); + + $resolvedName = NamespaceHelper::resolveClassName( + $phpcsFile, + $referencedName->getNameAsReferencedInFile(), + $referencedName->getStartPointer() + ); + + if ($className !== $resolvedName) { + continue; + } + + $fix = $phpcsFile->addFixableError( + '"self" for local reference is required.', + $referencedName->getStartPointer(), + self::CODE_REQUIRED_SELF_REFERENCE + ); + if (!$fix) { + continue; + } + + $inAttribute = $tokens[$referencedName->getStartPointer()]['code'] === T_ATTRIBUTE; + + $phpcsFile->fixer->beginChangeset(); + + if ($inAttribute) { + $attributeContent = TokenHelper::getContent( + $phpcsFile, + $referencedName->getStartPointer(), + $referencedName->getEndPointer() + ); + $fixedAttributeContent = preg_replace( + '~(?<=\W)' . preg_quote($referencedName->getNameAsReferencedInFile(), '~') . '(?=\W)~', + 'self', + $attributeContent + ); + $phpcsFile->fixer->replaceToken($referencedName->getStartPointer(), $fixedAttributeContent); + + } else { + $phpcsFile->fixer->replaceToken($referencedName->getStartPointer(), 'self'); + } + + FixerHelper::removeBetweenIncluding($phpcsFile, $referencedName->getStartPointer() + 1, $referencedName->getEndPointer()); + + $phpcsFile->fixer->endChangeset(); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php new file mode 100644 index 0000000..4a2342e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/RequireSingleLineMethodSignatureSniff.php @@ -0,0 +1,130 @@ + */ + public $includedMethodPatterns = []; + + /** @var list|null */ + public $includedMethodNormalizedPatterns; + + /** @var list */ + public $excludedMethodPatterns = []; + + /** @var list|null */ + public $excludedMethodNormalizedPatterns; + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $methodPointer + */ + public function process(File $phpcsFile, $methodPointer): void + { + $this->maxLineLength = SniffSettingsHelper::normalizeInteger($this->maxLineLength); + + if (!FunctionHelper::isMethod($phpcsFile, $methodPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + [$signatureStartPointer, $signatureEndPointer] = $this->getSignatureStartAndEndPointers($phpcsFile, $methodPointer); + + if ($tokens[$signatureStartPointer]['line'] === $tokens[$signatureEndPointer]['line']) { + return; + } + + $signature = $this->getSignature($phpcsFile, $signatureStartPointer, $signatureEndPointer); + $signatureWithoutTabIndentation = $this->getSignatureWithoutTabs($phpcsFile, $signature); + $methodName = FunctionHelper::getName($phpcsFile, $methodPointer); + + if ( + count($this->includedMethodPatterns) !== 0 + && !$this->isMethodNameInPatterns($methodName, $this->getIncludedMethodNormalizedPatterns()) + ) { + return; + } + + if ( + count($this->excludedMethodPatterns) !== 0 + && $this->isMethodNameInPatterns($methodName, $this->getExcludedMethodNormalizedPatterns()) + ) { + return; + } + + if ($this->maxLineLength !== 0 && strlen($signatureWithoutTabIndentation) > $this->maxLineLength) { + return; + } + + $error = sprintf('Signature of method "%s" should be placed on a single line.', $methodName); + $fix = $phpcsFile->addFixableError($error, $methodPointer, self::CODE_REQUIRED_SINGLE_LINE_SIGNATURE); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $signatureStartPointer, $signatureEndPointer, $signature); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $normalizedPatterns + */ + private function isMethodNameInPatterns(string $methodName, array $normalizedPatterns): bool + { + foreach ($normalizedPatterns as $pattern) { + if (!SniffSettingsHelper::isValidRegularExpression($pattern)) { + throw new Exception(sprintf('%s is not valid PCRE pattern.', $pattern)); + } + + if (preg_match($pattern, $methodName) !== 0) { + return true; + } + } + + return false; + } + + /** + * @return list + */ + private function getIncludedMethodNormalizedPatterns(): array + { + if ($this->includedMethodNormalizedPatterns === null) { + $this->includedMethodNormalizedPatterns = SniffSettingsHelper::normalizeArray($this->includedMethodPatterns); + } + return $this->includedMethodNormalizedPatterns; + } + + /** + * @return list + */ + private function getExcludedMethodNormalizedPatterns(): array + { + if ($this->excludedMethodNormalizedPatterns === null) { + $this->excludedMethodNormalizedPatterns = SniffSettingsHelper::normalizeArray($this->excludedMethodPatterns); + } + return $this->excludedMethodNormalizedPatterns; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousAbstractClassNamingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousAbstractClassNamingSniff.php new file mode 100644 index 0000000..5c5800f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousAbstractClassNamingSniff.php @@ -0,0 +1,70 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $className = ClassHelper::getName($phpcsFile, $classPointer); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $classPointer - 1); + if ($phpcsFile->getTokens()[$previousPointer]['code'] !== T_ABSTRACT) { + return; + } + + $this->checkPrefix($phpcsFile, $classPointer, $className); + $this->checkSuffix($phpcsFile, $classPointer, $className); + } + + private function checkPrefix(File $phpcsFile, int $classPointer, string $className): void + { + $prefix = substr($className, 0, 8); + + if (strtolower($prefix) !== 'abstract') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous prefix "%s".', $prefix), $classPointer, self::CODE_SUPERFLUOUS_PREFIX); + } + + private function checkSuffix(File $phpcsFile, int $classPointer, string $className): void + { + $suffix = substr($className, -8); + + if (strtolower($suffix) !== 'abstract') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $classPointer, self::CODE_SUPERFLUOUS_SUFFIX); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousErrorNamingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousErrorNamingSniff.php new file mode 100644 index 0000000..108c97e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousErrorNamingSniff.php @@ -0,0 +1,55 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $className = ClassHelper::getName($phpcsFile, $classPointer); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $classPointer - 1); + if ($phpcsFile->getTokens()[$previousPointer]['code'] === T_ABSTRACT) { + return; + } + + if (strtolower($className) === 'error') { + return; + } + + $suffix = substr($className, -5); + if (strtolower($suffix) !== 'error') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $classPointer, self::CODE_SUPERFLUOUS_SUFFIX); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousExceptionNamingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousExceptionNamingSniff.php new file mode 100644 index 0000000..5c1d586 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousExceptionNamingSniff.php @@ -0,0 +1,55 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $className = ClassHelper::getName($phpcsFile, $classPointer); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $classPointer - 1); + if ($phpcsFile->getTokens()[$previousPointer]['code'] === T_ABSTRACT) { + return; + } + + if (strtolower($className) === 'exception') { + return; + } + + $suffix = substr($className, -9); + if (strtolower($suffix) !== 'exception') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $classPointer, self::CODE_SUPERFLUOUS_SUFFIX); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousInterfaceNamingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousInterfaceNamingSniff.php new file mode 100644 index 0000000..448d83f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousInterfaceNamingSniff.php @@ -0,0 +1,63 @@ + + */ + public function register(): array + { + return [ + T_INTERFACE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $interfacePointer + */ + public function process(File $phpcsFile, $interfacePointer): void + { + $interfaceName = ClassHelper::getName($phpcsFile, $interfacePointer); + + $this->checkPrefix($phpcsFile, $interfacePointer, $interfaceName); + $this->checkSuffix($phpcsFile, $interfacePointer, $interfaceName); + } + + private function checkPrefix(File $phpcsFile, int $interfacePointer, string $interfaceName): void + { + $prefix = substr($interfaceName, 0, 9); + + if (strtolower($prefix) !== 'interface') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous prefix "%s".', $prefix), $interfacePointer, self::CODE_SUPERFLUOUS_PREFIX); + } + + private function checkSuffix(File $phpcsFile, int $interfacePointer, string $interfaceName): void + { + $suffix = substr($interfaceName, -9); + + if (strtolower($suffix) !== 'interface') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $interfacePointer, self::CODE_SUPERFLUOUS_SUFFIX); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousTraitNamingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousTraitNamingSniff.php new file mode 100644 index 0000000..22e7ea6 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/SuperfluousTraitNamingSniff.php @@ -0,0 +1,50 @@ + + */ + public function register(): array + { + return [ + T_TRAIT, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $traitPointer + */ + public function process(File $phpcsFile, $traitPointer): void + { + $traitName = ClassHelper::getName($phpcsFile, $traitPointer); + + $this->checkSuffix($phpcsFile, $traitPointer, $traitName); + } + + private function checkSuffix(File $phpcsFile, int $traitPointer, string $traitName): void + { + $suffix = substr($traitName, -5); + + if (strtolower($suffix) !== 'trait') { + return; + } + + $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $traitPointer, self::CODE_SUPERFLUOUS_SUFFIX); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php new file mode 100644 index 0000000..0ed15b4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseDeclarationSniff.php @@ -0,0 +1,101 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + T_ANON_CLASS, + T_TRAIT, + T_ENUM, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $usePointers = ClassHelper::getTraitUsePointers($phpcsFile, $classPointer); + + foreach ($usePointers as $usePointer) { + $this->checkDeclaration($phpcsFile, $usePointer); + } + } + + private function checkDeclaration(File $phpcsFile, int $usePointer): void + { + $commaPointer = TokenHelper::findNextLocal($phpcsFile, T_COMMA, $usePointer + 1); + if ($commaPointer === null) { + return; + } + + $endPointer = TokenHelper::findNext($phpcsFile, [T_OPEN_CURLY_BRACKET, T_SEMICOLON], $usePointer + 1); + + $tokens = $phpcsFile->getTokens(); + if ($tokens[$endPointer]['code'] === T_OPEN_CURLY_BRACKET) { + $phpcsFile->addError( + 'Multiple traits per use statement are forbidden.', + $usePointer, + self::CODE_MULTIPLE_TRAITS_PER_DECLARATION + ); + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multiple traits per use statement are forbidden.', + $usePointer, + self::CODE_MULTIPLE_TRAITS_PER_DECLARATION + ); + + if (!$fix) { + return; + } + + $indentation = ''; + $currentPointer = $usePointer - 1; + while ( + $tokens[$currentPointer]['code'] === T_WHITESPACE + && $tokens[$currentPointer]['content'] !== $phpcsFile->eolChar + ) { + $indentation .= $tokens[$currentPointer]['content']; + $currentPointer--; + } + + $phpcsFile->fixer->beginChangeset(); + + $otherCommaPointers = TokenHelper::findNextAll($phpcsFile, T_COMMA, $usePointer + 1, $endPointer); + foreach ($otherCommaPointers as $otherCommaPointer) { + $pointerAfterComma = TokenHelper::findNextEffective($phpcsFile, $otherCommaPointer + 1); + + FixerHelper::change($phpcsFile, $otherCommaPointer, $pointerAfterComma - 1, ';' . $phpcsFile->eolChar . $indentation . 'use '); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php new file mode 100644 index 0000000..0a4f4ef --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/TraitUseSpacingSniff.php @@ -0,0 +1,304 @@ + + */ + public function register(): array + { + return [ + T_CLASS, + T_ANON_CLASS, + T_TRAIT, + T_ENUM, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $classPointer + */ + public function process(File $phpcsFile, $classPointer): void + { + $this->linesCountBeforeFirstUse = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirstUse); + $this->linesCountBeforeFirstUseWhenFirstInClass = SniffSettingsHelper::normalizeNullableInteger( + $this->linesCountBeforeFirstUseWhenFirstInClass + ); + $this->linesCountBetweenUses = SniffSettingsHelper::normalizeInteger($this->linesCountBetweenUses); + $this->linesCountAfterLastUse = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLastUse); + $this->linesCountAfterLastUseWhenLastInClass = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLastUseWhenLastInClass); + + $usePointers = ClassHelper::getTraitUsePointers($phpcsFile, $classPointer); + + if (count($usePointers) === 0) { + return; + } + + $this->checkLinesBeforeFirstUse($phpcsFile, $usePointers[0]); + $this->checkLinesAfterLastUse($phpcsFile, $usePointers[count($usePointers) - 1]); + $this->checkLinesBetweenUses($phpcsFile, $usePointers); + } + + private function checkLinesBeforeFirstUse(File $phpcsFile, int $firstUsePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $useStartPointer = $firstUsePointer; + + /** @var int $pointerBeforeFirstUse */ + $pointerBeforeFirstUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $firstUsePointer - 1); + + if (in_array($tokens[$pointerBeforeFirstUse]['code'], Tokens::$commentTokens, true)) { + $pointerBeforeFirstUse = TokenHelper::findPreviousEffective($phpcsFile, $pointerBeforeFirstUse - 1); + $useStartPointer = TokenHelper::findNext($phpcsFile, Tokens::$commentTokens, $pointerBeforeFirstUse + 1); + } + + $isAtTheStartOfClass = $tokens[$pointerBeforeFirstUse]['code'] === T_OPEN_CURLY_BRACKET; + + $whitespaceBeforeFirstUse = ''; + + if ($pointerBeforeFirstUse + 1 !== $firstUsePointer) { + $whitespaceBeforeFirstUse .= TokenHelper::getContent($phpcsFile, $pointerBeforeFirstUse + 1, $useStartPointer - 1); + } + + $requiredLinesCountBeforeFirstUse = $this->linesCountBeforeFirstUse; + if ( + $isAtTheStartOfClass + && $this->linesCountBeforeFirstUseWhenFirstInClass !== null + ) { + $requiredLinesCountBeforeFirstUse = $this->linesCountBeforeFirstUseWhenFirstInClass; + } + + $actualLinesCountBeforeFirstUse = substr_count($whitespaceBeforeFirstUse, $phpcsFile->eolChar) - 1; + + if ($actualLinesCountBeforeFirstUse === $requiredLinesCountBeforeFirstUse) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before first use statement, found %d.', + $requiredLinesCountBeforeFirstUse, + $requiredLinesCountBeforeFirstUse === 1 ? '' : 's', + $actualLinesCountBeforeFirstUse + ), + $firstUsePointer, + self::CODE_INCORRECT_LINES_COUNT_BEFORE_FIRST_USE + ); + + if (!$fix) { + return; + } + + $pointerBeforeIndentation = TokenHelper::findPreviousContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $firstUsePointer, + $pointerBeforeFirstUse + ); + + $phpcsFile->fixer->beginChangeset(); + + if ($pointerBeforeIndentation !== null) { + FixerHelper::removeBetweenIncluding($phpcsFile, $pointerBeforeFirstUse + 1, $pointerBeforeIndentation); + } + for ($i = 0; $i <= $requiredLinesCountBeforeFirstUse; $i++) { + $phpcsFile->fixer->addNewline($pointerBeforeFirstUse); + } + + $phpcsFile->fixer->endChangeset(); + } + + private function checkLinesAfterLastUse(File $phpcsFile, int $lastUsePointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $lastUseEndPointer */ + $lastUseEndPointer = TokenHelper::findNextLocal($phpcsFile, [T_SEMICOLON, T_OPEN_CURLY_BRACKET], $lastUsePointer + 1); + if ($tokens[$lastUseEndPointer]['code'] === T_OPEN_CURLY_BRACKET) { + $lastUseEndPointer = $tokens[$lastUseEndPointer]['bracket_closer']; + } + + $pointerAfterLastUse = TokenHelper::findNextEffective($phpcsFile, $lastUseEndPointer + 1); + $isAtTheEndOfClass = $tokens[$pointerAfterLastUse]['code'] === T_CLOSE_CURLY_BRACKET; + + $whitespaceEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $lastUseEndPointer + 1) - 1; + if ($lastUseEndPointer !== $whitespaceEnd && $tokens[$whitespaceEnd]['content'] !== $phpcsFile->eolChar) { + $lastEolPointer = TokenHelper::findPreviousContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $whitespaceEnd - 1, + $lastUseEndPointer + ); + $whitespaceEnd = $lastEolPointer ?? $lastUseEndPointer; + } + $whitespaceAfterLastUse = TokenHelper::getContent($phpcsFile, $lastUseEndPointer + 1, $whitespaceEnd); + + $requiredLinesCountAfterLastUse = $isAtTheEndOfClass ? $this->linesCountAfterLastUseWhenLastInClass : $this->linesCountAfterLastUse; + $actualLinesCountAfterLastUse = substr_count($whitespaceAfterLastUse, $phpcsFile->eolChar) - 1; + + if ($actualLinesCountAfterLastUse === $requiredLinesCountAfterLastUse) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after last use statement, found %d.', + $requiredLinesCountAfterLastUse, + $requiredLinesCountAfterLastUse === 1 ? '' : 's', + $actualLinesCountAfterLastUse + ), + $lastUsePointer, + self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $lastUseEndPointer + 1, $whitespaceEnd); + + for ($i = 0; $i <= $requiredLinesCountAfterLastUse; $i++) { + $phpcsFile->fixer->addNewline($lastUseEndPointer); + } + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $usePointers + */ + private function checkLinesBetweenUses(File $phpcsFile, array $usePointers): void + { + if (count($usePointers) === 1) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $previousUsePointer = null; + foreach ($usePointers as $usePointer) { + if ($previousUsePointer === null) { + $previousUsePointer = $usePointer; + continue; + } + + /** @var int $previousUseEndPointer */ + $previousUseEndPointer = TokenHelper::findNextLocal($phpcsFile, [T_SEMICOLON, T_OPEN_CURLY_BRACKET], $previousUsePointer + 1); + if ($tokens[$previousUseEndPointer]['code'] === T_OPEN_CURLY_BRACKET) { + /** @var int $previousUseEndPointer */ + $previousUseEndPointer = $tokens[$previousUseEndPointer]['bracket_closer']; + } + + $useStartPointer = $usePointer; + $pointerBeforeUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $usePointer - 1); + + if (in_array($tokens[$pointerBeforeUse]['code'], Tokens::$commentTokens, true)) { + $useStartPointer = TokenHelper::findNext( + $phpcsFile, + Tokens::$commentTokens, + TokenHelper::findPreviousEffective($phpcsFile, $pointerBeforeUse - 1) + 1 + ); + } + + $actualLinesCountAfterPreviousUse = $tokens[$useStartPointer]['line'] - $tokens[$previousUseEndPointer]['line'] - 1; + + if ($actualLinesCountAfterPreviousUse === $this->linesCountBetweenUses) { + $previousUsePointer = $usePointer; + continue; + } + + $errorParameters = [ + sprintf( + 'Expected %d line%s between same types of use statement, found %d.', + $this->linesCountBetweenUses, + $this->linesCountBetweenUses === 1 ? '' : 's', + $actualLinesCountAfterPreviousUse + ), + $usePointer, + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_USES, + ]; + + $pointerBeforeUse = TokenHelper::findPreviousEffective($phpcsFile, $usePointer - 1); + + if ($previousUseEndPointer !== $pointerBeforeUse) { + $phpcsFile->addError(...$errorParameters); + $previousUsePointer = $usePointer; + continue; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + $previousUsePointer = $usePointer; + continue; + } + + $pointerBeforeIndentation = TokenHelper::findPreviousContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $usePointer, + $previousUseEndPointer + ); + + $phpcsFile->fixer->beginChangeset(); + if ($pointerBeforeIndentation !== null) { + FixerHelper::removeBetweenIncluding($phpcsFile, $previousUseEndPointer + 1, $pointerBeforeIndentation); + } + for ($i = 0; $i <= $this->linesCountBetweenUses; $i++) { + $phpcsFile->fixer->addNewline($previousUseEndPointer); + } + $phpcsFile->fixer->endChangeset(); + + $previousUsePointer = $usePointer; + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/UnsupportedClassGroupException.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/UnsupportedClassGroupException.php new file mode 100644 index 0000000..be76e9c --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/UnsupportedClassGroupException.php @@ -0,0 +1,16 @@ + + */ + public function register(): array + { + return [ + T_STATIC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $staticPointer + */ + public function process(File $phpcsFile, $staticPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $doubleColonPointer = TokenHelper::findNextEffective($phpcsFile, $staticPointer + 1); + if ($tokens[$doubleColonPointer]['code'] !== T_DOUBLE_COLON) { + return; + } + + $classPointer = null; + foreach (array_reverse($tokens[$staticPointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (!in_array($conditionTokenCode, Tokens::$ooScopeTokens, true)) { + continue; + } + + $classPointer = $conditionPointer; + break; + } + + if (!ClassHelper::isFinal($phpcsFile, $classPointer)) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Useless late static binding because class is final.', + $staticPointer, + self::CODE_USELESS_LATE_STATIC_BINDING + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($staticPointer, 'self'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AbstractRequireOneLineDocComment.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AbstractRequireOneLineDocComment.php new file mode 100644 index 0000000..3c11046 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AbstractRequireOneLineDocComment.php @@ -0,0 +1,137 @@ + + */ + public function register(): array + { + return [T_DOC_COMMENT_OPEN_TAG]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentStartPointer + */ + public function process(File $phpcsFile, $docCommentStartPointer): void + { + $tokens = $phpcsFile->getTokens(); + + // Only validate properties without description + if (DocCommentHelper::hasDocCommentDescription($phpcsFile, $docCommentStartPointer)) { + return; + } + + $docCommentEndPointer = $tokens[$docCommentStartPointer]['comment_closer']; + $lineDifference = $tokens[$docCommentEndPointer]['line'] - $tokens[$docCommentStartPointer]['line']; + + // Already one-line + if ($lineDifference === 0) { + return; + } + + // Ignore empty lines + $currentLinePointer = $docCommentStartPointer; + do { + $currentLinePointer = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $currentLinePointer); + + if ($currentLinePointer === null || $currentLinePointer >= $docCommentEndPointer) { + break; + } + + $types = [T_DOC_COMMENT_STAR, T_DOC_COMMENT_CLOSE_TAG]; + $startingPointer = TokenHelper::findNext($phpcsFile, $types, $currentLinePointer, $docCommentEndPointer); + + if ($startingPointer === null || $tokens[$startingPointer]['code'] === T_DOC_COMMENT_CLOSE_TAG) { + break; + } + + $nextEffectivePointer = TokenHelper::findNextExcluding( + $phpcsFile, + [T_DOC_COMMENT_WHITESPACE], + $startingPointer + 1, + $docCommentEndPointer + 1 + ); + + if ($tokens[$currentLinePointer]['line'] === $tokens[$nextEffectivePointer]['line']) { + continue; + } + + $lineDifference--; + } while (true); + + // Looks like a compound doc-comment + if ($lineDifference > 2) { + return; + } + + $fix = $this->addError($phpcsFile, $docCommentStartPointer); + if (!$fix) { + return; + } + + $contentStartPointer = TokenHelper::findNextExcluding( + $phpcsFile, + [ + T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_STAR, + ], + $docCommentStartPointer + 1, + $docCommentEndPointer + ); + $contentEndPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + [ + T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_STAR, + ], + $docCommentEndPointer - 1, + $docCommentStartPointer + ); + + if ($contentStartPointer === null) { + FixerHelper::removeBetween($phpcsFile, $docCommentStartPointer, $docCommentEndPointer); + return; + } + + $phpcsFile->fixer->beginChangeset(); + + for ($i = $docCommentStartPointer + 1; $i < $docCommentEndPointer; $i++) { + if ($i >= $contentStartPointer && $i <= $contentEndPointer) { + if ($i === $contentEndPointer) { + $phpcsFile->fixer->replaceToken($i, rtrim($phpcsFile->fixer->getTokenContent($i), ' ')); + } + + continue; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->addContentBefore($contentStartPointer, ' '); + $phpcsFile->fixer->addContentBefore($docCommentEndPointer, ' '); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php new file mode 100644 index 0000000..26c2234 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/AnnotationNameSniff.php @@ -0,0 +1,299 @@ +|null */ + public $annotations; + + /** @var array|null */ + private $normalizedAnnotations; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + $correctAnnotationNames = $this->getNormalizedAnnotationNames(); + + foreach ($annotations as $annotation) { + $lowerCasedAnnotationName = strtolower($annotation->getName()); + + if (!array_key_exists($lowerCasedAnnotationName, $correctAnnotationNames)) { + continue; + } + + $correctAnnotationName = $correctAnnotationNames[$lowerCasedAnnotationName]; + + if ($correctAnnotationName === $annotation->getName()) { + continue; + } + + $annotationNameWithoutAtSign = ltrim($annotation->getName(), '@'); + $fullyQualifiedAnnotationName = NamespaceHelper::resolveClassName( + $phpcsFile, + $annotationNameWithoutAtSign, + $annotation->getStartPointer() + ); + + if (NamespaceHelper::normalizeToCanonicalName($fullyQualifiedAnnotationName) !== $annotationNameWithoutAtSign) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Annotation name is incorrect. Expected %s, found %s.', $correctAnnotationName, $annotation->getName()), + $annotation->getStartPointer(), + self::CODE_ANNOTATION_NAME_INCORRECT + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($annotation->getStartPointer(), $correctAnnotationName); + + $phpcsFile->fixer->endChangeset(); + } + + $tokens = $phpcsFile->getTokens(); + + $docCommentContent = TokenHelper::getContent($phpcsFile, $docCommentOpenPointer, $tokens[$docCommentOpenPointer]['comment_closer']); + + if (preg_match_all( + '~\{(' . implode('|', $correctAnnotationNames) . ')\}~i', + $docCommentContent, + $matches, + PREG_OFFSET_CAPTURE + ) === 0) { + return; + } + + foreach ($matches[1] as $match) { + $correctAnnotationName = $correctAnnotationNames[strtolower($match[0])]; + + if ($correctAnnotationName === $match[0]) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Annotation name is incorrect. Expected %s, found %s.', $correctAnnotationName, $match[0]), + $docCommentOpenPointer, + self::CODE_ANNOTATION_NAME_INCORRECT + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $fixedDocCommentContent = substr($docCommentContent, 0, $match[1]) . $correctAnnotationName . substr( + $docCommentContent, + $match[1] + strlen($match[0]) + ); + + FixerHelper::change( + $phpcsFile, + $docCommentOpenPointer, + $tokens[$docCommentOpenPointer]['comment_closer'], + $fixedDocCommentContent + ); + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @return array + */ + private function getNormalizedAnnotationNames(): array + { + if ($this->normalizedAnnotations !== null) { + return $this->normalizedAnnotations; + } + + if ($this->annotations !== null) { + $annotationNames = array_map(static function (string $annotationName): string { + return ltrim($annotationName, '@'); + }, SniffSettingsHelper::normalizeArray($this->annotations)); + } else { + $annotationNames = array_merge(self::STANDARD_ANNOTATIONS, self::PHPUNIT_ANNOTATIONS, self::STATIC_ANALYSIS_ANNOTATIONS); + + foreach (self::STATIC_ANALYSIS_ANNOTATIONS as $annotationName) { + if (strpos($annotationName, 'psalm') === 0) { + continue; + } + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + $annotationNames[] = sprintf('%s-%s', $prefix, $annotationName); + } + } + } + + $annotationNames = array_map(static function (string $annotationName): string { + return '@' . $annotationName; + }, array_unique($annotationNames)); + + $this->normalizedAnnotations = array_combine(array_map(static function (string $annotationName): string { + return strtolower($annotationName); + }, $annotationNames), $annotationNames); + + return $this->normalizedAnnotations; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php new file mode 100644 index 0000000..633403d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DeprecatedAnnotationDeclarationSniff.php @@ -0,0 +1,50 @@ + */ + public function register(): array + { + return [T_DOC_COMMENT_OPEN_TAG]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentStartPointer + */ + public function process(File $phpcsFile, $docCommentStartPointer): void + { + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentStartPointer, '@deprecated'); + + if (count($annotations) === 0) { + return; + } + + foreach ($annotations as $annotation) { + if ($annotation->getValue()->description !== '') { + continue; + } + + $phpcsFile->addError( + 'Deprecated annotation must have a description.', + $annotation->getStartPointer(), + self::MISSING_DESCRIPTION + ); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php new file mode 100644 index 0000000..b7ae8c5 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowCommentAfterCodeSniff.php @@ -0,0 +1,135 @@ + + */ + public function register(): array + { + /** @phpstan-var array */ + return array_merge(TokenHelper::$inlineCommentTokenCodes, [T_DOC_COMMENT_OPEN_TAG]); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $commentPointer + */ + public function process(File $phpcsFile, $commentPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$commentPointer]['column'] === 1) { + return; + } + + $firstNonWhitespacePointerOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $commentPointer); + + if ($firstNonWhitespacePointerOnLine === $commentPointer) { + return; + } + + if ( + $tokens[$firstNonWhitespacePointerOnLine]['code'] === T_DOC_COMMENT_OPEN_TAG + && $tokens[$firstNonWhitespacePointerOnLine]['comment_closer'] > $commentPointer + ) { + return; + } + + $commentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $commentPointer); + $nextNonWhitespacePointer = TokenHelper::findNextNonWhitespace($phpcsFile, $commentEndPointer + 1); + + if ( + $nextNonWhitespacePointer !== null + && $commentEndPointer !== null + && $tokens[$nextNonWhitespacePointer]['line'] === $tokens[$commentEndPointer]['line'] + + ) { + return; + } + + $fix = $phpcsFile->addFixableError('Comment after code is disallowed.', $commentPointer, self::CODE_DISALLOWED_COMMENT_AFTER_CODE); + if (!$fix) { + return; + } + + $commentContent = TokenHelper::getContent($phpcsFile, $commentPointer, $commentEndPointer); + $commentHasNewLineAtTheEnd = substr($commentContent, -strlen($phpcsFile->eolChar)) === $phpcsFile->eolChar; + + if (!$commentHasNewLineAtTheEnd) { + $commentContent .= $phpcsFile->eolChar; + } + + $firstNonWhiteSpacePointerBeforeComment = TokenHelper::findPreviousNonWhitespace($phpcsFile, $commentPointer - 1); + + $newLineAfterComment = $commentHasNewLineAtTheEnd + ? $commentEndPointer + : TokenHelper::findLastTokenOnLine($phpcsFile, $commentEndPointer); + + $indentation = IndentationHelper::getIndentation($phpcsFile, $firstNonWhitespacePointerOnLine); + $firstPointerOnLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $firstNonWhitespacePointerOnLine); + + $phpcsFile->fixer->beginChangeset(); + + if ( + $tokens[$firstNonWhiteSpacePointerBeforeComment]['code'] === T_OPEN_CURLY_BRACKET + && array_key_exists('scope_condition', $tokens[$firstNonWhiteSpacePointerBeforeComment]) + && in_array( + $tokens[$tokens[$firstNonWhiteSpacePointerBeforeComment]['scope_condition']]['code'], + [T_ELSEIF, T_ELSE, T_CLOSURE], + true + ) + ) { + $phpcsFile->fixer->addContent( + $firstNonWhiteSpacePointerBeforeComment, + $phpcsFile->eolChar . IndentationHelper::addIndentation($indentation) . $commentContent + ); + } elseif ($tokens[$firstNonWhitespacePointerOnLine]['code'] === T_CLOSE_CURLY_BRACKET) { + $phpcsFile->fixer->addContent($firstNonWhiteSpacePointerBeforeComment, $phpcsFile->eolChar . $indentation . $commentContent); + } elseif (isset(Tokens::$stringTokens[$tokens[$firstPointerOnLine]['code']])) { + $prevNonStringToken = TokenHelper::findPreviousExcluding( + $phpcsFile, + [T_WHITESPACE] + Tokens::$stringTokens, + $firstPointerOnLine - 1 + ); + $firstTokenOnNonStringTokenLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $prevNonStringToken); + $firstNonWhitespacePointerOnNonStringTokenLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $prevNonStringToken); + $prevLineIndentation = IndentationHelper::getIndentation($phpcsFile, $firstNonWhitespacePointerOnNonStringTokenLine); + $phpcsFile->fixer->addContentBefore($firstTokenOnNonStringTokenLine, $prevLineIndentation . $commentContent); + $phpcsFile->fixer->addNewline($firstNonWhiteSpacePointerBeforeComment); + } else { + $phpcsFile->fixer->addContentBefore($firstPointerOnLine, $indentation . $commentContent); + $phpcsFile->fixer->addNewline($firstNonWhiteSpacePointerBeforeComment); + } + + FixerHelper::removeBetweenIncluding($phpcsFile, $firstNonWhiteSpacePointerBeforeComment + 1, $newLineAfterComment); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php new file mode 100644 index 0000000..bbb4e81 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DisallowOneLinePropertyDocCommentSniff.php @@ -0,0 +1,108 @@ + + */ + public function register(): array + { + return [T_VARIABLE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $propertyPointer + */ + public function process(File $phpcsFile, $propertyPointer): void + { + $tokens = $phpcsFile->getTokens(); + + // Not a property + if (!PropertyHelper::isProperty($phpcsFile, $propertyPointer)) { + return; + } + + // Only validate properties with comment + if (!DocCommentHelper::hasDocComment($phpcsFile, $propertyPointer)) { + return; + } + + /** @var int $docCommentStartPointer */ + $docCommentStartPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + $docCommentEndPointer = $tokens[$docCommentStartPointer]['comment_closer']; + $lineDifference = $tokens[$docCommentEndPointer]['line'] - $tokens[$docCommentStartPointer]['line']; + + // Already multi-line + if ($lineDifference !== 0) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Found one-line comment for property %s, use multi-line comment instead.', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer) + ), + $docCommentStartPointer, + self::CODE_ONE_LINE_PROPERTY_COMMENT + ); + + if (!$fix) { + return; + } + + $commentWhitespacePointer = TokenHelper::findPrevious($phpcsFile, [T_WHITESPACE], $docCommentStartPointer); + $indent = ($commentWhitespacePointer !== null ? $tokens[$commentWhitespacePointer]['content'] : '') . ' '; + + /** empty comment is not split into start & end tokens properly */ + if ($tokens[$docCommentStartPointer]['content'] === '/***/') { + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($docCommentStartPointer, '/**'); + $phpcsFile->fixer->addNewline($docCommentStartPointer); + $phpcsFile->fixer->addContent($docCommentStartPointer, $indent); + $phpcsFile->fixer->addContent($docCommentStartPointer, '*'); + $phpcsFile->fixer->addNewline($docCommentStartPointer); + $phpcsFile->fixer->addContent($docCommentStartPointer, $indent); + $phpcsFile->fixer->addContent($docCommentStartPointer, '*/'); + + $phpcsFile->fixer->endChangeset(); + + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addNewline($docCommentStartPointer); + $phpcsFile->fixer->addContent($docCommentStartPointer, $indent); + $phpcsFile->fixer->addContent($docCommentStartPointer, '*'); + + if ($docCommentEndPointer - 1 !== $docCommentStartPointer) { + $phpcsFile->fixer->replaceToken( + $docCommentEndPointer - 1, + rtrim($phpcsFile->fixer->getTokenContent($docCommentEndPointer - 1), ' ') + ); + } + + $phpcsFile->fixer->addContentBefore($docCommentEndPointer, $indent); + $phpcsFile->fixer->addNewlineBefore($docCommentEndPointer); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php new file mode 100644 index 0000000..f2ac58b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/DocCommentSpacingSniff.php @@ -0,0 +1,781 @@ + */ + public $annotationsGroups = []; + + /** @var array>|null */ + private $normalizedAnnotationsGroups = null; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenerPointer + */ + public function process(File $phpcsFile, $docCommentOpenerPointer): void + { + $this->linesCountBeforeFirstContent = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirstContent); + $this->linesCountBetweenDescriptionAndAnnotations = SniffSettingsHelper::normalizeInteger( + $this->linesCountBetweenDescriptionAndAnnotations + ); + $this->linesCountBetweenDifferentAnnotationsTypes = SniffSettingsHelper::normalizeInteger( + $this->linesCountBetweenDifferentAnnotationsTypes + ); + $this->linesCountBetweenAnnotationsGroups = SniffSettingsHelper::normalizeInteger($this->linesCountBetweenAnnotationsGroups); + $this->linesCountAfterLastContent = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLastContent); + + if (DocCommentHelper::isInline($phpcsFile, $docCommentOpenerPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (TokenHelper::findNextExcluding( + $phpcsFile, + [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], + $docCommentOpenerPointer + 1, + $tokens[$docCommentOpenerPointer]['comment_closer'] + ) === null) { + return; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenerPointer); + + if ($parsedDocComment === null) { + return; + } + + $firstContentStartPointer = $parsedDocComment->getNodeStartPointer($phpcsFile, $parsedDocComment->getNode()->children[0]); + $firstContentEndPointer = $parsedDocComment->getNodeEndPointer( + $phpcsFile, + $parsedDocComment->getNode()->children[0], + $firstContentStartPointer + ); + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenerPointer); + usort($annotations, static function (Annotation $a, Annotation $b): int { + return $a->getStartPointer() <=> $b->getStartPointer(); + }); + $annotationsCount = count($annotations); + + $firstAnnotationPointer = $annotationsCount > 0 ? $annotations[0]->getStartPointer() : null; + + /** @var int $lastContentEndPointer */ + $lastContentEndPointer = $annotationsCount > 0 + ? $annotations[$annotationsCount - 1]->getEndPointer() + : $firstContentEndPointer; + + $this->checkLinesBeforeFirstContent($phpcsFile, $docCommentOpenerPointer, $firstContentStartPointer); + $this->checkLinesBetweenDescriptionAndFirstAnnotation( + $phpcsFile, + $docCommentOpenerPointer, + $firstContentStartPointer, + $firstContentEndPointer, + $firstAnnotationPointer + ); + + if (count($annotations) > 1) { + if (count($this->getAnnotationsGroups()) === 0) { + $this->checkLinesBetweenDifferentAnnotationsTypes($phpcsFile, $docCommentOpenerPointer, $annotations); + } else { + $this->checkAnnotationsGroups($phpcsFile, $docCommentOpenerPointer, $annotations); + } + } + + $this->checkLinesAfterLastContent( + $phpcsFile, + $docCommentOpenerPointer, + $tokens[$docCommentOpenerPointer]['comment_closer'], + $lastContentEndPointer + ); + } + + private function checkLinesBeforeFirstContent(File $phpcsFile, int $docCommentOpenerPointer, int $firstContentStartPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $whitespaceBeforeFirstContent = substr($tokens[$docCommentOpenerPointer]['content'], 0, strlen('/**')); + $whitespaceBeforeFirstContent .= TokenHelper::getContent($phpcsFile, $docCommentOpenerPointer + 1, $firstContentStartPointer - 1); + + $linesCountBeforeFirstContent = max(substr_count($whitespaceBeforeFirstContent, $phpcsFile->eolChar) - 1, 0); + if ($linesCountBeforeFirstContent === $this->linesCountBeforeFirstContent) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before first content, found %d.', + $this->linesCountBeforeFirstContent, + $this->linesCountBeforeFirstContent === 1 ? '' : 's', + $linesCountBeforeFirstContent + ), + $firstContentStartPointer, + self::CODE_INCORRECT_LINES_COUNT_BEFORE_FIRST_CONTENT + ); + + if (!$fix) { + return; + } + + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $docCommentOpenerPointer, $firstContentStartPointer - 1, '/**' . $phpcsFile->eolChar); + + for ($i = 1; $i <= $this->linesCountBeforeFirstContent; $i++) { + $phpcsFile->fixer->addContent($docCommentOpenerPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); + } + + $phpcsFile->fixer->addContentBefore($firstContentStartPointer, $indentation . ' * '); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkLinesBetweenDescriptionAndFirstAnnotation( + File $phpcsFile, + int $docCommentOpenerPointer, + int $firstContentStartPointer, + int $firstContentEndPointer, + ?int $firstAnnotationPointer + ): void + { + if ($firstAnnotationPointer === null) { + return; + } + + if ($firstContentStartPointer === $firstAnnotationPointer) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + preg_match('~(\\s+)$~', $tokens[$firstContentEndPointer]['content'], $matches); + + $whitespaceBetweenDescriptionAndFirstAnnotation = $matches[1] ?? ''; + $whitespaceBetweenDescriptionAndFirstAnnotation .= TokenHelper::getContent( + $phpcsFile, + $firstContentEndPointer + 1, + $firstAnnotationPointer - 1 + ); + + $linesCountBetweenDescriptionAndAnnotations = max( + substr_count($whitespaceBetweenDescriptionAndFirstAnnotation, $phpcsFile->eolChar) - 1, + 0 + ); + if ($linesCountBetweenDescriptionAndAnnotations === $this->linesCountBetweenDescriptionAndAnnotations) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s between description and annotations, found %d.', + $this->linesCountBetweenDescriptionAndAnnotations, + $this->linesCountBetweenDescriptionAndAnnotations === 1 ? '' : 's', + $linesCountBetweenDescriptionAndAnnotations + ), + $firstAnnotationPointer, + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_DESCRIPTION_AND_ANNOTATIONS + ); + + if (!$fix) { + return; + } + + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addNewline($firstContentEndPointer); + + FixerHelper::removeBetween($phpcsFile, $firstContentEndPointer, $firstAnnotationPointer); + + for ($i = 1; $i <= $this->linesCountBetweenDescriptionAndAnnotations; $i++) { + $phpcsFile->fixer->addContent($firstContentEndPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); + } + + $phpcsFile->fixer->addContentBefore($firstAnnotationPointer, $indentation . ' * '); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $annotations + */ + private function checkLinesBetweenDifferentAnnotationsTypes(File $phpcsFile, int $docCommentOpenerPointer, array $annotations): void + { + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $previousAnnotation = null; + foreach ($annotations as $annotation) { + if ($previousAnnotation === null) { + $previousAnnotation = $annotation; + continue; + } + + if ($annotation->getName() === $previousAnnotation->getName()) { + $previousAnnotation = $annotation; + continue; + } + + $whitespaceAfterPreviousAnnotation = TokenHelper::getContent( + $phpcsFile, + $previousAnnotation->getEndPointer() + 1, + $annotation->getStartPointer() - 1 + ); + + $linesCountAfterPreviousAnnotation = max(substr_count($whitespaceAfterPreviousAnnotation, $phpcsFile->eolChar) - 1, 0); + + if ($linesCountAfterPreviousAnnotation === $this->linesCountBetweenDifferentAnnotationsTypes) { + $previousAnnotation = $annotation; + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s between different annotations types, found %d.', + $this->linesCountBetweenDifferentAnnotationsTypes, + $this->linesCountBetweenDifferentAnnotationsTypes === 1 ? '' : 's', + $linesCountAfterPreviousAnnotation + ), + $annotation->getStartPointer(), + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_DIFFERENT_ANNOTATIONS_TYPES + ); + + if (!$fix) { + $previousAnnotation = $annotation; + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $previousAnnotation->getEndPointer(), $annotation->getStartPointer()); + + $phpcsFile->fixer->addNewline($previousAnnotation->getEndPointer()); + + for ($i = 1; $i <= $this->linesCountBetweenDifferentAnnotationsTypes; $i++) { + $phpcsFile->fixer->addContent($previousAnnotation->getEndPointer(), sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); + } + + $phpcsFile->fixer->addContentBefore($annotation->getStartPointer(), $indentation . ' * '); + + $phpcsFile->fixer->endChangeset(); + + $previousAnnotation = $annotation; + } + } + + /** + * @param list $annotations + */ + private function checkAnnotationsGroups(File $phpcsFile, int $docCommentOpenerPointer, array $annotations): void + { + $tokens = $phpcsFile->getTokens(); + + $annotationsGroups = []; + $annotationsGroup = []; + $previousAnnotation = null; + foreach ($annotations as $annotation) { + if ( + $previousAnnotation === null + || $tokens[$previousAnnotation->getEndPointer()]['line'] + 1 === $tokens[$annotation->getStartPointer()]['line'] + ) { + $annotationsGroup[] = $annotation; + $previousAnnotation = $annotation; + continue; + } + + $annotationsGroups[] = $annotationsGroup; + $annotationsGroup = [$annotation]; + $previousAnnotation = $annotation; + } + + if (count($annotationsGroup) > 0) { + $annotationsGroups[] = $annotationsGroup; + } + + $this->checkAnnotationsGroupsOrder($phpcsFile, $docCommentOpenerPointer, $annotationsGroups, $annotations); + $this->checkLinesBetweenAnnotationsGroups($phpcsFile, $docCommentOpenerPointer, $annotationsGroups); + } + + /** + * @param list> $annotationsGroups + */ + private function checkLinesBetweenAnnotationsGroups(File $phpcsFile, int $docCommentOpenerPointer, array $annotationsGroups): void + { + $tokens = $phpcsFile->getTokens(); + + $previousAnnotationsGroup = null; + foreach ($annotationsGroups as $annotationsGroup) { + if ($previousAnnotationsGroup === null) { + $previousAnnotationsGroup = $annotationsGroup; + continue; + } + + $lastAnnotationInPreviousGroup = $previousAnnotationsGroup[count($previousAnnotationsGroup) - 1]; + $firstAnnotationInActualGroup = $annotationsGroup[0]; + + $actualLinesCountBetweenAnnotationsGroups = $tokens[$firstAnnotationInActualGroup->getStartPointer()]['line'] - $tokens[$lastAnnotationInPreviousGroup->getEndPointer()]['line'] - 1; + if ($actualLinesCountBetweenAnnotationsGroups === $this->linesCountBetweenAnnotationsGroups) { + $previousAnnotationsGroup = $annotationsGroup; + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s between annotations groups, found %d.', + $this->linesCountBetweenAnnotationsGroups, + $this->linesCountBetweenAnnotationsGroups === 1 ? '' : 's', + $actualLinesCountBetweenAnnotationsGroups + ), + $firstAnnotationInActualGroup->getStartPointer(), + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_ANNOTATIONS_GROUPS + ); + + if (!$fix) { + $previousAnnotationsGroup = $annotationsGroup; + continue; + } + + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addNewline($lastAnnotationInPreviousGroup->getEndPointer()); + + FixerHelper::removeBetween( + $phpcsFile, + $lastAnnotationInPreviousGroup->getEndPointer(), + $firstAnnotationInActualGroup->getStartPointer() + ); + + for ($i = 1; $i <= $this->linesCountBetweenAnnotationsGroups; $i++) { + $phpcsFile->fixer->addContent( + $lastAnnotationInPreviousGroup->getEndPointer(), + sprintf('%s *%s', $indentation, $phpcsFile->eolChar) + ); + } + + $phpcsFile->fixer->addContentBefore( + $firstAnnotationInActualGroup->getStartPointer(), + $indentation . ' * ' + ); + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @param list> $annotationsGroups + * @param list $annotations + */ + private function checkAnnotationsGroupsOrder( + File $phpcsFile, + int $docCommentOpenerPointer, + array $annotationsGroups, + array $annotations + ): void + { + $getAnnotationsPointers = static function (Annotation $annotation): int { + return $annotation->getStartPointer(); + }; + + $equals = static function (array $firstAnnotationsGroup, array $secondAnnotationsGroup) use ($getAnnotationsPointers): bool { + $firstAnnotationsPointers = array_map($getAnnotationsPointers, $firstAnnotationsGroup); + $secondAnnotationsPointers = array_map($getAnnotationsPointers, $secondAnnotationsGroup); + + return count(array_diff($firstAnnotationsPointers, $secondAnnotationsPointers)) === 0 + && count(array_diff($secondAnnotationsPointers, $firstAnnotationsPointers)) === 0; + }; + + $sortedAnnotationsGroups = $this->sortAnnotationsToGroups($annotations); + $incorrectAnnotationsGroupsExist = false; + $annotationsGroupsPositions = []; + + $fix = false; + $undefinedAnnotationsGroups = []; + foreach ($annotationsGroups as $annotationsGroupPosition => $annotationsGroup) { + foreach ($sortedAnnotationsGroups as $sortedAnnotationsGroupPosition => $sortedAnnotationsGroup) { + if ($equals($annotationsGroup, $sortedAnnotationsGroup)) { + $annotationsGroupsPositions[$annotationsGroupPosition] = $sortedAnnotationsGroupPosition; + continue 2; + } + + $undefinedAnnotationsGroup = true; + foreach ($annotationsGroup as $annotation) { + foreach ($this->getAnnotationsGroups() as $annotationNames) { + foreach ($annotationNames as $annotationName) { + if ($this->isAnnotationMatched($annotation, $annotationName)) { + $undefinedAnnotationsGroup = false; + break 3; + } + } + } + } + + if ($undefinedAnnotationsGroup) { + $undefinedAnnotationsGroups[] = $annotationsGroupPosition; + continue 2; + } + } + + $incorrectAnnotationsGroupsExist = true; + + $fix = $phpcsFile->addFixableError( + 'Incorrect annotations group.', + $annotationsGroup[0]->getStartPointer(), + self::CODE_INCORRECT_ANNOTATIONS_GROUP + ); + } + + if (count($annotationsGroupsPositions) === 0 && count($undefinedAnnotationsGroups) > 1) { + $incorrectAnnotationsGroupsExist = true; + + $fix = $phpcsFile->addFixableError( + 'Incorrect annotations group.', + $annotationsGroups[0][0]->getStartPointer(), + self::CODE_INCORRECT_ANNOTATIONS_GROUP + ); + } + + if (!$incorrectAnnotationsGroupsExist) { + foreach ($undefinedAnnotationsGroups as $undefinedAnnotationsGroupPosition) { + $annotationsGroupsPositions[$undefinedAnnotationsGroupPosition] = (count($annotationsGroupsPositions) > 0 + ? max($annotationsGroupsPositions) + : 0) + 1; + } + ksort($annotationsGroupsPositions); + + $positionsMappedToGroups = array_keys($annotationsGroupsPositions); + $tmp = array_values($annotationsGroupsPositions); + asort($tmp); + /** @var list $normalizedAnnotationsGroupsPositions */ + $normalizedAnnotationsGroupsPositions = array_combine(array_keys($positionsMappedToGroups), array_keys($tmp)); + + foreach ($normalizedAnnotationsGroupsPositions as $normalizedAnnotationsGroupPosition => $sortedAnnotationsGroupPosition) { + if ($normalizedAnnotationsGroupPosition === $sortedAnnotationsGroupPosition) { + continue; + } + + $fix = $phpcsFile->addFixableError( + 'Incorrect order of annotations groups.', + $annotationsGroups[$positionsMappedToGroups[$normalizedAnnotationsGroupPosition]][0]->getStartPointer(), + self::CODE_INCORRECT_ORDER_OF_ANNOTATIONS_GROUPS + ); + break; + } + } + + foreach ($annotationsGroups as $annotationsGroupPosition => $annotationsGroup) { + if (!array_key_exists($annotationsGroupPosition, $annotationsGroupsPositions)) { + continue; + } + + if (!array_key_exists($annotationsGroupsPositions[$annotationsGroupPosition], $sortedAnnotationsGroups)) { + continue; + } + + $sortedAnnotationsGroup = $sortedAnnotationsGroups[$annotationsGroupsPositions[$annotationsGroupPosition]]; + + foreach ($annotationsGroup as $annotationPosition => $annotation) { + if ($annotation === $sortedAnnotationsGroup[$annotationPosition]) { + continue; + } + + $fix = $phpcsFile->addFixableError( + 'Incorrect order of annotations in group.', + $annotation->getStartPointer(), + self::CODE_INCORRECT_ORDER_OF_ANNOTATIONS_IN_GROUP + ); + break; + } + } + + if (!$fix) { + return; + } + + $firstAnnotation = $annotationsGroups[0][0]; + $lastAnnotationsGroup = $annotationsGroups[count($annotationsGroups) - 1]; + $lastAnnotation = $lastAnnotationsGroup[count($lastAnnotationsGroup) - 1]; + + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $fixedAnnotations = ''; + $firstGroup = true; + foreach ($sortedAnnotationsGroups as $sortedAnnotationsGroup) { + if ($firstGroup) { + $firstGroup = false; + } else { + for ($i = 0; $i < $this->linesCountBetweenAnnotationsGroups; $i++) { + $fixedAnnotations .= sprintf('%s *%s', $indentation, $phpcsFile->eolChar); + } + } + + foreach ($sortedAnnotationsGroup as $sortedAnnotation) { + $fixedAnnotations .= sprintf( + '%s * %s%s', + $indentation, + trim(TokenHelper::getContent($phpcsFile, $sortedAnnotation->getStartPointer(), $sortedAnnotation->getEndPointer())), + $phpcsFile->eolChar + ); + } + } + + $tokens = $phpcsFile->getTokens(); + $docCommentCloserPointer = $tokens[$docCommentOpenerPointer]['comment_closer']; + + $endOfLineBeforeFirstAnnotation = TokenHelper::findPreviousContent( + $phpcsFile, + T_DOC_COMMENT_WHITESPACE, + $phpcsFile->eolChar, + $firstAnnotation->getStartPointer() - 1, + $docCommentOpenerPointer + ); + $docCommentContentEndPointer = TokenHelper::findNextContent( + $phpcsFile, + T_DOC_COMMENT_WHITESPACE, + $phpcsFile->eolChar, + $lastAnnotation->getEndPointer() + 1, + $docCommentCloserPointer + ); + + if ($docCommentContentEndPointer === null) { + $docCommentContentEndPointer = $lastAnnotation->getEndPointer(); + } + + $phpcsFile->fixer->beginChangeset(); + + if ($endOfLineBeforeFirstAnnotation === null) { + FixerHelper::change( + $phpcsFile, + $docCommentOpenerPointer, + $docCommentContentEndPointer, + '/**' . $phpcsFile->eolChar . $fixedAnnotations + ); + } else { + FixerHelper::change($phpcsFile, $endOfLineBeforeFirstAnnotation + 1, $docCommentContentEndPointer, $fixedAnnotations); + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $annotations + * @return list> + */ + private function sortAnnotationsToGroups(array $annotations): array + { + $expectedAnnotationsGroups = $this->getAnnotationsGroups(); + + $sortedAnnotationsGroups = []; + $annotationsNotInAnyGroup = []; + foreach ($annotations as $annotation) { + foreach ($expectedAnnotationsGroups as $annotationsGroupPosition => $annotationsGroup) { + foreach ($annotationsGroup as $annotationName) { + if ($this->isAnnotationMatched($annotation, $annotationName)) { + $sortedAnnotationsGroups[$annotationsGroupPosition][] = $annotation; + continue 3; + } + } + } + + $annotationsNotInAnyGroup[] = $annotation; + } + + ksort($sortedAnnotationsGroups); + + foreach (array_keys($sortedAnnotationsGroups) as $annotationsGroupPosition) { + $expectedAnnotationsGroupOrder = array_flip($expectedAnnotationsGroups[$annotationsGroupPosition]); + usort( + $sortedAnnotationsGroups[$annotationsGroupPosition], + function (Annotation $firstAnnotation, Annotation $secondAnnotation) use ($expectedAnnotationsGroupOrder): int { + $getExpectedOrder = function (string $annotationName) use ($expectedAnnotationsGroupOrder): int { + if (array_key_exists($annotationName, $expectedAnnotationsGroupOrder)) { + return $expectedAnnotationsGroupOrder[$annotationName]; + } + + $order = 0; + foreach ($expectedAnnotationsGroupOrder as $expectedAnnotationName => $expectedAnnotationOrder) { + if ($this->isAnnotationNameInAnnotationNamespace($expectedAnnotationName, $annotationName)) { + $order = $expectedAnnotationOrder; + break; + } + } + + return $order; + }; + + $expectedOrder = $getExpectedOrder($firstAnnotation->getName()) <=> $getExpectedOrder($secondAnnotation->getName()); + + return $expectedOrder !== 0 + ? $expectedOrder + : $firstAnnotation->getStartPointer() <=> $secondAnnotation->getStartPointer(); + } + ); + } + + if (count($annotationsNotInAnyGroup) > 0) { + $sortedAnnotationsGroups[] = $annotationsNotInAnyGroup; + } + + return $sortedAnnotationsGroups; + } + + private function isAnnotationNameInAnnotationNamespace(string $annotationNamespace, string $annotationName): bool + { + return $this->isAnnotationStartedFrom($annotationNamespace, $annotationName) + || ( + in_array(substr($annotationNamespace, -1), ['\\', '-', ':'], true) + && strpos($annotationName, $annotationNamespace) === 0 + ); + } + + private function isAnnotationStartedFrom(string $annotationNamespace, string $annotationName): bool + { + return substr($annotationNamespace, -1) === '*' + && strpos($annotationName, substr($annotationNamespace, 0, -1)) === 0; + } + + private function isAnnotationMatched(Annotation $annotation, string $annotationName): bool + { + if ($annotation->getName() === $annotationName) { + return true; + } + + return $this->isAnnotationNameInAnnotationNamespace($annotationName, $annotation->getName()); + } + + private function checkLinesAfterLastContent( + File $phpcsFile, + int $docCommentOpenerPointer, + int $docCommentCloserPointer, + int $lastContentEndPointer + ): void + { + $whitespaceAfterLastContent = TokenHelper::getContent($phpcsFile, $lastContentEndPointer + 1, $docCommentCloserPointer); + + $linesCountAfterLastContent = max(substr_count($whitespaceAfterLastContent, $phpcsFile->eolChar) - 1, 0); + if ($linesCountAfterLastContent === $this->linesCountAfterLastContent) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after last content, found %d.', + $this->linesCountAfterLastContent, + $this->linesCountAfterLastContent === 1 ? '' : 's', + $linesCountAfterLastContent + ), + $lastContentEndPointer, + self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_CONTENT + ); + + if (!$fix) { + return; + } + + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenerPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $lastContentEndPointer, $docCommentCloserPointer); + + $phpcsFile->fixer->addNewline($lastContentEndPointer); + + for ($i = 1; $i <= $this->linesCountAfterLastContent; $i++) { + $phpcsFile->fixer->addContent($lastContentEndPointer, sprintf('%s *%s', $indentation, $phpcsFile->eolChar)); + } + + $phpcsFile->fixer->addContentBefore($docCommentCloserPointer, $indentation . ' '); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @return array> + */ + private function getAnnotationsGroups(): array + { + if ($this->normalizedAnnotationsGroups === null) { + $this->normalizedAnnotationsGroups = []; + foreach ($this->annotationsGroups as $annotationsGroup) { + $this->normalizedAnnotationsGroups[] = SniffSettingsHelper::normalizeArray(explode(',', $annotationsGroup)); + } + } + + return $this->normalizedAnnotationsGroups; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/EmptyCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/EmptyCommentSniff.php new file mode 100644 index 0000000..ad5fda8 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/EmptyCommentSniff.php @@ -0,0 +1,198 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + T_COMMENT, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $commentStartPointer + */ + public function process(File $phpcsFile, $commentStartPointer): void + { + $commentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $commentStartPointer); + + if ($commentEndPointer === null) { + // Part of block comment + return; + } + + $commentContent = $this->getCommentContent($phpcsFile, $commentStartPointer, $commentEndPointer); + + $isLineComment = CommentHelper::isLineComment($phpcsFile, $commentStartPointer); + $isEmpty = $this->isEmpty($commentContent, $isLineComment); + + if (!$isEmpty) { + return; + } + + if ( + $isLineComment + && $this->isPartOfMultiLineInlineComments($phpcsFile, $commentStartPointer, $commentEndPointer) + ) { + return; + } + + $fix = $phpcsFile->addFixableError('Empty comment', $commentStartPointer, self::CODE_EMPTY_COMMENT); + + if (!$fix) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBeforeWhitespaceBeforeComment */ + $pointerBeforeWhitespaceBeforeComment = TokenHelper::findPreviousNonWhitespace($phpcsFile, $commentStartPointer - 1); + $whitespaceBeforeComment = $pointerBeforeWhitespaceBeforeComment !== $commentStartPointer - 1 + ? TokenHelper::getContent($phpcsFile, $pointerBeforeWhitespaceBeforeComment + 1, $commentStartPointer - 1) + : ''; + $fixedWhitespaceBeforeComment = preg_replace('~[ \\t]+$~', '', $whitespaceBeforeComment); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeWhitespaceBeforeComment, $commentStartPointer); + + $phpcsFile->fixer->addContent($pointerBeforeWhitespaceBeforeComment, $fixedWhitespaceBeforeComment); + + FixerHelper::removeBetweenIncluding($phpcsFile, $commentStartPointer, $commentEndPointer); + + $whitespacePointerAfterComment = $commentEndPointer + 1; + + if ($tokens[$pointerBeforeWhitespaceBeforeComment]['line'] === $tokens[$commentStartPointer]['line']) { + if (StringHelper::endsWith($tokens[$commentEndPointer]['content'], $phpcsFile->eolChar)) { + $phpcsFile->fixer->addNewline($commentEndPointer); + } + } elseif ( + array_key_exists($whitespacePointerAfterComment, $tokens) + && $tokens[$whitespacePointerAfterComment]['code'] === T_WHITESPACE + ) { + $fixedWhitespaceAfterComment = preg_replace( + '~^[ \\t]*' . $phpcsFile->eolChar . '~', + '', + $tokens[$whitespacePointerAfterComment]['content'] + ); + $phpcsFile->fixer->replaceToken($whitespacePointerAfterComment, $fixedWhitespaceAfterComment); + } + + $phpcsFile->fixer->endChangeset(); + } + + private function isEmpty(string $comment, bool $isLineComment): bool + { + return $isLineComment + ? (bool) preg_match('~^\\s*$~', $comment) + : (bool) preg_match('~^[\\s\*]*$~', $comment); + } + + private function getCommentContent(File $phpcsFile, int $commentStartPointer, int $commentEndPointer): string + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$commentStartPointer]['code'] === T_DOC_COMMENT_OPEN_TAG) { + return TokenHelper::getContent($phpcsFile, $commentStartPointer + 1, $commentEndPointer - 1); + } + + if (preg_match('~^(?://|#)(.*)~', $tokens[$commentStartPointer]['content'], $matches) !== 0) { + return $matches[1]; + } + + return substr(TokenHelper::getContent($phpcsFile, $commentStartPointer, $commentEndPointer), 2, -2); + } + + private function isPartOfMultiLineInlineComments(File $phpcsFile, int $commentStartPointer, int $commentEndPointer): bool + { + if (!$this->isNonEmptyLineCommentBefore($phpcsFile, $commentStartPointer)) { + return false; + } + + return $this->isNonEmptyLineCommentAfter($phpcsFile, $commentEndPointer); + } + + private function isNonEmptyLineCommentBefore(File $phpcsFile, int $commentStartPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $beforeCommentStartPointer */ + $beforeCommentStartPointer = TokenHelper::findPreviousNonWhitespace($phpcsFile, $commentStartPointer - 1); + + if ($tokens[$beforeCommentStartPointer]['code'] !== T_COMMENT) { + return false; + } + + if (!CommentHelper::isLineComment($phpcsFile, $beforeCommentStartPointer)) { + return false; + } + + if ($tokens[$beforeCommentStartPointer]['line'] + 1 !== $tokens[$commentStartPointer]['line']) { + return false; + } + + /** @var int $beforeCommentEndPointer */ + $beforeCommentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $beforeCommentStartPointer); + if (!$this->isEmpty($this->getCommentContent($phpcsFile, $beforeCommentStartPointer, $beforeCommentEndPointer), true)) { + return true; + } + + return $this->isNonEmptyLineCommentBefore($phpcsFile, $beforeCommentStartPointer); + } + + private function isNonEmptyLineCommentAfter(File $phpcsFile, int $commentEndPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $afterCommentStartPointer = TokenHelper::findNextNonWhitespace($phpcsFile, $commentEndPointer + 1); + + if ($afterCommentStartPointer === null) { + return false; + } + + if ($tokens[$afterCommentStartPointer]['code'] !== T_COMMENT) { + return false; + } + + if (!CommentHelper::isLineComment($phpcsFile, $afterCommentStartPointer)) { + return false; + } + + if ($tokens[$commentEndPointer]['line'] + 1 !== $tokens[$afterCommentStartPointer]['line']) { + return false; + } + + /** @var int $afterCommentEndPointer */ + $afterCommentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $afterCommentStartPointer); + if (!$this->isEmpty($this->getCommentContent($phpcsFile, $afterCommentStartPointer, $afterCommentEndPointer), true)) { + return true; + } + + return $this->isNonEmptyLineCommentAfter($phpcsFile, $afterCommentEndPointer); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php new file mode 100644 index 0000000..bbce185 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenAnnotationsSniff.php @@ -0,0 +1,132 @@ + */ + public $forbiddenAnnotations = []; + + /** @var list|null */ + private $normalizedForbiddenAnnotations; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + if (!in_array($annotation->getName(), $this->getNormalizedForbiddenAnnotations(), true)) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Use of annotation %s is forbidden.', $annotation->getName()), + $annotation->getStartPointer(), + self::CODE_ANNOTATION_FORBIDDEN + ); + if (!$fix) { + continue; + } + + $starPointer = TokenHelper::findPrevious( + $phpcsFile, + T_DOC_COMMENT_STAR, + $annotation->getStartPointer() - 1, + $docCommentOpenPointer + ); + $annotationStartPointer = $starPointer ?? $annotation->getStartPointer(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_TAG, T_DOC_COMMENT_CLOSE_TAG], + $annotation->getEndPointer() + 1 + ); + if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_TAG) { + $nextPointer = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $nextPointer - 1); + } + $annotationEndPointer = $nextPointer - 1; + + if ($tokens[$nextPointer]['code'] === T_DOC_COMMENT_CLOSE_TAG && $starPointer !== null) { + $pointerBeforeWhitespace = TokenHelper::findPreviousExcluding( + $phpcsFile, + [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], + $annotationStartPointer - 1 + ); + /** @var int $annotationStartPointer */ + $annotationStartPointer = TokenHelper::findNext($phpcsFile, T_DOC_COMMENT_STAR, $pointerBeforeWhitespace + 1); + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $annotationStartPointer, $annotationEndPointer); + + $docCommentUseful = false; + $docCommentClosePointer = $tokens[$docCommentOpenPointer]['comment_closer']; + for ($i = $docCommentOpenPointer + 1; $i < $docCommentClosePointer; $i++) { + $tokenContent = trim($phpcsFile->fixer->getTokenContent($i)); + if ($tokenContent === '' || $tokenContent === '*') { + continue; + } + + $docCommentUseful = true; + break; + } + + if (!$docCommentUseful) { + /** @var int $nextPointerAfterDocComment */ + $nextPointerAfterDocComment = TokenHelper::findNextEffective($phpcsFile, $docCommentClosePointer + 1); + + FixerHelper::removeBetweenIncluding($phpcsFile, $docCommentOpenPointer, $nextPointerAfterDocComment - 1); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @return list + */ + private function getNormalizedForbiddenAnnotations(): array + { + if ($this->normalizedForbiddenAnnotations === null) { + $this->normalizedForbiddenAnnotations = SniffSettingsHelper::normalizeArray($this->forbiddenAnnotations); + } + return $this->normalizedForbiddenAnnotations; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php new file mode 100644 index 0000000..f89881a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/ForbiddenCommentsSniff.php @@ -0,0 +1,132 @@ + */ + public $forbiddenCommentPatterns = []; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $comments = DocCommentHelper::getDocCommentDescription($phpcsFile, $docCommentOpenPointer); + + if ($comments === null) { + return; + } + + foreach (SniffSettingsHelper::normalizeArray($this->forbiddenCommentPatterns) as $forbiddenCommentPattern) { + if (!SniffSettingsHelper::isValidRegularExpression($forbiddenCommentPattern)) { + throw new Exception(sprintf('%s is not valid PCRE pattern.', $forbiddenCommentPattern)); + } + + foreach ($comments as $comment) { + if (preg_match($forbiddenCommentPattern, $comment->getContent()) === 0) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Documentation comment contains forbidden comment "%s".', $comment->getContent()), + $comment->getPointer(), + self::CODE_COMMENT_FORBIDDEN + ); + + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $fixedDocComment = preg_replace($forbiddenCommentPattern, '', $comment->getContent()); + + $phpcsFile->fixer->replaceToken($comment->getPointer(), $fixedDocComment); + + for ($i = $comment->getPointer() - 1; $i > $docCommentOpenPointer; $i--) { + $contentWithoutSpaces = preg_replace('~ +$~', '', $tokens[$i]['content'], -1, $replacedCount); + + if ($replacedCount === 0) { + break; + } + + $phpcsFile->fixer->replaceToken($i, $contentWithoutSpaces); + } + + $docCommentContent = ''; + for ($i = $docCommentOpenPointer + 1; $i < $tokens[$docCommentOpenPointer]['comment_closer']; $i++) { + /** @var string|array<(string|int)> $token */ + $token = $phpcsFile->fixer->getTokenContent($i); + $docCommentContent .= is_array($token) ? $token['content'] : $token; + } + + if (preg_match('~^[\\s\*]*$~', $docCommentContent) !== 0) { + $pointerBeforeDocComment = $docCommentOpenPointer - 1; + $contentBeforeWithoutSpaces = preg_replace( + '~[\t ]+$~', + '', + $tokens[$pointerBeforeDocComment]['content'], + -1, + $replacedCount + ); + if ($replacedCount !== 0) { + $phpcsFile->fixer->replaceToken($pointerBeforeDocComment, $contentBeforeWithoutSpaces); + } + + FixerHelper::removeBetweenIncluding( + $phpcsFile, + $docCommentOpenPointer, + $tokens[$docCommentOpenPointer]['comment_closer'] + ); + + $pointerAfterDocComment = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + if (array_key_exists($pointerAfterDocComment, $tokens)) { + $contentAfterWithoutSpaces = preg_replace( + '~^[\r\n]+~', + '', + $tokens[$pointerAfterDocComment]['content'], + -1, + $replacedCount + ); + if ($replacedCount !== 0) { + $phpcsFile->fixer->replaceToken($pointerAfterDocComment, $contentAfterWithoutSpaces); + } + } + } + + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php new file mode 100644 index 0000000..1ce816b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/InlineDocCommentDeclarationSniff.php @@ -0,0 +1,495 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + T_COMMENT, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $commentOpenPointer + */ + public function process(File $phpcsFile, $commentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $commentClosePointer = $tokens[$commentOpenPointer]['code'] === T_COMMENT + ? $commentOpenPointer + : $tokens[$commentOpenPointer]['comment_closer']; + + $pointerAfterCommentClosePointer = TokenHelper::findNextEffective($phpcsFile, $commentClosePointer + 1); + if ($pointerAfterCommentClosePointer !== null) { + do { + if ($tokens[$pointerAfterCommentClosePointer]['code'] !== T_ATTRIBUTE) { + break; + } + + $pointerAfterCommentClosePointer = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$pointerAfterCommentClosePointer]['attribute_closer'] + 1 + ); + } while (true); + + if (in_array( + $tokens[$pointerAfterCommentClosePointer]['code'], + [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_READONLY, T_FINAL, T_CONST], + true + )) { + return; + } + + if ($tokens[$pointerAfterCommentClosePointer]['code'] === T_STATIC) { + $pointerAfterStatic = TokenHelper::findNextEffective($phpcsFile, $pointerAfterCommentClosePointer + 1); + if (in_array($tokens[$pointerAfterStatic]['code'], [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_READONLY], true)) { + return; + } + + if ($tokens[$pointerAfterStatic]['code'] === T_VARIABLE && PropertyHelper::isProperty($phpcsFile, $pointerAfterStatic)) { + return; + } + } + } + + if ($tokens[$commentOpenPointer]['code'] === T_COMMENT) { + $this->checkCommentType($phpcsFile, $commentOpenPointer); + return; + } + + /** @var list> $annotations */ + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $commentOpenPointer, '@var'); + + if ($annotations === []) { + return; + } + + if ($this->allowDocCommentAboveReturn) { + $pointerAfterCommentClosePointer = TokenHelper::findNextEffective($phpcsFile, $commentClosePointer + 1); + if ($tokens[$pointerAfterCommentClosePointer]['code'] === T_RETURN) { + return; + } + } + + $this->checkFormat($phpcsFile, $annotations); + $this->checkVariable($phpcsFile, $annotations, $commentOpenPointer, $commentClosePointer); + } + + private function checkCommentType(File $phpcsFile, int $commentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (preg_match('~^/\*\\s*@var\\s+~', $tokens[$commentOpenPointer]['content']) === 0) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Invalid comment type /* */ for inline documentation comment, use /** */.', + $commentOpenPointer, + self::CODE_INVALID_COMMENT_TYPE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($commentOpenPointer, sprintf('/**%s', substr($tokens[$commentOpenPointer]['content'], 2))); + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list> $annotations + */ + private function checkFormat(File $phpcsFile, array $annotations): void + { + foreach ($annotations as $annotation) { + if (!$annotation->isInvalid() && $annotation->getValue()->variableName !== '') { + continue; + } + + $variableName = '$variableName'; + + $annotationContent = (string) $annotation->getValue(); + + $type = null; + + if ( + $annotationContent !== '' + && preg_match('~(\$\w+)(?:\s+(.+))?$~i', $annotationContent, $matches) === 1 + ) { + $variableName = $matches[1]; + $type = $matches[2] ?? null; + } + + // It may be description when it contains whitespaces + $isFixable = $type !== null && preg_match('~\s~', $type) === 0; + + if (!$isFixable) { + $phpcsFile->addError( + sprintf( + 'Invalid inline documentation comment format "@var %1$s", expected "@var type %2$s Optional description".', + $annotationContent, + $variableName + ), + $annotation->getStartPointer(), + self::CODE_INVALID_FORMAT + ); + + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Invalid inline documentation comment format "@var %1$s", expected "@var %2$s %3$s".', + $annotationContent, + $type, + $variableName + ), + $annotation->getStartPointer(), + self::CODE_INVALID_FORMAT + ); + + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent( + $annotation->getStartPointer(), + sprintf( + ' %s %s ', + $type, + $variableName + ) + ); + + FixerHelper::removeBetweenIncluding($phpcsFile, $annotation->getStartPointer() + 1, $annotation->getEndPointer()); + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @param list> $annotations + */ + private function checkVariable(File $phpcsFile, array $annotations, int $docCommentOpenerPointer, int $docCommentCloserPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $checkedTokens = [T_VARIABLE, T_FOREACH, T_WHILE, T_LIST, T_OPEN_SHORT_ARRAY, T_CLOSURE, T_FN]; + + $variableNames = []; + + foreach ($annotations as $variableAnnotation) { + if ($variableAnnotation->isInvalid()) { + continue; + } + + $variableName = $variableAnnotation->getValue()->variableName; + if ($variableName === '') { + continue; + } + + $variableNames[] = $variableName; + } + + $improveCodePointer = function (int $codePointer) use ($phpcsFile, $tokens, $checkedTokens, $variableNames): int { + $shouldSearchClosure = false; + + if (!in_array($tokens[$codePointer]['code'], $checkedTokens, true)) { + $shouldSearchClosure = true; + } elseif ( + $tokens[$codePointer]['code'] === T_VARIABLE + && ( + !$this->isAssignment($phpcsFile, $codePointer) + || !in_array($tokens[$codePointer]['content'], $variableNames, true) + ) + ) { + $shouldSearchClosure = true; + } + + if (!$shouldSearchClosure) { + return $codePointer; + } + + $closurePointer = TokenHelper::findNext($phpcsFile, [T_CLOSURE, T_FN], $codePointer + 1); + if ($closurePointer !== null && $tokens[$codePointer]['line'] === $tokens[$closurePointer]['line']) { + return $closurePointer; + } + + return $codePointer; + }; + + $firstPointerOnNextLine = TokenHelper::findFirstNonWhitespaceOnNextLine($phpcsFile, $docCommentCloserPointer); + + $codePointerAfter = $firstPointerOnNextLine; + while ($codePointerAfter !== null && $tokens[$codePointerAfter]['code'] === T_DOC_COMMENT_OPEN_TAG) { + $codePointerAfter = TokenHelper::findFirstNonWhitespaceOnNextLine($phpcsFile, $codePointerAfter + 1); + } + + if ($codePointerAfter !== null) { + if ($tokens[$codePointerAfter]['code'] === T_STATIC) { + $codePointerAfter = TokenHelper::findNextEffective($phpcsFile, $codePointerAfter + 1); + } + + $codePointerAfter = $improveCodePointer($codePointerAfter); + } + + $codePointerBefore = TokenHelper::findFirstNonWhitespaceOnPreviousLine($phpcsFile, $docCommentOpenerPointer); + while ($codePointerBefore !== null && $tokens[$codePointerBefore]['code'] === T_DOC_COMMENT_OPEN_TAG) { + $codePointerBefore = TokenHelper::findFirstNonWhitespaceOnPreviousLine($phpcsFile, $codePointerBefore - 1); + } + + if ($codePointerBefore !== null) { + $codePointerBefore = $improveCodePointer($codePointerBefore); + } + + foreach ($annotations as $variableAnnotation) { + if ($variableAnnotation->isInvalid()) { + continue; + } + + $variableName = $variableAnnotation->getValue()->variableName; + if ($variableName === '') { + continue; + } + + $missingVariableErrorParameters = [ + sprintf('Missing variable %s before or after the documentation comment.', $variableName), + $docCommentOpenerPointer, + self::CODE_MISSING_VARIABLE, + ]; + + $noAssignmentErrorParameters = [ + sprintf('No assignment to %s variable before or after the documentation comment.', $variableName), + $docCommentOpenerPointer, + self::CODE_NO_ASSIGNMENT, + ]; + + if ($this->allowAboveNonAssignment && $firstPointerOnNextLine !== null) { + for ($i = $firstPointerOnNextLine; $i < count($tokens); $i++) { + if ($tokens[$i]['line'] > $tokens[$firstPointerOnNextLine]['line']) { + break; + } + + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] === $variableName) { + return; + } + } + } + + foreach ([1 => $codePointerBefore, 2 => $codePointerAfter] as $tryNo => $codePointer) { + if ($codePointer === null || !in_array($tokens[$codePointer]['code'], $checkedTokens, true)) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + + if ($tokens[$codePointer]['code'] === T_VARIABLE) { + if ($tokens[$codePointer]['content'] !== '$this' && !$this->isAssignment($phpcsFile, $codePointer)) { + if ($tryNo === 2) { + $phpcsFile->addError(...$noAssignmentErrorParameters); + } + + continue; + } + + if ($variableName !== $tokens[$codePointer]['content']) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + } elseif ($tokens[$codePointer]['code'] === T_LIST) { + $listParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $codePointer + 1); + + $variablePointerInList = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $listParenthesisOpener + 1, + $tokens[$listParenthesisOpener]['parenthesis_closer'] + ); + if ($variablePointerInList === null) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + + } elseif ($tokens[$codePointer]['code'] === T_OPEN_SHORT_ARRAY) { + $pointerAfterList = TokenHelper::findNextEffective($phpcsFile, $tokens[$codePointer]['bracket_closer'] + 1); + if ($tokens[$pointerAfterList]['code'] !== T_EQUAL) { + if ($tryNo === 2) { + $phpcsFile->addError(...$noAssignmentErrorParameters); + } + + continue; + } + + $variablePointerInList = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $codePointer + 1, + $tokens[$codePointer]['bracket_closer'] + ); + if ($variablePointerInList === null) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + + } elseif (in_array($tokens[$codePointer]['code'], [T_CLOSURE, T_FN], true)) { + $parameterPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$codePointer]['parenthesis_opener'] + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + if ($parameterPointer === null) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + + } else { + if ($tokens[$codePointer]['code'] === T_WHILE) { + $variablePointerInWhile = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$codePointer]['parenthesis_opener'] + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + if ($variablePointerInWhile === null) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + + $pointerAfterVariableInWhile = TokenHelper::findNextEffective($phpcsFile, $variablePointerInWhile + 1); + if ($tokens[$pointerAfterVariableInWhile]['code'] !== T_EQUAL) { + if ($tryNo === 2) { + $phpcsFile->addError(...$noAssignmentErrorParameters); + } + + continue; + } + } else { + $asPointer = TokenHelper::findNext( + $phpcsFile, + T_AS, + $tokens[$codePointer]['parenthesis_opener'] + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + $variablePointerInForeach = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $asPointer + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + if ($variablePointerInForeach === null) { + if ($tryNo === 2) { + $phpcsFile->addError(...$missingVariableErrorParameters); + } + + continue; + } + } + } + + // No error, don't check second $codePointer + continue 2; + } + } + } + + private function isAssignment(File $phpcsFile, int $pointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $pointerAfterVariable = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + if ($tokens[$pointerAfterVariable]['code'] === T_SEMICOLON) { + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + return $tokens[$pointerBeforeVariable]['code'] === T_STATIC; + } + + return in_array($tokens[$pointerAfterVariable]['code'], [T_EQUAL, T_COALESCE_EQUAL], true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLineDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLineDocCommentSniff.php new file mode 100644 index 0000000..3b19cf1 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLineDocCommentSniff.php @@ -0,0 +1,19 @@ +addFixableError($error, $docCommentStartPointer, self::CODE_MULTI_LINE_DOC_COMMENT); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniff.php new file mode 100644 index 0000000..0c04e2d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/RequireOneLinePropertyDocCommentSniff.php @@ -0,0 +1,61 @@ +findNext(T_VARIABLE, $docCommentStartPointer); + + return $phpcsFile->addFixableError( + sprintf($error, PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer)), + $docCommentStartPointer, + self::CODE_MULTI_LINE_PROPERTY_COMMENT + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php new file mode 100644 index 0000000..502b058 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php @@ -0,0 +1,143 @@ + */ + public $traversableTypeHints = []; + + /** @var array|null */ + private $normalizedTraversableTypeHints; + + /** + * @return array + */ + public function register(): array + { + return [ + T_FUNCTION, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + if (!DocCommentHelper::hasDocComment($phpcsFile, $functionPointer)) { + return; + } + + if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $functionPointer)) { + return; + } + + if (DocCommentHelper::hasDocCommentDescription($phpcsFile, $functionPointer)) { + return; + } + + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $functionPointer); + $returnAnnotation = FunctionHelper::findReturnAnnotation($phpcsFile, $functionPointer); + + if ( + $returnAnnotation !== null + && !AnnotationHelper::isAnnotationUseless( + $phpcsFile, + $functionPointer, + $returnTypeHint, + $returnAnnotation, + $this->getTraversableTypeHints() + ) + ) { + return; + } + + $parameterTypeHints = FunctionHelper::getParametersTypeHints($phpcsFile, $functionPointer); + $parametersAnnotations = FunctionHelper::getValidParametersAnnotations($phpcsFile, $functionPointer); + + foreach ($parametersAnnotations as $parameterName => $parameterAnnotation) { + if (!array_key_exists($parameterName, $parameterTypeHints)) { + return; + } + + if (!AnnotationHelper::isAnnotationUseless( + $phpcsFile, + $functionPointer, + $parameterTypeHints[$parameterName], + $parameterAnnotation, + $this->getTraversableTypeHints() + )) { + return; + } + } + + foreach (AnnotationHelper::getAnnotations($phpcsFile, $functionPointer) as $annotation) { + if (!in_array($annotation->getName(), ['@param', '@return'], true)) { + return; + } + } + + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() does not need documentation comment.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ), + $functionPointer, + self::CODE_USELESS_DOC_COMMENT + ); + if (!$fix) { + return; + } + + /** @var int $docCommentOpenPointer */ + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $functionPointer); + $docCommentClosePointer = $phpcsFile->getTokens()[$docCommentOpenPointer]['comment_closer']; + + $changeStart = $docCommentOpenPointer; + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNextEffective($phpcsFile, $docCommentClosePointer + 1) - 1; + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @return array + */ + private function getTraversableTypeHints(): array + { + if ($this->normalizedTraversableTypeHints === null) { + $this->normalizedTraversableTypeHints = array_map(static function (string $typeHint): string { + return NamespaceHelper::isFullyQualifiedName($typeHint) + ? $typeHint + : sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $typeHint); + }, SniffSettingsHelper::normalizeArray($this->traversableTypeHints)); + } + return $this->normalizedTraversableTypeHints; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessInheritDocCommentSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessInheritDocCommentSniff.php new file mode 100644 index 0000000..4add286 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessInheritDocCommentSniff.php @@ -0,0 +1,118 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $docCommentContent = ''; + for ($i = $docCommentOpenPointer + 1; $i < $tokens[$docCommentOpenPointer]['comment_closer']; $i++) { + if (in_array($tokens[$i]['code'], [T_DOC_COMMENT_WHITESPACE, T_DOC_COMMENT_STAR], true)) { + continue; + } + + $docCommentContent .= $tokens[$i]['content']; + } + + if (preg_match('~^(?:\{@inheritDoc\}|@inheritDoc)$~i', $docCommentContent) === 0) { + return; + } + + $searchPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + do { + $docCommentOwnerPointer = TokenHelper::findNext( + $phpcsFile, + array_merge(TokenHelper::$functionTokenCodes, TokenHelper::getTypeHintTokenCodes(), [T_ATTRIBUTE]), + $searchPointer + ); + + if ($docCommentOwnerPointer === null) { + return; + } + + if ($tokens[$docCommentOwnerPointer]['code'] === T_ATTRIBUTE) { + $searchPointer = $tokens[$docCommentOwnerPointer]['attribute_closer'] + 1; + continue; + } + + break; + + } while (true); + + if (in_array($tokens[$docCommentOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $docCommentOwnerPointer); + if ($returnTypeHint === null) { + return; + } + + if (TypeHintHelper::isSimpleIterableTypeHint($returnTypeHint->getTypeHintWithoutNullabilitySymbol())) { + return; + } + + $parametersTypeHints = FunctionHelper::getParametersTypeHints($phpcsFile, $docCommentOwnerPointer); + foreach ($parametersTypeHints as $parameterTypeHint) { + if ($parameterTypeHint === null) { + return; + } + + if (TypeHintHelper::isSimpleIterableTypeHint($parameterTypeHint->getTypeHint())) { + return; + } + } + } + + $fix = $phpcsFile->addFixableError( + 'Useless documentation comment with @inheritDoc.', + $docCommentOpenPointer, + self::CODE_USELESS_INHERIT_DOC_COMMENT + ); + + if (!$fix) { + return; + } + + /** @var int $fixerStart */ + $fixerStart = TokenHelper::findLastTokenOnPreviousLine($phpcsFile, $docCommentOpenPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $fixerStart, $tokens[$docCommentOpenPointer]['comment_closer']); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php new file mode 100644 index 0000000..a42830a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Complexity/CognitiveSniff.php @@ -0,0 +1,310 @@ + T_CATCH, + T_DO => T_DO, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_IF => T_IF, + T_SWITCH => T_SWITCH, + T_WHILE => T_WHILE, + ]; + + private const BOOLEAN_OPERATORS = [ + T_BOOLEAN_AND => T_BOOLEAN_AND, + T_BOOLEAN_OR => T_BOOLEAN_OR, + ]; + + private const OPERATOR_CHAIN_BREAKS = [ + T_OPEN_PARENTHESIS => T_OPEN_PARENTHESIS, + T_CLOSE_PARENTHESIS => T_CLOSE_PARENTHESIS, + T_SEMICOLON => T_SEMICOLON, + T_INLINE_THEN => T_INLINE_THEN, + T_INLINE_ELSE => T_INLINE_ELSE, + ]; + + /** + * B3. Nesting increments + */ + private const NESTING_INCREMENTS = [ + T_CLOSURE => T_CLOSURE, + // increments, but does not receive + T_ELSEIF => T_ELSEIF, + // increments, but does not receive + T_ELSE => T_ELSE, + T_IF => T_IF, + T_INLINE_THEN => T_INLINE_THEN, + T_SWITCH => T_SWITCH, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_WHILE => T_WHILE, + T_DO => T_DO, + T_CATCH => T_CATCH, + ]; + + /** + * B1. Increments + */ + private const BREAKING_TOKENS = [ + T_CONTINUE => T_CONTINUE, + T_GOTO => T_GOTO, + T_BREAK => T_BREAK, + ]; + + /** + * @deprecated + * @var ?int maximum allowed complexity + */ + public $maxComplexity = null; + + /** @var int complexity which will raise warning */ + public $warningThreshold = 6; + + /** @var int complexity which will raise error */ + public $errorThreshold = 6; + + /** @var int */ + private $cognitiveComplexity = 0; + + /** @var int|string */ + private $lastBooleanOperator = 0; + + /** @var File */ + private $phpcsFile; + + /** + * @return array + */ + public function register(): array + { + return [ + T_CLOSURE, + T_FUNCTION, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stackPtr + */ + public function process(File $phpcsFile, $stackPtr): void + { + $this->phpcsFile = $phpcsFile; + + if ($phpcsFile->getCondition($stackPtr, T_FUNCTION) !== false) { + return; + } + + if ($this->maxComplexity !== null) { + // maxComplexity is deprecated... if set use it + $this->warningThreshold = $this->maxComplexity + 1; + $this->errorThreshold = $this->maxComplexity + 1; + } + + $cognitiveComplexity = $this->computeForFunctionFromTokensAndPosition($stackPtr); + + if ($cognitiveComplexity < $this->warningThreshold) { + return; + } + + $name = $phpcsFile->getDeclarationName($stackPtr); + + $errorParameters = [ + 'Cognitive complexity for "%s" is %d but has to be less than or equal to %d.', + $stackPtr, + self::CODE_COMPLEXITY, + [ + $name, + $cognitiveComplexity, + $this->warningThreshold - 1, + ], + ]; + + $cognitiveComplexity >= $this->errorThreshold + ? $phpcsFile->addError(...$errorParameters) + : $phpcsFile->addWarning(...$errorParameters); + } + + public function computeForFunctionFromTokensAndPosition(int $position): int + { + if (FunctionHelper::isAbstract($this->phpcsFile, $position)) { + return 0; + } + + $tokens = $this->phpcsFile->getTokens(); + + // Detect start and end of this function definition + $functionStartPosition = $tokens[$position]['scope_opener']; + $functionEndPosition = $tokens[$position]['scope_closer']; + + $this->lastBooleanOperator = 0; + $this->cognitiveComplexity = 0; + + /* + Keep track of parser's level stack + We push to this stak whenever we encounter a Tokens::$scopeOpeners + */ + $levelStack = []; + /* + We look for changes in token[level] to know when to remove from the stack + however ['level'] only increases when there are tokens inside {} + after pushing to the stack watch for a level change + */ + $levelIncreased = false; + + for ($i = $functionStartPosition + 1; $i < $functionEndPosition; $i++) { + $currentToken = $tokens[$i]; + + $isNestingToken = false; + if (in_array($currentToken['code'], Tokens::$scopeOpeners, true)) { + $isNestingToken = true; + if ($levelIncreased === false && count($levelStack) > 0) { + // parser's level never increased + // caused by empty condition such as `if ($x) { }` + array_pop($levelStack); + } + $levelStack[] = $currentToken; + $levelIncreased = false; + } elseif (isset($tokens[$i - 1]) && $currentToken['level'] < $tokens[$i - 1]['level']) { + $diff = $tokens[$i - 1]['level'] - $currentToken['level']; + array_splice($levelStack, 0 - $diff); + } elseif (isset($tokens[$i - 1]) && $currentToken['level'] > $tokens[$i - 1]['level']) { + $levelIncreased = true; + } + + $this->resolveBooleanOperatorChain($currentToken); + + if (!$this->isIncrementingToken($currentToken, $tokens, $i)) { + continue; + } + + $this->cognitiveComplexity++; + + $addNestingIncrement = isset(self::NESTING_INCREMENTS[$currentToken['code']]) + && in_array($currentToken['code'], [T_ELSEIF, T_ELSE], true) === false; + if (!$addNestingIncrement) { + continue; + } + $measuredNestingLevel = count(array_filter($levelStack, static function (array $token) { + return in_array($token['code'], self::NESTING_INCREMENTS, true); + })); + if ($isNestingToken) { + $measuredNestingLevel--; + } + // B3. Nesting increment + if ($measuredNestingLevel > 0) { + $this->cognitiveComplexity += $measuredNestingLevel; + } + } + + return $this->cognitiveComplexity; + } + + /** + * Keep track of consecutive matching boolean operators, that don't receive increment. + * + * @param array{code:int|string} $token + */ + private function resolveBooleanOperatorChain(array $token): void + { + $code = $token['code']; + + // Whenever we cross anything that interrupts possible condition we reset chain. + if ($this->lastBooleanOperator > 0 && isset(self::OPERATOR_CHAIN_BREAKS[$code])) { + $this->lastBooleanOperator = 0; + return; + } + + if (isset(self::BOOLEAN_OPERATORS[$code]) === false) { + return; + } + + // If we match last operator, there is no increment added for current one. + if ($this->lastBooleanOperator === $code) { + return; + } + + $this->cognitiveComplexity++; + + $this->lastBooleanOperator = $code; + } + + /** + * @param array{code:int|string} $token + * @param array|int|string>> $tokens + */ + private function isIncrementingToken(array $token, array $tokens, int $position): bool + { + $code = $token['code']; + + if (isset(self::INCREMENTS[$code])) { + return true; + } + + // B1. ternary operator + if ($code === T_INLINE_THEN) { + return true; + } + + // B1. goto LABEL, break LABEL, continue LABEL + if (isset(self::BREAKING_TOKENS[$code])) { + $nextToken = $this->phpcsFile->findNext(Tokens::$emptyTokens, $position + 1, null, true); + if ($nextToken === false || $tokens[$nextToken]['code'] !== T_SEMICOLON) { + return true; + } + } + + return false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php new file mode 100644 index 0000000..2c1bb80 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractControlStructureSpacing.php @@ -0,0 +1,510 @@ +|null */ + private $tokensToCheck; + + /** + * @return list + */ + abstract protected function getSupportedKeywords(): array; + + /** + * @return list + */ + abstract protected function getKeywordsToCheck(): array; + + abstract protected function getLinesCountBefore(): int; + + abstract protected function getLinesCountBeforeFirst(File $phpcsFile, int $controlStructurePointer): int; + + abstract protected function getLinesCountAfter(): int; + + abstract protected function getLinesCountAfterLast(File $phpcsFile, int $controlStructurePointer, int $controlStructureEndPointer): int; + + /** + * @return array + */ + public function register(): array + { + return $this->getTokensToCheck(); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $controlStructurePointer + */ + public function process(File $phpcsFile, $controlStructurePointer): void + { + $this->checkLinesBefore($phpcsFile, $controlStructurePointer); + + try { + $this->checkLinesAfter($phpcsFile, $controlStructurePointer); + } catch (Throwable $e) { + // Unsupported syntax without curly braces. + return; + } + } + + protected function checkLinesBefore(File $phpcsFile, int $controlStructurePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (in_array($tokens[$controlStructurePointer]['code'], [T_CASE, T_DEFAULT], true)) { + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $controlStructurePointer - 1); + if ($tokens[$pointerBefore]['code'] === T_COLON) { + return; + } + } + + $nonWhitespacePointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $controlStructurePointer - 1); + + $controlStructureStartPointer = $controlStructurePointer; + $pointerBefore = $nonWhitespacePointerBefore; + + $pointerToCheckFirst = $pointerBefore; + + if (in_array($tokens[$nonWhitespacePointerBefore]['code'], Tokens::$commentTokens, true)) { + $effectivePointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $pointerBefore - 1); + + if ($tokens[$effectivePointerBefore]['line'] === $tokens[$nonWhitespacePointerBefore]['line']) { + $pointerToCheckFirst = $effectivePointerBefore; + } elseif ($tokens[$nonWhitespacePointerBefore]['line'] + 1 === $tokens[$controlStructurePointer]['line']) { + if ($tokens[$effectivePointerBefore]['line'] !== $tokens[$nonWhitespacePointerBefore]['line']) { + $controlStructureStartPointer = array_key_exists('comment_opener', $tokens[$nonWhitespacePointerBefore]) + ? $tokens[$nonWhitespacePointerBefore]['comment_opener'] + : CommentHelper::getMultilineCommentStartPointer($phpcsFile, $nonWhitespacePointerBefore); + $pointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $controlStructureStartPointer - 1); + } + $pointerToCheckFirst = $pointerBefore; + } + } + + $isFirstControlStructure = in_array($tokens[$pointerToCheckFirst]['code'], [T_OPEN_CURLY_BRACKET, T_COLON], true); + $whitespaceBefore = ''; + + if ($tokens[$pointerBefore]['code'] === T_OPEN_TAG) { + $whitespaceBefore .= substr($tokens[$pointerBefore]['content'], strlen('eolChar)) === $phpcsFile->eolChar; + if ($hasCommentWithLineEndBefore) { + $whitespaceBefore .= $phpcsFile->eolChar; + } + + if ($pointerBefore + 1 !== $controlStructurePointer) { + $whitespaceBefore .= TokenHelper::getContent($phpcsFile, $pointerBefore + 1, $controlStructureStartPointer - 1); + } + + $requiredLinesCountBefore = $isFirstControlStructure + ? $this->getLinesCountBeforeFirst($phpcsFile, $controlStructurePointer) + : $this->getLinesCountBefore(); + $actualLinesCountBefore = substr_count($whitespaceBefore, $phpcsFile->eolChar) - 1; + + if ($requiredLinesCountBefore === $actualLinesCountBefore) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before "%s", found %d.', + $requiredLinesCountBefore, + $requiredLinesCountBefore === 1 ? '' : 's', + $tokens[$controlStructurePointer]['content'], + $actualLinesCountBefore + ), + $controlStructurePointer, + $isFirstControlStructure + ? self::CODE_INCORRECT_LINES_COUNT_BEFORE_FIRST_CONTROL_STRUCTURE + : self::CODE_INCORRECT_LINES_COUNT_BEFORE_CONTROL_STRUCTURE + ); + + if (!$fix) { + return; + } + + $endOfLineBeforePointer = TokenHelper::findPreviousContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $controlStructureStartPointer - 1 + ); + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$pointerBefore]['code'] === T_OPEN_TAG) { + $phpcsFile->fixer->replaceToken($pointerBefore, 'fixer->addNewline($pointerBefore); + } + + $phpcsFile->fixer->endChangeset(); + } + + protected function checkLinesAfter(File $phpcsFile, int $controlStructurePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (in_array($tokens[$controlStructurePointer]['code'], [T_CASE, T_DEFAULT], true)) { + $colonPointer = TokenHelper::findNext($phpcsFile, T_COLON, $controlStructurePointer + 1); + $pointerAfterColon = TokenHelper::findNextEffective($phpcsFile, $colonPointer + 1); + + if (in_array($tokens[$pointerAfterColon]['code'], [T_CASE, T_DEFAULT], true)) { + return; + } + } + + $controlStructureEndPointer = $this->findControlStructureEnd($phpcsFile, $controlStructurePointer); + + $pointerAfterControlStructureEnd = TokenHelper::findNextEffective($phpcsFile, $controlStructureEndPointer + 1); + if ( + $pointerAfterControlStructureEnd !== null + && $tokens[$pointerAfterControlStructureEnd]['code'] === T_SEMICOLON + ) { + $controlStructureEndPointer = $pointerAfterControlStructureEnd; + } + + $notWhitespacePointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $controlStructureEndPointer + 1); + + if ($notWhitespacePointerAfter === null) { + return; + } + + $hasCommentAfter = in_array($tokens[$notWhitespacePointerAfter]['code'], Tokens::$commentTokens, true); + $isCommentAfterOnSameLine = false; + $pointerAfter = $notWhitespacePointerAfter; + + $isControlStructureEndAfterPointer = static function (int $pointer) use ($tokens, $controlStructurePointer): bool { + return in_array($tokens[$controlStructurePointer]['code'], [T_CASE, T_DEFAULT], true) + ? $tokens[$pointer]['code'] === T_CLOSE_CURLY_BRACKET + : in_array($tokens[$pointer]['code'], [T_CLOSE_CURLY_BRACKET, T_CASE, T_DEFAULT], true); + }; + + if ($hasCommentAfter) { + if ($tokens[$notWhitespacePointerAfter]['line'] === $tokens[$controlStructureEndPointer]['line'] + 1) { + $commentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $notWhitespacePointerAfter); + $pointerAfterComment = TokenHelper::findNextNonWhitespace($phpcsFile, $commentEndPointer + 1); + + if ($isControlStructureEndAfterPointer($pointerAfterComment)) { + $controlStructureEndPointer = $commentEndPointer; + $pointerAfter = $pointerAfterComment; + } + } elseif ($tokens[$notWhitespacePointerAfter]['line'] === $tokens[$controlStructureEndPointer]['line']) { + $isCommentAfterOnSameLine = true; + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $notWhitespacePointerAfter + 1); + } + } + + $isLastControlStructure = $isControlStructureEndAfterPointer($pointerAfter); + + $requiredLinesCountAfter = $isLastControlStructure + ? $this->getLinesCountAfterLast($phpcsFile, $controlStructurePointer, $controlStructureEndPointer) + : $this->getLinesCountAfter(); + $actualLinesCountAfter = $tokens[$pointerAfter]['line'] - $tokens[$controlStructureEndPointer]['line'] - 1; + + if ($requiredLinesCountAfter === $actualLinesCountAfter) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after "%s", found %d.', + $requiredLinesCountAfter, + $requiredLinesCountAfter === 1 ? '' : 's', + $tokens[$controlStructurePointer]['content'], + $actualLinesCountAfter + ), + $controlStructurePointer, + $isLastControlStructure + ? self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_CONTROL_STRUCTURE + : self::CODE_INCORRECT_LINES_COUNT_AFTER_CONTROL_STRUCTURE + ); + + if (!$fix) { + return; + } + + $replaceStartPointer = $isCommentAfterOnSameLine ? $notWhitespacePointerAfter : $controlStructureEndPointer; + $endOfLineBeforeAfterPointer = TokenHelper::findLastTokenOnPreviousLine($phpcsFile, $pointerAfter); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $replaceStartPointer + 1, $endOfLineBeforeAfterPointer); + + if ($isCommentAfterOnSameLine) { + for ($i = 0; $i < $requiredLinesCountAfter; $i++) { + $phpcsFile->fixer->addNewline($notWhitespacePointerAfter); + } + } else { + $linesToAdd = substr($tokens[$controlStructureEndPointer]['content'], -strlen($phpcsFile->eolChar)) === $phpcsFile->eolChar + ? $requiredLinesCountAfter - 1 + : $requiredLinesCountAfter; + for ($i = 0; $i <= $linesToAdd; $i++) { + $phpcsFile->fixer->addNewline($controlStructureEndPointer); + } + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @return array + */ + private function getTokensToCheck(): array + { + if ($this->tokensToCheck === null) { + $supportedKeywords = $this->getSupportedKeywords(); + $supportedTokens = [ + self::KEYWORD_IF => T_IF, + self::KEYWORD_DO => T_DO, + self::KEYWORD_WHILE => T_WHILE, + self::KEYWORD_FOR => T_FOR, + self::KEYWORD_FOREACH => T_FOREACH, + self::KEYWORD_SWITCH => T_SWITCH, + self::KEYWORD_CASE => T_CASE, + self::KEYWORD_DEFAULT => T_DEFAULT, + self::KEYWORD_TRY => T_TRY, + self::KEYWORD_PARENT => T_PARENT, + self::KEYWORD_GOTO => T_GOTO, + self::KEYWORD_BREAK => T_BREAK, + self::KEYWORD_CONTINUE => T_CONTINUE, + self::KEYWORD_RETURN => T_RETURN, + self::KEYWORD_THROW => T_THROW, + self::KEYWORD_YIELD => T_YIELD, + self::KEYWORD_YIELD_FROM => T_YIELD_FROM, + ]; + + $this->tokensToCheck = array_values(array_map( + static function (string $keyword) use ($supportedKeywords, $supportedTokens) { + if (!in_array($keyword, $supportedKeywords, true)) { + throw new UnsupportedKeywordException($keyword); + } + + return $supportedTokens[$keyword]; + }, + SniffSettingsHelper::normalizeArray($this->getKeywordsToCheck()) + )); + + if (count($this->tokensToCheck) === 0) { + $this->tokensToCheck = array_map(static function (string $keyword) use ($supportedTokens) { + return $supportedTokens[$keyword]; + }, $supportedKeywords); + } + } + + return $this->tokensToCheck; + } + + private function findControlStructureEnd(File $phpcsFile, int $controlStructurePointer): int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$controlStructurePointer]['code'] === T_IF) { + if (!array_key_exists('scope_closer', $tokens[$controlStructurePointer])) { + throw new Exception('"if" without curly braces is not supported.'); + } + + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$controlStructurePointer]['parenthesis_closer'] + 1 + ); + if ($pointerAfterParenthesisCloser !== null && $tokens[$pointerAfterParenthesisCloser]['code'] === T_COLON) { + throw new Exception('"if" without curly braces is not supported.'); + } + + $controlStructureEndPointer = $tokens[$controlStructurePointer]['scope_closer']; + do { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $controlStructureEndPointer + 1); + if ($nextPointer === null) { + return $controlStructureEndPointer; + } + + if ($tokens[$nextPointer]['code'] === T_ELSE) { + if (!array_key_exists('scope_closer', $tokens[$nextPointer])) { + throw new Exception('"else" without curly braces is not supported.'); + } + + return $tokens[$nextPointer]['scope_closer']; + } + + if ($tokens[$nextPointer]['code'] !== T_ELSEIF) { + return $controlStructureEndPointer; + } + + $controlStructureEndPointer = $tokens[$nextPointer]['scope_closer']; + } while (true); + } + + if ($tokens[$controlStructurePointer]['code'] === T_DO) { + $whilePointer = TokenHelper::findNext($phpcsFile, T_WHILE, $tokens[$controlStructurePointer]['scope_closer'] + 1); + return (int) TokenHelper::findNext($phpcsFile, T_SEMICOLON, $tokens[$whilePointer]['parenthesis_closer'] + 1); + } + + if ($tokens[$controlStructurePointer]['code'] === T_TRY) { + $controlStructureEndPointer = $tokens[$controlStructurePointer]['scope_closer']; + do { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $controlStructureEndPointer + 1); + + if ($nextPointer === null) { + return $controlStructureEndPointer; + } + + if (!in_array($tokens[$nextPointer]['code'], [T_CATCH, T_FINALLY], true)) { + return $controlStructureEndPointer; + } + + $controlStructureEndPointer = $tokens[$nextPointer]['scope_closer']; + } while (true); + } + + if (in_array($tokens[$controlStructurePointer]['code'], [T_WHILE, T_FOR, T_FOREACH, T_SWITCH], true)) { + return $tokens[$controlStructurePointer]['scope_closer']; + } + + if (in_array($tokens[$controlStructurePointer]['code'], [T_CASE, T_DEFAULT], true)) { + $switchPointer = TokenHelper::findPrevious($phpcsFile, T_SWITCH, $controlStructurePointer - 1); + + $pointers = TokenHelper::findNextAll( + $phpcsFile, + [T_CASE, T_DEFAULT], + $controlStructurePointer + 1, + $tokens[$switchPointer]['scope_closer'] + ); + + foreach ($pointers as $pointer) { + if (TokenHelper::findPrevious($phpcsFile, T_SWITCH, $pointer - 1) === $switchPointer) { + $pointerBeforeCaseOrDefault = TokenHelper::findPreviousNonWhitespace($phpcsFile, $pointer - 1); + if ( + in_array($tokens[$pointerBeforeCaseOrDefault]['code'], Tokens::$commentTokens, true) + && $tokens[$pointerBeforeCaseOrDefault]['line'] + 1 === $tokens[$pointer]['line'] + ) { + $pointerBeforeCaseOrDefault = TokenHelper::findPreviousExcluding( + $phpcsFile, + T_WHITESPACE, + $pointerBeforeCaseOrDefault - 1 + ); + } + + return $pointerBeforeCaseOrDefault; + } + } + + return TokenHelper::findPreviousNonWhitespace($phpcsFile, $tokens[$switchPointer]['scope_closer'] - 1); + } + + $nextPointer = TokenHelper::findNext( + $phpcsFile, + [T_SEMICOLON, T_ANON_CLASS, T_CLOSURE, T_FN, T_OPEN_SHORT_ARRAY], + $controlStructurePointer + 1 + ); + if ($tokens[$nextPointer]['code'] === T_SEMICOLON) { + return $nextPointer; + } + + $scopeCloserPointer = $tokens[$nextPointer]['code'] === T_OPEN_SHORT_ARRAY + ? $tokens[$nextPointer]['bracket_closer'] + : $tokens[$nextPointer]['scope_closer']; + + if ($tokens[$scopeCloserPointer]['code'] === T_SEMICOLON) { + return $scopeCloserPointer; + } + + $nextPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $scopeCloserPointer + 1); + + $level = $tokens[$controlStructurePointer]['level']; + while ($level !== $tokens[$nextPointer]['level']) { + $nextPointer = (int) TokenHelper::findNext($phpcsFile, T_SEMICOLON, $nextPointer + 1); + } + + return $nextPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractLineCondition.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractLineCondition.php new file mode 100644 index 0000000..613a94d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AbstractLineCondition.php @@ -0,0 +1,128 @@ + */ + public $checkedControlStructures = [ + self::IF_CONTROL_STRUCTURE, + self::WHILE_CONTROL_STRUCTURE, + self::DO_CONTROL_STRUCTURE, + ]; + + /** + * @return array + */ + public function register(): array + { + $this->checkedControlStructures = SniffSettingsHelper::normalizeArray($this->checkedControlStructures); + + $register = []; + + if (in_array(self::IF_CONTROL_STRUCTURE, $this->checkedControlStructures, true)) { + $register[] = T_IF; + $register[] = T_ELSEIF; + } + + if (in_array(self::WHILE_CONTROL_STRUCTURE, $this->checkedControlStructures, true)) { + $register[] = T_WHILE; + } + + if (in_array(self::DO_CONTROL_STRUCTURE, $this->checkedControlStructures, true)) { + $register[] = T_WHILE; + } + + return $register; + } + + protected function shouldBeSkipped(File $phpcsFile, int $controlStructurePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if ( + !array_key_exists('parenthesis_opener', $tokens[$controlStructurePointer]) + || $tokens[$controlStructurePointer]['parenthesis_opener'] === null + || !array_key_exists('parenthesis_closer', $tokens[$controlStructurePointer]) + || $tokens[$controlStructurePointer]['parenthesis_closer'] === null + ) { + return true; + } + + if ($tokens[$controlStructurePointer]['code'] === T_WHILE) { + $isPartOfDo = $this->isPartOfDo($phpcsFile, $controlStructurePointer); + + if ($isPartOfDo && !in_array(self::DO_CONTROL_STRUCTURE, $this->checkedControlStructures, true)) { + return true; + } + + if (!$isPartOfDo && !in_array(self::WHILE_CONTROL_STRUCTURE, $this->checkedControlStructures, true)) { + return true; + } + } + + return false; + } + + protected function getControlStructureName(File $phpcsFile, int $controlStructurePointer): string + { + $tokens = $phpcsFile->getTokens(); + + return $tokens[$controlStructurePointer]['code'] === T_WHILE && $this->isPartOfDo($phpcsFile, $controlStructurePointer) + ? 'do-while' + : $tokens[$controlStructurePointer]['content']; + } + + protected function isPartOfDo(File $phpcsFile, int $whilePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisCloserPointer = $tokens[$whilePointer]['parenthesis_closer']; + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); + + return $tokens[$pointerAfterParenthesisCloser]['code'] !== T_OPEN_CURLY_BRACKET; + } + + protected function getLineStart(File $phpcsFile, int $pointer): string + { + $firstPointerOnLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $pointer); + + return IndentationHelper::convertTabsToSpaces($phpcsFile, TokenHelper::getContent($phpcsFile, $firstPointerOnLine, $pointer)); + } + + protected function getCondition(File $phpcsFile, int $parenthesisOpenerPointer, int $parenthesisCloserPointer): string + { + $condition = TokenHelper::getContent($phpcsFile, $parenthesisOpenerPointer + 1, $parenthesisCloserPointer - 1); + + return trim(preg_replace(sprintf('~%s[ \t]*~', $phpcsFile->eolChar), ' ', $condition)); + } + + protected function getLineEnd(File $phpcsFile, int $pointer): string + { + $lastPointerOnLine = TokenHelper::findLastTokenOnLine($phpcsFile, $pointer); + + return rtrim(TokenHelper::getContent($phpcsFile, $pointer, $lastPointerOnLine)); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AssignmentInConditionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AssignmentInConditionSniff.php new file mode 100644 index 0000000..5616544 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/AssignmentInConditionSniff.php @@ -0,0 +1,115 @@ + + */ + public function register(): array + { + return [ + T_IF, + T_ELSEIF, + T_DO, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $conditionStartPointer + */ + public function process(File $phpcsFile, $conditionStartPointer): void + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$conditionStartPointer]; + + if ($token['code'] === T_DO) { + $whilePointer = TokenHelper::findNext($phpcsFile, T_WHILE, $token['scope_closer'] + 1); + $whileToken = $tokens[$whilePointer]; + $parenthesisOpener = $whileToken['parenthesis_opener']; + $parenthesisCloser = $whileToken['parenthesis_closer']; + $type = 'do-while'; + } else { + $parenthesisOpener = $token['parenthesis_opener']; + $parenthesisCloser = $token['parenthesis_closer']; + $type = $token['code'] === T_IF ? 'if' : 'elseif'; + } + + if ( + $parenthesisOpener === null + || $parenthesisCloser === null + ) { + return; + } + + $this->processCondition($phpcsFile, $parenthesisOpener, $parenthesisCloser, $type); + } + + private function processCondition(File $phpcsFile, int $parenthesisOpener, int $parenthesisCloser, string $conditionType): void + { + $equalsTokenPointers = TokenHelper::findNextAll($phpcsFile, T_EQUAL, $parenthesisOpener + 1, $parenthesisCloser); + if ($equalsTokenPointers === []) { + return; + } + + if (!$this->ignoreAssignmentsInsideFunctionCalls) { + $this->error($phpcsFile, $conditionType, $equalsTokenPointers[0]); + return; + } + + $tokens = $phpcsFile->getTokens(); + + foreach ($equalsTokenPointers as $equalsTokenPointer) { + $parenthesisStarts = array_keys($tokens[$equalsTokenPointer]['nested_parenthesis']); + + /** @var int $insideParenthesis */ + $insideParenthesis = max($parenthesisStarts); + if ($insideParenthesis === $parenthesisOpener) { + $this->error($phpcsFile, $conditionType, $equalsTokenPointer); + continue; + } + + $functionCall = TokenHelper::findPrevious( + $phpcsFile, + TokenHelper::getOnlyNameTokenCodes(), + $insideParenthesis, + $parenthesisOpener + ); + if ($functionCall !== null) { + continue; + } + + $this->error($phpcsFile, $conditionType, $equalsTokenPointer); + } + } + + private function error(File $phpcsFile, string $conditionType, int $equalsTokenPointer): void + { + $phpcsFile->addError( + sprintf('Assignment in %s condition is not allowed.', $conditionType), + $equalsTokenPointer, + self::CODE_ASSIGNMENT_IN_CONDITION + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php new file mode 100644 index 0000000..ab7821a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php @@ -0,0 +1,113 @@ + */ + public $controlStructures = []; + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $controlStructurePointer + */ + public function process(File $phpcsFile, $controlStructurePointer): void + { + $this->linesCountBefore = SniffSettingsHelper::normalizeInteger($this->linesCountBefore); + $this->linesCountBeforeFirst = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirst); + $this->linesCountAfter = SniffSettingsHelper::normalizeInteger($this->linesCountAfter); + $this->linesCountAfterLast = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLast); + + if ($this->isWhilePartOfDo($phpcsFile, $controlStructurePointer)) { + return; + } + + parent::process($phpcsFile, $controlStructurePointer); + } + + /** + * @return list + */ + protected function getSupportedKeywords(): array + { + return [ + self::KEYWORD_IF, + self::KEYWORD_DO, + self::KEYWORD_WHILE, + self::KEYWORD_FOR, + self::KEYWORD_FOREACH, + self::KEYWORD_SWITCH, + self::KEYWORD_TRY, + self::KEYWORD_CASE, + self::KEYWORD_DEFAULT, + ]; + } + + /** + * @return list + */ + protected function getKeywordsToCheck(): array + { + return $this->controlStructures; + } + + protected function getLinesCountBefore(): int + { + return $this->linesCountBefore; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + */ + protected function getLinesCountBeforeFirst(File $phpcsFile, int $controlStructurePointer): int + { + return $this->linesCountBeforeFirst; + } + + protected function getLinesCountAfter(): int + { + return $this->linesCountAfter; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + */ + protected function getLinesCountAfterLast(File $phpcsFile, int $controlStructurePointer, int $controlStructureEndPointer): int + { + return $this->linesCountAfterLast; + } + + private function isWhilePartOfDo(File $phpcsFile, int $controlStructurePointer): bool + { + $tokens = $phpcsFile->getTokens(); + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $controlStructurePointer - 1); + + return + $tokens[$controlStructurePointer]['code'] === T_WHILE + && $tokens[$pointerBefore]['code'] === T_CLOSE_CURLY_BRACKET + && array_key_exists('scope_condition', $tokens[$pointerBefore]) + && $tokens[$tokens[$pointerBefore]['scope_condition']]['code'] === T_DO; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowContinueWithoutIntegerOperandInSwitchSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowContinueWithoutIntegerOperandInSwitchSniff.php new file mode 100644 index 0000000..69bfc56 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowContinueWithoutIntegerOperandInSwitchSniff.php @@ -0,0 +1,63 @@ + + */ + public function register(): array + { + return [ + T_CONTINUE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $continuePointer + */ + public function process(File $phpcsFile, $continuePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $operandPointer = TokenHelper::findNextEffective($phpcsFile, $continuePointer + 1); + + if ($tokens[$operandPointer]['code'] === T_LNUMBER) { + return; + } + + $conditionTokenCode = current(array_reverse($tokens[$continuePointer]['conditions'])); + if ($conditionTokenCode !== T_SWITCH) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Usage of "continue" without integer operand in "switch" is disallowed, use "break" instead.', + $continuePointer, + self::CODE_DISALLOWED_CONTINUE_WITHOUT_INTEGER_OPERAND_IN_SWITCH + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($continuePointer, 'break'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowEmptySniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowEmptySniff.php new file mode 100644 index 0000000..e7cf973 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowEmptySniff.php @@ -0,0 +1,33 @@ + + */ + public function register(): array + { + return [ + T_EMPTY, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $emptyPointer + */ + public function process(File $phpcsFile, $emptyPointer): void + { + $phpcsFile->addError('Use of empty() is disallowed.', $emptyPointer, self::CODE_DISALLOWED_EMPTY); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowNullSafeObjectOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowNullSafeObjectOperatorSniff.php new file mode 100644 index 0000000..6a26e4f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowNullSafeObjectOperatorSniff.php @@ -0,0 +1,33 @@ + + */ + public function register(): array + { + return [ + T_NULLSAFE_OBJECT_OPERATOR, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $operatorPointer + */ + public function process(File $phpcsFile, $operatorPointer): void + { + $phpcsFile->addError('Operator ?-> is disallowed.', $operatorPointer, self::CODE_DISALLOWED_NULL_SAFE_OBJECT_OPERATOR); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowShortTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowShortTernaryOperatorSniff.php new file mode 100644 index 0000000..59c1eba --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowShortTernaryOperatorSniff.php @@ -0,0 +1,72 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + + if ($tokens[$nextPointer]['code'] !== T_INLINE_ELSE) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + + $message = 'Use of short ternary operator is disallowed.'; + + if ($tokens[$previousPointer]['code'] !== T_VARIABLE) { + $phpcsFile->addError($message, $inlineThenPointer, self::CODE_DISALLOWED_SHORT_TERNARY_OPERATOR); + return; + } + + if (!$this->fixable) { + $phpcsFile->addError($message, $inlineThenPointer, self::CODE_DISALLOWED_SHORT_TERNARY_OPERATOR); + return; + } + + $fix = $phpcsFile->addFixableError($message, $inlineThenPointer, self::CODE_DISALLOWED_SHORT_TERNARY_OPERATOR); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($inlineThenPointer, sprintf(' %s ', $tokens[$previousPointer]['content'])); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php new file mode 100644 index 0000000..f377630 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowTrailingMultiLineTernaryOperatorSniff.php @@ -0,0 +1,88 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + if ($tokens[$nextPointer]['code'] === T_INLINE_ELSE) { + return; + } + + if ($tokens[$inlineThenPointer]['line'] === $tokens[$nextPointer]['line']) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Ternary operator should be reformatted as leading the line.', + $inlineThenPointer, + self::CODE_TRAILING_MULTI_LINE_TERNARY_OPERATOR_USED + ); + + if (!$fix) { + return; + } + + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + + $pointerBeforeInlineThen = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + $pointerAfterInlineThen = TokenHelper::findNextExcluding($phpcsFile, [T_WHITESPACE], $inlineThenPointer + 1); + $pointerBeforeInlineElse = TokenHelper::findPreviousEffective($phpcsFile, $inlineElsePointer - 1); + $pointerAfterInlineElse = TokenHelper::findNextExcluding($phpcsFile, [T_WHITESPACE], $inlineElsePointer + 1); + + $indentation = IndentationHelper::addIndentation( + IndentationHelper::getIndentation( + $phpcsFile, + TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $inlineThenPointer) + ) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineThen, $inlineThenPointer); + FixerHelper::removeBetween($phpcsFile, $inlineThenPointer, $pointerAfterInlineThen); + + $phpcsFile->fixer->addContentBefore($inlineThenPointer, $phpcsFile->eolChar . $indentation); + $phpcsFile->fixer->addContentBefore($pointerAfterInlineThen, ' '); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineElse, $inlineElsePointer); + FixerHelper::removeBetween($phpcsFile, $inlineElsePointer, $pointerAfterInlineElse); + + $phpcsFile->fixer->addContentBefore($inlineElsePointer, $phpcsFile->eolChar . $indentation); + $phpcsFile->fixer->addContentBefore($pointerAfterInlineElse, ' '); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowYodaComparisonSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowYodaComparisonSniff.php new file mode 100644 index 0000000..8cdc703 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/DisallowYodaComparisonSniff.php @@ -0,0 +1,88 @@ + (Foo::BAR, BAR) + * > (true, false, null, 1, 1.0, arrays, 'foo') + */ +class DisallowYodaComparisonSniff implements Sniff +{ + + public const CODE_DISALLOWED_YODA_COMPARISON = 'DisallowedYodaComparison'; + + /** + * @return array + */ + public function register(): array + { + return [ + T_IS_IDENTICAL, + T_IS_NOT_IDENTICAL, + T_IS_EQUAL, + T_IS_NOT_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $comparisonTokenPointer + */ + public function process(File $phpcsFile, $comparisonTokenPointer): void + { + $tokens = $phpcsFile->getTokens(); + $leftSideTokens = YodaHelper::getLeftSideTokens($tokens, $comparisonTokenPointer); + $rightSideTokens = YodaHelper::getRightSideTokens($tokens, $comparisonTokenPointer); + $leftDynamism = YodaHelper::getDynamismForTokens($tokens, $leftSideTokens); + $rightDynamism = YodaHelper::getDynamismForTokens($tokens, $rightSideTokens); + + if ($leftDynamism === null || $rightDynamism === null) { + return; + } + + if ($leftDynamism >= $rightDynamism) { + return; + } + + if ($leftDynamism >= 900 && $rightDynamism >= 900) { + return; + } + + $errorParameters = [ + 'Yoda comparisons are disallowed.', + $comparisonTokenPointer, + self::CODE_DISALLOWED_YODA_COMPARISON, + ]; + + $lastRightSideTokenPointer = array_keys($rightSideTokens)[count($rightSideTokens) - 1]; + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $lastRightSideTokenPointer + 1); + if ($tokens[$nextPointer]['code'] === T_EQUAL) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + if (!$fix) { + return; + } + + YodaHelper::fix($phpcsFile, $leftSideTokens, $rightSideTokens); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php new file mode 100644 index 0000000..fd33700 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php @@ -0,0 +1,480 @@ + + */ + public function register(): array + { + return [ + T_IF, + T_ELSEIF, + T_ELSE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_IF) { + $this->processIf($phpcsFile, $pointer); + } elseif ($tokens[$pointer]['code'] === T_ELSEIF) { + $this->processElseIf($phpcsFile, $pointer); + } else { + $this->processElse($phpcsFile, $pointer); + } + } + + private function processElse(File $phpcsFile, int $elsePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('scope_opener', $tokens[$elsePointer])) { + // Else without curly braces is not supported. + return; + } + + try { + $allConditionsPointers = $this->getAllConditionsPointers($phpcsFile, $elsePointer); + } catch (Throwable $e) { + // Else without curly braces is not supported. + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + T_FUNCTION, + $tokens[$elsePointer]['scope_opener'] + 1, + $tokens[$elsePointer]['scope_closer'] + ) !== null) { + return; + } + + $ifPointer = $allConditionsPointers[0]; + $ifEarlyExitPointer = null; + $elseEarlyExitPointer = null; + $previousConditionPointer = null; + $previousConditionEarlyExitPointer = null; + + foreach ($allConditionsPointers as $conditionPointer) { + $conditionEarlyExitPointer = $this->findEarlyExitInScope( + $phpcsFile, + $tokens[$conditionPointer]['scope_opener'], + $tokens[$conditionPointer]['scope_closer'] + ); + + if ($conditionPointer === $elsePointer) { + $elseEarlyExitPointer = $conditionEarlyExitPointer; + continue; + } + + if (count($allConditionsPointers) > 2 && $conditionEarlyExitPointer === null) { + return; + } + + $previousConditionPointer = $conditionPointer; + $previousConditionEarlyExitPointer = $conditionEarlyExitPointer; + + if ($conditionPointer === $ifPointer) { + $ifEarlyExitPointer = $conditionEarlyExitPointer; + continue; + } + } + + if ($ifEarlyExitPointer === null && $elseEarlyExitPointer === null) { + return; + } + + if ($elseEarlyExitPointer !== null && $previousConditionEarlyExitPointer === null) { + $fix = $phpcsFile->addFixableError('Use early exit instead of "else".', $elsePointer, self::CODE_EARLY_EXIT_NOT_USED); + + if (!$fix) { + return; + } + + $ifCodePointers = $this->getScopeCodePointers($phpcsFile, $ifPointer); + $elseCode = $this->getScopeCode($phpcsFile, $elsePointer); + $negativeIfCondition = ConditionHelper::getNegativeCondition( + $phpcsFile, + $tokens[$ifPointer]['parenthesis_opener'], + $tokens[$ifPointer]['parenthesis_closer'] + ); + $afterIfCode = IndentationHelper::fixIndentation( + $phpcsFile, + $ifCodePointers, + IndentationHelper::getIndentation($phpcsFile, $ifPointer) + ); + + $ifContent = sprintf('if %s {%s}%s%s', $negativeIfCondition, $elseCode, $phpcsFile->eolChar, $afterIfCode); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer'], $ifContent); + + $phpcsFile->fixer->endChangeset(); + + return; + } + + $fix = $phpcsFile->addFixableError('Remove useless "else" to reduce code nesting.', $elsePointer, self::CODE_USELESS_ELSE); + + if (!$fix) { + return; + } + + $elseCodePointers = $this->getScopeCodePointers($phpcsFile, $elsePointer); + $afterIfCode = IndentationHelper::fixIndentation( + $phpcsFile, + $elseCodePointers, + IndentationHelper::getIndentation($phpcsFile, $ifPointer) + ); + + $phpcsFile->fixer->beginChangeset(); + + $previousConditionContent = sprintf('%s%s', $phpcsFile->eolChar, $afterIfCode); + + FixerHelper::change( + $phpcsFile, + $tokens[$previousConditionPointer]['scope_closer'] + 1, + $tokens[$elsePointer]['scope_closer'], + $previousConditionContent + ); + + $phpcsFile->fixer->endChangeset(); + } + + private function processElseIf(File $phpcsFile, int $elseIfPointer): void + { + $tokens = $phpcsFile->getTokens(); + + try { + $allConditionsPointers = $this->getAllConditionsPointers($phpcsFile, $elseIfPointer); + } catch (Throwable $e) { + // Elseif without curly braces is not supported. + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + T_FUNCTION, + $tokens[$elseIfPointer]['scope_opener'] + 1, + $tokens[$elseIfPointer]['scope_closer'] + ) !== null) { + return; + } + + foreach ($allConditionsPointers as $conditionPointer) { + $conditionEarlyExitPointer = $this->findEarlyExitInScope( + $phpcsFile, + $tokens[$conditionPointer]['scope_opener'], + $tokens[$conditionPointer]['scope_closer'] + ); + + if ($conditionPointer === $elseIfPointer) { + break; + } + + if ($conditionEarlyExitPointer === null) { + return; + } + } + + $fix = $phpcsFile->addFixableError('Use "if" instead of "elseif".', $elseIfPointer, self::CODE_USELESS_ELSEIF); + + if (!$fix) { + return; + } + + /** @var int $pointerBeforeElseIfPointer */ + $pointerBeforeElseIfPointer = TokenHelper::findPreviousNonWhitespace($phpcsFile, $elseIfPointer - 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeElseIfPointer, $elseIfPointer); + + $phpcsFile->fixer->addNewline($pointerBeforeElseIfPointer); + $phpcsFile->fixer->addNewline($pointerBeforeElseIfPointer); + + $phpcsFile->fixer->replaceToken( + $elseIfPointer, + sprintf('%sif', IndentationHelper::getIndentation($phpcsFile, $allConditionsPointers[0])) + ); + + $phpcsFile->fixer->endChangeset(); + } + + private function processIf(File $phpcsFile, int $ifPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('scope_closer', $tokens[$ifPointer])) { + // If without curly braces is not supported. + return; + } + + $nextPointer = TokenHelper::findNextNonWhitespace($phpcsFile, $tokens[$ifPointer]['scope_closer'] + 1); + if ($nextPointer === null || $tokens[$nextPointer]['code'] !== T_CLOSE_CURLY_BRACKET) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $ifPointer - 1); + if ( + $this->ignoreStandaloneIfInScope + && in_array($tokens[$previousPointer]['code'], [T_OPEN_CURLY_BRACKET, T_COLON], true) + ) { + return; + } + + if ( + $this->ignoreOneLineTrailingIf + && $tokens[$tokens[$ifPointer]['scope_opener']]['line'] + 2 === $tokens[$tokens[$ifPointer]['scope_closer']]['line'] + ) { + return; + } + + if ($this->ignoreTrailingIfWithOneInstruction) { + $pointerBeforeScopeCloser = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$ifPointer]['scope_closer'] - 1); + if ($tokens[$pointerBeforeScopeCloser]['code'] === T_SEMICOLON) { + $ignore = true; + + $searchStartPointer = $tokens[$ifPointer]['scope_opener'] + 1; + + while (true) { + $anotherSemicolonPointer = TokenHelper::findNext( + $phpcsFile, + T_SEMICOLON, + $searchStartPointer, + $pointerBeforeScopeCloser + ); + if ($anotherSemicolonPointer === null) { + break; + } + + if (ScopeHelper::isInSameScope($phpcsFile, $anotherSemicolonPointer, $pointerBeforeScopeCloser)) { + $ignore = false; + break; + } + + $searchStartPointer = $anotherSemicolonPointer + 1; + } + + if ($ignore) { + return; + } + } + } + + $scopePointer = $tokens[$nextPointer]['scope_condition']; + + if (!in_array($tokens[$scopePointer]['code'], [T_FUNCTION, T_CLOSURE, T_WHILE, T_DO, T_FOREACH, T_FOR], true)) { + return; + } + + if ($this->isEarlyExitInScope($phpcsFile, $tokens[$ifPointer]['scope_opener'], $tokens[$ifPointer]['scope_closer'])) { + return; + } + + $fix = $phpcsFile->addFixableError('Use early exit to reduce code nesting.', $ifPointer, self::CODE_EARLY_EXIT_NOT_USED); + if (!$fix) { + return; + } + + $ifCodePointers = $this->getScopeCodePointers($phpcsFile, $ifPointer); + $ifIndentation = IndentationHelper::getIndentation($phpcsFile, $ifPointer); + $earlyExitCode = $this->getEarlyExitCode($tokens[$scopePointer]['code']); + $earlyExitCodeIndentation = IndentationHelper::addIndentation($ifIndentation); + + $negativeIfCondition = ConditionHelper::getNegativeCondition( + $phpcsFile, + $tokens[$ifPointer]['parenthesis_opener'], + $tokens[$ifPointer]['parenthesis_closer'] + ); + $afterIfCode = IndentationHelper::fixIndentation($phpcsFile, $ifCodePointers, $ifIndentation); + + $ifContent = sprintf( + 'if %s {%s%s%s;%s%s}%s%s', + $negativeIfCondition, + $phpcsFile->eolChar, + $earlyExitCodeIndentation, + $earlyExitCode, + $phpcsFile->eolChar, + $ifIndentation, + $phpcsFile->eolChar, + $afterIfCode + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$ifPointer]['scope_closer'], $ifContent); + + $phpcsFile->fixer->endChangeset(); + } + + private function getScopeCode(File $phpcsFile, int $scopePointer): string + { + $tokens = $phpcsFile->getTokens(); + return TokenHelper::getContent($phpcsFile, $tokens[$scopePointer]['scope_opener'] + 1, $tokens[$scopePointer]['scope_closer'] - 1); + } + + /** + * @return list + */ + private function getScopeCodePointers(File $phpcsFile, int $scopePointer): array + { + $tokens = $phpcsFile->getTokens(); + return range($tokens[$scopePointer]['scope_opener'] + 1, $tokens[$scopePointer]['scope_closer'] - 1); + } + + /** + * @param string|int $code + */ + private function getEarlyExitCode($code): string + { + if (in_array($code, [T_WHILE, T_DO, T_FOREACH, T_FOR], true)) { + return 'continue'; + } + + return 'return'; + } + + private function findEarlyExitInScope(File $phpcsFile, int $startPointer, int $endPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $ifPointers = TokenHelper::findNextAll($phpcsFile, T_IF, $startPointer + 1, $endPointer); + foreach ($ifPointers as $ifPointer) { + if ($tokens[$ifPointer]['level'] - 1 !== $tokens[$startPointer]['level']) { + continue; + } + + $conditionPointers = $this->getAllConditionsPointers($phpcsFile, $ifPointer); + foreach ($conditionPointers as $conditionPointer) { + if ($this->findEarlyExitInScope( + $phpcsFile, + $tokens[$conditionPointer]['scope_opener'], + $tokens[$conditionPointer]['scope_closer'] + ) === null) { + return null; + } + } + } + + $lastSemicolonInScopePointer = TokenHelper::findPreviousEffective($phpcsFile, $endPointer - 1, $startPointer); + return $tokens[$lastSemicolonInScopePointer]['code'] === T_SEMICOLON + ? TokenHelper::findPreviousLocal($phpcsFile, TokenHelper::$earlyExitTokenCodes, $lastSemicolonInScopePointer - 1, $startPointer) + : null; + } + + private function isEarlyExitInScope(File $phpcsFile, int $startPointer, int $endPointer): bool + { + return $this->findEarlyExitInScope($phpcsFile, $startPointer, $endPointer) !== null; + } + + /** + * @return list + */ + private function getAllConditionsPointers(File $phpcsFile, int $conditionPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $conditionsPointers = [$conditionPointer]; + + if ( + isset($tokens[$conditionPointer]['scope_opener']) + && $tokens[$tokens[$conditionPointer]['scope_opener']]['code'] === T_COLON + ) { + // Alternative control structure syntax. + throw new Exception(sprintf('"%s" without curly braces is not supported.', $tokens[$conditionPointer]['content'])); + } + + if ($tokens[$conditionPointer]['code'] !== T_IF) { + $currentConditionPointer = $conditionPointer; + do { + $previousConditionCloseParenthesisPointer = TokenHelper::findPreviousEffective($phpcsFile, $currentConditionPointer - 1); + $currentConditionPointer = $tokens[$previousConditionCloseParenthesisPointer]['scope_condition']; + + $conditionsPointers[] = $currentConditionPointer; + } while ($tokens[$currentConditionPointer]['code'] !== T_IF); + } + + if ($tokens[$conditionPointer]['code'] !== T_ELSE) { + if (!array_key_exists('scope_closer', $tokens[$conditionPointer])) { + throw new Exception(sprintf('"%s" without curly braces is not supported.', $tokens[$conditionPointer]['content'])); + } + + $currentConditionPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$conditionPointer]['scope_closer'] + 1); + if ($currentConditionPointer !== null) { + while (in_array($tokens[$currentConditionPointer]['code'], [T_ELSEIF, T_ELSE], true)) { + $conditionsPointers[] = $currentConditionPointer; + + if (!array_key_exists('scope_closer', $tokens[$currentConditionPointer])) { + throw new Exception( + sprintf('"%s" without curly braces is not supported.', $tokens[$currentConditionPointer]['content']) + ); + } + + $currentConditionPointer = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$currentConditionPointer]['scope_closer'] + 1 + ); + } + } + } + + sort($conditionsPointers); + + return $conditionsPointers; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php new file mode 100644 index 0000000..334fbbc --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/JumpStatementsSpacingSniff.php @@ -0,0 +1,282 @@ + */ + public $jumpStatements = []; + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $jumpStatementPointer + */ + public function process(File $phpcsFile, $jumpStatementPointer): void + { + $this->linesCountBefore = SniffSettingsHelper::normalizeInteger($this->linesCountBefore); + $this->linesCountBeforeFirst = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirst); + $this->linesCountBeforeWhenFirstInCaseOrDefault = SniffSettingsHelper::normalizeNullableInteger( + $this->linesCountBeforeWhenFirstInCaseOrDefault + ); + $this->linesCountAfter = SniffSettingsHelper::normalizeInteger($this->linesCountAfter); + $this->linesCountAfterLast = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLast); + $this->linesCountAfterWhenLastInCaseOrDefault = SniffSettingsHelper::normalizeNullableInteger( + $this->linesCountAfterWhenLastInCaseOrDefault + ); + $this->linesCountAfterWhenLastInLastCaseOrDefault = SniffSettingsHelper::normalizeNullableInteger( + $this->linesCountAfterWhenLastInLastCaseOrDefault + ); + + if ($this->isOneOfYieldSpecialCases($phpcsFile, $jumpStatementPointer)) { + return; + } + + parent::process($phpcsFile, $jumpStatementPointer); + } + + /** + * @return list + */ + protected function getSupportedKeywords(): array + { + return [ + self::KEYWORD_GOTO, + self::KEYWORD_BREAK, + self::KEYWORD_CONTINUE, + self::KEYWORD_RETURN, + self::KEYWORD_THROW, + self::KEYWORD_YIELD, + self::KEYWORD_YIELD_FROM, + ]; + } + + /** + * @return list + */ + protected function getKeywordsToCheck(): array + { + return $this->jumpStatements; + } + + protected function getLinesCountBefore(): int + { + return $this->linesCountBefore; + } + + protected function getLinesCountBeforeFirst(File $phpcsFile, int $jumpStatementPointer): int + { + if ( + $this->linesCountBeforeWhenFirstInCaseOrDefault !== null + && $this->isFirstInCaseOrDefault($phpcsFile, $jumpStatementPointer) + ) { + return $this->linesCountBeforeWhenFirstInCaseOrDefault; + } + + return $this->linesCountBeforeFirst; + } + + protected function getLinesCountAfter(): int + { + return $this->linesCountAfter; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + */ + protected function getLinesCountAfterLast(File $phpcsFile, int $jumpStatementPointer, int $jumpStatementEndPointer): int + { + if ( + $this->linesCountAfterWhenLastInLastCaseOrDefault !== null + && $this->isLastInLastCaseOrDefault($phpcsFile, $jumpStatementEndPointer) + ) { + return $this->linesCountAfterWhenLastInLastCaseOrDefault; + } + + if ( + $this->linesCountAfterWhenLastInCaseOrDefault !== null + && $this->isLastInCaseOrDefault($phpcsFile, $jumpStatementEndPointer) + ) { + return $this->linesCountAfterWhenLastInCaseOrDefault; + } + + return $this->linesCountAfterLast; + } + + protected function checkLinesBefore(File $phpcsFile, int $jumpStatementPointer): void + { + if ( + $this->allowSingleLineYieldStacking + && $this->isStackedSingleLineYield($phpcsFile, $jumpStatementPointer, true) + ) { + return; + } + + if ($this->isThrowExpression($phpcsFile, $jumpStatementPointer)) { + return; + } + + parent::checkLinesBefore($phpcsFile, $jumpStatementPointer); + } + + protected function checkLinesAfter(File $phpcsFile, int $jumpStatementPointer): void + { + if ( + $this->allowSingleLineYieldStacking + && $this->isStackedSingleLineYield($phpcsFile, $jumpStatementPointer, false) + ) { + return; + } + + if ($this->isThrowExpression($phpcsFile, $jumpStatementPointer)) { + return; + } + + parent::checkLinesAfter($phpcsFile, $jumpStatementPointer); + } + + private function isOneOfYieldSpecialCases(File $phpcsFile, int $jumpStatementPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $jumpStatementToken = $tokens[$jumpStatementPointer]; + if ($jumpStatementToken['code'] !== T_YIELD && $jumpStatementToken['code'] !== T_YIELD_FROM) { + return false; + } + + // check if yield is used inside parentheses (function call, while, ...) + if (array_key_exists('nested_parenthesis', $jumpStatementToken)) { + return true; + } + + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $jumpStatementPointer - 1); + + // check if yield is used in assignment + if (in_array($tokens[$pointerBefore]['code'], Tokens::$assignmentTokens, true)) { + return true; + } + + // check if yield is used in a return statement + return $tokens[$pointerBefore]['code'] === T_RETURN; + } + + private function isStackedSingleLineYield(File $phpcsFile, int $jumpStatementPointer, bool $previous): bool + { + $tokens = $phpcsFile->getTokens(); + $yields = [T_YIELD, T_YIELD_FROM]; + + if (!in_array($tokens[$jumpStatementPointer]['code'], $yields, true)) { + return false; + } + + $adjoiningYieldPointer = $previous + ? TokenHelper::findPrevious($phpcsFile, $yields, $jumpStatementPointer - 1) + : TokenHelper::findNext($phpcsFile, $yields, $jumpStatementPointer + 1); + + return $adjoiningYieldPointer !== null + && abs($tokens[$adjoiningYieldPointer]['line'] - $tokens[$jumpStatementPointer]['line']) === 1; + } + + private function isThrowExpression(File $phpcsFile, int $jumpStatementPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$jumpStatementPointer]['code'] !== T_THROW) { + return false; + } + + $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $jumpStatementPointer - 1); + + return !in_array( + $tokens[$pointerBefore]['code'], + [T_SEMICOLON, T_COLON, T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_OPEN_TAG], + true + ); + } + + private function isFirstInCaseOrDefault(File $phpcsFile, int $jumpStatementPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $jumpStatementPointer - 1); + + if ($tokens[$previousPointer]['code'] !== T_COLON) { + return false; + } + + $firstPointerOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $previousPointer); + + return in_array($tokens[$firstPointerOnLine]['code'], [T_CASE, T_DEFAULT], true); + } + + private function isLastInCaseOrDefault(File $phpcsFile, int $jumpStatementEndPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $jumpStatementEndPointer + 1); + + if (in_array($tokens[$nextPointer]['code'], [T_CASE, T_DEFAULT], true)) { + return true; + } + + return $tokens[$nextPointer]['code'] === T_CLOSE_CURLY_BRACKET + && array_key_exists('scope_condition', $tokens[$nextPointer]) + && $tokens[$tokens[$nextPointer]['scope_condition']]['code'] === T_SWITCH; + } + + private function isLastInLastCaseOrDefault(File $phpcsFile, int $jumpStatementEndPointer): bool + { + if (!$this->isLastInCaseOrDefault($phpcsFile, $jumpStatementEndPointer)) { + return false; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $jumpStatementEndPointer + 1); + + return !in_array($phpcsFile->getTokens()[$nextPointer]['code'], [T_CASE, T_DEFAULT], true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/LanguageConstructWithParenthesesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/LanguageConstructWithParenthesesSniff.php new file mode 100644 index 0000000..b7f4eec --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/LanguageConstructWithParenthesesSniff.php @@ -0,0 +1,102 @@ + + */ + public function register(): array + { + return [ + T_BREAK, + T_CONTINUE, + T_ECHO, + T_EXIT, + T_INCLUDE, + T_INCLUDE_ONCE, + T_PRINT, + T_REQUIRE, + T_REQUIRE_ONCE, + T_RETURN, + T_THROW, + T_YIELD, + T_YIELD_FROM, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $languageConstructPointer + */ + public function process(File $phpcsFile, $languageConstructPointer): void + { + $tokens = $phpcsFile->getTokens(); + /** @var int $openParenthesisPointer */ + $openParenthesisPointer = TokenHelper::findNextEffective($phpcsFile, $languageConstructPointer + 1); + if ($tokens[$openParenthesisPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $closeParenthesisPointer = $tokens[$openParenthesisPointer]['parenthesis_closer']; + $afterCloseParenthesisPointer = TokenHelper::findNextEffective($phpcsFile, $closeParenthesisPointer + 1); + if (!in_array($tokens[$afterCloseParenthesisPointer]['code'], [T_SEMICOLON, T_CLOSE_PARENTHESIS, T_CLOSE_SHORT_ARRAY], true)) { + return; + } + + $containsContentBetweenParentheses = TokenHelper::findNextEffective( + $phpcsFile, + $openParenthesisPointer + 1, + $closeParenthesisPointer + ) !== null; + if ($tokens[$languageConstructPointer]['code'] === T_EXIT && $containsContentBetweenParentheses) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Usage of language construct "%s" with parentheses is disallowed.', $tokens[$languageConstructPointer]['content']), + $languageConstructPointer, + self::CODE_USED_WITH_PARENTHESES + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($openParenthesisPointer, ''); + if ($tokens[$openParenthesisPointer - 1]['code'] !== T_WHITESPACE && $containsContentBetweenParentheses) { + $phpcsFile->fixer->addContent($openParenthesisPointer, ' '); + } + $phpcsFile->fixer->replaceToken($closeParenthesisPointer, ''); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php new file mode 100644 index 0000000..1d0b667 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithParenthesesSniff.php @@ -0,0 +1,114 @@ + + */ + public function register(): array + { + return [ + T_NEW, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $newPointer + */ + public function process(File $phpcsFile, $newPointer): void + { + $tokens = $phpcsFile->getTokens(); + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $newPointer + 1); + + if ($tokens[$nextPointer]['code'] === T_ATTRIBUTE) { + $nextPointer = AttributeHelper::getAttributeTarget($phpcsFile, $nextPointer); + } + + if ($tokens[$nextPointer]['code'] === T_ANON_CLASS) { + return; + } + + if ($tokens[$nextPointer]['code'] === T_OPEN_PARENTHESIS) { + $nextPointer = $tokens[$nextPointer]['parenthesis_closer']; + } + + $shouldBeOpenParenthesisPointer = $nextPointer + 1; + do { + $shouldBeOpenParenthesisPointer = TokenHelper::findNext( + $phpcsFile, + [ + T_OPEN_PARENTHESIS, + T_SEMICOLON, + T_COMMA, + T_INLINE_THEN, + T_INLINE_ELSE, + T_COALESCE, + T_CLOSE_SHORT_ARRAY, + T_CLOSE_SQUARE_BRACKET, + T_CLOSE_PARENTHESIS, + T_DOUBLE_ARROW, + ], + $shouldBeOpenParenthesisPointer + ); + + if ( + $shouldBeOpenParenthesisPointer === null + || $tokens[$shouldBeOpenParenthesisPointer]['code'] !== T_CLOSE_SQUARE_BRACKET + || $tokens[$shouldBeOpenParenthesisPointer]['bracket_opener'] <= $newPointer + ) { + break; + } + + $shouldBeOpenParenthesisPointer++; + } while (true); + + if ( + $shouldBeOpenParenthesisPointer !== null + && $tokens[$shouldBeOpenParenthesisPointer]['code'] === T_OPEN_PARENTHESIS + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Usage of "new" without parentheses is disallowed.', + $newPointer, + self::CODE_MISSING_PARENTHESES + ); + if (!$fix) { + return; + } + + /** @var int $classNameEndPointer */ + $classNameEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $shouldBeOpenParenthesisPointer - 1); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($classNameEndPointer, '()'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithoutParenthesesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithoutParenthesesSniff.php new file mode 100644 index 0000000..6ea0cfb --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/NewWithoutParenthesesSniff.php @@ -0,0 +1,106 @@ + + */ + public function register(): array + { + return [ + T_NEW, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $newPointer + */ + public function process(File $phpcsFile, $newPointer): void + { + $tokens = $phpcsFile->getTokens(); + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $newPointer + 1); + + if ($tokens[$nextPointer]['code'] === T_ANON_CLASS) { + return; + } + + $parenthesisOpenerPointer = $nextPointer + 1; + do { + /** @var int $parenthesisOpenerPointer */ + $parenthesisOpenerPointer = TokenHelper::findNext( + $phpcsFile, + [ + T_OPEN_PARENTHESIS, + T_SEMICOLON, + T_COMMA, + T_INLINE_THEN, + T_INLINE_ELSE, + T_COALESCE, + T_CLOSE_SHORT_ARRAY, + T_CLOSE_SQUARE_BRACKET, + T_CLOSE_PARENTHESIS, + T_DOUBLE_ARROW, + ], + $parenthesisOpenerPointer + ); + + if ( + $tokens[$parenthesisOpenerPointer]['code'] !== T_CLOSE_SQUARE_BRACKET + || $tokens[$parenthesisOpenerPointer]['bracket_opener'] <= $newPointer + ) { + break; + } + + $parenthesisOpenerPointer++; + } while (true); + + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $nextPointer = TokenHelper::findNextNonWhitespace($phpcsFile, $parenthesisOpenerPointer + 1); + if ($nextPointer !== $tokens[$parenthesisOpenerPointer]['parenthesis_closer']) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless parentheses in "new".', $newPointer, self::CODE_USELESS_PARENTHESES); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding( + $phpcsFile, + $parenthesisOpenerPointer, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineConditionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineConditionSniff.php new file mode 100644 index 0000000..62f911d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineConditionSniff.php @@ -0,0 +1,188 @@ +minLineLength = SniffSettingsHelper::normalizeInteger($this->minLineLength); + + if ($this->shouldBeSkipped($phpcsFile, $controlStructurePointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $tokens[$controlStructurePointer]['parenthesis_opener']; + $parenthesisCloserPointer = $tokens[$controlStructurePointer]['parenthesis_closer']; + + $booleanOperatorPointers = TokenHelper::findNextAll( + $phpcsFile, + Tokens::$booleanOperators, + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ); + + if ($booleanOperatorPointers === []) { + return; + } + + $conditionStartPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + $conditionEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisCloserPointer - 1); + + $conditionStartsOnNewLine = $tokens[$parenthesisOpenerPointer]['line'] !== $tokens[$conditionStartPointer]['line']; + $conditionEndsOnNewLine = $tokens[$parenthesisCloserPointer]['line'] !== $tokens[$conditionEndPointer]['line']; + + $lineStart = $this->getLineStart($phpcsFile, $conditionStartsOnNewLine ? $conditionStartPointer - 1 : $parenthesisOpenerPointer); + $lineEnd = $this->getLineEnd($phpcsFile, $conditionEndsOnNewLine ? $conditionEndPointer + 1 : $parenthesisCloserPointer); + + $condition = $this->getCondition($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + + $lineLength = strlen($lineStart . $condition . $lineEnd); + $conditionLinesCount = $tokens[$conditionEndPointer]['line'] - $tokens[$conditionStartPointer]['line'] + 1; + + if (!$this->shouldReportError($lineLength, $conditionLinesCount, count($booleanOperatorPointers))) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Condition of "%s" should be split to more lines so each condition part is on its own line.', + $this->getControlStructureName($phpcsFile, $controlStructurePointer) + ), + $controlStructurePointer, + self::CODE_REQUIRED_MULTI_LINE_CONDITION + ); + + if (!$fix) { + return; + } + + $controlStructureIndentation = IndentationHelper::getIndentation( + $phpcsFile, + $conditionStartsOnNewLine + ? $conditionStartPointer + : TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $parenthesisOpenerPointer) + ); + + $conditionIndentation = $conditionStartsOnNewLine + ? $controlStructureIndentation + : IndentationHelper::addIndentation($controlStructureIndentation); + + $innerConditionLevel = 0; + + $phpcsFile->fixer->beginChangeset(); + + if (!$conditionStartsOnNewLine) { + FixerHelper::removeWhitespaceBefore($phpcsFile, $conditionStartPointer); + $phpcsFile->fixer->addContentBefore($conditionStartPointer, $phpcsFile->eolChar . $conditionIndentation); + } + + for ($i = $conditionStartPointer; $i <= $conditionEndPointer; $i++) { + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $containsBooleanOperator = TokenHelper::findNext( + $phpcsFile, + Tokens::$booleanOperators, + $i + 1, + $tokens[$i]['parenthesis_closer'] + ) !== null; + + $innerConditionLevel++; + + if ($containsBooleanOperator) { + FixerHelper::removeWhitespaceAfter($phpcsFile, $i); + + $phpcsFile->fixer->addContent( + $i, + $phpcsFile->eolChar . IndentationHelper::addIndentation($conditionIndentation, $innerConditionLevel) + ); + + FixerHelper::removeWhitespaceBefore($phpcsFile, $tokens[$i]['parenthesis_closer']); + + $phpcsFile->fixer->addContentBefore( + $tokens[$i]['parenthesis_closer'], + $phpcsFile->eolChar . IndentationHelper::addIndentation($conditionIndentation, $innerConditionLevel - 1) + ); + } + + continue; + } + + if ($tokens[$i]['code'] === T_CLOSE_PARENTHESIS) { + $innerConditionLevel--; + continue; + } + + if (!in_array($tokens[$i]['code'], Tokens::$booleanOperators, true)) { + continue; + } + + $innerConditionIndentation = $conditionIndentation; + if ($innerConditionLevel > 0) { + $innerConditionIndentation = IndentationHelper::addIndentation($innerConditionIndentation, $innerConditionLevel); + } + + if ($this->booleanOperatorOnPreviousLine) { + $phpcsFile->fixer->addContent($i, $phpcsFile->eolChar . $innerConditionIndentation); + + FixerHelper::removeWhitespaceAfter($phpcsFile, $i); + + continue; + + } + + FixerHelper::removeWhitespaceBefore($phpcsFile, $i); + + $phpcsFile->fixer->addContentBefore($i, $phpcsFile->eolChar . $innerConditionIndentation); + } + + if (!$conditionEndsOnNewLine) { + FixerHelper::removeWhitespaceAfter($phpcsFile, $conditionEndPointer); + $phpcsFile->fixer->addContent($conditionEndPointer, $phpcsFile->eolChar . $controlStructureIndentation); + } + + $phpcsFile->fixer->endChangeset(); + } + + private function shouldReportError(int $lineLength, int $conditionLinesCount, int $booleanOperatorPointersCount): bool + { + if ($conditionLinesCount === 1) { + return $this->minLineLength === 0 || $lineLength >= $this->minLineLength; + } + + return $this->alwaysSplitAllConditionParts + ? $conditionLinesCount < $booleanOperatorPointersCount + 1 + : false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php new file mode 100644 index 0000000..09ae723 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireMultiLineTernaryOperatorSniff.php @@ -0,0 +1,178 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $this->lineLengthLimit = SniffSettingsHelper::normalizeInteger($this->lineLengthLimit); + $this->minExpressionsLength = SniffSettingsHelper::normalizeNullableInteger($this->minExpressionsLength); + + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + if ($tokens[$nextPointer]['code'] === T_INLINE_ELSE) { + return; + } + + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + + if ($tokens[$inlineThenPointer]['line'] !== $tokens[$inlineElsePointer]['line']) { + return; + } + + $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); + $pointerAfterInlineElseEnd = TokenHelper::findNextEffective($phpcsFile, $inlineElseEndPointer + 1); + + if ($pointerAfterInlineElseEnd === null || $tokens[$pointerAfterInlineElseEnd]['code'] !== T_SEMICOLON) { + return; + } + + $endOfLineBeforeInlineThenPointer = $this->getEndOfLineBefore($phpcsFile, $inlineThenPointer); + + $actualLineLength = strlen(TokenHelper::getContent($phpcsFile, $endOfLineBeforeInlineThenPointer + 1, $pointerAfterInlineElseEnd)); + + if ($actualLineLength <= $this->lineLengthLimit) { + return; + } + + $expressionsLength = strlen(TokenHelper::getContent($phpcsFile, $inlineThenPointer + 1, $pointerAfterInlineElseEnd - 1)); + + if ( + $this->minExpressionsLength !== null + && $this->minExpressionsLength >= $expressionsLength + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Ternary operator should be reformatted to more lines.', + $inlineThenPointer, + self::CODE_MULTI_LINE_TERNARY_OPERATOR_NOT_USED + ); + + if (!$fix) { + return; + } + + $indentation = $this->getIndentation($phpcsFile, $endOfLineBeforeInlineThenPointer); + $pointerBeforeInlineThen = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + $pointerBeforeInlineElse = TokenHelper::findPreviousEffective($phpcsFile, $inlineElsePointer - 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineThen, $inlineThenPointer); + + $phpcsFile->fixer->addContentBefore($inlineThenPointer, $phpcsFile->eolChar . $indentation); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeInlineElse, $inlineElsePointer); + + $phpcsFile->fixer->addContentBefore($inlineElsePointer, $phpcsFile->eolChar . $indentation); + + $phpcsFile->fixer->endChangeset(); + } + + private function getEndOfLineBefore(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $endOfLineBefore = null; + + $startPointer = $pointer - 1; + while (true) { + $possibleEndOfLinePointer = TokenHelper::findPrevious( + $phpcsFile, + array_merge([T_WHITESPACE, T_OPEN_TAG, T_OPEN_TAG_WITH_ECHO], TokenHelper::$inlineCommentTokenCodes), + $startPointer + ); + if ( + $tokens[$possibleEndOfLinePointer]['code'] === T_WHITESPACE + && $tokens[$possibleEndOfLinePointer]['content'] === $phpcsFile->eolChar + ) { + $endOfLineBefore = $possibleEndOfLinePointer; + break; + } + + if ( + $tokens[$possibleEndOfLinePointer]['code'] === T_OPEN_TAG + || $tokens[$possibleEndOfLinePointer]['code'] === T_OPEN_TAG_WITH_ECHO + ) { + $endOfLineBefore = $possibleEndOfLinePointer; + break; + } + + if ( + in_array($tokens[$possibleEndOfLinePointer]['code'], TokenHelper::$inlineCommentTokenCodes, true) + && substr($tokens[$possibleEndOfLinePointer]['content'], -1) === $phpcsFile->eolChar + ) { + $endOfLineBefore = $possibleEndOfLinePointer; + break; + } + + $startPointer = $possibleEndOfLinePointer - 1; + } + + /** @var int $endOfLineBefore */ + $endOfLineBefore = $endOfLineBefore; + return $endOfLineBefore; + } + + private function getIndentation(File $phpcsFile, int $endOfLinePointer): string + { + $pointerAfterWhitespace = TokenHelper::findNextNonWhitespace($phpcsFile, $endOfLinePointer + 1); + $actualIndentation = TokenHelper::getContent($phpcsFile, $endOfLinePointer + 1, $pointerAfterWhitespace - 1); + + if (strlen($actualIndentation) !== 0) { + return $actualIndentation . (substr( + $actualIndentation, + -1 + ) === IndentationHelper::TAB_INDENT ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT); + } + + $tabPointer = TokenHelper::findPreviousContent($phpcsFile, T_WHITESPACE, IndentationHelper::TAB_INDENT, $endOfLinePointer - 1); + return $tabPointer !== null ? IndentationHelper::TAB_INDENT : IndentationHelper::SPACES_INDENT; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php new file mode 100644 index 0000000..03823e0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceEqualOperatorSniff.php @@ -0,0 +1,99 @@ + + */ + public function register(): array + { + return [ + T_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $equalPointer + */ + public function process(File $phpcsFile, $equalPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 70400); + + if (!$this->enable) { + return; + } + + /** @var int $variableStartPointer */ + $variableStartPointer = TokenHelper::findNextEffective($phpcsFile, $equalPointer + 1); + $variableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $variableStartPointer); + + if ($variableEndPointer === null) { + return; + } + + $nullCoalescePointer = TokenHelper::findNextEffective($phpcsFile, $variableEndPointer + 1); + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$nullCoalescePointer]['code'] !== T_COALESCE) { + return; + } + + $variableContent = IdentificatorHelper::getContent($phpcsFile, $variableStartPointer, $variableEndPointer); + + /** @var int $beforeEqualEndPointer */ + $beforeEqualEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $equalPointer - 1); + $beforeEqualStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $beforeEqualEndPointer); + + if ($beforeEqualStartPointer === null) { + return; + } + + $beforeEqualVariableContent = IdentificatorHelper::getContent($phpcsFile, $beforeEqualStartPointer, $beforeEqualEndPointer); + + if ($beforeEqualVariableContent !== $variableContent) { + return; + } + + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $equalPointer + 1); + if (TokenHelper::findNext($phpcsFile, Tokens::$operators, $nullCoalescePointer + 1, $semicolonPointer) !== null) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use "??=" operator instead of "=" and "??".', + $equalPointer, + self::CODE_REQUIRED_NULL_COALESCE_EQUAL_OPERATOR + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $equalPointer, $nullCoalescePointer, '??='); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php new file mode 100644 index 0000000..333ac6a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullCoalesceOperatorSniff.php @@ -0,0 +1,217 @@ + + */ + public function register(): array + { + return [ + T_ISSET, + T_IS_IDENTICAL, + T_IS_NOT_IDENTICAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_ISSET) { + $this->checkIsset($phpcsFile, $pointer); + } else { + $this->checkIdenticalOperator($phpcsFile, $pointer); + } + } + + public function checkIsset(File $phpcsFile, int $issetPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $issetPointer - 1); + if ($tokens[$previousPointer]['code'] === T_BOOLEAN_NOT) { + return; + } + + if (in_array($tokens[$previousPointer]['code'], Tokens::$booleanOperators, true)) { + return; + } + + $openParenthesisPointer = TokenHelper::findNextEffective($phpcsFile, $issetPointer + 1); + $closeParenthesisPointer = $tokens[$openParenthesisPointer]['parenthesis_closer']; + + /** @var int $inlineThenPointer */ + $inlineThenPointer = TokenHelper::findNextEffective($phpcsFile, $closeParenthesisPointer + 1); + if ($tokens[$inlineThenPointer]['code'] !== T_INLINE_THEN) { + return; + } + + $commaPointer = TokenHelper::findNext($phpcsFile, T_COMMA, $openParenthesisPointer + 1, $closeParenthesisPointer); + if ($commaPointer !== null) { + return; + } + + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + + $variableContent = IdentificatorHelper::getContent($phpcsFile, $openParenthesisPointer + 1, $closeParenthesisPointer - 1); + $thenContent = IdentificatorHelper::getContent($phpcsFile, $inlineThenPointer + 1, $inlineElsePointer - 1); + + if ($variableContent !== $thenContent) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use null coalesce operator instead of ternary operator.', + $inlineThenPointer, + self::CODE_NULL_COALESCE_OPERATOR_NOT_USED + ); + if (!$fix) { + return; + } + + $startPointer = $issetPointer; + if (in_array($tokens[$previousPointer]['code'], Tokens::$castTokens, true)) { + $startPointer = $previousPointer; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $startPointer, $inlineElsePointer, sprintf('%s ??', $variableContent)); + + $phpcsFile->fixer->endChangeset(); + } + + public function checkIdenticalOperator(File $phpcsFile, int $identicalOperator): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBeforeIdenticalOperator */ + $pointerBeforeIdenticalOperator = TokenHelper::findPreviousEffective($phpcsFile, $identicalOperator - 1); + /** @var int $pointerAfterIdenticalOperator */ + $pointerAfterIdenticalOperator = TokenHelper::findNextEffective($phpcsFile, $identicalOperator + 1); + + if ( + $tokens[$pointerBeforeIdenticalOperator]['code'] !== T_NULL + && $tokens[$pointerAfterIdenticalOperator]['code'] !== T_NULL + ) { + return; + } + + $isYodaCondition = $tokens[$pointerBeforeIdenticalOperator]['code'] === T_NULL; + + $variableEndPointer = $isYodaCondition ? $pointerAfterIdenticalOperator : $pointerBeforeIdenticalOperator; + $tmpPointer = $variableEndPointer; + while ($tokens[$tmpPointer]['code'] === T_CLOSE_PARENTHESIS) { + /** @var int $tmpPointer */ + $tmpPointer = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$tmpPointer]['parenthesis_opener'] - 1); + } + $variableStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $tmpPointer); + + if ($variableStartPointer === null) { + return; + } + + $pointerBeforeCondition = TokenHelper::findPreviousEffective( + $phpcsFile, + ($isYodaCondition ? $pointerBeforeIdenticalOperator : $variableStartPointer) - 1 + ); + + if (in_array($tokens[$pointerBeforeCondition]['code'], Tokens::$booleanOperators, true)) { + return; + } + + /** @var int $inlineThenPointer */ + $inlineThenPointer = TokenHelper::findNextEffective( + $phpcsFile, + ($isYodaCondition ? $variableEndPointer : $pointerAfterIdenticalOperator) + 1 + ); + if ($tokens[$inlineThenPointer]['code'] !== T_INLINE_THEN) { + return; + } + + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); + + $pointerAfterInlineElseEnd = TokenHelper::findNextEffective($phpcsFile, $inlineElseEndPointer + 1); + + $variableContent = IdentificatorHelper::getContent($phpcsFile, $variableStartPointer, $variableEndPointer); + + /** @var int $compareToStartPointer */ + $compareToStartPointer = TokenHelper::findNextEffective( + $phpcsFile, + ($tokens[$identicalOperator]['code'] === T_IS_IDENTICAL ? $inlineElsePointer : $inlineThenPointer) + 1 + ); + /** @var int $compareToEndPointer */ + $compareToEndPointer = TokenHelper::findPreviousEffective( + $phpcsFile, + ($tokens[$identicalOperator]['code'] === T_IS_IDENTICAL ? $pointerAfterInlineElseEnd : $inlineElsePointer) - 1 + ); + + $compareToContent = IdentificatorHelper::getContent($phpcsFile, $compareToStartPointer, $compareToEndPointer); + + if ($compareToContent !== $variableContent) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use null coalesce operator instead of ternary operator.', + $inlineThenPointer, + self::CODE_NULL_COALESCE_OPERATOR_NOT_USED + ); + + if (!$fix) { + return; + } + + /** @var int $conditionStart */ + $conditionStart = $isYodaCondition ? $pointerBeforeIdenticalOperator : $variableStartPointer; + $variableContent = trim(TokenHelper::getContent($phpcsFile, $variableStartPointer, $variableEndPointer)); + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($conditionStart, sprintf('%s ??', $variableContent)); + + if ($tokens[$identicalOperator]['code'] === T_IS_IDENTICAL) { + FixerHelper::removeBetweenIncluding($phpcsFile, $conditionStart + 1, $inlineThenPointer); + + $pointerBeforeInlineElse = TokenHelper::findPreviousEffective($phpcsFile, $inlineElsePointer - 1); + + FixerHelper::removeBetweenIncluding($phpcsFile, $pointerBeforeInlineElse + 1, $inlineElseEndPointer); + + } else { + FixerHelper::removeBetweenIncluding($phpcsFile, $conditionStart + 1, $inlineElsePointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php new file mode 100644 index 0000000..4dd1f9e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireNullSafeObjectOperatorSniff.php @@ -0,0 +1,513 @@ +|\?->)~'; + + /** @var bool|null */ + public $enable = null; + + /** + * @return array + */ + public function register(): array + { + return [ + T_IS_IDENTICAL, + T_IS_NOT_IDENTICAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $identicalPointer + */ + public function process(File $phpcsFile, $identicalPointer): int + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return $identicalPointer + 1; + } + + $tokens = $phpcsFile->getTokens(); + + [$pointerBeforeIdentical, $pointerAfterIdentical] = $this->getIdenticalData($phpcsFile, $identicalPointer); + + if ($tokens[$pointerBeforeIdentical]['code'] !== T_NULL && $tokens[$pointerAfterIdentical]['code'] !== T_NULL) { + return $identicalPointer + 1; + } + + [$identificatorStartPointer, $identificatorEndPointer, $conditionStartPointer] = $this->getConditionData( + $phpcsFile, + $pointerBeforeIdentical, + $pointerAfterIdentical + ); + + if ($identificatorStartPointer === null || $identificatorEndPointer === null) { + return $identicalPointer + 1; + } + + $isYoda = $tokens[$pointerBeforeIdentical]['code'] === T_NULL; + $identificator = IdentificatorHelper::getContent($phpcsFile, $identificatorStartPointer, $identificatorEndPointer); + + $pointerAfterCondition = TokenHelper::findNextEffective( + $phpcsFile, + ($isYoda ? $identificatorEndPointer : $pointerAfterIdentical) + 1 + ); + + $allowedBooleanCondition = $tokens[$identicalPointer]['code'] === T_IS_NOT_IDENTICAL ? T_BOOLEAN_AND : T_BOOLEAN_OR; + if ($tokens[$pointerAfterCondition]['code'] === $allowedBooleanCondition) { + return $this->checkNextCondition($phpcsFile, $identicalPointer, $conditionStartPointer, $identificator, $pointerAfterCondition); + } + + if ($tokens[$pointerAfterCondition]['code'] === T_INLINE_THEN) { + $this->checkTernaryOperator($phpcsFile, $identicalPointer, $conditionStartPointer, $identificator, $pointerAfterCondition); + return $pointerAfterCondition + 1; + } + + return $identicalPointer + 1; + } + + private function checkTernaryOperator( + File $phpcsFile, + int $identicalPointer, + int $conditionStartPointer, + string $identificator, + int $inlineThenPointer + ): void + { + $tokens = $phpcsFile->getTokens(); + + $ternaryOperatorStartPointer = TernaryOperatorHelper::getStartPointer($phpcsFile, $inlineThenPointer); + + $searchStartPointer = $ternaryOperatorStartPointer; + do { + $booleanOperatorPointer = TokenHelper::findNext($phpcsFile, Tokens::$booleanOperators, $searchStartPointer, $inlineThenPointer); + if ($booleanOperatorPointer === null) { + break; + } + + $identicalPointer = TokenHelper::findNext( + $phpcsFile, + [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL], + $searchStartPointer, + $booleanOperatorPointer + ); + + if ($identicalPointer === null) { + return; + } + + $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $identicalPointer + 1); + + if ($tokens[$pointerAfterIdentical]['code'] !== T_NULL) { + return; + } + + $searchStartPointer = $booleanOperatorPointer + 1; + + } while (true); + + $pointerBeforeCondition = TokenHelper::findPreviousEffective($phpcsFile, $conditionStartPointer - 1); + if (in_array($tokens[$pointerBeforeCondition]['code'], [T_BOOLEAN_AND, T_BOOLEAN_OR], true)) { + $previousIdenticalPointer = TokenHelper::findPreviousLocal( + $phpcsFile, + [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL], + $pointerBeforeCondition + ); + + if ($previousIdenticalPointer !== null) { + [$pointerBeforePreviousIdentical, $pointerAfterPreviousIdentical] = $this->getIdenticalData( + $phpcsFile, + $previousIdenticalPointer + ); + + [$previousIdentificatorStartPointer, $previousIdentificatorEndPointer] = $this->getConditionData( + $phpcsFile, + $pointerBeforePreviousIdentical, + $pointerAfterPreviousIdentical + ); + + if ($previousIdentificatorStartPointer !== null && $previousIdentificatorEndPointer !== null) { + $previousIdentificator = IdentificatorHelper::getContent( + $phpcsFile, + $previousIdentificatorStartPointer, + $previousIdentificatorEndPointer + ); + + if (!self::areIdentificatorsCompatible($previousIdentificator, $identificator)) { + return; + } + } + } + } + + $defaultInElse = $tokens[$identicalPointer]['code'] === T_IS_NOT_IDENTICAL; + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); + + if ($defaultInElse) { + $nextIdentificatorPointers = $this->getNextIdentificator($phpcsFile, $inlineThenPointer); + + if ($nextIdentificatorPointers === null) { + return; + } + + [$nextIdentificatorStartPointer, $nextIdentificatorEndPointer] = $nextIdentificatorPointers; + + $nextIdentificator = IdentificatorHelper::getContent($phpcsFile, $nextIdentificatorStartPointer, $nextIdentificatorEndPointer); + + if (!$this->areIdentificatorsCompatible($identificator, $nextIdentificator)) { + return; + } + + if (TokenHelper::findNextEffective($phpcsFile, $nextIdentificatorEndPointer + 1) !== $inlineElsePointer) { + return; + } + + $identificatorDifference = $this->getIdentificatorDifference( + $phpcsFile, + $identificator, + $nextIdentificatorStartPointer, + $nextIdentificatorEndPointer + ); + + $firstPointerInElse = TokenHelper::findNextEffective($phpcsFile, $inlineElsePointer + 1); + + $defaultContent = TokenHelper::getContent($phpcsFile, $firstPointerInElse, $inlineElseEndPointer); + + $conditionEndPointer = $inlineElseEndPointer; + + } else { + $nullPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + + if ($tokens[$nullPointer]['code'] !== T_NULL) { + return; + } + + if (TokenHelper::findNextEffective($phpcsFile, $nullPointer + 1) !== $inlineElsePointer) { + return; + } + + $nextIdentificatorPointers = $this->getNextIdentificator($phpcsFile, $inlineElsePointer); + + if ($nextIdentificatorPointers === null) { + return; + } + + [$nextIdentificatorStartPointer, $nextIdentificatorEndPointer] = $nextIdentificatorPointers; + + if ($nextIdentificatorEndPointer !== $inlineElseEndPointer) { + return; + } + + $nextIdentificator = IdentificatorHelper::getContent($phpcsFile, $nextIdentificatorStartPointer, $nextIdentificatorEndPointer); + + if (!$this->areIdentificatorsCompatible($identificator, $nextIdentificator)) { + return; + } + + $identificatorDifference = $this->getIdentificatorDifference( + $phpcsFile, + $identificator, + $nextIdentificatorStartPointer, + $nextIdentificatorEndPointer + ); + + $defaultContent = trim(TokenHelper::getContent($phpcsFile, $inlineThenPointer + 1, $inlineElsePointer - 1)); + + $conditionEndPointer = $nextIdentificatorEndPointer; + } + + $fix = $phpcsFile->addFixableError('Operator ?-> is required.', $identicalPointer, self::CODE_REQUIRED_NULL_SAFE_OBJECT_OPERATOR); + + if (!$fix) { + return; + } + + $conditionContent = sprintf('%s?%s', $identificator, $identificatorDifference); + if (strtolower($defaultContent) !== 'null') { + $conditionContent .= sprintf(' ?? %s', $defaultContent); + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $conditionStartPointer, $conditionEndPointer, $conditionContent); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkNextCondition( + File $phpcsFile, + int $identicalPointer, + int $conditionStartPointer, + string $identificator, + int $nextConditionBooleanPointer + ): int + { + $nextIdentificatorPointers = $this->getNextIdentificator($phpcsFile, $nextConditionBooleanPointer); + + if ($nextIdentificatorPointers === null) { + return $nextConditionBooleanPointer; + } + + [$nextIdentificatorStartPointer, $nextIdentificatorEndPointer] = $nextIdentificatorPointers; + + $nextIdentificator = IdentificatorHelper::getContent($phpcsFile, $nextIdentificatorStartPointer, $nextIdentificatorEndPointer); + + if (!$this->areIdentificatorsCompatible($identificator, $nextIdentificator)) { + return $nextIdentificatorEndPointer; + } + + $pointerAfterNexIdentificator = TokenHelper::findNextEffective($phpcsFile, $nextIdentificatorEndPointer + 1); + + $tokens = $phpcsFile->getTokens(); + + if ( + $tokens[$pointerAfterNexIdentificator]['code'] !== $tokens[$identicalPointer]['code'] + && !in_array($tokens[$pointerAfterNexIdentificator]['code'], [T_INLINE_THEN, T_SEMICOLON], true) + ) { + return $pointerAfterNexIdentificator; + } + + if (!in_array($tokens[$pointerAfterNexIdentificator]['code'], [T_IS_IDENTICAL, T_IS_NOT_IDENTICAL], true)) { + return $pointerAfterNexIdentificator; + } + + $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $pointerAfterNexIdentificator + 1); + if ($tokens[$pointerAfterIdentical]['code'] !== T_NULL) { + return $pointerAfterNexIdentificator; + } + + $identificatorDifference = $this->getIdentificatorDifference( + $phpcsFile, + $identificator, + $nextIdentificatorStartPointer, + $nextIdentificatorEndPointer + ); + + $fix = $phpcsFile->addFixableError('Operator ?-> is required.', $identicalPointer, self::CODE_REQUIRED_NULL_SAFE_OBJECT_OPERATOR); + + if (!$fix) { + return $pointerAfterNexIdentificator; + } + + $isConditionOfTernaryOperator = TernaryOperatorHelper::isConditionOfTernaryOperator($phpcsFile, $identicalPointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $conditionStartPointer, + $nextIdentificatorEndPointer, + sprintf('%s?%s', $identificator, $identificatorDifference) + ); + + $phpcsFile->fixer->endChangeset(); + + if ($isConditionOfTernaryOperator) { + return TokenHelper::findNext($phpcsFile, T_INLINE_THEN, $identicalPointer + 1); + } + + return $pointerAfterNexIdentificator; + } + + /** + * @return array|null + */ + private function getNextIdentificator(File $phpcsFile, int $pointerBefore): ?array + { + /** @var int $nextIdentificatorStartPointer */ + $nextIdentificatorStartPointer = TokenHelper::findNextEffective($phpcsFile, $pointerBefore + 1); + $nextIdentificatorEndPointer = $this->findIdentificatorEnd($phpcsFile, $nextIdentificatorStartPointer); + + if ($nextIdentificatorEndPointer === null) { + return null; + } + + return [$nextIdentificatorStartPointer, $nextIdentificatorEndPointer]; + } + + private function findIdentificatorStart(File $phpcsFile, int $identificatorEndPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$identificatorEndPointer]['code'] === T_CLOSE_PARENTHESIS) { + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective( + $phpcsFile, + $tokens[$identificatorEndPointer]['parenthesis_opener'] - 1 + ); + $identificatorStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $pointerBeforeParenthesisOpener); + } else { + $identificatorStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $identificatorEndPointer); + } + + if ($identificatorStartPointer !== null) { + $pointerBeforeIdentificatorStart = TokenHelper::findPreviousEffective($phpcsFile, $identificatorStartPointer - 1); + + if (in_array( + $tokens[$pointerBeforeIdentificatorStart]['code'], + [T_DOUBLE_COLON, T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], + true + )) { + $pointerBeforeOperator = TokenHelper::findPreviousEffective($phpcsFile, $pointerBeforeIdentificatorStart - 1); + return $this->findIdentificatorStart($phpcsFile, $pointerBeforeOperator); + } + } + + return $identificatorStartPointer; + } + + private function findIdentificatorEnd(File $phpcsFile, int $identificatorStartPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $identificatorEndPointer = $tokens[$identificatorStartPointer]['code'] === T_STRING + ? $identificatorStartPointer + : IdentificatorHelper::findEndPointer($phpcsFile, $identificatorStartPointer); + + if ($identificatorEndPointer !== null) { + $pointerAfterIdentificatorEnd = TokenHelper::findNextEffective($phpcsFile, $identificatorEndPointer + 1); + + if ($tokens[$pointerAfterIdentificatorEnd]['code'] === T_OPEN_PARENTHESIS) { + $identificatorEndPointer = $tokens[$pointerAfterIdentificatorEnd]['parenthesis_closer']; + $pointerAfterIdentificatorEnd = TokenHelper::findNextEffective($phpcsFile, $identificatorEndPointer + 1); + } + + if (in_array( + $tokens[$pointerAfterIdentificatorEnd]['code'], + [T_DOUBLE_COLON, T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], + true + )) { + $pointerAfterOperator = TokenHelper::findNextEffective($phpcsFile, $pointerAfterIdentificatorEnd + 1); + return $this->findIdentificatorEnd($phpcsFile, $pointerAfterOperator); + } + } + + return $identificatorEndPointer; + } + + private function areIdentificatorsCompatible(string $first, string $second): bool + { + /** @var list $firstParts */ + $firstParts = preg_split(self::OPERATOR_REGEXP, $first, -1, PREG_SPLIT_DELIM_CAPTURE); + /** @var list $secondParts */ + $secondParts = preg_split(self::OPERATOR_REGEXP, $second, -1, PREG_SPLIT_DELIM_CAPTURE); + + $minPartsCount = min(count($firstParts), count($secondParts)); + + for ($i = 0; $i < $minPartsCount; $i++) { + if ($firstParts[$i] === '?->' && $secondParts[$i] === '->') { + continue; + } + + if ($firstParts[$i] !== $secondParts[$i]) { + return false; + } + } + + return array_key_exists($minPartsCount, $secondParts) && $secondParts[$minPartsCount] === '->'; + } + + private function getIdentificatorDifference( + File $phpcsFile, + string $identificator, + int $nextIdentificatorStartPointer, + int $nextIdentificatorEndPointer + ): string + { + $objectOperatorsCountInIdentificator = substr_count($identificator, '->'); + + $tokens = $phpcsFile->getTokens(); + + $objectOperatorsCountInNextIdentificator = 0; + $differencePointer = $nextIdentificatorStartPointer; + for ($i = $nextIdentificatorStartPointer; $i <= $nextIdentificatorEndPointer; $i++) { + if (in_array($tokens[$i]['code'], [T_OBJECT_OPERATOR, T_NULLSAFE_OBJECT_OPERATOR], true)) { + $objectOperatorsCountInNextIdentificator++; + } + + if ($objectOperatorsCountInNextIdentificator > $objectOperatorsCountInIdentificator) { + $differencePointer = $i; + break; + } + } + + return TokenHelper::getContent($phpcsFile, $differencePointer, $nextIdentificatorEndPointer); + } + + /** + * @return array{0: int, 1: int} + */ + private function getIdenticalData(File $phpcsFile, int $identicalPointer): array + { + /** @var int $pointerBeforeIdentical */ + $pointerBeforeIdentical = TokenHelper::findPreviousEffective($phpcsFile, $identicalPointer - 1); + /** @var int $pointerAfterIdentical */ + $pointerAfterIdentical = TokenHelper::findNextEffective($phpcsFile, $identicalPointer + 1); + + return [$pointerBeforeIdentical, $pointerAfterIdentical]; + } + + /** + * @return array{0: int|null, 1: int|null, 2: int|null} + */ + private function getConditionData(File $phpcsFile, int $pointerBeforeIdentical, int $pointerAfterIdentical): array + { + $tokens = $phpcsFile->getTokens(); + + $isYoda = $tokens[$pointerBeforeIdentical]['code'] === T_NULL; + + if ($isYoda) { + $identificatorStartPointer = $pointerAfterIdentical; + $identificatorEndPointer = $this->findIdentificatorEnd($phpcsFile, $identificatorStartPointer); + $conditionStartPointer = $pointerBeforeIdentical; + + } else { + $identificatorEndPointer = $pointerBeforeIdentical; + $identificatorStartPointer = $this->findIdentificatorStart($phpcsFile, $identificatorEndPointer); + $conditionStartPointer = $identificatorStartPointer; + } + + return [$identificatorStartPointer, $identificatorEndPointer, $conditionStartPointer]; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php new file mode 100644 index 0000000..6cfe2f9 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireShortTernaryOperatorSniff.php @@ -0,0 +1,87 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + + if ($tokens[$nextPointer]['code'] === T_INLINE_ELSE) { + return; + } + + $conditionStartPointer = TernaryOperatorHelper::getStartPointer($phpcsFile, $inlineThenPointer); + $inlineElsePointer = TernaryOperatorHelper::getElsePointer($phpcsFile, $inlineThenPointer); + $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); + + $thenContent = trim(TokenHelper::getContent($phpcsFile, $inlineThenPointer + 1, $inlineElsePointer - 1)); + $elseContent = trim(TokenHelper::getContent($phpcsFile, $inlineElsePointer + 1, $inlineElseEndPointer)); + + $conditionEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + + $condition = TokenHelper::getContent($phpcsFile, $conditionStartPointer, $conditionEndPointer); + + if ($tokens[$conditionStartPointer]['code'] === T_BOOLEAN_NOT) { + if ($elseContent !== ltrim($condition, '!')) { + return; + } + } else { + if ($thenContent !== $condition) { + return; + } + } + + $fix = $phpcsFile->addFixableError('Use short ternary operator.', $inlineThenPointer, self::CODE_REQUIRED_SHORT_TERNARY_OPERATOR); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$conditionStartPointer]['code'] === T_BOOLEAN_NOT) { + $phpcsFile->fixer->replaceToken($conditionStartPointer, ''); + + FixerHelper::change($phpcsFile, $inlineThenPointer, $inlineElseEndPointer, sprintf('?: %s', $thenContent)); + + } else { + FixerHelper::removeBetween($phpcsFile, $inlineThenPointer, $inlineElsePointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireSingleLineConditionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireSingleLineConditionSniff.php new file mode 100644 index 0000000..d55864d --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireSingleLineConditionSniff.php @@ -0,0 +1,105 @@ +maxLineLength = SniffSettingsHelper::normalizeInteger($this->maxLineLength); + + if ($this->shouldBeSkipped($phpcsFile, $controlStructurePointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $tokens[$controlStructurePointer]['parenthesis_opener']; + $parenthesisCloserPointer = $tokens[$controlStructurePointer]['parenthesis_closer']; + + if ($tokens[$parenthesisOpenerPointer]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + TokenHelper::$inlineCommentTokenCodes, + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null) { + return; + } + + $lineStart = $this->getLineStart($phpcsFile, $parenthesisOpenerPointer); + $condition = $this->getCondition($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + $lineEnd = $this->getLineEnd($phpcsFile, $parenthesisCloserPointer); + + $lineLength = strlen($lineStart . $condition . $lineEnd); + $isSimpleCondition = TokenHelper::findNext( + $phpcsFile, + Tokens::$booleanOperators, + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) === null; + + if (!$this->shouldReportError($lineLength, $isSimpleCondition)) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Condition of "%s" should be placed on a single line.', + $this->getControlStructureName($phpcsFile, $controlStructurePointer) + ), + $controlStructurePointer, + self::CODE_REQUIRED_SINGLE_LINE_CONDITION + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($parenthesisOpenerPointer, $condition); + + FixerHelper::removeBetween($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function shouldReportError(int $lineLength, bool $isSimpleCondition): bool + { + if ($this->maxLineLength === 0) { + return true; + } + + if ($lineLength <= $this->maxLineLength) { + return true; + } + + return $isSimpleCondition && $this->alwaysForSimpleConditions; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php new file mode 100644 index 0000000..f1dc541 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireTernaryOperatorSniff.php @@ -0,0 +1,266 @@ + + */ + public function register(): array + { + return [ + T_IF, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $ifPointer + */ + public function process(File $phpcsFile, $ifPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('scope_closer', $tokens[$ifPointer])) { + // If without curly braces is not supported. + return; + } + + $elsePointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$ifPointer]['scope_closer'] + 1); + if ($elsePointer === null || $tokens[$elsePointer]['code'] !== T_ELSE) { + return; + } + + if (!array_key_exists('scope_closer', $tokens[$elsePointer])) { + // Else without curly braces is not supported. + return; + } + + if ( + !$this->isCompatibleScope($phpcsFile, $tokens[$ifPointer]['scope_opener'], $tokens[$ifPointer]['scope_closer']) + || !$this->isCompatibleScope($phpcsFile, $tokens[$elsePointer]['scope_opener'], $tokens[$elsePointer]['scope_closer']) + ) { + return; + } + + /** @var int $firstPointerInIf */ + $firstPointerInIf = TokenHelper::findNextEffective($phpcsFile, $tokens[$ifPointer]['scope_opener'] + 1); + /** @var int $firstPointerInElse */ + $firstPointerInElse = TokenHelper::findNextEffective($phpcsFile, $tokens[$elsePointer]['scope_opener'] + 1); + + if ($tokens[$firstPointerInIf]['code'] === T_RETURN && $tokens[$firstPointerInElse]['code'] === T_RETURN) { + $this->checkIfWithReturns($phpcsFile, $ifPointer, $elsePointer, $firstPointerInIf, $firstPointerInElse); + return; + } + + $this->checkIfWithAssignments($phpcsFile, $ifPointer, $elsePointer, $firstPointerInIf, $firstPointerInElse); + } + + private function checkIfWithReturns(File $phpcsFile, int $ifPointer, int $elsePointer, int $returnInIf, int $returnInElse): void + { + $ifContainsComment = $this->containsComment($phpcsFile, $ifPointer); + $elseContainsComment = $this->containsComment($phpcsFile, $elsePointer); + $conditionContainsLogicalOperators = $this->containsLogicalOperators($phpcsFile, $ifPointer); + + $errorParameters = [ + 'Use ternary operator.', + $ifPointer, + self::CODE_TERNARY_OPERATOR_NOT_USED, + ]; + + if ($ifContainsComment || $elseContainsComment || $conditionContainsLogicalOperators) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $pointerAfterReturnInIf = TokenHelper::findNextEffective($phpcsFile, $returnInIf + 1); + /** @var int $semicolonAfterReturnInIf */ + $semicolonAfterReturnInIf = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $pointerAfterReturnInIf + 1); + $pointerAfterReturnInElse = TokenHelper::findNextEffective($phpcsFile, $returnInElse + 1); + $semicolonAfterReturnInElse = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $pointerAfterReturnInElse + 1); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($ifPointer, 'return'); + if ($ifPointer + 1 === $tokens[$ifPointer]['parenthesis_opener']) { + $phpcsFile->fixer->addContent($ifPointer, ' '); + } + $phpcsFile->fixer->replaceToken($tokens[$ifPointer]['parenthesis_opener'], ''); + $phpcsFile->fixer->replaceToken($tokens[$ifPointer]['parenthesis_closer'], ' ? '); + + FixerHelper::removeBetween($phpcsFile, $tokens[$ifPointer]['parenthesis_closer'], $pointerAfterReturnInIf); + + FixerHelper::change($phpcsFile, $semicolonAfterReturnInIf, $pointerAfterReturnInElse - 1, ' : '); + + FixerHelper::removeBetweenIncluding($phpcsFile, $semicolonAfterReturnInElse + 1, $tokens[$elsePointer]['scope_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkIfWithAssignments( + File $phpcsFile, + int $ifPointer, + int $elsePointer, + int $firstPointerInIf, + int $firstPointerInElse + ): void + { + $tokens = $phpcsFile->getTokens(); + + $identificatorEndPointerInIf = IdentificatorHelper::findEndPointer($phpcsFile, $firstPointerInIf); + $identificatorEndPointerInElse = IdentificatorHelper::findEndPointer($phpcsFile, $firstPointerInElse); + + if ($identificatorEndPointerInIf === null || $identificatorEndPointerInElse === null) { + return; + } + + $identificatorInIf = TokenHelper::getContent($phpcsFile, $firstPointerInIf, $identificatorEndPointerInIf); + $identificatorInElse = TokenHelper::getContent($phpcsFile, $firstPointerInElse, $identificatorEndPointerInElse); + + if ($identificatorInIf !== $identificatorInElse) { + return; + } + + $assignmentPointerInIf = TokenHelper::findNextEffective($phpcsFile, $identificatorEndPointerInIf + 1); + $assignmentPointerInElse = TokenHelper::findNextEffective($phpcsFile, $identificatorEndPointerInElse + 1); + + if ( + $tokens[$assignmentPointerInIf]['code'] !== T_EQUAL + || $tokens[$assignmentPointerInElse]['code'] !== T_EQUAL + ) { + return; + } + + $pointerAfterAssignmentInIf = TokenHelper::findNextEffective($phpcsFile, $assignmentPointerInIf + 1); + $pointerAfterAssignmentInElse = TokenHelper::findNextEffective($phpcsFile, $assignmentPointerInElse + 1); + + if ( + $tokens[$pointerAfterAssignmentInIf]['code'] === T_BITWISE_AND || + $tokens[$pointerAfterAssignmentInElse]['code'] === T_BITWISE_AND + ) { + return; + } + + $ifContainsComment = $this->containsComment($phpcsFile, $ifPointer); + $elseContainsComment = $this->containsComment($phpcsFile, $elsePointer); + $conditionContainsLogicalOperators = $this->containsLogicalOperators($phpcsFile, $ifPointer); + + $errorParameters = [ + 'Use ternary operator.', + $ifPointer, + self::CODE_TERNARY_OPERATOR_NOT_USED, + ]; + + if ($ifContainsComment || $elseContainsComment || $conditionContainsLogicalOperators) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + /** @var int $semicolonAfterAssignmentInIf */ + $semicolonAfterAssignmentInIf = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $pointerAfterAssignmentInIf + 1); + $semicolonAfterAssignmentInElse = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $pointerAfterAssignmentInElse + 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$ifPointer]['parenthesis_opener'], sprintf('%s = ', $identificatorInIf)); + + FixerHelper::change($phpcsFile, $tokens[$ifPointer]['parenthesis_closer'], $pointerAfterAssignmentInIf - 1, ' ? '); + + FixerHelper::change($phpcsFile, $semicolonAfterAssignmentInIf, $pointerAfterAssignmentInElse - 1, ' : '); + + FixerHelper::removeBetweenIncluding($phpcsFile, $semicolonAfterAssignmentInElse + 1, $tokens[$elsePointer]['scope_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function isCompatibleScope(File $phpcsFile, int $scopeOpenerPointer, int $scopeCloserPointer): bool + { + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $scopeOpenerPointer + 1, $scopeCloserPointer); + if ($semicolonPointer === null) { + return false; + } + + if (TokenHelper::findNext($phpcsFile, T_INLINE_THEN, $scopeOpenerPointer + 1, $semicolonPointer) !== null) { + return false; + } + + if ($this->ignoreMultiLine) { + $firstContentPointer = TokenHelper::findNextEffective($phpcsFile, $scopeOpenerPointer + 1); + if (TokenHelper::findNextContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $firstContentPointer + 1, + $semicolonPointer + ) !== null) { + return false; + } + } + + $pointerAfterSemicolon = TokenHelper::findNextEffective($phpcsFile, $semicolonPointer + 1); + return $pointerAfterSemicolon === $scopeCloserPointer; + } + + private function containsComment(File $phpcsFile, int $scopeOwnerPointer): bool + { + $tokens = $phpcsFile->getTokens(); + return TokenHelper::findNext( + $phpcsFile, + Tokens::$commentTokens, + $tokens[$scopeOwnerPointer]['scope_opener'] + 1, + $tokens[$scopeOwnerPointer]['scope_closer'] + ) !== null; + } + + private function containsLogicalOperators(File $phpcsFile, int $scopeOwnerPointer): bool + { + $tokens = $phpcsFile->getTokens(); + return TokenHelper::findNext( + $phpcsFile, + [T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR], + $tokens[$scopeOwnerPointer]['parenthesis_opener'] + 1, + $tokens[$scopeOwnerPointer]['parenthesis_closer'] + ) !== null; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireYodaComparisonSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireYodaComparisonSniff.php new file mode 100644 index 0000000..cc0a319 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/RequireYodaComparisonSniff.php @@ -0,0 +1,74 @@ + (Foo::BAR, BAR) + * > (true, false, null, 1, 1.0, arrays, 'foo') + */ +class RequireYodaComparisonSniff implements Sniff +{ + + public const CODE_REQUIRED_YODA_COMPARISON = 'RequiredYodaComparison'; + + /** @var bool */ + public $alwaysVariableOnRight = false; + + /** + * @return array + */ + public function register(): array + { + return [ + T_IS_IDENTICAL, + T_IS_NOT_IDENTICAL, + T_IS_EQUAL, + T_IS_NOT_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $comparisonTokenPointer + */ + public function process(File $phpcsFile, $comparisonTokenPointer): void + { + $tokens = $phpcsFile->getTokens(); + $leftSideTokens = YodaHelper::getLeftSideTokens($tokens, $comparisonTokenPointer); + $rightSideTokens = YodaHelper::getRightSideTokens($tokens, $comparisonTokenPointer); + $leftDynamism = YodaHelper::getDynamismForTokens($tokens, $leftSideTokens); + $rightDynamism = YodaHelper::getDynamismForTokens($tokens, $rightSideTokens); + + if ($leftDynamism === null || $rightDynamism === null) { + return; + } + + if ($leftDynamism <= $rightDynamism) { + return; + } + + if (!$this->alwaysVariableOnRight && $leftDynamism >= 900 && $rightDynamism >= 900) { + return; + } + + $fix = $phpcsFile->addFixableError('Yoda comparison is required.', $comparisonTokenPointer, self::CODE_REQUIRED_YODA_COMPARISON); + if (!$fix || count($leftSideTokens) === 0 || count($rightSideTokens) === 0) { + return; + } + + YodaHelper::fix($phpcsFile, $leftSideTokens, $rightSideTokens); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UnsupportedKeywordException.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UnsupportedKeywordException.php new file mode 100644 index 0000000..9379e0e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UnsupportedKeywordException.php @@ -0,0 +1,17 @@ + + */ + public function register(): array + { + return [ + T_IF, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $ifPointer + */ + public function process(File $phpcsFile, $ifPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('scope_closer', $tokens[$ifPointer])) { + // If without curly braces is not supported. + return; + } + + $ifBooleanPointer = $this->findBooleanAfterReturnInScope($phpcsFile, $tokens[$ifPointer]['scope_opener']); + if ($ifBooleanPointer === null) { + return; + } + + $newCondition = static function () use ($phpcsFile, $tokens, $ifBooleanPointer, $ifPointer): string { + return strtolower($tokens[$ifBooleanPointer]['content']) === 'true' + ? TokenHelper::getContent( + $phpcsFile, + $tokens[$ifPointer]['parenthesis_opener'] + 1, + $tokens[$ifPointer]['parenthesis_closer'] - 1 + ) + : ConditionHelper::getNegativeCondition( + $phpcsFile, + $tokens[$ifPointer]['parenthesis_opener'] + 1, + $tokens[$ifPointer]['parenthesis_closer'] - 1 + ); + }; + + $elsePointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$ifPointer]['scope_closer'] + 1); + + $errorParameters = [ + 'Useless condition.', + $ifPointer, + self::CODE_USELESS_IF_CONDITION, + ]; + + if ( + $elsePointer !== null + && $tokens[$elsePointer]['code'] === T_ELSE + ) { + if (!array_key_exists('scope_closer', $tokens[$elsePointer])) { + // Else without curly braces is not supported. + return; + } + + $elseBooleanPointer = $this->findBooleanAfterReturnInScope($phpcsFile, $tokens[$elsePointer]['scope_opener']); + if ($elseBooleanPointer === null) { + return; + } + + if (!$this->isFixable($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer'])) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $tokens[$elsePointer]['scope_closer'], sprintf('return %s;', $newCondition())); + + $phpcsFile->fixer->endChangeset(); + } else { + $returnPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$ifPointer]['scope_closer'] + 1); + + if ($returnPointer === null) { + return; + } + + if ($tokens[$returnPointer]['code'] !== T_RETURN) { + return; + } + + $semicolonPointer = $this->findSemicolonAfterReturnWithBoolean($phpcsFile, $returnPointer); + if ($semicolonPointer === null) { + return; + } + + if (!$this->isFixable($phpcsFile, $ifPointer, $semicolonPointer)) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $ifPointer, $semicolonPointer, sprintf('return %s;', $newCondition())); + + $phpcsFile->fixer->endChangeset(); + } + } + + private function isFixable(File $phpcsFile, int $ifPointer, int $endPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + if (TokenHelper::findNext($phpcsFile, Tokens::$commentTokens, $ifPointer + 1, $endPointer) !== null) { + return false; + } + + if ($this->assumeAllConditionExpressionsAreAlreadyBoolean) { + return true; + } + + return ConditionHelper::conditionReturnsBoolean( + $phpcsFile, + $tokens[$ifPointer]['parenthesis_opener'] + 1, + $tokens[$ifPointer]['parenthesis_closer'] - 1 + ); + } + + private function findBooleanAfterReturnInScope(File $phpcsFile, int $scopeOpenerPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $returnPointer */ + $returnPointer = TokenHelper::findNextEffective($phpcsFile, $scopeOpenerPointer + 1); + if ($tokens[$returnPointer]['code'] !== T_RETURN) { + return null; + } + + $booleanPointer = $this->findBooleanAfterReturn($phpcsFile, $returnPointer); + if ($booleanPointer === null) { + return null; + } + + $semicolonPointer = TokenHelper::findNextEffective($phpcsFile, $booleanPointer + 1); + if ($tokens[$semicolonPointer]['code'] !== T_SEMICOLON) { + return null; + } + + return $booleanPointer; + } + + private function findBooleanAfterReturn(File $phpcsFile, int $returnPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $booleanPointer = TokenHelper::findNextEffective($phpcsFile, $returnPointer + 1); + if (in_array($tokens[$booleanPointer]['code'], [T_TRUE, T_FALSE], true)) { + return $booleanPointer; + } + + return null; + } + + private function findSemicolonAfterReturnWithBoolean(File $phpcsFile, int $returnPointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $booleanPointer = $this->findBooleanAfterReturn($phpcsFile, $returnPointer); + if ($booleanPointer === null) { + return null; + } + + $semicolonPointer = TokenHelper::findNextEffective($phpcsFile, $booleanPointer + 1); + if ($tokens[$semicolonPointer]['code'] !== T_SEMICOLON) { + return null; + } + + return $semicolonPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php new file mode 100644 index 0000000..55f5113 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/UselessTernaryOperatorSniff.php @@ -0,0 +1,105 @@ + + */ + public function register(): array + { + return [ + T_INLINE_THEN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $inlineThenPointer + */ + public function process(File $phpcsFile, $inlineThenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $pointerAfterInlineThen = TokenHelper::findNextEffective($phpcsFile, $inlineThenPointer + 1); + if ($tokens[$pointerAfterInlineThen]['code'] === T_INLINE_ELSE) { + $inlineElsePointer = $pointerAfterInlineThen; + } else { + if (!in_array($tokens[$pointerAfterInlineThen]['code'], [T_TRUE, T_FALSE], true)) { + return; + } + + $inlineElsePointer = TokenHelper::findNextEffective($phpcsFile, $pointerAfterInlineThen + 1); + if ($tokens[$inlineElsePointer]['code'] !== T_INLINE_ELSE) { + return; + } + } + + $pointerAfterInlineElse = TokenHelper::findNextEffective($phpcsFile, $inlineElsePointer + 1); + if (!in_array($tokens[$pointerAfterInlineElse]['code'], [T_TRUE, T_FALSE], true)) { + return; + } + + $conditionStartPointer = TernaryOperatorHelper::getStartPointer($phpcsFile, $inlineThenPointer); + /** @var int $conditionEndPointer */ + $conditionEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $inlineThenPointer - 1); + + $errorParameters = [ + 'Useless ternary operator.', + $inlineThenPointer, + self::CODE_USELESS_TERNARY_OPERATOR, + ]; + + if ( + !$this->assumeAllConditionExpressionsAreAlreadyBoolean + && !ConditionHelper::conditionReturnsBoolean($phpcsFile, $conditionStartPointer, $conditionEndPointer) + ) { + if ($tokens[$pointerAfterInlineThen]['code'] !== T_INLINE_ELSE) { + $phpcsFile->addError(...$errorParameters); + } + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + $inlineElseEndPointer = TernaryOperatorHelper::getEndPointer($phpcsFile, $inlineThenPointer, $inlineElsePointer); + + $pointerAfterTernaryOperator = TokenHelper::findNextEffective($phpcsFile, $inlineElseEndPointer + 1); + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$pointerAfterInlineThen]['code'] === T_FALSE) { + $negativeCondition = ConditionHelper::getNegativeCondition($phpcsFile, $conditionStartPointer, $conditionEndPointer); + + FixerHelper::change($phpcsFile, $conditionStartPointer, $conditionEndPointer, $negativeCondition); + } + + FixerHelper::removeBetween($phpcsFile, $conditionEndPointer, $pointerAfterTernaryOperator); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php new file mode 100644 index 0000000..8a3c292 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DeadCatchSniff.php @@ -0,0 +1,56 @@ + + */ + public function register(): array + { + return [ + T_CATCH, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $catchPointer + */ + public function process(File $phpcsFile, $catchPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $catchToken = $tokens[$catchPointer]; + $caughtTypes = CatchHelper::findCaughtTypesInCatch($phpcsFile, $catchToken); + + if (!in_array('\\Throwable', $caughtTypes, true)) { + return; + } + + $nextCatchPointer = TokenHelper::findNextEffective($phpcsFile, $catchToken['scope_closer'] + 1); + + while ($nextCatchPointer !== null) { + $nextCatchToken = $tokens[$nextCatchPointer]; + if ($nextCatchToken['code'] !== T_CATCH) { + break; + } + + $phpcsFile->addError('Unreachable catch block.', $nextCatchPointer, self::CODE_CATCH_AFTER_THROWABLE_CATCH); + + $nextCatchPointer = TokenHelper::findNextEffective($phpcsFile, $nextCatchToken['scope_closer'] + 1); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DisallowNonCapturingCatchSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DisallowNonCapturingCatchSniff.php new file mode 100644 index 0000000..fcf40c9 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/DisallowNonCapturingCatchSniff.php @@ -0,0 +1,46 @@ + + */ + public function register(): array + { + return [ + T_CATCH, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $catchPointer + */ + public function process(File $phpcsFile, $catchPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $variablePointer = TokenHelper::findNext( + $phpcsFile, + T_VARIABLE, + $tokens[$catchPointer]['parenthesis_opener'], + $tokens[$catchPointer]['parenthesis_closer'] + ); + + if ($variablePointer === null) { + $phpcsFile->addError('Use of non-capturing catch is disallowed.', $catchPointer, self::CODE_DISALLOWED_NON_CAPTURING_CATCH); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php new file mode 100644 index 0000000..3769e0a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/ReferenceThrowableOnlySniff.php @@ -0,0 +1,139 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $message = sprintf('Referencing general \%s; use \%s instead.', Exception::class, Throwable::class); + $referencedNames = ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer); + foreach ($referencedNames as $referencedName) { + $resolvedName = NamespaceHelper::resolveClassName( + $phpcsFile, + $referencedName->getNameAsReferencedInFile(), + $referencedName->getStartPointer() + ); + if ($resolvedName !== '\\Exception') { + continue; + } + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $referencedName->getStartPointer() - 1); + if (in_array($tokens[$previousPointer]['code'], [T_EXTENDS, T_NEW, T_INSTANCEOF], true)) { + // Allow \Exception in extends and instantiating it + continue; + } + if ($tokens[$previousPointer]['code'] === T_BITWISE_OR) { + $previousPointer = TokenHelper::findPreviousExcluding( + $phpcsFile, + array_merge(TokenHelper::$ineffectiveTokenCodes, TokenHelper::getNameTokenCodes(), [T_BITWISE_OR]), + $previousPointer - 1 + ); + } + if ($tokens[$previousPointer]['code'] === T_OPEN_PARENTHESIS) { + /** @var int $openParenthesisOpenerPointer */ + $openParenthesisOpenerPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + if ($tokens[$openParenthesisOpenerPointer]['code'] === T_CATCH) { + if ($this->searchForThrowableInNextCatches($phpcsFile, $openParenthesisOpenerPointer)) { + continue; + } + } elseif ( + array_key_exists('parenthesis_owner', $tokens[$previousPointer]) + && $tokens[$tokens[$previousPointer]['parenthesis_owner']]['code'] === T_FUNCTION + && $tokens[$previousPointer]['parenthesis_closer'] > $referencedName->getStartPointer() + && SuppressHelper::isSniffSuppressed( + $phpcsFile, + $openParenthesisOpenerPointer, + sprintf('%s.%s', self::NAME, self::CODE_REFERENCED_GENERAL_EXCEPTION) + ) + ) { + continue; + } + } + + $fix = $phpcsFile->addFixableError( + $message, + $referencedName->getStartPointer(), + self::CODE_REFERENCED_GENERAL_EXCEPTION + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer(), '\Throwable'); + + $phpcsFile->fixer->endChangeset(); + } + } + + private function searchForThrowableInNextCatches(File $phpcsFile, int $catchPointer): bool + { + $tokens = $phpcsFile->getTokens(); + $nextCatchPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$catchPointer]['scope_closer'] + 1); + + while ($nextCatchPointer !== null) { + $nextCatchToken = $tokens[$nextCatchPointer]; + if ($nextCatchToken['code'] !== T_CATCH) { + break; + } + + $caughtTypes = CatchHelper::findCaughtTypesInCatch($phpcsFile, $nextCatchToken); + if (in_array('\\Throwable', $caughtTypes, true)) { + return true; + } + + $nextCatchPointer = TokenHelper::findNextEffective($phpcsFile, $nextCatchToken['scope_closer'] + 1); + } + + return false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/RequireNonCapturingCatchSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/RequireNonCapturingCatchSniff.php new file mode 100644 index 0000000..cbe8810 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Exceptions/RequireNonCapturingCatchSniff.php @@ -0,0 +1,170 @@ + + */ + public function register(): array + { + return [ + T_CATCH, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $catchPointer + */ + public function process(File $phpcsFile, $catchPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $variablePointer = TokenHelper::findNext( + $phpcsFile, + T_VARIABLE, + $tokens[$catchPointer]['parenthesis_opener'], + $tokens[$catchPointer]['parenthesis_closer'] + ); + if ($variablePointer === null) { + return; + } + + $variableName = $tokens[$variablePointer]['content']; + + if ($this->isVariableUsedInCodePart( + $phpcsFile, + $tokens[$catchPointer]['scope_opener'], + $tokens[$catchPointer]['scope_closer'], + $variableName + )) { + return; + } + + $tryEndPointer = CatchHelper::getTryEndPointer($phpcsFile, $catchPointer); + + $possibleFinallyPointer = $tokens[$tryEndPointer]['scope_condition']; + if ( + $tokens[$possibleFinallyPointer]['code'] === T_FINALLY + && $this->isVariableUsedInCodePart( + $phpcsFile, + $tokens[$possibleFinallyPointer]['scope_opener'], + $tokens[$possibleFinallyPointer]['scope_closer'], + $variableName + ) + ) { + return; + } + + $nextScopeEnd = count($tokens) - 1; + + foreach (array_reverse($tokens[$tryEndPointer]['conditions'], true) as $conditionPointer => $conditionCode) { + if (in_array($conditionCode, TokenHelper::$functionTokenCodes, true)) { + $nextScopeEnd = $tokens[$conditionPointer]['scope_closer']; + break; + } + } + + if ($this->isVariableUsedInCodePart($phpcsFile, $tryEndPointer, $nextScopeEnd, $variableName)) { + return; + } + + $fix = $phpcsFile->addFixableError('Non-capturing catch is required.', $catchPointer, self::CODE_NON_CAPTURING_CATCH_REQUIRED); + + if (!$fix) { + return; + } + + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + $fixEndPointer = TokenHelper::findNextContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $variablePointer + 1, + $tokens[$catchPointer]['parenthesis_closer'] + ); + if ($fixEndPointer === null) { + $fixEndPointer = $tokens[$catchPointer]['parenthesis_closer']; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeVariable, $fixEndPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function isVariableUsedInCodePart(File $phpcsFile, int $codeStartPointer, int $codeEndPointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + $firstPointerInCode = $codeStartPointer + 1; + + for ($i = $firstPointerInCode; $i <= $codeEndPointer; $i++) { + if ($tokens[$i]['code'] === T_VARIABLE) { + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + if (ParameterHelper::isParameter($phpcsFile, $i)) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $firstPointerInCode, $i)) { + continue; + } + + $catchPointer = TokenHelper::findPrevious($phpcsFile, T_CATCH, $i - 1, $firstPointerInCode); + if ($catchPointer === null) { + return true; + } + + if ($tokens[$catchPointer]['parenthesis_closer'] < $i) { + return true; + } + + } elseif ( + in_array($tokens[$i]['code'], [T_DOUBLE_QUOTED_STRING, T_HEREDOC], true) + && VariableHelper::isUsedInScopeInString($phpcsFile, $variableName, $i) + ) { + return true; + } + } + + return false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FileLengthSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FileLengthSniff.php new file mode 100644 index 0000000..a3e0108 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FileLengthSniff.php @@ -0,0 +1,63 @@ + + */ + public function register(): array + { + return [T_OPEN_TAG]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->maxLinesLength = SniffSettingsHelper::normalizeInteger($this->maxLinesLength); + $flags = array_keys(array_filter([ + FunctionHelper::LINE_INCLUDE_COMMENT => $this->includeComments, + FunctionHelper::LINE_INCLUDE_WHITESPACE => $this->includeWhitespace, + ])); + $flags = array_reduce($flags, static function ($carry, $flag): int { + return $carry | $flag; + }, 0); + + $length = FunctionHelper::getLineCount($phpcsFile, $pointer, $flags); + + if ($length <= $this->maxLinesLength) { + return; + } + + $errorMessage = sprintf('Your file is too long. Currently using %d lines. Can be up to %d lines.', $length, $this->maxLinesLength); + + $phpcsFile->addError($errorMessage, $pointer, self::CODE_FILE_TOO_LONG); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php new file mode 100644 index 0000000..768bb9a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/FilepathNamespaceExtractor.php @@ -0,0 +1,88 @@ + */ + private $rootNamespaces; + + /** @var array dir(string) => true(bool) */ + private $skipDirs; + + /** @var list */ + private $extensions; + + /** + * @param array $rootNamespaces directory(string) => namespace + * @param list $skipDirs + * @param list $extensions index(integer) => extension + */ + public function __construct(array $rootNamespaces, array $skipDirs, array $extensions) + { + $this->rootNamespaces = $rootNamespaces; + $this->skipDirs = array_fill_keys($skipDirs, true); + $this->extensions = array_map(static function (string $extension): string { + return strtolower($extension); + }, $extensions); + } + + public function getTypeNameFromProjectPath(string $path): ?string + { + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + if (!in_array($extension, $this->extensions, true)) { + return null; + } + + /** @var list $pathParts */ + $pathParts = preg_split('~[/\\\]~', $path); + $rootNamespace = null; + while (count($pathParts) > 0) { + array_shift($pathParts); + foreach ($this->rootNamespaces as $directory => $namespace) { + if (!StringHelper::startsWith(implode('/', $pathParts) . '/', $directory . '/')) { + continue; + } + + $directoryPartsCount = count(explode('/', $directory)); + for ($i = 0; $i < $directoryPartsCount; $i++) { + array_shift($pathParts); + } + + $rootNamespace = $namespace; + break 2; + } + } + + if ($rootNamespace === null) { + return null; + } + + array_unshift($pathParts, $rootNamespace); + + $typeName = implode('\\', array_filter($pathParts, function (string $pathPart): bool { + return !isset($this->skipDirs[$pathPart]); + })); + + return substr($typeName, 0, -strlen('.' . $extension)); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/LineLengthSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/LineLengthSniff.php new file mode 100644 index 0000000..accfa53 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/LineLengthSniff.php @@ -0,0 +1,138 @@ + + */ + public function register(): array + { + return [T_OPEN_TAG]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): int + { + $tokens = $phpcsFile->getTokens(); + for ($i = 0; $i < $phpcsFile->numTokens; $i++) { + if ($tokens[$i]['column'] !== 1) { + continue; + } + + $this->checkLineLength($phpcsFile, $i); + } + + return $phpcsFile->numTokens + 1; + } + + private function checkLineLength(File $phpcsFile, int $pointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['column'] === 1 && $tokens[$pointer]['length'] === 0) { + // Blank line. + return; + } + + $line = $tokens[$pointer]['line']; + $nextLineStartPtr = $pointer; + while (isset($tokens[$nextLineStartPtr]) && $line === $tokens[$nextLineStartPtr]['line']) { + $pointer = $nextLineStartPtr; + $nextLineStartPtr++; + } + + if ($tokens[$pointer]['content'] === $phpcsFile->eolChar) { + $pointer--; + } + + $lineLength = $tokens[$pointer]['column'] + $tokens[$pointer]['length'] - 1; + if ($lineLength <= $this->lineLengthLimit) { + return; + } + + if (in_array($tokens[$pointer]['code'], [T_COMMENT, T_DOC_COMMENT_STRING], true)) { + if ($this->ignoreComments === true) { + return; + } + + // If this is a long comment, check if it can be broken up onto multiple lines. + // Some comments contain unbreakable strings like URLs and so it makes sense + // to ignore the line length in these cases if the URL would be longer than the max + // line length once you indent it to the correct level. + if ($lineLength > $this->lineLengthLimit) { + $oldLength = strlen($tokens[$pointer]['content']); + $newLength = strlen(ltrim($tokens[$pointer]['content'], "/#\t ")); + $indent = $tokens[$pointer]['column'] - 1 + $oldLength - $newLength; + + $nonBreakingLength = $tokens[$pointer]['length']; + + $space = strrpos($tokens[$pointer]['content'], ' '); + if ($space !== false) { + $nonBreakingLength -= $space + 1; + } + + if ($nonBreakingLength + $indent > $this->lineLengthLimit) { + return; + } + } + } + + if ($this->ignoreImports) { + $usePointer = UseStatementHelper::getUseStatementPointer($phpcsFile, $pointer - 1); + if ( + is_int($usePointer) + && $tokens[$usePointer]['line'] === $tokens[$pointer]['line'] + && UseStatementHelper::isImportUse($phpcsFile, $usePointer) + ) { + return; + } + } + + $error = sprintf('Line exceeds maximum limit of %s characters, contains %s characters.', $this->lineLengthLimit, $lineLength); + $phpcsFile->addError($error, $pointer, self::CODE_LINE_TOO_LONG); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php new file mode 100644 index 0000000..25b369f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Files/TypeNameMatchesFileNameSniff.php @@ -0,0 +1,188 @@ + */ + public $rootNamespaces = []; + + /** @var list */ + public $skipDirs = []; + + /** @var list */ + public $ignoredNamespaces = []; + + /** @var list */ + public $extensions = ['php']; + + /** @var array|null */ + private $normalizedRootNamespaces; + + /** @var list|null */ + private $normalizedSkipDirs; + + /** @var list|null */ + private $normalizedIgnoredNamespaces; + + /** @var list|null */ + private $normalizedExtensions; + + /** @var FilepathNamespaceExtractor */ + private $namespaceExtractor; + + /** + * @return array + */ + public function register(): array + { + return TokenHelper::$typeKeywordTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $typePointer + */ + public function process(File $phpcsFile, $typePointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $namePointer */ + $namePointer = TokenHelper::findNext($phpcsFile, T_STRING, $typePointer + 1); + + $typeName = NamespaceHelper::normalizeToCanonicalName(ClassHelper::getFullyQualifiedName($phpcsFile, $typePointer)); + + foreach ($this->getIgnoredNamespaces() as $ignoredNamespace) { + if (!StringHelper::startsWith($typeName, $ignoredNamespace . '\\')) { + continue; + } + + return; + } + + $filename = str_replace('/', DIRECTORY_SEPARATOR, $phpcsFile->getFilename()); + $basePath = str_replace('/', DIRECTORY_SEPARATOR, $phpcsFile->config->basepath ?? ''); + if ($basePath !== '' && StringHelper::startsWith($filename, $basePath)) { + $filename = substr($filename, strlen($basePath)); + } + + $expectedTypeName = $this->getNamespaceExtractor()->getTypeNameFromProjectPath($filename); + if ($typeName === $expectedTypeName) { + return; + } + + $phpcsFile->addError( + sprintf( + '%s name %s does not match filepath %s.', + ucfirst($tokens[$typePointer]['content']), + $typeName, + $phpcsFile->getFilename() + ), + $namePointer, + self::CODE_NO_MATCH_BETWEEN_TYPE_NAME_AND_FILE_NAME + ); + } + + /** + * @return array path(string) => namespace + */ + private function getRootNamespaces(): array + { + if ($this->normalizedRootNamespaces === null) { + /** @var array $normalizedRootNamespaces */ + $normalizedRootNamespaces = SniffSettingsHelper::normalizeAssociativeArray($this->rootNamespaces); + $this->normalizedRootNamespaces = $normalizedRootNamespaces; + uksort($this->normalizedRootNamespaces, static function (string $a, string $b): int { + $aParts = explode('/', str_replace('\\', '/', $a)); + $bParts = explode('/', str_replace('\\', '/', $b)); + + $minPartsCount = min(count($aParts), count($bParts)); + for ($i = 0; $i < $minPartsCount; $i++) { + $comparison = strcasecmp($bParts[$i], $aParts[$i]); + if ($comparison === 0) { + continue; + } + + return $comparison; + } + + return count($bParts) <=> count($aParts); + }); + } + + return $this->normalizedRootNamespaces; + } + + /** + * @return list + */ + private function getSkipDirs(): array + { + if ($this->normalizedSkipDirs === null) { + $this->normalizedSkipDirs = SniffSettingsHelper::normalizeArray($this->skipDirs); + } + + return $this->normalizedSkipDirs; + } + + /** + * @return list + */ + private function getIgnoredNamespaces(): array + { + if ($this->normalizedIgnoredNamespaces === null) { + $this->normalizedIgnoredNamespaces = SniffSettingsHelper::normalizeArray($this->ignoredNamespaces); + } + + return $this->normalizedIgnoredNamespaces; + } + + /** + * @return list + */ + private function getExtensions(): array + { + if ($this->normalizedExtensions === null) { + $this->normalizedExtensions = SniffSettingsHelper::normalizeArray($this->extensions); + } + + return $this->normalizedExtensions; + } + + private function getNamespaceExtractor(): FilepathNamespaceExtractor + { + if ($this->namespaceExtractor === null) { + $this->namespaceExtractor = new FilepathNamespaceExtractor( + $this->getRootNamespaces(), + $this->getSkipDirs(), + $this->getExtensions() + ); + } + + return $this->namespaceExtractor; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/AbstractLineCall.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/AbstractLineCall.php new file mode 100644 index 0000000..72c8699 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/AbstractLineCall.php @@ -0,0 +1,102 @@ + + */ + public function register(): array + { + return array_merge(TokenHelper::getOnlyNameTokenCodes(), [T_SELF, T_STATIC, T_PARENT]); + } + + protected function isCall(File $phpcsFile, int $stringPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + + if ($tokens[$nextPointer]['code'] !== T_OPEN_PARENTHESIS) { + return false; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $stringPointer - 1); + + return $tokens[$previousPointer]['code'] !== T_FUNCTION; + } + + protected function getLineStart(File $phpcsFile, int $pointer): string + { + $firstPointerOnLine = TokenHelper::findFirstTokenOnLine($phpcsFile, $pointer); + + return IndentationHelper::convertTabsToSpaces($phpcsFile, TokenHelper::getContent($phpcsFile, $firstPointerOnLine, $pointer)); + } + + protected function getCall(File $phpcsFile, int $parenthesisOpenerPointer, int $parenthesisCloserPointer): string + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeParenthesisCloser = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisCloserPointer - 1); + + $endPointer = $tokens[$pointerBeforeParenthesisCloser]['code'] === T_COMMA + ? $pointerBeforeParenthesisCloser + : $parenthesisCloserPointer; + + $call = ''; + + for ($i = $parenthesisOpenerPointer + 1; $i < $endPointer; $i++) { + if ($tokens[$i]['code'] === T_COMMA) { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$nextPointer]['code'] === T_CLOSE_PARENTHESIS) { + $i = $nextPointer - 1; + continue; + } + } + + if ($tokens[$i]['code'] === T_WHITESPACE) { + if ($tokens[$i]['content'] === $phpcsFile->eolChar) { + if ($tokens[$i - 1]['code'] === T_COMMA) { + $call .= ' '; + } + + continue; + + } if ($tokens[$i]['column'] === 1) { + // Nothing + continue; + } + } + + $call .= $tokens[$i]['content']; + } + + return trim($call); + } + + protected function getLineEnd(File $phpcsFile, int $pointer): string + { + $firstPointerOnNextLine = TokenHelper::findFirstTokenOnNextLine($phpcsFile, $pointer); + + return rtrim(TokenHelper::getContent($phpcsFile, $pointer, $firstPointerOnNextLine - 1)); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/ArrowFunctionDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/ArrowFunctionDeclarationSniff.php new file mode 100644 index 0000000..e593423 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/ArrowFunctionDeclarationSniff.php @@ -0,0 +1,181 @@ + + */ + public function register(): array + { + return [ + T_FN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $arrowFunctionPointer + */ + public function process(File $phpcsFile, $arrowFunctionPointer): void + { + $this->spacesCountAfterKeyword = SniffSettingsHelper::normalizeInteger($this->spacesCountAfterKeyword); + $this->spacesCountBeforeArrow = SniffSettingsHelper::normalizeInteger($this->spacesCountBeforeArrow); + $this->spacesCountAfterArrow = SniffSettingsHelper::normalizeInteger($this->spacesCountAfterArrow); + + $this->checkSpacesAfterKeyword($phpcsFile, $arrowFunctionPointer); + + $arrowPointer = TokenHelper::findNext($phpcsFile, T_FN_ARROW, $arrowFunctionPointer); + + $this->checkSpacesBeforeArrow($phpcsFile, $arrowPointer); + $this->checkSpacesAfterArrow($phpcsFile, $arrowPointer); + } + + private function checkSpacesAfterKeyword(File $phpcsFile, int $arrowFunctionPointer): void + { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $arrowFunctionPointer + 1); + + $spaces = TokenHelper::getContent($phpcsFile, $arrowFunctionPointer + 1, $pointerAfter - 1); + + if ($this->allowMultiLine && strpos($spaces, $phpcsFile->eolChar) === 0) { + return; + } + + $actualSpaces = strlen($spaces); + + if ( + $actualSpaces === $this->spacesCountAfterKeyword + && ( + $this->spacesCountAfterKeyword === 0 + || preg_match('~^ +$~', $spaces) === 1 + ) + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + $this->formatErrorMessage('after "fn" keyword', $this->spacesCountAfterKeyword), + $arrowFunctionPointer, + self::CODE_INCORRECT_SPACES_AFTER_KEYWORD + ); + if (!$fix) { + return; + } + + $this->fixSpaces($phpcsFile, $arrowFunctionPointer, $pointerAfter, $this->spacesCountAfterKeyword); + } + + private function checkSpacesBeforeArrow(File $phpcsFile, int $arrowPointer): void + { + $pointerBefore = TokenHelper::findPreviousNonWhitespace($phpcsFile, $arrowPointer - 1); + + $spaces = TokenHelper::getContent($phpcsFile, $pointerBefore + 1, $arrowPointer - 1); + + if ($this->allowMultiLine && strpos($spaces, $phpcsFile->eolChar) === 0) { + return; + } + + $actualSpaces = strlen($spaces); + + if ( + $actualSpaces === $this->spacesCountBeforeArrow + && ( + $this->spacesCountBeforeArrow === 0 + || preg_match('~^ +$~', $spaces) === 1 + ) + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + $this->formatErrorMessage('before =>', $this->spacesCountBeforeArrow), + $arrowPointer, + self::CODE_INCORRECT_SPACES_BEFORE_ARROW + ); + if (!$fix) { + return; + } + + $this->fixSpaces($phpcsFile, $pointerBefore, $arrowPointer, $this->spacesCountBeforeArrow); + } + + private function checkSpacesAfterArrow(File $phpcsFile, int $arrowPointer): void + { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $arrowPointer + 1); + + $spaces = TokenHelper::getContent($phpcsFile, $arrowPointer + 1, $pointerAfter - 1); + + if ($this->allowMultiLine && strpos($spaces, $phpcsFile->eolChar) === 0) { + return; + } + + $actualSpaces = strlen($spaces); + + if ($actualSpaces === $this->spacesCountAfterArrow && ($this->spacesCountAfterArrow === 0 || preg_match('~^ +$~', $spaces) === 1)) { + return; + } + + $fix = $phpcsFile->addFixableError( + $this->formatErrorMessage('after =>', $this->spacesCountAfterArrow), + $arrowPointer, + self::CODE_INCORRECT_SPACES_AFTER_ARROW + ); + if (!$fix) { + return; + } + + $this->fixSpaces($phpcsFile, $arrowPointer, $pointerAfter, $this->spacesCountAfterArrow); + } + + private function formatErrorMessage(string $suffix, int $requiredSpaces): string + { + return $requiredSpaces === 0 + ? sprintf('There must be no whitespace %s.', $suffix) + : sprintf('There must be exactly %d whitespace%s %s.', $requiredSpaces, $requiredSpaces !== 1 ? 's' : '', $suffix); + } + + private function fixSpaces(File $phpcsFile, int $pointerBefore, int $pointerAfter, int $requiredSpaces): void + { + $phpcsFile->fixer->beginChangeset(); + + if ($requiredSpaces > 0) { + $phpcsFile->fixer->addContent($pointerBefore, str_repeat(' ', $requiredSpaces)); + } + + FixerHelper::removeBetween($phpcsFile, $pointerBefore, $pointerAfter); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowArrowFunctionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowArrowFunctionSniff.php new file mode 100644 index 0000000..31520d0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowArrowFunctionSniff.php @@ -0,0 +1,33 @@ + + */ + public function register(): array + { + return [ + T_FN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $arrowFunctionPointer + */ + public function process(File $phpcsFile, $arrowFunctionPointer): void + { + $phpcsFile->addError('Use of arrow function is disallowed.', $arrowFunctionPointer, self::CODE_DISALLOWED_ARROW_FUNCTION); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowEmptyFunctionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowEmptyFunctionSniff.php new file mode 100644 index 0000000..704d30f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowEmptyFunctionSniff.php @@ -0,0 +1,69 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (FunctionHelper::isAbstract($phpcsFile, $functionPointer)) { + return; + } + + if (FunctionHelper::getName($phpcsFile, $functionPointer) === '__construct') { + $propertyPromotion = TokenHelper::findNext( + $phpcsFile, + Tokens::$scopeModifiers, + $tokens[$functionPointer]['parenthesis_opener'] + 1, + $tokens[$functionPointer]['parenthesis_closer'] + ); + + if ($propertyPromotion !== null) { + return; + } + } + + $firstContent = TokenHelper::findNextExcluding( + $phpcsFile, + T_WHITESPACE, + $tokens[$functionPointer]['scope_opener'] + 1, + $tokens[$functionPointer]['scope_closer'] + ); + + if ($firstContent !== null) { + return; + } + + $phpcsFile->addError( + 'Empty function body must have at least a comment to explain why is empty.', + $functionPointer, + self::CODE_EMPTY_FUNCTION + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowNamedArgumentsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowNamedArgumentsSniff.php new file mode 100644 index 0000000..500f0f4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowNamedArgumentsSniff.php @@ -0,0 +1,40 @@ + + */ + public function register(): array + { + return [ + T_PARAM_NAME, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $argumentNamePointer + */ + public function process(File $phpcsFile, $argumentNamePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $phpcsFile->addError( + sprintf('Named arguments are disallowed, usage of named argument "%s" found.', $tokens[$argumentNamePointer]['content']), + $argumentNamePointer, + self::CODE_DISALLOWED_NAMED_ARGUMENT + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInCallSniff.php new file mode 100644 index 0000000..2914a84 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInCallSniff.php @@ -0,0 +1,95 @@ + + */ + public function register(): array + { + return [ + T_OPEN_PARENTHESIS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $parenthesisOpenerPointer + */ + public function process(File $phpcsFile, $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (array_key_exists('parenthesis_owner', $tokens[$parenthesisOpenerPointer])) { + return; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if (!in_array( + $tokens[$pointerBeforeParenthesisOpener]['code'], + array_merge( + TokenHelper::getOnlyNameTokenCodes(), + [T_VARIABLE, T_ISSET, T_UNSET, T_CLOSE_PARENTHESIS, T_SELF, T_STATIC, T_PARENT] + ), + true + )) { + return; + } + + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + $pointerBeforeParenthesisCloser = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisCloserPointer - 1); + + if ($tokens[$pointerBeforeParenthesisCloser]['code'] !== T_COMMA) { + return; + } + + if ($this->onlySingleLine && $tokens[$parenthesisOpenerPointer]['line'] !== $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Trailing comma after the last parameter in function call is disallowed.', + $pointerBeforeParenthesisCloser, + self::CODE_DISALLOWED_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($pointerBeforeParenthesisCloser, ''); + + if ($tokens[$pointerBeforeParenthesisCloser]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + FixerHelper::removeBetween($phpcsFile, $pointerBeforeParenthesisCloser, $parenthesisCloserPointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInClosureUseSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInClosureUseSniff.php new file mode 100644 index 0000000..ad8e2bc --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInClosureUseSniff.php @@ -0,0 +1,86 @@ + + */ + public function register(): array + { + return [ + T_CLOSURE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisCloserPointer = $tokens[$functionPointer]['parenthesis_closer']; + + $usePointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); + + if ($tokens[$usePointer]['code'] !== T_USE) { + return; + } + + $useParenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + $useParenthesisCloserPointer = $tokens[$useParenthesisOpenerPointer]['parenthesis_closer']; + + $pointerBeforeUseParenthesisCloser = TokenHelper::findPreviousExcluding( + $phpcsFile, + T_WHITESPACE, + $tokens[$useParenthesisOpenerPointer]['parenthesis_closer'] - 1, + $useParenthesisOpenerPointer + ); + + if ($tokens[$pointerBeforeUseParenthesisCloser]['code'] !== T_COMMA) { + return; + } + + if ($this->onlySingleLine && $tokens[$useParenthesisOpenerPointer]['line'] !== $tokens[$useParenthesisCloserPointer]['line']) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Trailing comma after the last inherited variable in "use" of closure declaration is disallowed.', + $pointerBeforeUseParenthesisCloser, + self::CODE_DISALLOWED_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($pointerBeforeUseParenthesisCloser, ''); + + if ($tokens[$pointerBeforeUseParenthesisCloser]['line'] === $tokens[$useParenthesisCloserPointer]['line']) { + FixerHelper::removeBetween($phpcsFile, $pointerBeforeUseParenthesisCloser, $useParenthesisCloserPointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInDeclarationSniff.php new file mode 100644 index 0000000..4e3c747 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/DisallowTrailingCommaInDeclarationSniff.php @@ -0,0 +1,74 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $tokens[$functionPointer]['parenthesis_opener']; + $parenthesisCloserPointer = $tokens[$functionPointer]['parenthesis_closer']; + + $pointerBeforeParenthesisCloser = TokenHelper::findPreviousExcluding( + $phpcsFile, + T_WHITESPACE, + $parenthesisCloserPointer - 1, + $parenthesisOpenerPointer + ); + + if ($tokens[$pointerBeforeParenthesisCloser]['code'] !== T_COMMA) { + return; + } + + if ($this->onlySingleLine && $tokens[$parenthesisOpenerPointer]['line'] !== $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Trailing comma after the last parameter in function declaration is disallowed.', + $pointerBeforeParenthesisCloser, + self::CODE_DISALLOWED_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($pointerBeforeParenthesisCloser, ''); + + if ($tokens[$pointerBeforeParenthesisCloser]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + FixerHelper::removeBetween($phpcsFile, $pointerBeforeParenthesisCloser, $parenthesisCloserPointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/FunctionLengthSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/FunctionLengthSniff.php new file mode 100644 index 0000000..0c15e81 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/FunctionLengthSniff.php @@ -0,0 +1,68 @@ + + */ + public function register(): array + { + return [T_FUNCTION]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $file, $functionPointer): void + { + $this->maxLinesLength = SniffSettingsHelper::normalizeInteger($this->maxLinesLength); + + $flags = array_keys(array_filter([ + FunctionHelper::LINE_INCLUDE_COMMENT => $this->includeComments, + FunctionHelper::LINE_INCLUDE_WHITESPACE => $this->includeWhitespace, + ])); + $flags = array_reduce($flags, static function ($carry, $flag): int { + return $carry | $flag; + }, 0); + + $length = FunctionHelper::getFunctionLengthInLines($file, $functionPointer, $flags); + + if ($length <= $this->maxLinesLength) { + return; + } + + $errorMessage = sprintf( + 'Your function is too long. Currently using %d lines. Can be up to %d lines.', + $length, + $this->maxLinesLength + ); + + $file->addError($errorMessage, $functionPointer, self::CODE_FUNCTION_LENGTH); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/NamedArgumentSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/NamedArgumentSpacingSniff.php new file mode 100644 index 0000000..b442722 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/NamedArgumentSpacingSniff.php @@ -0,0 +1,79 @@ + + */ + public function register(): array + { + return [ + T_PARAM_NAME, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $colonPointer */ + $colonPointer = TokenHelper::findNext($phpcsFile, T_COLON, $pointer + 1); + + $parameterName = $tokens[$pointer]['content']; + + if ($colonPointer !== $pointer + 1) { + $fix = $phpcsFile->addFixableError( + sprintf('There must be no whitespace between named argument "%s" and colon.', $parameterName), + $colonPointer, + self::CODE_WHITESPACE_BEFORE_COLON + ); + if ($fix) { + $phpcsFile->fixer->replaceToken($colonPointer - 1, ''); + } + } + + $whitespacePointer = $colonPointer + 1; + + if ( + $tokens[$whitespacePointer]['code'] === T_WHITESPACE + && $tokens[$whitespacePointer]['content'] === ' ' + ) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('There must be exactly one space after colon in named argument "%s".', $parameterName), + $colonPointer, + self::CODE_NO_WHITESPACE_AFTER_COLON + ); + + if (!$fix) { + return; + } + + if ($tokens[$whitespacePointer]['code'] === T_WHITESPACE) { + $phpcsFile->fixer->replaceToken($whitespacePointer, ' '); + } else { + $phpcsFile->fixer->addContent($colonPointer, ' '); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php new file mode 100644 index 0000000..06e0787 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireArrowFunctionSniff.php @@ -0,0 +1,158 @@ + + */ + public function register(): array + { + return [ + T_CLOSURE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $closurePointer + */ + public function process(File $phpcsFile, $closurePointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 70400); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $returnPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$closurePointer]['scope_opener'] + 1); + if ($tokens[$returnPointer]['code'] !== T_RETURN) { + return; + } + + $usePointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$closurePointer]['parenthesis_closer'] + 1); + if ($tokens[$usePointer]['code'] === T_USE) { + $useOpenParenthesisPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + if (TokenHelper::findNext( + $phpcsFile, + T_BITWISE_AND, + $useOpenParenthesisPointer + 1, + $tokens[$useOpenParenthesisPointer]['parenthesis_closer'] + ) !== null) { + return; + } + } + + if (!$this->allowNested) { + $closureOrArrowFunctionPointer = TokenHelper::findNext( + $phpcsFile, + [T_CLOSURE, T_FN], + $tokens[$closurePointer]['scope_opener'] + 1, + $tokens[$closurePointer]['scope_closer'] + ); + if ($closureOrArrowFunctionPointer !== null) { + return; + } + } + + $fix = $phpcsFile->addFixableError('Use arrow function.', $closurePointer, self::CODE_REQUIRED_ARROW_FUNCTION); + if (!$fix) { + return; + } + + $pointerAfterReturn = TokenHelper::findNextNonWhitespace($phpcsFile, $returnPointer + 1); + $semicolonAfterReturn = $this->findSemicolon($phpcsFile, $returnPointer); + $usePointer = TokenHelper::findNext( + $phpcsFile, + T_USE, + $tokens[$closurePointer]['parenthesis_closer'] + 1, + $tokens[$closurePointer]['scope_opener'] + ); + $nonWhitespacePointerBeforeScopeOpener = TokenHelper::findPreviousExcluding( + $phpcsFile, + T_WHITESPACE, + $tokens[$closurePointer]['scope_opener'] - 1 + ); + + $nonWhitespacePointerAfterUseParenthesisCloser = null; + if ($usePointer !== null) { + $useParenthesiCloserPointer = TokenHelper::findNext($phpcsFile, T_CLOSE_PARENTHESIS, $usePointer + 1); + $nonWhitespacePointerAfterUseParenthesisCloser = TokenHelper::findNextExcluding( + $phpcsFile, + T_WHITESPACE, + $useParenthesiCloserPointer + 1 + ); + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($closurePointer, 'fn'); + + if ($nonWhitespacePointerAfterUseParenthesisCloser !== null) { + FixerHelper::removeBetween( + $phpcsFile, + $tokens[$closurePointer]['parenthesis_closer'], + $nonWhitespacePointerAfterUseParenthesisCloser + ); + } + + FixerHelper::removeBetween($phpcsFile, $nonWhitespacePointerBeforeScopeOpener, $pointerAfterReturn); + + $phpcsFile->fixer->addContent($nonWhitespacePointerBeforeScopeOpener, ' => '); + + FixerHelper::removeBetweenIncluding($phpcsFile, $semicolonAfterReturn, $tokens[$closurePointer]['scope_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function findSemicolon(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $semicolonPointer = null; + for ($i = $pointer + 1; $i < count($tokens) - 1; $i++) { + if ($tokens[$i]['code'] !== T_SEMICOLON) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $pointer, $i)) { + continue; + } + + $semicolonPointer = $i; + break; + } + + /** @var int $semicolonPointer */ + $semicolonPointer = $semicolonPointer; + return $semicolonPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireMultiLineCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireMultiLineCallSniff.php new file mode 100644 index 0000000..693eb17 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireMultiLineCallSniff.php @@ -0,0 +1,243 @@ +minLineLength = SniffSettingsHelper::normalizeInteger($this->minLineLength); + + if (!$this->isCall($phpcsFile, $stringPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + + // No parameters + $effectivePointerAfterParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + if ($effectivePointerAfterParenthesisOpener === $parenthesisCloserPointer) { + return; + } + + $parametersPointers = [TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1)]; + + $level = 0; + $pointers = TokenHelper::findNextAll( + $phpcsFile, + [T_COMMA, T_OPEN_PARENTHESIS, T_CLOSE_PARENTHESIS, T_OPEN_SHORT_ARRAY, T_CLOSE_SHORT_ARRAY], + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ); + foreach ($pointers as $pointer) { + if (in_array($tokens[$pointer]['code'], [T_OPEN_PARENTHESIS, T_OPEN_SHORT_ARRAY], true)) { + $level++; + continue; + } + + if (in_array($tokens[$pointer]['code'], [T_CLOSE_PARENTHESIS, T_CLOSE_SHORT_ARRAY], true)) { + $level--; + continue; + } + + if ($level !== 0) { + continue; + } + + $parameterPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1, $parenthesisCloserPointer); + if ($parameterPointer !== null) { + $parametersPointers[] = $parameterPointer; + } + } + + $lines = [ + $tokens[$parenthesisOpenerPointer]['line'], + $tokens[$parenthesisCloserPointer]['line'], + ]; + foreach ($parametersPointers as $parameterPointer) { + $lines[] = $tokens[$parameterPointer]['line']; + } + + // Each parameter on its line + if (count(array_unique($lines)) - 2 >= count($parametersPointers)) { + return; + } + + if ($this->shouldBeSkipped($phpcsFile, $stringPointer, $parenthesisCloserPointer)) { + return; + } + + $lineStart = $this->getLineStart($phpcsFile, $parenthesisOpenerPointer); + + if ($tokens[$parenthesisCloserPointer]['line'] === $tokens[$stringPointer]['line']) { + $call = $this->getCall($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + $lineEnd = $this->getLineEnd($phpcsFile, $parenthesisCloserPointer); + $lineLength = strlen($lineStart . $call . $lineEnd); + } else { + $lineEnd = $this->getLineEnd($phpcsFile, $parenthesisOpenerPointer); + $lineLength = strlen($lineStart . $lineEnd); + } + + $firstNonWhitespaceOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $stringPointer); + $indentation = IndentationHelper::getIndentation($phpcsFile, $firstNonWhitespaceOnLine); + $oneIndentation = IndentationHelper::getOneIndentationLevel($indentation); + + if (!$this->shouldReportError( + $lineLength, + $lineStart, + $lineEnd, + count($parametersPointers), + strlen(IndentationHelper::convertTabsToSpaces($phpcsFile, $oneIndentation)) + )) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $stringPointer - 1); + + $name = ltrim($tokens[$stringPointer]['content'], '\\'); + + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + $error = sprintf('Call of method %s() should be split to more lines.', $name); + } elseif ($tokens[$previousPointer]['code'] === T_NEW) { + $error = 'Constructor call should be split to more lines.'; + } else { + $error = sprintf('Call of function %s() should be split to more lines.', $name); + } + + $fix = $phpcsFile->addFixableError($error, $stringPointer, self::CODE_REQUIRED_MULTI_LINE_CALL); + + if (!$fix) { + return; + } + + $parametersIndentation = IndentationHelper::addIndentation($indentation); + + $phpcsFile->fixer->beginChangeset(); + + for ($i = $parenthesisOpenerPointer + 1; $i < $parenthesisCloserPointer; $i++) { + if (in_array($i, $parametersPointers, true)) { + FixerHelper::removeWhitespaceBefore($phpcsFile, $i); + $phpcsFile->fixer->addContentBefore($i, $phpcsFile->eolChar . $parametersIndentation); + } elseif ($tokens[$i]['content'] === $phpcsFile->eolChar) { + $phpcsFile->fixer->addContent($i, $oneIndentation); + } else { + // Create conflict so inner calls are fixed in next loop + $phpcsFile->fixer->replaceToken($i, $tokens[$i]['content']); + } + } + + $phpcsFile->fixer->addContentBefore($parenthesisCloserPointer, $phpcsFile->eolChar . $indentation); + + $phpcsFile->fixer->endChangeset(); + } + + private function shouldBeSkipped(File $phpcsFile, int $stringPointer, int $parenthesisCloserPointer): bool + { + $tokens = $phpcsFile->getTokens(); + $nameTokenCodes = TokenHelper::getOnlyNameTokenCodes(); + + $searchStartPointer = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $stringPointer); + while (true) { + $stringPointerBefore = TokenHelper::findNext($phpcsFile, $nameTokenCodes, $searchStartPointer, $stringPointer); + + if ($stringPointerBefore === null) { + break; + } + + $pointerAfterStringPointerBefore = TokenHelper::findNextEffective($phpcsFile, $stringPointerBefore + 1); + if ( + $tokens[$pointerAfterStringPointerBefore]['code'] === T_OPEN_PARENTHESIS + && $tokens[$pointerAfterStringPointerBefore]['parenthesis_closer'] > $stringPointer + ) { + return true; + } + + $searchStartPointer = $stringPointerBefore + 1; + } + + $lastPointerOnLine = TokenHelper::findLastTokenOnLine($phpcsFile, $parenthesisCloserPointer); + $searchStartPointer = $parenthesisCloserPointer + 1; + while (true) { + $stringPointerAfter = TokenHelper::findNext($phpcsFile, $nameTokenCodes, $searchStartPointer, $lastPointerOnLine + 1); + + if ($stringPointerAfter === null) { + break; + } + + $pointerAfterStringPointerAfter = TokenHelper::findNextEffective($phpcsFile, $stringPointerAfter + 1); + if ( + $pointerAfterStringPointerAfter !== null + && $tokens[$pointerAfterStringPointerAfter]['code'] === T_OPEN_PARENTHESIS + && $tokens[$tokens[$pointerAfterStringPointerAfter]['parenthesis_closer']]['line'] === $tokens[$stringPointer]['line'] + && $tokens[$pointerAfterStringPointerAfter]['parenthesis_closer'] !== TokenHelper::findNextEffective( + $phpcsFile, + $pointerAfterStringPointerAfter + 1 + ) + ) { + return true; + } + + $searchStartPointer = $stringPointerAfter + 1; + } + + return false; + } + + private function shouldReportError( + int $lineLength, + string $lineStart, + string $lineEnd, + int $parametersCount, + int $indentationLength + ): bool + { + if ($this->minLineLength === 0) { + return true; + } + + if ($lineLength < $this->minLineLength) { + return false; + } + + if ($parametersCount > 1) { + return true; + } + + return strlen(trim($lineStart) . trim($lineEnd)) > $indentationLength; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireSingleLineCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireSingleLineCallSniff.php new file mode 100644 index 0000000..6e1bd4c --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireSingleLineCallSniff.php @@ -0,0 +1,200 @@ +maxLineLength = SniffSettingsHelper::normalizeInteger($this->maxLineLength); + + if (!$this->isCall($phpcsFile, $stringPointer)) { + return; + } + + if ($this->shouldBeSkipped($phpcsFile, $stringPointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + + if ($tokens[$parenthesisOpenerPointer]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + array_merge(TokenHelper::$inlineCommentTokenCodes, Tokens::$heredocTokens), + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null) { + return; + } + + for ($i = $parenthesisOpenerPointer + 1; $i < $parenthesisCloserPointer; $i++) { + if ($tokens[$i]['code'] !== T_CONSTANT_ENCAPSED_STRING && $tokens[$i]['code'] !== T_DOUBLE_QUOTED_STRING) { + continue; + } + + if (strpos($tokens[$i]['content'], $phpcsFile->eolChar) !== false) { + return; + } + } + + if ($this->ignoreWithComplexParameter) { + if ( + TokenHelper::findNext( + $phpcsFile, + [T_CLOSURE, T_FN, T_OPEN_SHORT_ARRAY], + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null + ) { + return; + } + + // Contains inner call + $callSearchStartPointer = $parenthesisOpenerPointer + 1; + $nameTokenCodes = TokenHelper::getOnlyNameTokenCodes(); + while (true) { + $innerStringPointer = TokenHelper::findNext( + $phpcsFile, + $nameTokenCodes, + $callSearchStartPointer, + $parenthesisCloserPointer + ); + if ($innerStringPointer === null) { + break; + } + + $pointerAfterInnerString = TokenHelper::findNextEffective($phpcsFile, $innerStringPointer + 1); + if ( + $pointerAfterInnerString !== null + && $tokens[$pointerAfterInnerString]['code'] === T_OPEN_PARENTHESIS + ) { + return; + } + + $callSearchStartPointer = $innerStringPointer + 1; + } + } + + $lineStart = $this->getLineStart($phpcsFile, $parenthesisOpenerPointer); + $call = $this->getCall($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + $lineEnd = $this->getLineEnd($phpcsFile, $parenthesisCloserPointer); + + $lineLength = strlen($lineStart . $call . $lineEnd); + + if (!$this->shouldReportError($lineLength)) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $stringPointer - 1); + + $name = ltrim($tokens[$stringPointer]['content'], '\\'); + + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + $error = sprintf('Call of method %s() should be placed on a single line.', $name); + } elseif ($tokens[$previousPointer]['code'] === T_NEW) { + $error = 'Constructor call should be placed on a single line.'; + } else { + $error = sprintf('Call of function %s() should be placed on a single line.', $name); + } + + $fix = $phpcsFile->addFixableError($error, $stringPointer, self::CODE_REQUIRED_SINGLE_LINE_CALL); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($parenthesisOpenerPointer, $call); + + FixerHelper::removeBetween($phpcsFile, $parenthesisOpenerPointer, $parenthesisCloserPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function shouldBeSkipped(File $phpcsFile, int $stringPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + foreach (array_reverse(TokenHelper::findNextAll($phpcsFile, [T_OPEN_PARENTHESIS, T_FUNCTION], 0, $stringPointer)) as $pointer) { + if ($tokens[$pointer]['code'] === T_FUNCTION) { + if (array_key_exists('scope_closer', $tokens[$pointer]) && $tokens[$pointer]['scope_closer'] > $stringPointer) { + return false; + } + + continue; + } + + if ($tokens[$pointer]['parenthesis_closer'] < $stringPointer) { + continue; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + if ( + $pointerBeforeParenthesisOpener === null + || $tokens[$pointerBeforeParenthesisOpener]['code'] !== T_STRING + ) { + continue; + } + + return true; + } + + return false; + } + + private function shouldReportError(int $lineLength): bool + { + if ($this->maxLineLength === 0) { + return true; + } + + return $lineLength <= $this->maxLineLength; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInCallSniff.php new file mode 100644 index 0000000..7748011 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInCallSniff.php @@ -0,0 +1,104 @@ + + */ + public function register(): array + { + return [ + T_OPEN_PARENTHESIS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $parenthesisOpenerPointer + */ + public function process(File $phpcsFile, $parenthesisOpenerPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 70300); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if (array_key_exists('parenthesis_owner', $tokens[$parenthesisOpenerPointer])) { + return; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if (!in_array( + $tokens[$pointerBeforeParenthesisOpener]['code'], + array_merge( + TokenHelper::getOnlyNameTokenCodes(), + [T_VARIABLE, T_ISSET, T_UNSET, T_CLOSE_PARENTHESIS, T_SELF, T_STATIC, T_PARENT] + ), + true + )) { + return; + } + + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + + if ($tokens[$parenthesisOpenerPointer]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + $pointerBeforeParenthesisCloser = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisCloserPointer - 1); + if ($pointerBeforeParenthesisCloser === $parenthesisOpenerPointer) { + return; + } + + if ($tokens[$parenthesisCloserPointer]['line'] === $tokens[$pointerBeforeParenthesisCloser]['line']) { + return; + } + + if ($tokens[$pointerBeforeParenthesisCloser]['code'] === T_COMMA) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multi-line function calls must have a trailing comma after the last parameter.', + $pointerBeforeParenthesisCloser, + self::CODE_MISSING_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($pointerBeforeParenthesisCloser, ','); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInClosureUseSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInClosureUseSniff.php new file mode 100644 index 0000000..e50a8e3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInClosureUseSniff.php @@ -0,0 +1,85 @@ + + */ + public function register(): array + { + return [T_CLOSURE]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisCloserPointer = $tokens[$functionPointer]['parenthesis_closer']; + + $usePointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); + + if ($tokens[$usePointer]['code'] !== T_USE) { + return; + } + + $useParenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + $useParenthesisCloserPointer = $tokens[$useParenthesisOpenerPointer]['parenthesis_closer']; + + if ($tokens[$useParenthesisOpenerPointer]['line'] === $tokens[$useParenthesisCloserPointer]['line']) { + return; + } + + $pointerBeforeUseParenthesisCloser = TokenHelper::findPreviousExcluding( + $phpcsFile, + T_WHITESPACE, + $useParenthesisCloserPointer - 1, + $useParenthesisOpenerPointer + ); + + if ($tokens[$pointerBeforeUseParenthesisCloser]['code'] === T_COMMA) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multi-line "use" of closure declaration must have a trailing comma after the last inherited variable.', + $pointerBeforeUseParenthesisCloser, + self::CODE_MISSING_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($pointerBeforeUseParenthesisCloser, ','); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInDeclarationSniff.php new file mode 100644 index 0000000..aab66c5 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/RequireTrailingCommaInDeclarationSniff.php @@ -0,0 +1,77 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $tokens[$functionPointer]['parenthesis_opener']; + $parenthesisCloserPointer = $tokens[$functionPointer]['parenthesis_closer']; + + if ($tokens[$parenthesisOpenerPointer]['line'] === $tokens[$parenthesisCloserPointer]['line']) { + return; + } + + $pointerBeforeParenthesisCloser = TokenHelper::findPreviousEffective( + $phpcsFile, + $parenthesisCloserPointer - 1, + $parenthesisOpenerPointer + ); + + if ($pointerBeforeParenthesisCloser === $parenthesisOpenerPointer) { + return; + } + + if ($tokens[$pointerBeforeParenthesisCloser]['code'] === T_COMMA) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Multi-line function declaration must have a trailing comma after the last parameter.', + $pointerBeforeParenthesisCloser, + self::CODE_MISSING_TRAILING_COMMA + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($pointerBeforeParenthesisCloser, ','); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StaticClosureSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StaticClosureSniff.php new file mode 100644 index 0000000..5e2053c --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StaticClosureSniff.php @@ -0,0 +1,103 @@ + + */ + public function register(): array + { + return [ + T_CLOSURE, + T_FN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $closurePointer + */ + public function process(File $phpcsFile, $closurePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $closurePointer - 1); + if ($tokens[$previousPointer]['code'] === T_STATIC) { + return; + } + + if ($tokens[$previousPointer]['code'] === T_OPEN_PARENTHESIS) { + $pointerBeforeParenthesis = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + if ( + $tokens[$pointerBeforeParenthesis]['code'] === T_STRING + && $tokens[$pointerBeforeParenthesis]['content'] === 'bind' + ) { + return; + } + } + + $closureScopeOpenerPointer = $tokens[$closurePointer]['scope_opener']; + $closureScopeCloserPointer = $tokens[$closurePointer]['scope_closer']; + + $thisPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + '$this', + $closureScopeOpenerPointer + 1, + $closureScopeCloserPointer + ); + if ($thisPointer !== null) { + return; + } + + $stringPointers = TokenHelper::findNextAll( + $phpcsFile, + T_DOUBLE_QUOTED_STRING, + $closureScopeOpenerPointer + 1, + $closureScopeCloserPointer + ); + foreach ($stringPointers as $stringPointer) { + if (VariableHelper::isUsedInScopeInString($phpcsFile, '$this', $stringPointer)) { + return; + } + } + + $parentPointer = TokenHelper::findNext($phpcsFile, T_PARENT, $closureScopeOpenerPointer + 1, $closureScopeCloserPointer); + if ($parentPointer !== null) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Closure not using "$this" should be declared static.', + $closurePointer, + self::CODE_CLOSURE_NOT_STATIC + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore($closurePointer, 'static '); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StrictCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StrictCallSniff.php new file mode 100644 index 0000000..a012fb4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/StrictCallSniff.php @@ -0,0 +1,127 @@ + 3, + 'array_search' => 3, + 'base64_decode' => 2, + 'array_keys' => 3, + ]; + + /** + * @return array + */ + public function register(): array + { + return TokenHelper::getOnlyNameTokenCodes(); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stringPointer + */ + public function process(File $phpcsFile, $stringPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + + $functionName = ltrim(strtolower($tokens[$stringPointer]['content']), '\\'); + + if (!array_key_exists($functionName, self::FUNCTIONS)) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $stringPointer - 1); + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON, T_FUNCTION], true)) { + return; + } + + $commaPointers = []; + for ($i = $parenthesisOpenerPointer + 1; $i < $parenthesisCloserPointer; $i++) { + if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) { + $i = $tokens[$i]['parenthesis_closer']; + continue; + } + + if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) { + $i = $tokens[$i]['bracket_closer']; + continue; + } + + if ($tokens[$i]['code'] === T_COMMA) { + $commaPointers[] = $i; + } + } + + $commaPointersCount = count($commaPointers); + + $parametersCount = $commaPointersCount + 1; + $lastCommaPointer = $commaPointersCount > 0 ? $commaPointers[$commaPointersCount - 1] : null; + $hasTrailingComma = false; + + if ( + $lastCommaPointer !== null + && TokenHelper::findNextEffective($phpcsFile, $lastCommaPointer + 1, $parenthesisCloserPointer) === null + ) { + $hasTrailingComma = true; + $parametersCount--; + } + + if ($parametersCount === self::FUNCTIONS[$functionName]) { + + $strictParameterValue = TokenHelper::getContent( + $phpcsFile, + $commaPointers[self::FUNCTIONS[$functionName] - 2] + 1, + ($hasTrailingComma ? $lastCommaPointer : $parenthesisCloserPointer) - 1 + ); + + if (strtolower(trim($strictParameterValue)) !== 'false') { + return; + } + + $phpcsFile->addError( + sprintf('Strict parameter should be set to true in %s() call.', $functionName), + $stringPointer, + self::CODE_NON_STRICT_COMPARISON + ); + + } elseif ($parametersCount === self::FUNCTIONS[$functionName] - 1) { + $phpcsFile->addError( + sprintf('Strict parameter missing in %s() call.', $functionName), + $stringPointer, + self::CODE_STRICT_PARAMETER_MISSING + ); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedInheritedVariablePassedToClosureSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedInheritedVariablePassedToClosureSniff.php new file mode 100644 index 0000000..3fe2e7e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedInheritedVariablePassedToClosureSniff.php @@ -0,0 +1,150 @@ + + */ + public function register(): array + { + return [ + T_USE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $parenthesisOpenerPointer */ + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + /** @var int $closurePointer */ + $closurePointer = TokenHelper::findPrevious($phpcsFile, T_CLOSURE, $usePointer - 1); + + $currentPointer = $parenthesisOpenerPointer + 1; + do { + $variablePointer = TokenHelper::findNext( + $phpcsFile, + T_VARIABLE, + $currentPointer, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ); + if ($variablePointer === null) { + break; + } + + $this->checkVariableUsage( + $phpcsFile, + $usePointer, + $parenthesisOpenerPointer, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'], + $variablePointer, + $closurePointer + ); + + $currentPointer = $variablePointer + 1; + } while (true); + } + + private function checkVariableUsage( + File $phpcsFile, + int $usePointer, + int $useParenthesisOpenerPointer, + int $useParenthesisCloserPointer, + int $variablePointer, + int $scopeOwnerPointer + ): void + { + $tokens = $phpcsFile->getTokens(); + + if (VariableHelper::isUsedInScope($phpcsFile, $scopeOwnerPointer, $variablePointer)) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Unused inherited variable %s passed to closure.', $tokens[$variablePointer]['content']), + $variablePointer, + self::CODE_UNUSED_INHERITED_VARIABLE + ); + + if (!$fix) { + return; + } + + $fixStartPointer = $variablePointer; + do { + if ($tokens[$fixStartPointer - 1]['code'] === T_OPEN_PARENTHESIS) { + break; + } + + $fixStartPointer--; + + if ($tokens[$fixStartPointer]['code'] === T_COMMA) { + break; + } + } while (true); + + $fixEndPointer = $variablePointer; + do { + if ($tokens[$fixEndPointer + 1]['code'] === T_CLOSE_PARENTHESIS) { + break; + } + + if ($tokens[$fixEndPointer + 1]['code'] === T_COMMA && $tokens[$fixStartPointer]['code'] === T_COMMA) { + break; + } + + if (in_array($tokens[$fixEndPointer + 1]['code'], [T_VARIABLE, T_BITWISE_AND], true)) { + break; + } + + $fixEndPointer++; + } while (true); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $fixStartPointer, $fixEndPointer); + + $emptyUse = true; + for ($i = $useParenthesisOpenerPointer + 1; $i < $useParenthesisCloserPointer; $i++) { + if ($phpcsFile->fixer->getTokenContent($i) !== '') { + $emptyUse = false; + break; + } + } + if ($emptyUse) { + FixerHelper::removeBetweenIncluding($phpcsFile, $usePointer, $useParenthesisCloserPointer); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedParameterSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedParameterSniff.php new file mode 100644 index 0000000..857f7b3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UnusedParameterSniff.php @@ -0,0 +1,107 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + if (FunctionHelper::isAbstract($phpcsFile, $functionPointer)) { + return; + } + + $isSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $this->getSniffName(self::CODE_UNUSED_PARAMETER)); + $suppressUseless = true; + + $tokens = $phpcsFile->getTokens(); + + $currentPointer = $tokens[$functionPointer]['parenthesis_opener'] + 1; + while (true) { + $parameterPointer = TokenHelper::findNext( + $phpcsFile, + T_VARIABLE, + $currentPointer, + $tokens[$functionPointer]['parenthesis_closer'] + ); + if ($parameterPointer === null) { + break; + } + + $previousPointer = TokenHelper::findPrevious( + $phpcsFile, + array_merge([T_COMMA], Tokens::$scopeModifiers), + $parameterPointer - 1, + $tokens[$functionPointer]['parenthesis_opener'] + ); + + if ($previousPointer !== null && in_array($tokens[$previousPointer]['code'], Tokens::$scopeModifiers, true)) { + $currentPointer = $parameterPointer + 1; + continue; + } + + if (VariableHelper::isUsedInScope($phpcsFile, $functionPointer, $parameterPointer)) { + $currentPointer = $parameterPointer + 1; + continue; + } + + if (!$isSuppressed) { + $phpcsFile->addError( + sprintf('Unused parameter %s.', $tokens[$parameterPointer]['content']), + $parameterPointer, + self::CODE_UNUSED_PARAMETER + ); + } else { + $suppressUseless = false; + } + + $currentPointer = $parameterPointer + 1; + } + + if (!$isSuppressed || !$suppressUseless) { + return; + } + + $phpcsFile->addError( + sprintf('Useless %s %s', SuppressHelper::ANNOTATION, self::NAME), + $functionPointer, + self::CODE_USELESS_SUPPRESS + ); + } + + private function getSniffName(string $sniffName): string + { + return sprintf('%s.%s', self::NAME, $sniffName); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UselessParameterDefaultValueSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UselessParameterDefaultValueSniff.php new file mode 100644 index 0000000..2a9d613 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Functions/UselessParameterDefaultValueSniff.php @@ -0,0 +1,88 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $parameters = $phpcsFile->getMethodParameters($functionPointer); + $parametersCount = count($parameters); + + if ($parametersCount === 0) { + return; + } + + for ($i = 0; $i < $parametersCount; $i++) { + $parameter = $parameters[$i]; + + if (!array_key_exists('default', $parameter)) { + continue; + } + + $defaultValue = strtolower($parameter['default']); + if ($defaultValue === 'null' && !$parameter['nullable_type']) { + continue; + } + + for ($j = $i + 1; $j < $parametersCount; $j++) { + $nextParameter = $parameters[$j]; + + if (array_key_exists('default', $nextParameter)) { + continue; + } + + if ($nextParameter['variable_length']) { + break; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Useless default value of parameter %s.', $parameter['name']), + $parameter['token'], + self::CODE_USELESS_PARAMETER_DEFAULT_VALUE + ); + + if (!$fix) { + continue; + } + + $commaPointer = TokenHelper::findPrevious($phpcsFile, T_COMMA, $parameters[$i + 1]['token'] - 1); + /** @var int $parameterPointer */ + $parameterPointer = $parameter['token']; + + $phpcsFile->fixer->beginChangeset(); + for ($k = $parameterPointer + 1; $k < $commaPointer; $k++) { + $phpcsFile->fixer->replaceToken($k, ''); + } + $phpcsFile->fixer->endChangeset(); + + break; + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php new file mode 100644 index 0000000..5e91e0e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php @@ -0,0 +1,172 @@ + */ + public $exclude = []; + + /** @var list */ + public $include = []; + + /** @var list|null */ + private $normalizedExclude; + + /** @var list|null */ + private $normalizedInclude; + + abstract protected function getNotFullyQualifiedMessage(): string; + + abstract protected function isCaseSensitive(): bool; + + abstract protected function isValidType(ReferencedName $name): bool; + + /** + * @return array + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + if (TokenHelper::findNext($phpcsFile, T_OPEN_USE_GROUP, $openTagPointer) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $namespacePointers = NamespaceHelper::getAllNamespacesPointers($phpcsFile); + $referencedNames = ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer); + $include = array_flip($this->getNormalizedInclude()); + $exclude = array_flip($this->getNormalizedExclude()); + + foreach ($referencedNames as $referencedName) { + $name = $referencedName->getNameAsReferencedInFile(); + $namePointer = $referencedName->getStartPointer(); + + if (!$this->isValidType($referencedName)) { + continue; + } + + if (NamespaceHelper::isFullyQualifiedName($name)) { + continue; + } + + if (NamespaceHelper::hasNamespace($name)) { + continue; + } + + if ($namespacePointers === []) { + continue; + } + + $canonicalName = $this->isCaseSensitive() ? $name : strtolower($name); + + $useStatements = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $namePointer); + + if (array_key_exists(UseStatement::getUniqueId($referencedName->getType(), $canonicalName), $useStatements)) { + $fullyQualifiedName = NamespaceHelper::resolveName($phpcsFile, $name, $referencedName->getType(), $namePointer); + if (NamespaceHelper::hasNamespace($fullyQualifiedName)) { + continue; + } + } + + if ($include !== [] && !array_key_exists($canonicalName, $include)) { + continue; + } + + if (array_key_exists($canonicalName, $exclude)) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf($this->getNotFullyQualifiedMessage(), $tokens[$namePointer]['content']), + $namePointer, + self::CODE_NON_FULLY_QUALIFIED + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore($namePointer, NamespaceHelper::NAMESPACE_SEPARATOR); + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @return list + */ + protected function getNormalizedInclude(): array + { + if ($this->normalizedInclude === null) { + $this->normalizedInclude = $this->normalizeNames($this->include); + } + return $this->normalizedInclude; + } + + /** + * @return list + */ + private function getNormalizedExclude(): array + { + if ($this->normalizedExclude === null) { + $this->normalizedExclude = $this->normalizeNames($this->exclude); + } + return $this->normalizedExclude; + } + + /** + * @param list $names + * @return list + */ + private function normalizeNames(array $names): array + { + $names = SniffSettingsHelper::normalizeArray($names); + + if (!$this->isCaseSensitive()) { + $names = array_map(static function (string $name): string { + return strtolower($name); + }, $names); + } + + return $names; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php new file mode 100644 index 0000000..6e5b3a0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php @@ -0,0 +1,240 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + // If there are any 'use group' statements then we cannot sort and fix the file. + $groupUsePointer = TokenHelper::findNext($phpcsFile, T_OPEN_USE_GROUP, $openTagPointer); + if ($groupUsePointer !== null) { + return; + } + + $fileUseStatements = UseStatementHelper::getFileUseStatements($phpcsFile); + foreach ($fileUseStatements as $useStatements) { + $lastUse = null; + foreach ($useStatements as $useStatement) { + if ($lastUse === null) { + $lastUse = $useStatement; + } else { + $order = $this->compareUseStatements($useStatement, $lastUse); + if ($order < 0) { + // The use statements are not ordered correctly. Go through all statements and if any are multi-part then + // we report the problem but cannot fix it, because this would lose the secondary parts of the statement. + $fixable = true; + $tokens = $phpcsFile->getTokens(); + foreach ($useStatements as $statement) { + $nextBreaker = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_COMMA], $statement->getPointer()); + + if ($tokens[$nextBreaker]['code'] === T_COMMA) { + $fixable = false; + break; + } + } + + $errorParameters = [ + sprintf( + 'Use statements should be sorted alphabetically. The first wrong one is %s.', + $useStatement->getFullyQualifiedTypeName() + ), + $useStatement->getPointer(), + self::CODE_INCORRECT_ORDER, + ]; + + if (!$fixable) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + if ($fix) { + $this->fixAlphabeticalOrder($phpcsFile, $useStatements); + } + + return; + } + + $lastUse = $useStatement; + } + } + } + } + + /** + * @param array $useStatements + */ + private function fixAlphabeticalOrder(File $phpcsFile, array $useStatements): void + { + /** @var UseStatement $firstUseStatement */ + $firstUseStatement = reset($useStatements); + /** @var UseStatement $lastUseStatement */ + $lastUseStatement = end($useStatements); + $lastSemicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $lastUseStatement->getPointer()); + + $firstPointer = $firstUseStatement->getPointer(); + + $tokens = $phpcsFile->getTokens(); + + $commentsBefore = []; + foreach ($useStatements as $useStatement) { + $pointerBeforeUseStatement = TokenHelper::findPreviousNonWhitespace($phpcsFile, $useStatement->getPointer() - 1); + + if (!in_array($tokens[$pointerBeforeUseStatement]['code'], Tokens::$commentTokens, true)) { + continue; + } + + $commentAndWhitespace = TokenHelper::getContent($phpcsFile, $pointerBeforeUseStatement, $useStatement->getPointer() - 1); + if (StringHelper::endsWith($commentAndWhitespace, $phpcsFile->eolChar . $phpcsFile->eolChar)) { + continue; + } + + $commentStartPointer = in_array($tokens[$pointerBeforeUseStatement]['code'], TokenHelper::$inlineCommentTokenCodes, true) + ? CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeUseStatement) + : $tokens[$pointerBeforeUseStatement]['comment_opener']; + + $commentsBefore[$useStatement->getPointer()] = TokenHelper::getContent( + $phpcsFile, + $commentStartPointer, + $pointerBeforeUseStatement + ); + + if ($firstPointer === $useStatement->getPointer()) { + $firstPointer = $commentStartPointer; + } + } + + uasort($useStatements, function (UseStatement $a, UseStatement $b): int { + return $this->compareUseStatements($a, $b); + }); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $firstPointer, $lastSemicolonPointer); + + $phpcsFile->fixer->addContent( + $firstPointer, + implode($phpcsFile->eolChar, array_map(static function (UseStatement $useStatement) use ($phpcsFile, $commentsBefore): string { + $unqualifiedName = NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($useStatement->getFullyQualifiedTypeName()); + + $useTypeName = UseStatement::getTypeName($useStatement->getType()); + $useTypeFormatted = $useTypeName !== null ? sprintf('%s ', $useTypeName) : ''; + + $commentBefore = ''; + if (array_key_exists($useStatement->getPointer(), $commentsBefore)) { + $commentBefore = $commentsBefore[$useStatement->getPointer()]; + if (!StringHelper::endsWith($commentBefore, $phpcsFile->eolChar)) { + $commentBefore .= $phpcsFile->eolChar; + } + } + + if ($unqualifiedName === $useStatement->getNameAsReferencedInFile()) { + return sprintf('%suse %s%s;', $commentBefore, $useTypeFormatted, $useStatement->getFullyQualifiedTypeName()); + } + + return sprintf( + '%suse %s%s as %s;', + $commentBefore, + $useTypeFormatted, + $useStatement->getFullyQualifiedTypeName(), + $useStatement->getNameAsReferencedInFile() + ); + }, $useStatements)) + ); + $phpcsFile->fixer->endChangeset(); + } + + private function compareUseStatements(UseStatement $a, UseStatement $b): int + { + if (!$a->hasSameType($b)) { + $order = [ + UseStatement::TYPE_CLASS => 1, + UseStatement::TYPE_FUNCTION => $this->psr12Compatible ? 2 : 3, + UseStatement::TYPE_CONSTANT => $this->psr12Compatible ? 3 : 2, + ]; + + return $order[$a->getType()] <=> $order[$b->getType()]; + } + + $aNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $a->getFullyQualifiedTypeName()); + $bNameParts = explode(NamespaceHelper::NAMESPACE_SEPARATOR, $b->getFullyQualifiedTypeName()); + + $minPartsCount = min(count($aNameParts), count($bNameParts)); + for ($i = 0; $i < $minPartsCount; $i++) { + $comparison = $this->compare($aNameParts[$i], $bNameParts[$i]); + if ($comparison === 0) { + continue; + } + + return $comparison; + } + + return count($aNameParts) <=> count($bNameParts); + } + + private function compare(string $a, string $b): int + { + if ($this->caseSensitive) { + return strcmp($a, $b); + } + + return strcasecmp($a, $b); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/DisallowGroupUseSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/DisallowGroupUseSniff.php new file mode 100644 index 0000000..35aecfa --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/DisallowGroupUseSniff.php @@ -0,0 +1,37 @@ + + */ + public function register(): array + { + return [ + T_OPEN_USE_GROUP, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + $phpcsFile->addError( + 'Group use declaration is disallowed, use single use for every import.', + $usePointer, + self::CODE_DISALLOWED_GROUP_USE + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php new file mode 100644 index 0000000..17f25b0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php @@ -0,0 +1,173 @@ + */ + public $ignoredAnnotationNames = []; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + $this->ignoredAnnotationNames = SniffSettingsHelper::normalizeArray($this->ignoredAnnotationNames); + + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + $annotationName = $annotation->getName(); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + $lowercasedTypeHint = strtolower($typeHint); + if ( + TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) + || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) + || !TypeHelper::isTypeName($typeHint) + || TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $docCommentOpenPointer, $typeHint) + ) { + continue; + } + + if (in_array($annotationName, $this->ignoredAnnotationNames, true)) { + continue; + } + + $fullyQualifiedTypeHint = TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeHint); + if ($fullyQualifiedTypeHint === $typeHint) { + continue; + } + + $fix = $phpcsFile->addFixableError(sprintf( + 'Class name %s in %s should be referenced via a fully qualified name.', + $fullyQualifiedTypeHint, + $annotationName + ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); + + if (!$fix) { + continue; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $typeHintNode, + new IdentifierTypeNode($fullyQualifiedTypeHint) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } + + /** @var list $constantFetchNodes */ + $constantFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + foreach ($constantFetchNodes as $constantFetchNode) { + $isClassConstant = $constantFetchNode->className !== ''; + + $typeHint = $isClassConstant + ? $constantFetchNode->className + : $constantFetchNode->name; + + if ($typeHint === 'self') { + continue; + } + + $fullyQualifiedTypeHint = $isClassConstant + ? NamespaceHelper::resolveClassName($phpcsFile, $typeHint, $docCommentOpenPointer) + : NamespaceHelper::resolveName($phpcsFile, $typeHint, ReferencedName::TYPE_CONSTANT, $docCommentOpenPointer); + + if ($fullyQualifiedTypeHint === $typeHint) { + continue; + } + + $fix = $phpcsFile->addFixableError(sprintf( + '%s name %s in %s should be referenced via a fully qualified name.', + $isClassConstant ? 'Class' : 'Constant', + $fullyQualifiedTypeHint, + $annotationName + ), $annotation->getStartPointer(), self::CODE_NON_FULLY_QUALIFIED_CLASS_NAME); + + if (!$fix) { + continue; + } + + $fixedConstantFetchNode = PhpDocParserHelper::cloneNode($constantFetchNode); + if ($isClassConstant) { + $fixedConstantFetchNode->className = $fullyQualifiedTypeHint; + } else { + $fixedConstantFetchNode->name = $fullyQualifiedTypeHint; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $constantFetchNode, + $fixedConstantFetchNode + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php new file mode 100644 index 0000000..8d410cb --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedExceptionsSniff.php @@ -0,0 +1,162 @@ + */ + public $specialExceptionNames = []; + + /** @var list */ + public $ignoredNames = []; + + /** @var list|null */ + private $normalizedSpecialExceptionNames; + + /** @var list|null */ + private $normalizedIgnoredNames; + + /** + * @return array + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $namespacePointers = array_reverse(NamespaceHelper::getAllNamespacesPointers($phpcsFile)); + + $referencedNames = ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer); + foreach ($referencedNames as $referencedName) { + $pointer = $referencedName->getStartPointer(); + $name = $referencedName->getNameAsReferencedInFile(); + $uniqueId = UseStatement::getUniqueId($referencedName->getType(), $name); + $useStatements = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $pointer); + + if ( + isset($useStatements[$uniqueId]) + && $referencedName->hasSameUseStatementType($useStatements[$uniqueId]) + ) { + $useStatement = $useStatements[$uniqueId]; + if ( + in_array($useStatement->getFullyQualifiedTypeName(), $this->getIgnoredNames(), true) + || ( + !StringHelper::endsWith($useStatement->getFullyQualifiedTypeName(), 'Exception') + && $useStatement->getFullyQualifiedTypeName() !== Throwable::class + && (!StringHelper::endsWith($useStatement->getFullyQualifiedTypeName(), 'Error') || NamespaceHelper::hasNamespace( + $useStatement->getFullyQualifiedTypeName() + )) + && !in_array($useStatement->getFullyQualifiedTypeName(), $this->getSpecialExceptionNames(), true) + ) + ) { + continue; + } + } else { + $fileNamespacePointer = null; + if ($namespacePointers !== []) { + foreach ($namespacePointers as $namespacePointer) { + if ($namespacePointer < $pointer) { + $fileNamespacePointer = $namespacePointer; + break; + } + } + } + + $fileNamespace = $fileNamespacePointer !== null + ? NamespaceHelper::getName($phpcsFile, $fileNamespacePointer) + : null; + $canonicalName = $name; + if (!NamespaceHelper::isFullyQualifiedName($name) && $fileNamespace !== null) { + $canonicalName = sprintf('%s%s%s', $fileNamespace, NamespaceHelper::NAMESPACE_SEPARATOR, $name); + } + if ( + in_array($canonicalName, $this->getIgnoredNames(), true) + || ( + !StringHelper::endsWith($name, 'Exception') + && $name !== Throwable::class + && (!StringHelper::endsWith($canonicalName, 'Error') || NamespaceHelper::hasNamespace($canonicalName)) + && !in_array($canonicalName, $this->getSpecialExceptionNames(), true) + ) + ) { + continue; + } + } + + if (NamespaceHelper::isFullyQualifiedName($name)) { + continue; + } + + $fix = $phpcsFile->addFixableError(sprintf( + 'Exception %s should be referenced via a fully qualified name.', + $name + ), $pointer, self::CODE_NON_FULLY_QUALIFIED_EXCEPTION); + if (!$fix) { + continue; + } + + $fullyQualifiedName = NamespaceHelper::resolveClassName($phpcsFile, $name, $pointer); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $referencedName->getStartPointer(), $referencedName->getEndPointer(), $fullyQualifiedName); + + $phpcsFile->fixer->endChangeset(); + } + } + + /** + * @return list + */ + private function getSpecialExceptionNames(): array + { + if ($this->normalizedSpecialExceptionNames === null) { + $this->normalizedSpecialExceptionNames = SniffSettingsHelper::normalizeArray($this->specialExceptionNames); + } + + return $this->normalizedSpecialExceptionNames; + } + + /** + * @return list + */ + private function getIgnoredNames(): array + { + if ($this->normalizedIgnoredNames === null) { + $this->normalizedIgnoredNames = SniffSettingsHelper::normalizeArray($this->ignoredNames); + } + + return $this->normalizedIgnoredNames; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalConstantsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalConstantsSniff.php new file mode 100644 index 0000000..f45597e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalConstantsSniff.php @@ -0,0 +1,26 @@ +isConstant(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php new file mode 100644 index 0000000..30741a3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php @@ -0,0 +1,45 @@ + + */ + protected function getNormalizedInclude(): array + { + $include = parent::getNormalizedInclude(); + + if ($this->includeSpecialFunctions) { + $include = array_merge($include, FunctionHelper::SPECIAL_FUNCTIONS); + } + + return $include; + } + + protected function getNotFullyQualifiedMessage(): string + { + return 'Function %s() should be referenced via a fully qualified name.'; + } + + protected function isCaseSensitive(): bool + { + return false; + } + + protected function isValidType(ReferencedName $name): bool + { + return $name->isFunction(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/MultipleUsesPerLineSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/MultipleUsesPerLineSniff.php new file mode 100644 index 0000000..38ed103 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/MultipleUsesPerLineSniff.php @@ -0,0 +1,48 @@ + + */ + public function register(): array + { + return [ + T_USE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + if (!UseStatementHelper::isImportUse($phpcsFile, $usePointer)) { + return; + } + + $endPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $usePointer + 1); + $commaPointer = TokenHelper::findNext($phpcsFile, T_COMMA, $usePointer + 1, $endPointer); + + if ($commaPointer === null) { + return; + } + + $phpcsFile->addError('Multiple used types per use statement are forbidden.', $commaPointer, self::CODE_MULTIPLE_USES_PER_LINE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceDeclarationSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceDeclarationSniff.php new file mode 100644 index 0000000..028a63e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceDeclarationSniff.php @@ -0,0 +1,147 @@ + + */ + public function register(): array + { + return [ + T_NAMESPACE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $namespacePointer + */ + public function process(File $phpcsFile, $namespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $pointerAfterNamespace = TokenHelper::findNextEffective($phpcsFile, $namespacePointer + 1); + if ($tokens[$pointerAfterNamespace]['code'] === T_NS_SEPARATOR) { + return; + } + + $this->checkWhitespaceAfterNamespace($phpcsFile, $namespacePointer); + $this->checkDisallowedContentBetweenNamespaceNameAndSemicolon($phpcsFile, $namespacePointer); + $this->checkDisallowedBracketedSyntax($phpcsFile, $namespacePointer); + } + + private function checkWhitespaceAfterNamespace(File $phpcsFile, int $namespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $whitespacePointer = $namespacePointer + 1; + + if ($tokens[$whitespacePointer]['code'] !== T_WHITESPACE) { + $phpcsFile->addError( + 'Expected one space after namespace statement.', + $namespacePointer, + self::CODE_INVALID_WHITESPACE_AFTER_NAMESPACE + ); + return; + } + + if ($tokens[$whitespacePointer]['content'] === ' ') { + return; + } + + $errorMessage = $tokens[$whitespacePointer]['content'][0] === "\t" + ? 'Expected one space after namespace statement, found tab.' + : sprintf('Expected one space after namespace statement, found %d.', strlen($tokens[$whitespacePointer]['content'])); + + $fix = $phpcsFile->addFixableError($errorMessage, $namespacePointer, self::CODE_INVALID_WHITESPACE_AFTER_NAMESPACE); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($whitespacePointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + + private function checkDisallowedContentBetweenNamespaceNameAndSemicolon(File $phpcsFile, int $namespacePointer): void + { + if (array_key_exists('scope_opener', $phpcsFile->getTokens()[$namespacePointer])) { + return; + } + + $namespaceNameStartPointer = TokenHelper::findNextEffective($phpcsFile, $namespacePointer + 1); + $namespaceNameEndPointer = TokenHelper::findNextExcluding( + $phpcsFile, + TokenHelper::getNameTokenCodes(), + $namespaceNameStartPointer + 1 + ) - 1; + + /** @var int $namespaceSemicolonPointer */ + $namespaceSemicolonPointer = TokenHelper::findNextLocal($phpcsFile, T_SEMICOLON, $namespaceNameEndPointer + 1); + + if ($namespaceNameEndPointer + 1 === $namespaceSemicolonPointer) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Disallowed content between namespace name and semicolon.', + $namespacePointer, + self::CODE_DISALLOWED_CONTENT_BETWEEN_NAMESPACE_NAME_AND_SEMICOLON + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $namespaceNameEndPointer, $namespaceSemicolonPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkDisallowedBracketedSyntax(File $phpcsFile, int $namespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('scope_opener', $tokens[$namespacePointer])) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Bracketed syntax for namespaces is disallowed.', + $namespacePointer, + self::CODE_DISALLOWED_BRACKETED_SYNTAX + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($tokens[$namespacePointer]['scope_opener'], ';'); + $phpcsFile->fixer->replaceToken($tokens[$namespacePointer]['scope_closer'], ''); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceSpacingSniff.php new file mode 100644 index 0000000..14229a0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/NamespaceSpacingSniff.php @@ -0,0 +1,164 @@ + + */ + public function register(): array + { + return [ + T_NAMESPACE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $namespacePointer + */ + public function process(File $phpcsFile, $namespacePointer): void + { + $this->linesCountBeforeNamespace = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeNamespace); + $this->linesCountAfterNamespace = SniffSettingsHelper::normalizeInteger($this->linesCountAfterNamespace); + + $this->checkLinesBeforeNamespace($phpcsFile, $namespacePointer); + $this->checkLinesAfterNamespace($phpcsFile, $namespacePointer); + } + + private function checkLinesBeforeNamespace(File $phpcsFile, int $namespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBeforeNamespace */ + $pointerBeforeNamespace = TokenHelper::findPreviousNonWhitespace($phpcsFile, $namespacePointer - 1); + + $whitespaceBeforeNamespace = ''; + + $isInlineCommentBefore = (bool) preg_match('~^(?://|#)(.*)~', $tokens[$pointerBeforeNamespace]['content']); + + if ($tokens[$pointerBeforeNamespace]['code'] === T_OPEN_TAG) { + $whitespaceBeforeNamespace .= substr($tokens[$pointerBeforeNamespace]['content'], strlen('eolChar; + } + + if ($pointerBeforeNamespace + 1 !== $namespacePointer) { + $whitespaceBeforeNamespace .= TokenHelper::getContent($phpcsFile, $pointerBeforeNamespace + 1, $namespacePointer - 1); + } + + $actualLinesCountBeforeNamespace = substr_count($whitespaceBeforeNamespace, $phpcsFile->eolChar) - 1; + + if ($actualLinesCountBeforeNamespace === $this->linesCountBeforeNamespace) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before namespace statement, found %d.', + $this->linesCountBeforeNamespace, + $this->linesCountBeforeNamespace === 1 ? '' : 's', + $actualLinesCountBeforeNamespace + ), + $namespacePointer, + self::CODE_INCORRECT_LINES_COUNT_BEFORE_NAMESPACE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$pointerBeforeNamespace]['code'] === T_OPEN_TAG) { + $phpcsFile->fixer->replaceToken($pointerBeforeNamespace, 'fixer->replaceToken( + $pointerBeforeNamespace, + rtrim($tokens[$pointerBeforeNamespace]['content'], $phpcsFile->eolChar) + ); + } + + FixerHelper::removeBetween($phpcsFile, $pointerBeforeNamespace, $namespacePointer); + + for ($i = 0; $i <= $this->linesCountBeforeNamespace; $i++) { + $phpcsFile->fixer->addNewline($pointerBeforeNamespace); + } + $phpcsFile->fixer->endChangeset(); + } + + private function checkLinesAfterNamespace(File $phpcsFile, int $namespacePointer): void + { + if (array_key_exists('scope_opener', $phpcsFile->getTokens()[$namespacePointer])) { + return; + } + + /** @var int $namespaceSemicolonPointer */ + $namespaceSemicolonPointer = TokenHelper::findNextLocal($phpcsFile, T_SEMICOLON, $namespacePointer + 1); + + $pointerAfterWhitespaceEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $namespaceSemicolonPointer + 1); + if ($pointerAfterWhitespaceEnd === null) { + return; + } + + $whitespaceAfterNamespace = TokenHelper::getContent($phpcsFile, $namespaceSemicolonPointer + 1, $pointerAfterWhitespaceEnd - 1); + + $actualLinesCountAfterNamespace = substr_count($whitespaceAfterNamespace, $phpcsFile->eolChar) - 1; + + if ($actualLinesCountAfterNamespace === $this->linesCountAfterNamespace) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after namespace statement, found %d.', + $this->linesCountAfterNamespace, + $this->linesCountAfterNamespace === 1 ? '' : 's', + $actualLinesCountAfterNamespace + ), + $namespacePointer, + self::CODE_INCORRECT_LINES_COUNT_AFTER_NAMESPACE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $namespaceSemicolonPointer, $pointerAfterWhitespaceEnd); + + for ($i = 0; $i <= $this->linesCountAfterNamespace; $i++) { + $phpcsFile->fixer->addNewline($namespaceSemicolonPointer); + } + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php new file mode 100644 index 0000000..224afd5 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php @@ -0,0 +1,779 @@ + */ + public $specialExceptionNames = []; + + /** @var list */ + public $ignoredNames = []; + + /** @var bool */ + public $allowPartialUses = true; + + /** + * If empty, all namespaces are required to be used + * + * @var list + */ + public $namespacesRequiredToUse = []; + + /** @var bool */ + public $allowFullyQualifiedNameForCollidingClasses = false; + + /** @var bool */ + public $allowFullyQualifiedNameForCollidingFunctions = false; + + /** @var bool */ + public $allowFullyQualifiedNameForCollidingConstants = false; + + /** @var list|null */ + private $normalizedSpecialExceptionNames; + + /** @var list|null */ + private $normalizedIgnoredNames; + + /** @var list|null */ + private $normalizedNamespacesRequiredToUse; + + /** + * @return array + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $references = $this->getReferences($phpcsFile, $openTagPointer); + + $definedClassesIndex = []; + foreach (ClassHelper::getAllNames($phpcsFile) as $definedClassPointer => $definedClassName) { + $definedClassesIndex[strtolower($definedClassName)] = NamespaceHelper::resolveClassName( + $phpcsFile, + $definedClassName, + $definedClassPointer + ); + } + $definedFunctionsIndex = array_flip(array_map(static function (string $functionName): string { + return strtolower($functionName); + }, FunctionHelper::getAllFunctionNames($phpcsFile))); + $definedConstantsIndex = array_flip(ConstantHelper::getAllNames($phpcsFile)); + + $classReferencesIndex = []; + $classReferences = array_filter($references, static function (stdClass $reference): bool { + return $reference->source === self::SOURCE_CODE && $reference->isClass; + }); + + foreach ($classReferences as $classReference) { + $classReferencesIndex[strtolower($classReference->name)] = NamespaceHelper::resolveName( + $phpcsFile, + $classReference->name, + $classReference->type, + $classReference->startPointer + ); + } + + $namespacePointers = NamespaceHelper::getAllNamespacesPointers($phpcsFile); + + $referenceErrors = []; + + foreach ($references as $reference) { + $useStatements = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $reference->startPointer); + + $name = $reference->name; + /** @var int $startPointer */ + $startPointer = $reference->startPointer; + $canonicalName = NamespaceHelper::normalizeToCanonicalName($name); + $unqualifiedName = NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($name); + + if (in_array(strtolower($unqualifiedName), ['true', 'false', 'null'], true)) { + continue; + } + + $collidingUseStatementUniqueId = UseStatement::getUniqueId($reference->type, $unqualifiedName); + + $isPartialUse = false; + foreach ($useStatements as $useStatement) { + $useStatementName = $useStatement->getAlias() ?? $useStatement->getNameAsReferencedInFile(); + if (strpos($name, $useStatementName . '\\') === 0) { + $isPartialUse = true; + break; + } + } + + $isFullyQualified = NamespaceHelper::isFullyQualifiedName($name) + || ($namespacePointers === [] && NamespaceHelper::hasNamespace($name) && !$isPartialUse); + + $isGlobalFallback = !$isFullyQualified + && !NamespaceHelper::hasNamespace($name) + && $namespacePointers !== [] + && !array_key_exists(UseStatement::getUniqueId($reference->type, $name), $useStatements); + + $isGlobalFunctionFallback = false; + if ($reference->isFunction && $isGlobalFallback) { + $isGlobalFunctionFallback = !array_key_exists(strtolower($reference->name), $definedFunctionsIndex) && function_exists( + $reference->name + ); + } + $isGlobalConstantFallback = false; + if ($reference->isConstant && $isGlobalFallback) { + $isGlobalConstantFallback = !array_key_exists($reference->name, $definedConstantsIndex) && defined($reference->name); + } + + if ($isFullyQualified) { + if ($reference->isClass && $this->allowFullyQualifiedNameForCollidingClasses) { + $lowerCasedUnqualifiedClassName = strtolower($unqualifiedName); + if ( + array_key_exists($lowerCasedUnqualifiedClassName, $definedClassesIndex) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName( + $definedClassesIndex[$lowerCasedUnqualifiedClassName] + ) + ) { + continue; + } + + if ( + array_key_exists($lowerCasedUnqualifiedClassName, $classReferencesIndex) + && $name !== $classReferencesIndex[$lowerCasedUnqualifiedClassName] + ) { + continue; + } + + if ( + array_key_exists($collidingUseStatementUniqueId, $useStatements) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName( + $useStatements[$collidingUseStatementUniqueId]->getFullyQualifiedTypeName() + ) + ) { + continue; + } + } elseif ($reference->isFunction && $this->allowFullyQualifiedNameForCollidingFunctions) { + $lowerCasedUnqualifiedFunctionName = strtolower($unqualifiedName); + if (array_key_exists($lowerCasedUnqualifiedFunctionName, $definedFunctionsIndex)) { + continue; + } + + if ( + array_key_exists($collidingUseStatementUniqueId, $useStatements) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName( + $useStatements[$collidingUseStatementUniqueId]->getFullyQualifiedTypeName() + ) + ) { + continue; + } + } elseif ($reference->isConstant && $this->allowFullyQualifiedNameForCollidingConstants) { + if (array_key_exists($unqualifiedName, $definedConstantsIndex)) { + continue; + } + + if ( + array_key_exists($collidingUseStatementUniqueId, $useStatements) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName( + $useStatements[$collidingUseStatementUniqueId]->getFullyQualifiedTypeName() + ) + ) { + continue; + } + } + } + + if ($isFullyQualified || $isGlobalFunctionFallback || $isGlobalConstantFallback) { + if ($isFullyQualified && !$this->isRequiredToBeUsed($name)) { + continue; + } + + $isExceptionByName = StringHelper::endsWith($name, 'Exception') + || $name === '\Throwable' + || (StringHelper::endsWith($name, 'Error') && !NamespaceHelper::hasNamespace($name)) + || in_array($canonicalName, $this->getSpecialExceptionNames(), true); + $inIgnoredNames = in_array($canonicalName, $this->getIgnoredNames(), true); + + if ($isExceptionByName && !$inIgnoredNames && $this->allowFullyQualifiedExceptions) { + continue; + } + + if ( + $isFullyQualified + && !NamespaceHelper::hasNamespace($name) + && $namespacePointers === [] + ) { + $label = sprintf( + $reference->isConstant ? 'Constant %s' : ($reference->isFunction ? 'Function %s()' : 'Class %s'), + $name + ); + + $fix = $phpcsFile->addFixableError(sprintf( + '%s should not be referenced via a fully qualified name, but via an unqualified name without the leading \\, because the file does not have a namespace and the type cannot be put in a use statement.', + $label + ), $startPointer, self::CODE_REFERENCE_VIA_FULLY_QUALIFIED_NAME_WITHOUT_NAMESPACE); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + + if ($reference->source === self::SOURCE_ANNOTATION) { + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, + $reference->annotation, + $reference->nameNode, + new IdentifierTypeNode(substr($reference->name, 1)) + ); + + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + } elseif ($reference->source === self::SOURCE_ANNOTATION_CONSTANT_FETCH) { + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, + $reference->annotation, + $reference->constantFetchNode, + new ConstFetchNode(substr($reference->name, 1), $reference->constantFetchNode->name) + ); + + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + } else { + $phpcsFile->fixer->replaceToken($startPointer, substr($tokens[$startPointer]['content'], 1)); + } + + $phpcsFile->fixer->endChangeset(); + } + } else { + $shouldBeUsed = NamespaceHelper::hasNamespace($name); + if (!$shouldBeUsed) { + if ($reference->isFunction) { + $shouldBeUsed = $isFullyQualified + ? !$this->allowFullyQualifiedGlobalFunctions + : !$this->allowFallbackGlobalFunctions; + } elseif ($reference->isConstant) { + $shouldBeUsed = $isFullyQualified + ? !$this->allowFullyQualifiedGlobalConstants + : !$this->allowFallbackGlobalConstants; + } else { + $shouldBeUsed = !$this->allowFullyQualifiedGlobalClasses; + } + } + + if (!$shouldBeUsed) { + continue; + } + + $referenceErrors[] = (object) [ + 'reference' => $reference, + 'canonicalName' => $canonicalName, + 'isGlobalConstantFallback' => $isGlobalConstantFallback, + 'isGlobalFunctionFallback' => $isGlobalFunctionFallback, + ]; + } + } elseif (!$this->allowPartialUses) { + if (NamespaceHelper::isQualifiedName($name)) { + $phpcsFile->addError(sprintf( + 'Partial use statements are not allowed, but referencing %s found.', + $name + ), $startPointer, self::CODE_PARTIAL_USE); + } + } + } + + if (count($referenceErrors) === 0) { + return; + } + + $alreadyAddedUses = [ + UseStatement::TYPE_CLASS => [], + UseStatement::TYPE_FUNCTION => [], + UseStatement::TYPE_CONSTANT => [], + ]; + + $phpcsFile->fixer->beginChangeset(); + + foreach ($referenceErrors as $referenceData) { + $reference = $referenceData->reference; + /** @var int $startPointer */ + $startPointer = $reference->startPointer; + $canonicalName = $referenceData->canonicalName; + $nameToReference = NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($reference->name); + $canonicalNameToReference = $reference->isConstant ? $nameToReference : strtolower($nameToReference); + $isGlobalConstantFallback = $referenceData->isGlobalConstantFallback; + $isGlobalFunctionFallback = $referenceData->isGlobalFunctionFallback; + + $useStatements = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $reference->startPointer); + + $canBeFixed = array_reduce( + $alreadyAddedUses[$reference->type], + static function (bool $carry, string $use) use ($canonicalName): bool { + $useLastName = strtolower(NamespaceHelper::getLastNamePart($use)); + $canonicalLastName = strtolower(NamespaceHelper::getLastNamePart($canonicalName)); + return $useLastName === $canonicalLastName ? false : $carry; + }, + true + ); + + if ( + ( + $reference->isClass + && array_key_exists($canonicalNameToReference, $definedClassesIndex) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName($definedClassesIndex[$canonicalNameToReference]) + ) + || ( + $reference->isClass + && array_key_exists($canonicalNameToReference, $classReferencesIndex) + && $canonicalName !== NamespaceHelper::normalizeToCanonicalName($classReferencesIndex[$canonicalNameToReference]) + ) + || ($reference->isFunction && array_key_exists($canonicalNameToReference, $definedFunctionsIndex)) + || ($reference->isConstant && array_key_exists($canonicalNameToReference, $definedConstantsIndex)) + ) { + $canBeFixed = false; + } + + foreach ($useStatements as $useStatement) { + if ($useStatement->getType() !== $reference->type) { + continue; + } + + if ($useStatement->getFullyQualifiedTypeName() === $canonicalName) { + continue; + } + + if ($useStatement->getCanonicalNameAsReferencedInFile() !== $canonicalNameToReference) { + continue; + } + + $canBeFixed = false; + break; + } + + $label = sprintf( + $reference->isConstant + ? 'Constant %s' + : ($reference->isFunction ? 'Function %s()' : 'Class %s'), + $reference->name + ); + $errorCode = $isGlobalConstantFallback || $isGlobalFunctionFallback + ? self::CODE_REFERENCE_VIA_FALLBACK_GLOBAL_NAME + : self::CODE_REFERENCE_VIA_FULLY_QUALIFIED_NAME; + $errorMessage = $isGlobalConstantFallback || $isGlobalFunctionFallback + ? sprintf('%s should not be referenced via a fallback global name, but via a use statement.', $label) + : sprintf('%s should not be referenced via a fully qualified name, but via a use statement.', $label); + + if (!$canBeFixed) { + $phpcsFile->addError($errorMessage, $startPointer, $errorCode); + continue; + } + + $fix = $phpcsFile->addFixableError($errorMessage, $startPointer, $errorCode); + + if (!$fix) { + continue; + } + + $addUse = !in_array($canonicalName, $alreadyAddedUses[$reference->type], true); + + if ( + $reference->isClass + && array_key_exists($canonicalNameToReference, $definedClassesIndex) + ) { + $addUse = false; + } + + foreach ($useStatements as $useStatement) { + if ( + $useStatement->getType() !== $reference->type + || $useStatement->getFullyQualifiedTypeName() !== $canonicalName + ) { + continue; + } + + $nameToReference = $useStatement->getNameAsReferencedInFile(); + $addUse = false; + // Lock the use statement, so it is not modified by other sniffs + $phpcsFile->fixer->replaceToken( + $useStatement->getPointer(), + $phpcsFile->fixer->getTokenContent($useStatement->getPointer()) + ); + break; + } + + if ($addUse) { + $useStatementPlacePointer = $this->getUseStatementPlacePointer($phpcsFile, $openTagPointer, $useStatements); + $useTypeName = UseStatement::getTypeName($reference->type); + $useTypeFormatted = $useTypeName !== null ? sprintf('%s ', $useTypeName) : ''; + + $phpcsFile->fixer->addNewline($useStatementPlacePointer); + $phpcsFile->fixer->addContent($useStatementPlacePointer, sprintf('use %s%s;', $useTypeFormatted, $canonicalName)); + + $alreadyAddedUses[$reference->type][] = $canonicalName; + } + + if ($reference->source === self::SOURCE_ANNOTATION) { + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, + $reference->annotation, + $reference->nameNode, + new IdentifierTypeNode($nameToReference) + ); + + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + } elseif ($reference->source === self::SOURCE_ANNOTATION_CONSTANT_FETCH) { + $fixedDocComment = AnnotationHelper::fixAnnotation( + $reference->parsedDocComment, + $reference->annotation, + $reference->constantFetchNode, + new ConstFetchNode($nameToReference, $reference->constantFetchNode->name) + ); + + FixerHelper::change( + $phpcsFile, + $reference->parsedDocComment->getOpenPointer(), + $reference->parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + } elseif ($reference->source === self::SOURCE_ATTRIBUTE) { + $attributeContent = TokenHelper::getContent($phpcsFile, $startPointer, $reference->endPointer); + $fixedAttributeContent = preg_replace( + '~(?<=\W)' . preg_quote($reference->name, '~') . '(?=\W)~', + $nameToReference, + $attributeContent + ); + FixerHelper::change($phpcsFile, $startPointer, $reference->endPointer, $fixedAttributeContent); + } else { + FixerHelper::change($phpcsFile, $startPointer, $reference->endPointer, $nameToReference); + } + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @return list + */ + private function getSpecialExceptionNames(): array + { + if ($this->normalizedSpecialExceptionNames === null) { + $this->normalizedSpecialExceptionNames = SniffSettingsHelper::normalizeArray($this->specialExceptionNames); + } + + return $this->normalizedSpecialExceptionNames; + } + + /** + * @return list + */ + private function getIgnoredNames(): array + { + if ($this->normalizedIgnoredNames === null) { + $this->normalizedIgnoredNames = SniffSettingsHelper::normalizeArray($this->ignoredNames); + } + + return $this->normalizedIgnoredNames; + } + + /** + * @return list + */ + private function getNamespacesRequiredToUse(): array + { + if ($this->normalizedNamespacesRequiredToUse === null) { + $this->normalizedNamespacesRequiredToUse = SniffSettingsHelper::normalizeArray($this->namespacesRequiredToUse); + } + + return $this->normalizedNamespacesRequiredToUse; + } + + /** + * @param array $useStatements + */ + private function getUseStatementPlacePointer(File $phpcsFile, int $openTagPointer, array $useStatements): int + { + if (count($useStatements) !== 0) { + $lastUseStatement = array_values($useStatements)[count($useStatements) - 1]; + /** @var int $useStatementPlacePointer */ + $useStatementPlacePointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $lastUseStatement->getPointer() + 1); + return $useStatementPlacePointer; + } + + $namespacePointer = TokenHelper::findNext($phpcsFile, T_NAMESPACE, $openTagPointer + 1); + if ($namespacePointer !== null) { + /** @var int $useStatementPlacePointer */ + $useStatementPlacePointer = TokenHelper::findNext($phpcsFile, [T_SEMICOLON, T_OPEN_CURLY_BRACKET], $namespacePointer + 1); + return $useStatementPlacePointer; + } + + $tokens = $phpcsFile->getTokens(); + + $useStatementPlacePointer = $openTagPointer; + + $nonWhitespacePointerAfterOpenTag = TokenHelper::findNextNonWhitespace($phpcsFile, $openTagPointer + 1); + if (in_array($tokens[$nonWhitespacePointerAfterOpenTag]['code'], Tokens::$commentTokens, true)) { + $commentEndPointer = CommentHelper::getCommentEndPointer($phpcsFile, $nonWhitespacePointerAfterOpenTag); + + if (StringHelper::endsWith($tokens[$commentEndPointer]['content'], $phpcsFile->eolChar)) { + $useStatementPlacePointer = $commentEndPointer; + } else { + $newLineAfterComment = $commentEndPointer + 1; + + if (array_key_exists($newLineAfterComment, $tokens) && $tokens[$newLineAfterComment]['content'] === $phpcsFile->eolChar) { + $pointerAfterCommentEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $newLineAfterComment + 1); + + if (TokenHelper::findNextContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $newLineAfterComment + 1, + $pointerAfterCommentEnd + ) !== null) { + $useStatementPlacePointer = $commentEndPointer; + } + } + } + } + + $pointerAfter = TokenHelper::findNextEffective($phpcsFile, $useStatementPlacePointer + 1); + if ($tokens[$pointerAfter]['code'] === T_DECLARE) { + return TokenHelper::findNext($phpcsFile, T_SEMICOLON, $pointerAfter + 1); + } + + return $useStatementPlacePointer; + } + + private function isRequiredToBeUsed(string $name): bool + { + if ($this->namespacesRequiredToUse === null || $this->namespacesRequiredToUse === []) { + return true; + } + + foreach ($this->getNamespacesRequiredToUse() as $namespace) { + if (!NamespaceHelper::isTypeInNamespace($name, $namespace)) { + continue; + } + + return true; + } + + return false; + } + + /** + * @return list + */ + private function getReferences(File $phpcsFile, int $openTagPointer): array + { + $tokens = $phpcsFile->getTokens(); + + $references = []; + foreach (ReferencedNameHelper::getAllReferencedNames($phpcsFile, $openTagPointer) as $referencedName) { + $reference = new stdClass(); + $reference->source = self::SOURCE_CODE; + $reference->name = $referencedName->getNameAsReferencedInFile(); + $reference->type = $referencedName->getType(); + $reference->startPointer = $referencedName->getStartPointer(); + $reference->endPointer = $referencedName->getEndPointer(); + $reference->isClass = $referencedName->isClass(); + $reference->isConstant = $referencedName->isConstant(); + $reference->isFunction = $referencedName->isFunction(); + + $references[] = $reference; + } + + foreach (ReferencedNameHelper::getAllReferencedNamesInAttributes($phpcsFile, $openTagPointer) as $referencedName) { + $reference = new stdClass(); + $reference->source = self::SOURCE_ATTRIBUTE; + $reference->name = $referencedName->getNameAsReferencedInFile(); + $reference->type = $referencedName->getType(); + $reference->startPointer = $referencedName->getStartPointer(); + $reference->endPointer = $referencedName->getEndPointer(); + $reference->isClass = $referencedName->isClass(); + $reference->isConstant = $referencedName->isConstant(); + $reference->isFunction = $referencedName->isFunction(); + + $references[] = $reference; + } + + if (!$this->searchAnnotations) { + return $references; + } + + $searchAnnotationsPointer = $openTagPointer + 1; + while (true) { + $docCommentOpenPointer = TokenHelper::findNext($phpcsFile, T_DOC_COMMENT_OPEN_TAG, $searchAnnotationsPointer); + if ($docCommentOpenPointer === null) { + break; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + if ($parsedDocComment !== null) { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + $lowercasedTypeHint = strtolower($typeHint); + if ( + TypeHintHelper::isSimpleTypeHint($lowercasedTypeHint) + || TypeHintHelper::isSimpleUnofficialTypeHints($lowercasedTypeHint) + || !TypeHelper::isTypeName($typeHint) + ) { + continue; + } + + $reference = new stdClass(); + $reference->source = self::SOURCE_ANNOTATION; + $reference->parsedDocComment = $parsedDocComment; + $reference->annotation = $annotation; + $reference->nameNode = $typeHintNode; + $reference->name = $typeHint; + $reference->type = ReferencedName::TYPE_CLASS; + $reference->startPointer = $annotation->getStartPointer(); + $reference->endPointer = null; + $reference->isClass = true; + $reference->isConstant = false; + $reference->isFunction = false; + + $references[] = $reference; + } + + /** @var list $constantFetchNodes */ + $constantFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + foreach ($constantFetchNodes as $constantFetchNode) { + $reference = new stdClass(); + $reference->source = self::SOURCE_ANNOTATION_CONSTANT_FETCH; + $reference->parsedDocComment = $parsedDocComment; + $reference->annotation = $annotation; + $reference->constantFetchNode = $constantFetchNode; + $reference->name = $constantFetchNode->className; + $reference->type = ReferencedName::TYPE_CLASS; + $reference->startPointer = $annotation->getStartPointer(); + $reference->endPointer = null; + $reference->isClass = true; + $reference->isConstant = false; + $reference->isFunction = false; + + $references[] = $reference; + } + } + } + + $searchAnnotationsPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + } + + return $references; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/RequireOneNamespaceInFileSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/RequireOneNamespaceInFileSniff.php new file mode 100644 index 0000000..8b97302 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/RequireOneNamespaceInFileSniff.php @@ -0,0 +1,58 @@ + + */ + public function register(): array + { + return [ + T_NAMESPACE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $namespacePointer + */ + public function process(File $phpcsFile, $namespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $pointerAfterNamespace = TokenHelper::findNextEffective($phpcsFile, $namespacePointer + 1); + if ($tokens[$pointerAfterNamespace]['code'] === T_NS_SEPARATOR) { + return; + } + + $previousNamespacePointer = $namespacePointer; + do { + $previousNamespacePointer = TokenHelper::findPrevious($phpcsFile, T_NAMESPACE, $previousNamespacePointer - 1); + if ($previousNamespacePointer === null) { + return; + } + + $pointerAfterPreviousNamespace = TokenHelper::findNextEffective($phpcsFile, $previousNamespacePointer + 1); + if ($tokens[$pointerAfterPreviousNamespace]['code'] === T_NS_SEPARATOR) { + continue; + } + + break; + + } while (true); + + $phpcsFile->addError('Only one namespace in a file is allowed.', $namespacePointer, self::CODE_MORE_NAMESPACES_IN_FILE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php new file mode 100644 index 0000000..9dfb68f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UnusedUsesSniff.php @@ -0,0 +1,294 @@ + */ + public $ignoredAnnotationNames = []; + + /** @var list */ + public $ignoredAnnotations = []; + + /** @var list|null */ + private $normalizedIgnoredAnnotationNames; + + /** @var list|null */ + private $normalizedIgnoredAnnotations; + + /** + * @return array + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $startPointer = TokenHelper::findPrevious($phpcsFile, T_NAMESPACE, $openTagPointer - 1) ?? $openTagPointer; + + $fileUnusedNames = UseStatementHelper::getFileUseStatements($phpcsFile); + $referencedNamesInCode = ReferencedNameHelper::getAllReferencedNames($phpcsFile, $startPointer); + $referencedNamesInAttributes = ReferencedNameHelper::getAllReferencedNamesInAttributes($phpcsFile, $startPointer); + + $pointersBeforeUseStatements = array_reverse(NamespaceHelper::getAllNamespacesPointers($phpcsFile)); + + $allUsedNames = []; + + foreach ([$referencedNamesInCode, $referencedNamesInAttributes] as $referencedNames) { + foreach ($referencedNames as $referencedName) { + $pointer = $referencedName->getStartPointer(); + + $pointerBeforeUseStatements = $this->firstPointerBefore($pointer, $pointersBeforeUseStatements, $startPointer); + + $name = $referencedName->getNameAsReferencedInFile(); + $nameParts = NamespaceHelper::getNameParts($name); + $nameAsReferencedInFile = $nameParts[0]; + $nameReferencedWithoutSubNamespace = count($nameParts) === 1; + $uniqueId = $nameReferencedWithoutSubNamespace + ? UseStatement::getUniqueId($referencedName->getType(), $nameAsReferencedInFile) + : UseStatement::getUniqueId(ReferencedName::TYPE_CLASS, $nameAsReferencedInFile); + if ( + NamespaceHelper::isFullyQualifiedName($name) + || !array_key_exists($pointerBeforeUseStatements, $fileUnusedNames) + || !array_key_exists($uniqueId, $fileUnusedNames[$pointerBeforeUseStatements]) + ) { + continue; + } + + $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; + } + } + + if ($this->searchAnnotations) { + $tokens = $phpcsFile->getTokens(); + $searchAnnotationsPointer = $startPointer + 1; + while (true) { + $docCommentOpenPointer = TokenHelper::findNext($phpcsFile, T_DOC_COMMENT_OPEN_TAG, $searchAnnotationsPointer); + if ($docCommentOpenPointer === null) { + break; + } + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + if ($annotations === []) { + $searchAnnotationsPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + continue; + } + + $pointerBeforeUseStatements = $this->firstPointerBefore( + $docCommentOpenPointer - 1, + $pointersBeforeUseStatements, + $startPointer + ); + + if (!array_key_exists($pointerBeforeUseStatements, $fileUnusedNames)) { + $searchAnnotationsPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + continue; + } + + foreach ($fileUnusedNames[$pointerBeforeUseStatements] as $useStatement) { + if (!$useStatement->isClass()) { + continue; + } + + $nameAsReferencedInFile = $useStatement->getNameAsReferencedInFile(); + $uniqueId = UseStatement::getUniqueId($useStatement->getType(), $nameAsReferencedInFile); + + foreach ($annotations as $annotation) { + if (in_array($annotation->getName(), $this->getIgnoredAnnotations(), true)) { + continue; + } + + if ($annotation->isInvalid()) { + continue; + } + + $contentsToCheck = []; + + if ($annotation->getValue() instanceof GenericTagValueNode) { + $contentsToCheck[] = $annotation->getName(); + $contentsToCheck[] = $annotation->getValue()->value; + } else { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType( + $annotation->getNode(), + IdentifierTypeNode::class + ); + /** @var list $doctrineAnnotations */ + $doctrineAnnotations = AnnotationHelper::getAnnotationNodesByType( + $annotation->getNode(), + DoctrineAnnotation::class + ); + /** @var list $constFetchNodes */ + $constFetchNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), ConstFetchNode::class); + + $contentsToCheck = array_filter(array_merge( + $contentsToCheck, + array_map(static function (IdentifierTypeNode $identifierTypeNode): ?string { + if ( + TypeHintHelper::isSimpleTypeHint($identifierTypeNode->name) + || TypeHintHelper::isSimpleUnofficialTypeHints($identifierTypeNode->name) + || !TypeHelper::isTypeName($identifierTypeNode->name) + ) { + return null; + } + + return $identifierTypeNode->name; + }, $identifierTypeNodes), + array_map(function (DoctrineAnnotation $doctrineAnnotation): ?string { + if (in_array($doctrineAnnotation->name, $this->getIgnoredAnnotationNames(), true)) { + return null; + } + + return $doctrineAnnotation->name; + }, $doctrineAnnotations), + array_map(static function (ConstFetchNode $constFetchNode): string { + return $constFetchNode->className; + }, $constFetchNodes) + )); + } + + foreach ($contentsToCheck as $contentToCheck) { + if (preg_match( + '~(?<=^|[^a-z\\\\])(' . preg_quote($nameAsReferencedInFile, '~') . ')(?=\\s|::|\\\\|\||\[|$)~im', + $contentToCheck + ) === 0) { + continue; + } + + $allUsedNames[$pointerBeforeUseStatements][$uniqueId] = true; + } + } + } + + $searchAnnotationsPointer = $tokens[$docCommentOpenPointer]['comment_closer'] + 1; + } + } + + foreach ($fileUnusedNames as $pointerBeforeUnusedNames => $unusedNames) { + $usedNames = $allUsedNames[$pointerBeforeUnusedNames] ?? []; + foreach (array_diff_key($unusedNames, $usedNames) as $unusedUse) { + $fullName = $unusedUse->getFullyQualifiedTypeName(); + if ( + $unusedUse->getNameAsReferencedInFile() !== $fullName + && $unusedUse->getNameAsReferencedInFile() !== NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($fullName) + ) { + $fullName .= sprintf(' (as %s)', $unusedUse->getNameAsReferencedInFile()); + } + $fix = $phpcsFile->addFixableError(sprintf( + 'Type %s is not used in this file.', + $fullName + ), $unusedUse->getPointer(), self::CODE_UNUSED_USE); + if (!$fix) { + continue; + } + + $endPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $unusedUse->getPointer()) + 1; + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $unusedUse->getPointer(), $endPointer); + + $phpcsFile->fixer->endChangeset(); + } + } + } + + /** + * @return list + */ + private function getIgnoredAnnotationNames(): array + { + if ($this->normalizedIgnoredAnnotationNames === null) { + $this->normalizedIgnoredAnnotationNames = array_merge( + SniffSettingsHelper::normalizeArray($this->ignoredAnnotationNames), + [ + '@param', + '@throws', + '@property', + '@method', + ] + ); + } + + return $this->normalizedIgnoredAnnotationNames; + } + + /** + * @return list + */ + private function getIgnoredAnnotations(): array + { + if ($this->normalizedIgnoredAnnotations === null) { + $this->normalizedIgnoredAnnotations = SniffSettingsHelper::normalizeArray($this->ignoredAnnotations); + } + + return $this->normalizedIgnoredAnnotations; + } + + /** + * @param list $pointersBeforeUseStatements + */ + private function firstPointerBefore(int $pointer, array $pointersBeforeUseStatements, int $startPointer): int + { + foreach ($pointersBeforeUseStatements as $pointerBeforeUseStatements) { + if ($pointerBeforeUseStatements < $pointer) { + return $pointerBeforeUseStatements; + } + } + + return $startPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php new file mode 100644 index 0000000..6313862 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseDoesNotStartWithBackslashSniff.php @@ -0,0 +1,74 @@ + + */ + public function register(): array + { + return [ + T_USE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + if (!UseStatementHelper::isImportUse($phpcsFile, $usePointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + /** @var int $nextTokenPointer */ + $nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + + if ( + in_array($tokens[$nextTokenPointer]['code'], TokenHelper::getOnlyNameTokenCodes(), true) + && ( + $tokens[$nextTokenPointer]['content'] === 'function' + || $tokens[$nextTokenPointer]['content'] === 'const' + ) + ) { + /** @var int $nextTokenPointer */ + $nextTokenPointer = TokenHelper::findNextEffective($phpcsFile, $nextTokenPointer + 1); + } + + if (!NamespaceHelper::isFullyQualifiedPointer($phpcsFile, $nextTokenPointer)) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use statement cannot start with a backslash.', + $nextTokenPointer, + self::CODE_STARTS_WITH_BACKSLASH + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($nextTokenPointer, ltrim($tokens[$nextTokenPointer]['content'], '\\')); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseFromSameNamespaceSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseFromSameNamespaceSniff.php new file mode 100644 index 0000000..224876a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseFromSameNamespaceSniff.php @@ -0,0 +1,90 @@ + + */ + public function register(): array + { + return [ + T_USE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + if (!UseStatementHelper::isImportUse($phpcsFile, $usePointer)) { + return; + } + + $namespaceName = NamespaceHelper::findCurrentNamespaceName($phpcsFile, $usePointer); + if ($namespaceName === null) { + $namespaceName = ''; + } + + $usedTypeName = UseStatementHelper::getFullyQualifiedTypeNameFromUse($phpcsFile, $usePointer); + if (!StringHelper::startsWith($usedTypeName, $namespaceName)) { + return; + } + + $asPointer = $this->findAsPointer($phpcsFile, $usePointer); + if ($asPointer !== null) { + return; + } + + $usedTypeNameRest = substr($usedTypeName, strlen($namespaceName)); + if (!NamespaceHelper::isFullyQualifiedName($usedTypeNameRest) && $namespaceName !== '') { + return; + } + + if (NamespaceHelper::hasNamespace($usedTypeNameRest)) { + return; + } + + $fix = $phpcsFile->addFixableError(sprintf( + 'Use %s is from the same namespace – that is prohibited.', + $usedTypeName + ), $usePointer, self::CODE_USE_FROM_SAME_NAMESPACE); + if (!$fix) { + return; + } + + $endPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $usePointer) + 1; + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $usePointer, $endPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function findAsPointer(File $phpcsFile, int $startPointer): ?int + { + return TokenHelper::findNextLocal($phpcsFile, T_AS, $startPointer); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php new file mode 100644 index 0000000..dbdb471 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseOnlyWhitelistedNamespacesSniff.php @@ -0,0 +1,78 @@ + */ + public $namespacesRequiredToUse = []; + + /** @var list|null */ + private $normalizedNamespacesRequiredToUse; + + /** + * @return array + */ + public function register(): array + { + return [ + T_USE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $usePointer + */ + public function process(File $phpcsFile, $usePointer): void + { + if (!UseStatementHelper::isImportUse($phpcsFile, $usePointer)) { + return; + } + + $className = UseStatementHelper::getFullyQualifiedTypeNameFromUse($phpcsFile, $usePointer); + if ($this->allowUseFromRootNamespace && !NamespaceHelper::isQualifiedName($className)) { + return; + } + + foreach ($this->getNamespacesRequiredToUse() as $namespace) { + if (!NamespaceHelper::isTypeInNamespace($className, $namespace)) { + continue; + } + + return; + } + + $phpcsFile->addError(sprintf( + 'Type %s should not be used, but referenced via a fully qualified name.', + $className + ), $usePointer, self::CODE_NON_FULLY_QUALIFIED); + } + + /** + * @return list + */ + private function getNamespacesRequiredToUse(): array + { + if ($this->normalizedNamespacesRequiredToUse === null) { + $this->normalizedNamespacesRequiredToUse = SniffSettingsHelper::normalizeArray($this->namespacesRequiredToUse); + } + + return $this->normalizedNamespacesRequiredToUse; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php new file mode 100644 index 0000000..ca0808a --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UseSpacingSniff.php @@ -0,0 +1,343 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + $this->linesCountBeforeFirstUse = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeFirstUse); + $this->linesCountBetweenUseTypes = SniffSettingsHelper::normalizeInteger($this->linesCountBetweenUseTypes); + $this->linesCountAfterLastUse = SniffSettingsHelper::normalizeInteger($this->linesCountAfterLastUse); + + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $fileUseStatements = UseStatementHelper::getFileUseStatements($phpcsFile); + + if (count($fileUseStatements) === 0) { + return; + } + + foreach ($fileUseStatements as $useStatementsByName) { + $useStatements = array_values($useStatementsByName); + + $this->checkLinesBeforeFirstUse($phpcsFile, $useStatements[0]); + $this->checkLinesAfterLastUse($phpcsFile, $useStatements[count($useStatements) - 1]); + $this->checkLinesBetweenSameTypesOfUse($phpcsFile, $useStatements); + $this->checkLinesBetweenDifferentTypesOfUse($phpcsFile, $useStatements); + } + } + + private function checkLinesBeforeFirstUse(File $phpcsFile, UseStatement $firstUse): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $pointerBeforeFirstUse */ + $pointerBeforeFirstUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $firstUse->getPointer() - 1); + $useStartPointer = $firstUse->getPointer(); + + if ( + in_array($tokens[$pointerBeforeFirstUse]['code'], Tokens::$commentTokens, true) + && $tokens[$pointerBeforeFirstUse]['line'] + 1 === $tokens[$useStartPointer]['line'] + ) { + $useStartPointer = array_key_exists('comment_opener', $tokens[$pointerBeforeFirstUse]) + ? $tokens[$pointerBeforeFirstUse]['comment_opener'] + : CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeFirstUse); + /** @var int $pointerBeforeFirstUse */ + $pointerBeforeFirstUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $useStartPointer - 1); + } + + $actualLinesCountBeforeFirstUse = $tokens[$useStartPointer]['line'] - $tokens[$pointerBeforeFirstUse]['line'] - 1; + + if ($actualLinesCountBeforeFirstUse === $this->linesCountBeforeFirstUse) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before first use statement, found %d.', + $this->linesCountBeforeFirstUse, + $this->linesCountBeforeFirstUse === 1 ? '' : 's', + $actualLinesCountBeforeFirstUse + ), + $firstUse->getPointer(), + self::CODE_INCORRECT_LINES_COUNT_BEFORE_FIRST_USE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$pointerBeforeFirstUse]['code'] === T_OPEN_TAG) { + $phpcsFile->fixer->replaceToken($pointerBeforeFirstUse, 'linesCountBeforeFirstUse; $i++) { + $phpcsFile->fixer->addNewline($pointerBeforeFirstUse); + } + $phpcsFile->fixer->endChangeset(); + } + + private function checkLinesAfterLastUse(File $phpcsFile, UseStatement $lastUse): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $useEndPointer */ + $useEndPointer = TokenHelper::findNextLocal($phpcsFile, T_SEMICOLON, $lastUse->getPointer() + 1); + + $pointerAfterWhitespaceEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $useEndPointer + 1); + if ($pointerAfterWhitespaceEnd === null) { + return; + } + + if ( + in_array($tokens[$pointerAfterWhitespaceEnd]['code'], Tokens::$commentTokens, true) + && $tokens[$pointerAfterWhitespaceEnd]['code'] !== T_DOC_COMMENT_OPEN_TAG + && ( + $tokens[$useEndPointer]['line'] === $tokens[$pointerAfterWhitespaceEnd]['line'] + || $tokens[$useEndPointer]['line'] + 1 === $tokens[$pointerAfterWhitespaceEnd]['line'] + ) + ) { + $useEndPointer = CommentHelper::getMultilineCommentEndPointer($phpcsFile, $pointerAfterWhitespaceEnd); + /** @var int $pointerAfterWhitespaceEnd */ + $pointerAfterWhitespaceEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $useEndPointer + 1); + } + + $actualLinesCountAfterLastUse = $tokens[$pointerAfterWhitespaceEnd]['line'] - $tokens[$useEndPointer]['line'] - 1; + + if ($actualLinesCountAfterLastUse === $this->linesCountAfterLastUse) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after last use statement, found %d.', + $this->linesCountAfterLastUse, + $this->linesCountAfterLastUse === 1 ? '' : 's', + $actualLinesCountAfterLastUse + ), + $lastUse->getPointer(), + self::CODE_INCORRECT_LINES_COUNT_AFTER_LAST_USE + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $useEndPointer, $pointerAfterWhitespaceEnd); + + $linesToAdd = $this->linesCountAfterLastUse; + if (CommentHelper::isLineComment($phpcsFile, $useEndPointer)) { + $linesToAdd--; + } + + for ($i = 0; $i <= $linesToAdd; $i++) { + $phpcsFile->fixer->addNewline($useEndPointer); + } + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $useStatements + */ + private function checkLinesBetweenSameTypesOfUse(File $phpcsFile, array $useStatements): void + { + if (count($useStatements) === 1) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $requiredLinesCountBetweenUses = 0; + + $previousUse = null; + foreach ($useStatements as $use) { + if ($previousUse === null) { + $previousUse = $use; + continue; + } + + if (!$use->hasSameType($previousUse)) { + $previousUse = null; + continue; + } + + /** @var int $pointerBeforeUse */ + $pointerBeforeUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $use->getPointer() - 1); + $useStartPointer = $use->getPointer(); + + if ( + in_array($tokens[$pointerBeforeUse]['code'], Tokens::$commentTokens, true) + && TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $pointerBeforeUse) === $pointerBeforeUse + && $tokens[$pointerBeforeUse]['line'] + 1 === $tokens[$useStartPointer]['line'] + ) { + $useStartPointer = array_key_exists('comment_opener', $tokens[$pointerBeforeUse]) + ? $tokens[$pointerBeforeUse]['comment_opener'] + : CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeUse); + } + + $actualLinesCountAfterPreviousUse = $tokens[$useStartPointer]['line'] - $tokens[$previousUse->getPointer()]['line'] - 1; + + if ($actualLinesCountAfterPreviousUse === $requiredLinesCountBetweenUses) { + $previousUse = $use; + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected 0 lines between same types of use statement, found %d.', + $actualLinesCountAfterPreviousUse + ), + $use->getPointer(), + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_SAME_TYPES_OF_USE + ); + + if (!$fix) { + $previousUse = $use; + continue; + } + + /** @var int $previousUseSemicolonPointer */ + $previousUseSemicolonPointer = TokenHelper::findNextLocal($phpcsFile, T_SEMICOLON, $previousUse->getPointer() + 1); + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetween($phpcsFile, $previousUseSemicolonPointer, $useStartPointer); + $phpcsFile->fixer->addNewline($previousUseSemicolonPointer); + $phpcsFile->fixer->endChangeset(); + + $previousUse = $use; + } + } + + /** + * @param list $useStatements + */ + private function checkLinesBetweenDifferentTypesOfUse(File $phpcsFile, array $useStatements): void + { + if (count($useStatements) === 1) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $previousUse = null; + foreach ($useStatements as $use) { + if ($previousUse === null) { + $previousUse = $use; + continue; + } + + if ($use->hasSameType($previousUse)) { + $previousUse = $use; + continue; + } + + /** @var int $pointerBeforeUse */ + $pointerBeforeUse = TokenHelper::findPreviousNonWhitespace($phpcsFile, $use->getPointer() - 1); + $useStartPointer = $use->getPointer(); + + if ( + in_array($tokens[$pointerBeforeUse]['code'], Tokens::$commentTokens, true) + && TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $pointerBeforeUse) === $pointerBeforeUse + && $tokens[$pointerBeforeUse]['line'] + 1 === $tokens[$useStartPointer]['line'] + ) { + $useStartPointer = array_key_exists('comment_opener', $tokens[$pointerBeforeUse]) + ? $tokens[$pointerBeforeUse]['comment_opener'] + : CommentHelper::getMultilineCommentStartPointer($phpcsFile, $pointerBeforeUse); + } + + $actualLinesCountAfterPreviousUse = $tokens[$useStartPointer]['line'] - $tokens[$previousUse->getPointer()]['line'] - 1; + + if ($actualLinesCountAfterPreviousUse === $this->linesCountBetweenUseTypes) { + $previousUse = $use; + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s between different types of use statement, found %d.', + $this->linesCountBetweenUseTypes, + $this->linesCountBetweenUseTypes === 1 ? '' : 's', + $actualLinesCountAfterPreviousUse + ), + $use->getPointer(), + self::CODE_INCORRECT_LINES_COUNT_BETWEEN_DIFFERENT_TYPES_OF_USE + ); + + if (!$fix) { + $previousUse = $use; + continue; + } + + /** @var int $previousUseSemicolonPointer */ + $previousUseSemicolonPointer = TokenHelper::findNextLocal($phpcsFile, T_SEMICOLON, $previousUse->getPointer() + 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $previousUseSemicolonPointer, $useStartPointer); + + for ($i = 0; $i <= $this->linesCountBetweenUseTypes; $i++) { + $phpcsFile->fixer->addNewline($previousUseSemicolonPointer); + } + $phpcsFile->fixer->endChangeset(); + + $previousUse = $use; + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UselessAliasSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UselessAliasSniff.php new file mode 100644 index 0000000..140e334 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/UselessAliasSniff.php @@ -0,0 +1,82 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $fileUseStatements = UseStatementHelper::getFileUseStatements($phpcsFile); + + if (count($fileUseStatements) === 0) { + return; + } + + foreach ($fileUseStatements as $useStatements) { + foreach ($useStatements as $useStatement) { + if ($useStatement->getAlias() === null) { + continue; + } + + $unqualifiedName = NamespaceHelper::getUnqualifiedNameFromFullyQualifiedName($useStatement->getFullyQualifiedTypeName()); + if ($unqualifiedName !== $useStatement->getAlias()) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Useless alias "%s" for use of "%s".', $useStatement->getAlias(), $useStatement->getFullyQualifiedTypeName()), + $useStatement->getPointer(), + self::CODE_USELESS_ALIAS + ); + + if (!$fix) { + continue; + } + + $asPointer = TokenHelper::findNext($phpcsFile, T_AS, $useStatement->getPointer() + 1); + $nameEndPointer = TokenHelper::findPrevious($phpcsFile, TokenHelper::getOnlyNameTokenCodes(), $asPointer - 1); + $useSemicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $asPointer + 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $nameEndPointer, $useSemicolonPointer); + + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/DisallowNumericLiteralSeparatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/DisallowNumericLiteralSeparatorSniff.php new file mode 100644 index 0000000..76c0493 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/DisallowNumericLiteralSeparatorSniff.php @@ -0,0 +1,55 @@ + + */ + public function register(): array + { + return [ + T_LNUMBER, + T_DNUMBER, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $numberPointer + */ + public function process(File $phpcsFile, $numberPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (strpos($tokens[$numberPointer]['content'], '_') === false) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Use of numeric literal separator is disallowed.', + $numberPointer, + self::CODE_DISALLOWED_NUMERIC_LITERAL_SEPARATOR + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($numberPointer, str_replace('_', '', $tokens[$numberPointer]['content'])); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/RequireNumericLiteralSeparatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/RequireNumericLiteralSeparatorSniff.php new file mode 100644 index 0000000..92df96e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Numbers/RequireNumericLiteralSeparatorSniff.php @@ -0,0 +1,82 @@ + + */ + public function register(): array + { + return [ + T_LNUMBER, + T_DNUMBER, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $numberPointer + */ + public function process(File $phpcsFile, $numberPointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 70400); + $this->minDigitsBeforeDecimalPoint = SniffSettingsHelper::normalizeInteger($this->minDigitsBeforeDecimalPoint); + $this->minDigitsAfterDecimalPoint = SniffSettingsHelper::normalizeInteger($this->minDigitsAfterDecimalPoint); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $number = $tokens[$numberPointer]['content']; + + if (strpos($tokens[$numberPointer]['content'], '_') !== false) { + return; + } + + if ( + $this->ignoreOctalNumbers + && preg_match('~^0[0-7]+$~', $number) === 1 + ) { + return; + } + + $regexp = '~(?:^\\d{' . $this->minDigitsBeforeDecimalPoint . '}|\.\\d{' . $this->minDigitsAfterDecimalPoint . '})~'; + + if (preg_match($regexp, $number) === 0) { + return; + } + + $phpcsFile->addError( + 'Use of numeric literal separator is required.', + $numberPointer, + self::CODE_REQUIRED_NUMERIC_LITERAL_SEPARATOR + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowEqualOperatorsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowEqualOperatorsSniff.php new file mode 100644 index 0000000..11acc89 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowEqualOperatorsSniff.php @@ -0,0 +1,60 @@ + + */ + public function register(): array + { + return [ + T_IS_EQUAL, + T_IS_NOT_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $operatorPointer + */ + public function process(File $phpcsFile, $operatorPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$operatorPointer]['code'] === T_IS_EQUAL) { + $fix = $phpcsFile->addFixableError( + 'Operator == is disallowed, use === instead.', + $operatorPointer, + self::CODE_DISALLOWED_EQUAL_OPERATOR + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($operatorPointer, '==='); + $phpcsFile->fixer->endChangeset(); + } + } else { + $fix = $phpcsFile->addFixableError(sprintf( + 'Operator %s is disallowed, use !== instead.', + $tokens[$operatorPointer]['content'] + ), $operatorPointer, self::CODE_DISALLOWED_NOT_EQUAL_OPERATOR); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($operatorPointer, '!=='); + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowIncrementAndDecrementOperatorsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowIncrementAndDecrementOperatorsSniff.php new file mode 100644 index 0000000..3d9d539 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/DisallowIncrementAndDecrementOperatorsSniff.php @@ -0,0 +1,65 @@ + + */ + public function register(): array + { + return [ + T_DEC, + T_INC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $operatorPointer + */ + public function process(File $phpcsFile, $operatorPointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $operatorPointer + 1); + $afterVariableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $nextPointer); + $isPostOperator = $afterVariableEndPointer === null; + + if ($tokens[$operatorPointer]['code'] === T_INC) { + if ($isPostOperator) { + $code = self::CODE_DISALLOWED_POST_INCREMENT_OPERATOR; + $message = 'Use of post-increment operator is disallowed.'; + } else { + $code = self::CODE_DISALLOWED_PRE_INCREMENT_OPERATOR; + $message = 'Use of pre-increment operator is disallowed.'; + } + } else { + if ($isPostOperator) { + $code = self::CODE_DISALLOWED_POST_DECREMENT_OPERATOR; + $message = 'Use of post-decrement operator is disallowed.'; + } else { + $code = self::CODE_DISALLOWED_PRE_DECREMENT_OPERATOR; + $message = 'Use of pre-decrement operator is disallowed.'; + } + } + + $phpcsFile->addError($message, $operatorPointer, $code); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/NegationOperatorSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/NegationOperatorSpacingSniff.php new file mode 100644 index 0000000..3da9174 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/NegationOperatorSpacingSniff.php @@ -0,0 +1,125 @@ + + */ + public function register(): array + { + return [T_MINUS]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->spacesCount = SniffSettingsHelper::normalizeInteger($this->spacesCount); + + $tokens = $phpcsFile->getTokens(); + + $previousEffective = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + + $possibleOperandTypes = array_merge( + TokenHelper::getOnlyNameTokenCodes(), + [ + T_CONSTANT_ENCAPSED_STRING, + T_CLASS_C, + T_CLOSE_PARENTHESIS, + T_CLOSE_SHORT_ARRAY, + T_CLOSE_SQUARE_BRACKET, + T_DIR, + T_DNUMBER, + T_ENCAPSED_AND_WHITESPACE, + T_FILE, + T_FUNC_C, + T_LINE, + T_LNUMBER, + T_METHOD_C, + T_NS_C, + T_NUM_STRING, + T_TRAIT_C, + T_VARIABLE, + ] + ); + + if (in_array($tokens[$previousEffective]['code'], $possibleOperandTypes, true)) { + return; + } + + $possibleVariableStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $previousEffective); + if ($possibleVariableStartPointer !== null) { + return; + } + + $whitespacePointer = $pointer + 1; + + $numberOfSpaces = $tokens[$whitespacePointer]['code'] !== T_WHITESPACE ? 0 : strlen($tokens[$whitespacePointer]['content']); + if ($numberOfSpaces === $this->spacesCount) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected exactly %d space after "%s", %d found.', + $this->spacesCount, + $tokens[$pointer]['content'], + $numberOfSpaces + ), + $pointer, + self::CODE_INVALID_SPACE_AFTER_MINUS + ); + + if (!$fix) { + return; + } + + if ($this->spacesCount > $numberOfSpaces) { + $phpcsFile->fixer->addContent($pointer, ' '); + + return; + } + + $phpcsFile->fixer->replaceToken($whitespacePointer, ''); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php new file mode 100644 index 0000000..7a3406b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireCombinedAssignmentOperatorSniff.php @@ -0,0 +1,149 @@ + + */ + public function register(): array + { + return [ + T_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $equalPointer + */ + public function process(File $phpcsFile, $equalPointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $variableStartPointer */ + $variableStartPointer = TokenHelper::findNextEffective($phpcsFile, $equalPointer + 1); + $variableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $variableStartPointer); + + if ($variableEndPointer === null) { + return; + } + + $operatorPointer = TokenHelper::findNextEffective($phpcsFile, $variableEndPointer + 1); + + $operators = [ + T_BITWISE_AND => '&=', + T_BITWISE_OR => '|=', + T_STRING_CONCAT => '.=', + T_DIVIDE => '/=', + T_MINUS => '-=', + T_POW => '**=', + T_MODULUS => '%=', + T_MULTIPLY => '*=', + T_PLUS => '+=', + T_SL => '<<=', + T_SR => '>>=', + T_BITWISE_XOR => '^=', + ]; + + if (!array_key_exists($tokens[$operatorPointer]['code'], $operators)) { + return; + } + + $isFixable = true; + + if ($tokens[$variableEndPointer]['code'] === T_CLOSE_SQUARE_BRACKET) { + $pointerAfterOperator = TokenHelper::findNextEffective($phpcsFile, $operatorPointer + 1); + if (in_array( + $tokens[$pointerAfterOperator]['code'], + [T_CONSTANT_ENCAPSED_STRING, T_DOUBLE_QUOTED_STRING, T_START_HEREDOC, T_START_NOWDOC], + true + )) { + return; + } + + $isFixable = in_array($tokens[$pointerAfterOperator]['code'], [T_LNUMBER, T_DNUMBER], true); + } + + $variableContent = IdentificatorHelper::getContent($phpcsFile, $variableStartPointer, $variableEndPointer); + + /** @var int $beforeEqualEndPointer */ + $beforeEqualEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $equalPointer - 1); + $beforeEqualStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $beforeEqualEndPointer); + + if ($beforeEqualStartPointer === null) { + return; + } + + $beforeEqualVariableContent = IdentificatorHelper::getContent($phpcsFile, $beforeEqualStartPointer, $beforeEqualEndPointer); + + if ($beforeEqualVariableContent !== $variableContent) { + return; + } + + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $equalPointer + 1); + if (TokenHelper::findNext($phpcsFile, Tokens::$operators, $operatorPointer + 1, $semicolonPointer) !== null) { + return; + } + + $errorMessage = sprintf( + 'Use "%s" operator instead of "=" and "%s".', + $operators[$tokens[$operatorPointer]['code']], + $tokens[$operatorPointer]['content'] + ); + + if (!$isFixable) { + $phpcsFile->addError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGNMENT_OPERATOR); + + return; + } + + $fix = $phpcsFile->addFixableError($errorMessage, $equalPointer, self::CODE_REQUIRED_COMBINED_ASSIGNMENT_OPERATOR); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $equalPointer, $operatorPointer, $operators[$tokens[$operatorPointer]['code']]); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff.php new file mode 100644 index 0000000..9b66a3c --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/RequireOnlyStandaloneIncrementAndDecrementOperatorsSniff.php @@ -0,0 +1,118 @@ + + */ + public function register(): array + { + return [ + T_DEC, + T_INC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $operatorPointer + */ + public function process(File $phpcsFile, $operatorPointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $nextPointer */ + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $operatorPointer + 1); + + $afterVariableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $nextPointer); + $isPostOperator = $afterVariableEndPointer === null; + + if ($isPostOperator) { + /** @var int $beforeVariableEndPointer */ + $beforeVariableEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $operatorPointer - 1); + /** @var int $instructionStartPointer */ + $instructionStartPointer = IdentificatorHelper::findStartPointer($phpcsFile, $beforeVariableEndPointer); + $instructionEndPointer = $operatorPointer; + } else { + $instructionStartPointer = $operatorPointer; + /** @var int $instructionEndPointer */ + $instructionEndPointer = $afterVariableEndPointer; + } + + if ($this->isStandalone($phpcsFile, $instructionStartPointer, $instructionEndPointer)) { + return; + } + + if ($tokens[$operatorPointer]['code'] === T_INC) { + if ($isPostOperator) { + $code = self::CODE_POST_INCREMENT_OPERATOR_NOT_USED_STANDALONE; + $message = 'Post-increment operator should be used only as single instruction.'; + } else { + $code = self::CODE_PRE_INCREMENT_OPERATOR_NOT_USED_STANDALONE; + $message = 'Pre-increment operator should be used only as single instruction.'; + } + } else { + if ($isPostOperator) { + $code = self::CODE_POST_DECREMENT_OPERATOR_NOT_USED_STANDALONE; + $message = 'Post-decrement operator should be used only as single instruction.'; + } else { + $code = self::CODE_PRE_DECREMENT_OPERATOR_NOT_USED_STANDALONE; + $message = 'Pre-decrement operator should be used only as single instruction.'; + } + } + + $phpcsFile->addError($message, $operatorPointer, $code); + } + + private function isStandalone(File $phpcsFile, int $instructionStartPointer, int $instructionEndPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeInstructionStart = TokenHelper::findPreviousEffective($phpcsFile, $instructionStartPointer - 1); + if (!in_array( + $tokens[$pointerBeforeInstructionStart]['code'], + [T_SEMICOLON, T_COLON, T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET, T_OPEN_TAG], + true + )) { + return false; + } + + $pointerAfterInstructionEnd = TokenHelper::findNextEffective($phpcsFile, $instructionEndPointer + 1); + if ($tokens[$pointerAfterInstructionEnd]['code'] === T_SEMICOLON) { + return true; + } + + if ($tokens[$pointerAfterInstructionEnd]['code'] === T_CLOSE_PARENTHESIS) { + return array_key_exists('parenthesis_owner', $tokens[$pointerAfterInstructionEnd]) + && in_array($tokens[$tokens[$pointerAfterInstructionEnd]['parenthesis_owner']]['code'], [T_FOR, T_WHILE], true); + } + + return false; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/SpreadOperatorSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/SpreadOperatorSpacingSniff.php new file mode 100644 index 0000000..27548e7 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Operators/SpreadOperatorSpacingSniff.php @@ -0,0 +1,71 @@ + + */ + public function register(): array + { + return [ + T_ELLIPSIS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $spreadOperatorPointer + */ + public function process(File $phpcsFile, $spreadOperatorPointer): void + { + $this->spacesCountAfterOperator = SniffSettingsHelper::normalizeInteger($this->spacesCountAfterOperator); + + $pointerAfterWhitespace = TokenHelper::findNextNonWhitespace($phpcsFile, $spreadOperatorPointer + 1); + + $whitespace = TokenHelper::getContent($phpcsFile, $spreadOperatorPointer + 1, $pointerAfterWhitespace - 1); + + if ($this->spacesCountAfterOperator === strlen($whitespace)) { + return; + } + + $errorMessage = $this->spacesCountAfterOperator === 0 + ? 'There must be no whitespace after spread operator.' + : sprintf( + 'There must be exactly %d whitespace%s after spread operator.', + $this->spacesCountAfterOperator, + $this->spacesCountAfterOperator !== 1 ? 's' : '' + ); + + $fix = $phpcsFile->addFixableError($errorMessage, $spreadOperatorPointer, self::CODE_INCORRECT_SPACES_AFTER_OPERATOR); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($spreadOperatorPointer, str_repeat(' ', $this->spacesCountAfterOperator)); + FixerHelper::removeBetween($phpcsFile, $spreadOperatorPointer, $pointerAfterWhitespace); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowDirectMagicInvokeCallSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowDirectMagicInvokeCallSniff.php new file mode 100644 index 0000000..f6db2f3 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowDirectMagicInvokeCallSniff.php @@ -0,0 +1,67 @@ + + */ + public function register(): array + { + return [ + T_STRING, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stringPointer + */ + public function process(File $phpcsFile, $stringPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + if (strtolower($tokens[$stringPointer]['content']) !== '__invoke') { + return; + } + + $objectOperator = TokenHelper::findPreviousEffective($phpcsFile, $stringPointer - 1); + if ($tokens[$objectOperator]['code'] !== T_OBJECT_OPERATOR) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Direct call of __invoke() is disallowed.', + $stringPointer, + self::CODE_DISALLOWED_DIRECT_MAGIC_INVOKE_CALL + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $objectOperator, $parenthesisOpenerPointer - 1); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowReferenceSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowReferenceSniff.php new file mode 100644 index 0000000..3134039 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/DisallowReferenceSniff.php @@ -0,0 +1,99 @@ + + */ + public function register(): array + { + return [ + T_BITWISE_AND, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $referencePointer + */ + public function process(File $phpcsFile, $referencePointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $referencePointer - 1); + if (in_array($tokens[$previousPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + $phpcsFile->addError('Returning reference is disallowed.', $referencePointer, self::CODE_DISALLOWED_RETURNING_REFERENCE); + return; + } + + $previousParenthesisOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_PARENTHESIS, $referencePointer - 1); + if ( + $previousParenthesisOpenerPointer !== null + && $tokens[$previousParenthesisOpenerPointer]['parenthesis_closer'] > $referencePointer + ) { + if (array_key_exists('parenthesis_owner', $tokens[$previousParenthesisOpenerPointer])) { + $parenthesisOwnerPointer = $tokens[$previousParenthesisOpenerPointer]['parenthesis_owner']; + if (in_array($tokens[$parenthesisOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + $phpcsFile->addError( + 'Passing by reference is disallowed.', + $referencePointer, + self::CODE_DISALLOWED_PASSING_BY_REFERENCE + ); + return; + } + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $previousParenthesisOpenerPointer - 1); + if ( + $pointerBeforeParenthesisOpener !== null + && $tokens[$pointerBeforeParenthesisOpener]['code'] === T_USE + ) { + $phpcsFile->addError( + 'Inheriting variable by reference is disallowed.', + $referencePointer, + self::CODE_DISALLOWED_INHERITING_VARIABLE_BY_REFERENCE + ); + return; + } + } + + /** @var int $variableStartPointer */ + $variableStartPointer = TokenHelper::findNextEffective($phpcsFile, $referencePointer + 1); + $variableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $variableStartPointer); + + if ($variableEndPointer === null) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $referencePointer - 1); + if (!in_array($tokens[$previousPointer]['code'], [T_EQUAL, T_DOUBLE_ARROW, T_OPEN_SHORT_ARRAY, T_COMMA, T_AS], true)) { + return; + } + + $phpcsFile->addError('Assigning by reference is disallowed.', $referencePointer, self::CODE_DISALLOWED_ASSIGNING_BY_REFERENCE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php new file mode 100644 index 0000000..165840e --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ForbiddenClassesSniff.php @@ -0,0 +1,272 @@ + */ + public $forbiddenClasses = []; + + /** @var array */ + public $forbiddenExtends = []; + + /** @var array */ + public $forbiddenInterfaces = []; + + /** @var array */ + public $forbiddenTraits = []; + + /** @var list */ + private static $keywordReferences = ['self', 'parent', 'static']; + + /** + * @return array + */ + public function register(): array + { + $searchTokens = []; + + if (count($this->forbiddenClasses) > 0) { + $this->forbiddenClasses = self::normalizeInputOption($this->forbiddenClasses); + $searchTokens[] = T_NEW; + $searchTokens[] = T_DOUBLE_COLON; + } + + if (count($this->forbiddenExtends) > 0) { + $this->forbiddenExtends = self::normalizeInputOption($this->forbiddenExtends); + $searchTokens[] = T_EXTENDS; + } + + if (count($this->forbiddenInterfaces) > 0) { + $this->forbiddenInterfaces = self::normalizeInputOption($this->forbiddenInterfaces); + $searchTokens[] = T_IMPLEMENTS; + } + + if (count($this->forbiddenTraits) > 0) { + $this->forbiddenTraits = self::normalizeInputOption($this->forbiddenTraits); + $searchTokens[] = T_USE; + } + + return $searchTokens; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $tokenPointer + */ + public function process(File $phpcsFile, $tokenPointer): void + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$tokenPointer]; + $nameTokens = array_merge(TokenHelper::getNameTokenCodes(), TokenHelper::$ineffectiveTokenCodes); + + if ( + $token['code'] === T_IMPLEMENTS + || ( + $token['code'] === T_USE + && UseStatementHelper::isTraitUse($phpcsFile, $tokenPointer) + ) + ) { + $endTokenPointer = TokenHelper::findNext( + $phpcsFile, + [T_SEMICOLON, T_OPEN_CURLY_BRACKET], + $tokenPointer + ); + $references = $this->getAllReferences($phpcsFile, $tokenPointer, $endTokenPointer); + + if ($token['code'] === T_IMPLEMENTS) { + $this->checkReferences($phpcsFile, $tokenPointer, $references, $this->forbiddenInterfaces); + } else { + // Fixer does not work when traits contains aliases + $this->checkReferences( + $phpcsFile, + $tokenPointer, + $references, + $this->forbiddenTraits, + $tokens[$endTokenPointer]['code'] !== T_OPEN_CURLY_BRACKET + ); + } + } elseif (in_array($token['code'], [T_NEW, T_EXTENDS], true)) { + $endTokenPointer = TokenHelper::findNextExcluding($phpcsFile, $nameTokens, $tokenPointer + 1); + $references = $this->getAllReferences($phpcsFile, $tokenPointer, $endTokenPointer); + + $this->checkReferences( + $phpcsFile, + $tokenPointer, + $references, + $token['code'] === T_NEW ? $this->forbiddenClasses : $this->forbiddenExtends + ); + } elseif ($token['code'] === T_DOUBLE_COLON && !$this->isTraitsConflictResolutionToken($token)) { + $startTokenPointer = TokenHelper::findPreviousExcluding($phpcsFile, $nameTokens, $tokenPointer - 1); + $references = $this->getAllReferences($phpcsFile, $startTokenPointer, $tokenPointer); + + $this->checkReferences($phpcsFile, $tokenPointer, $references, $this->forbiddenClasses); + } + } + + /** + * @param list $references + * @param array $forbiddenNames + */ + private function checkReferences( + File $phpcsFile, + int $tokenPointer, + array $references, + array $forbiddenNames, + bool $isFixable = true + ): void + { + $token = $phpcsFile->getTokens()[$tokenPointer]; + $details = [ + T_NEW => ['class', self::CODE_FORBIDDEN_CLASS], + T_DOUBLE_COLON => ['class', self::CODE_FORBIDDEN_CLASS], + T_EXTENDS => ['as a parent class', self::CODE_FORBIDDEN_PARENT_CLASS], + T_IMPLEMENTS => ['interface', self::CODE_FORBIDDEN_INTERFACE], + T_USE => ['trait', self::CODE_FORBIDDEN_TRAIT], + ]; + + foreach ($references as $reference) { + if (!array_key_exists($reference['fullyQualifiedName'], $forbiddenNames)) { + continue; + } + + $alternative = $forbiddenNames[$reference['fullyQualifiedName']]; + [$nameType, $code] = $details[$token['code']]; + + if ($alternative === null) { + $phpcsFile->addError( + sprintf('Usage of %s %s is forbidden.', $reference['fullyQualifiedName'], $nameType), + $reference['startPointer'], + $code + ); + } elseif (!$isFixable) { + $phpcsFile->addError( + sprintf( + 'Usage of %s %s is forbidden, use %s instead.', + $reference['fullyQualifiedName'], + $nameType, + $alternative + ), + $reference['startPointer'], + $code + ); + } else { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Usage of %s %s is forbidden, use %s instead.', + $reference['fullyQualifiedName'], + $nameType, + $alternative + ), + $reference['startPointer'], + $code + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $reference['startPointer'], $reference['endPointer'], $alternative); + + $phpcsFile->fixer->endChangeset(); + } + } + } + + /** + * @param array|int|string> $token + */ + private function isTraitsConflictResolutionToken(array $token): bool + { + return is_array($token['conditions']) && array_pop($token['conditions']) === T_USE; + } + + /** + * @return list + */ + private function getAllReferences(File $phpcsFile, int $startPointer, int $endPointer): array + { + // Always ignore first token + $startPointer++; + $references = []; + + while ($startPointer < $endPointer) { + $nextComma = TokenHelper::findNext($phpcsFile, [T_COMMA], $startPointer + 1); + $nextSeparator = min($endPointer, $nextComma ?? PHP_INT_MAX); + $reference = ReferencedNameHelper::getReferenceName($phpcsFile, $startPointer, $nextSeparator - 1); + + if ( + strlen($reference) !== 0 + && !in_array(strtolower($reference), self::$keywordReferences, true) + ) { + $references[] = [ + 'fullyQualifiedName' => NamespaceHelper::resolveClassName($phpcsFile, $reference, $startPointer), + 'startPointer' => TokenHelper::findNextEffective($phpcsFile, $startPointer, $endPointer), + 'endPointer' => TokenHelper::findPreviousEffective($phpcsFile, $nextSeparator - 1, $startPointer), + ]; + } + + $startPointer = $nextSeparator + 1; + } + + return $references; + } + + /** + * @param array $option + * @return array + */ + private static function normalizeInputOption(array $option): array + { + $forbiddenClasses = []; + foreach ($option as $forbiddenClass => $alternative) { + $forbiddenClasses[self::normalizeClassName($forbiddenClass)] = self::normalizeClassName($alternative); + } + + return $forbiddenClasses; + } + + private static function normalizeClassName(?string $typeName): ?string + { + if ($typeName === null || strlen($typeName) === 0 || strtolower($typeName) === 'null') { + return null; + } + + return NamespaceHelper::getFullyQualifiedTypeName($typeName); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php new file mode 100644 index 0000000..cc304bb --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/OptimizedFunctionsWithoutUnpackingSniff.php @@ -0,0 +1,114 @@ + + */ + public function register(): array + { + return TokenHelper::getOnlyNameTokenCodes(); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $previousTokenPointer = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + $openBracketPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + $tokens = $phpcsFile->getTokens(); + + if ($openBracketPointer === null || $tokens[$openBracketPointer]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + if (in_array($tokens[$previousTokenPointer]['code'], [T_FUNCTION, T_NEW, T_OBJECT_OPERATOR], true)) { + return; + } + /** @var int $tokenBeforeInvocationPointer */ + $tokenBeforeInvocationPointer = TokenHelper::findPreviousExcluding($phpcsFile, TokenHelper::getNameTokenCodes(), $pointer); + $invokedName = TokenHelper::getContent($phpcsFile, $tokenBeforeInvocationPointer + 1, $pointer); + $useName = sprintf('function %s', $invokedName); + + $uses = UseStatementHelper::getUseStatementsForPointer($phpcsFile, $pointer); + if ($invokedName[0] === '\\') { + $invokedName = substr($invokedName, 1); + } elseif (array_key_exists($useName, $uses) && $uses[$useName]->isFunction()) { + $invokedName = $uses[$useName]->getFullyQualifiedTypeName(); + } elseif (NamespaceHelper::findCurrentNamespaceName($phpcsFile, $pointer) !== null) { + return; + } + + if (!in_array($invokedName, FunctionHelper::SPECIAL_FUNCTIONS, true)) { + return; + } + + $closeBracketPointer = $tokens[$openBracketPointer]['parenthesis_closer']; + + if (TokenHelper::findNextEffective($phpcsFile, $openBracketPointer + 1, $closeBracketPointer + 1) === $closeBracketPointer) { + return; + } + + $pointerBeforeCloseBracket = TokenHelper::findPreviousEffective($phpcsFile, $closeBracketPointer - 1); + + $startPointer = $tokens[$pointerBeforeCloseBracket]['code'] === T_COMMA ? $pointerBeforeCloseBracket : $closeBracketPointer; + do { + $lastArgumentSeparatorPointer = TokenHelper::findPrevious($phpcsFile, [T_COMMA], $startPointer - 1, $openBracketPointer); + $startPointer = $lastArgumentSeparatorPointer; + } while ( + $lastArgumentSeparatorPointer !== null + && $tokens[$lastArgumentSeparatorPointer]['level'] !== $tokens[$openBracketPointer]['level'] + ); + + if ($lastArgumentSeparatorPointer === null) { + $lastArgumentSeparatorPointer = $openBracketPointer; + } + + /** @var int $nextTokenAfterSeparatorPointer */ + $nextTokenAfterSeparatorPointer = TokenHelper::findNextEffective( + $phpcsFile, + $lastArgumentSeparatorPointer + 1, + $closeBracketPointer + ); + + if ($tokens[$nextTokenAfterSeparatorPointer]['code'] !== T_ELLIPSIS) { + return; + } + + if (TokenHelper::findNextEffective($phpcsFile, $nextTokenAfterSeparatorPointer + 1) === $closeBracketPointer) { + // First class callables + return; + } + + $phpcsFile->addError( + sprintf('Function %s is specialized by PHP and should not use argument unpacking.', $invokedName), + $nextTokenAfterSeparatorPointer, + self::CODE_UNPACKING_USED + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ReferenceSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ReferenceSpacingSniff.php new file mode 100644 index 0000000..a3478c9 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ReferenceSpacingSniff.php @@ -0,0 +1,131 @@ + + */ + public function register(): array + { + return [ + T_BITWISE_AND, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $referencePointer + */ + public function process(File $phpcsFile, $referencePointer): void + { + $this->spacesCountAfterReference = SniffSettingsHelper::normalizeInteger($this->spacesCountAfterReference); + + if (!$this->isReference($phpcsFile, $referencePointer)) { + return; + } + + $pointerAfterWhitespace = TokenHelper::findNextNonWhitespace($phpcsFile, $referencePointer + 1); + + $whitespace = TokenHelper::getContent($phpcsFile, $referencePointer + 1, $pointerAfterWhitespace - 1); + + $actualSpacesCount = strlen($whitespace); + + if ($this->spacesCountAfterReference === $actualSpacesCount) { + return; + } + + $errorMessage = $this->spacesCountAfterReference === 0 + ? 'There must be no whitespace after reference.' + : sprintf( + 'There must be exactly %d whitespace%s after reference.', + $this->spacesCountAfterReference, + $this->spacesCountAfterReference !== 1 ? 's' : '' + ); + + $fix = $phpcsFile->addFixableError($errorMessage, $referencePointer, self::CODE_INCORRECT_SPACES_AFTER_REFERENCE); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->addContent($referencePointer, str_repeat(' ', $this->spacesCountAfterReference)); + + FixerHelper::removeBetween($phpcsFile, $referencePointer, $pointerAfterWhitespace); + + $phpcsFile->fixer->endChangeset(); + } + + private function isReference(File $phpcsFile, int $referencePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $referencePointer - 1); + if (in_array($tokens[$previousPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + return true; + } + + $previousParenthesisOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_PARENTHESIS, $referencePointer - 1); + if ( + $previousParenthesisOpenerPointer !== null + && $tokens[$previousParenthesisOpenerPointer]['parenthesis_closer'] > $referencePointer + ) { + if (array_key_exists('parenthesis_owner', $tokens[$previousParenthesisOpenerPointer])) { + $parenthesisOwnerPointer = $tokens[$previousParenthesisOpenerPointer]['parenthesis_owner']; + if (in_array($tokens[$parenthesisOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + return true; + } + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $previousParenthesisOpenerPointer - 1); + if ( + $pointerBeforeParenthesisOpener !== null + && $tokens[$pointerBeforeParenthesisOpener]['code'] === T_USE + ) { + return true; + } + } + + /** @var int $variableStartPointer */ + $variableStartPointer = TokenHelper::findNextEffective($phpcsFile, $referencePointer + 1); + $variableEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $variableStartPointer); + + if ($variableEndPointer === null) { + return false; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $referencePointer - 1); + + return in_array($tokens[$previousPointer]['code'], [T_EQUAL, T_DOUBLE_ARROW, T_OPEN_SHORT_ARRAY, T_COMMA, T_AS], true); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php new file mode 100644 index 0000000..49466b1 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireExplicitAssertionSniff.php @@ -0,0 +1,472 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $tokenCodes = [T_VARIABLE, T_FOREACH, T_WHILE, T_LIST, T_OPEN_SHORT_ARRAY]; + $commentClosePointer = $tokens[$docCommentOpenPointer]['comment_closer']; + + $codePointer = TokenHelper::findFirstNonWhitespaceOnNextLine($phpcsFile, $commentClosePointer); + + if ($codePointer === null || !in_array($tokens[$codePointer]['code'], $tokenCodes, true)) { + $firstPointerOnPreviousLine = TokenHelper::findFirstNonWhitespaceOnPreviousLine($phpcsFile, $docCommentOpenPointer); + if ( + $firstPointerOnPreviousLine === null + || !in_array($tokens[$firstPointerOnPreviousLine]['code'], $tokenCodes, true) + ) { + return; + } + + $codePointer = $firstPointerOnPreviousLine; + } + + /** @var list> $variableAnnotations */ + $variableAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, '@var'); + if (count($variableAnnotations) === 0) { + return; + } + + foreach (array_reverse($variableAnnotations) as $variableAnnotation) { + if ($variableAnnotation->isInvalid()) { + continue; + } + + $variableName = $variableAnnotation->getValue()->variableName; + + if ($variableName === '') { + continue; + } + + $variableAnnotationType = $variableAnnotation->getValue()->type; + + if ( + $variableAnnotationType instanceof UnionTypeNode + || $variableAnnotationType instanceof IntersectionTypeNode + ) { + foreach ($variableAnnotationType->types as $typeNode) { + if (!$this->isValidTypeNode($typeNode)) { + continue 2; + } + } + } elseif (!$this->isValidTypeNode($variableAnnotationType)) { + continue; + } + + /** @var IdentifierTypeNode|ThisTypeNode|UnionTypeNode|GenericTypeNode $variableAnnotationType */ + $variableAnnotationType = $variableAnnotationType; + + $assertion = $this->createAssert($variableName, $variableAnnotationType); + + if ($assertion === null) { + continue; + } + + if ($tokens[$codePointer]['code'] === T_VARIABLE) { + $pointerAfterVariable = TokenHelper::findNextEffective($phpcsFile, $codePointer + 1); + if ($tokens[$pointerAfterVariable]['code'] !== T_EQUAL) { + continue; + } + + if ($variableName !== $tokens[$codePointer]['content']) { + continue; + } + + $pointerToAddAssertion = $this->getNextSemicolonInSameScope($phpcsFile, $codePointer, $codePointer + 1); + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenPointer); + + } elseif ($tokens[$codePointer]['code'] === T_LIST) { + $listParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $codePointer + 1); + + $variablePointerInList = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $listParenthesisOpener + 1, + $tokens[$listParenthesisOpener]['parenthesis_closer'] + ); + if ($variablePointerInList === null) { + continue; + } + + $pointerToAddAssertion = $this->getNextSemicolonInSameScope($phpcsFile, $codePointer, $codePointer + 1); + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenPointer); + + } elseif ($tokens[$codePointer]['code'] === T_OPEN_SHORT_ARRAY) { + $pointerAfterList = TokenHelper::findNextEffective($phpcsFile, $tokens[$codePointer]['bracket_closer'] + 1); + if ($tokens[$pointerAfterList]['code'] !== T_EQUAL) { + continue; + } + + $variablePointerInList = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $codePointer + 1, + $tokens[$codePointer]['bracket_closer'] + ); + if ($variablePointerInList === null) { + continue; + } + + $pointerToAddAssertion = $this->getNextSemicolonInSameScope( + $phpcsFile, + $codePointer, + $tokens[$codePointer]['bracket_closer'] + 1 + ); + $indentation = IndentationHelper::getIndentation($phpcsFile, $docCommentOpenPointer); + + } else { + if ($tokens[$codePointer]['code'] === T_WHILE) { + $variablePointerInWhile = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$codePointer]['parenthesis_opener'] + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + if ($variablePointerInWhile === null) { + continue; + } + + $pointerAfterVariableInWhile = TokenHelper::findNextEffective($phpcsFile, $variablePointerInWhile + 1); + if ($tokens[$pointerAfterVariableInWhile]['code'] !== T_EQUAL) { + continue; + } + } else { + $asPointer = TokenHelper::findNext( + $phpcsFile, + T_AS, + $tokens[$codePointer]['parenthesis_opener'] + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + $variablePointerInForeach = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $asPointer + 1, + $tokens[$codePointer]['parenthesis_closer'] + ); + if ($variablePointerInForeach === null) { + continue; + } + } + + $pointerToAddAssertion = $tokens[$codePointer]['scope_opener']; + $indentation = IndentationHelper::addIndentation(IndentationHelper::getIndentation($phpcsFile, $codePointer)); + } + + $fix = $phpcsFile->addFixableError( + 'Use assertion instead of inline documentation comment.', + $variableAnnotation->getStartPointer(), + self::CODE_REQUIRED_EXPLICIT_ASSERTION + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $variableAnnotation->getStartPointer(), $variableAnnotation->getEndPointer()); + + $docCommentUseful = false; + $docCommentClosePointer = $tokens[$docCommentOpenPointer]['comment_closer']; + for ($i = $docCommentOpenPointer + 1; $i < $docCommentClosePointer; $i++) { + $tokenContent = trim($phpcsFile->fixer->getTokenContent($i)); + if ($tokenContent === '' || $tokenContent === '*') { + continue; + } + + $docCommentUseful = true; + break; + } + + $pointerBeforeDocComment = TokenHelper::findPreviousContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $docCommentOpenPointer - 1 + ); + $pointerAfterDocComment = TokenHelper::findNextContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $docCommentClosePointer + 1 + ); + + if (!$docCommentUseful) { + FixerHelper::removeBetweenIncluding($phpcsFile, $pointerBeforeDocComment + 1, $pointerAfterDocComment); + } + + if ( + $pointerToAddAssertion < $docCommentClosePointer + && array_key_exists($pointerAfterDocComment + 1, $tokens) + ) { + $phpcsFile->fixer->addContentBefore($pointerAfterDocComment + 1, $indentation . $assertion . $phpcsFile->eolChar); + } else { + $phpcsFile->fixer->addContent($pointerToAddAssertion, $phpcsFile->eolChar . $indentation . $assertion); + } + + $phpcsFile->fixer->endChangeset(); + } + } + + private function isValidTypeNode(TypeNode $typeNode): bool + { + if ($typeNode instanceof ThisTypeNode) { + return true; + } + + if ($typeNode instanceof IdentifierTypeNode) { + return true; + } + + if ( + $this->enableIntegerRanges + && $typeNode instanceof GenericTypeNode + && $typeNode->type->name === 'int' + && count($typeNode->genericTypes) === 2 + ) { + foreach ($typeNode->genericTypes as $genericType) { + $isValid = ($genericType instanceof IdentifierTypeNode && in_array($genericType->name, ['min', 'max'], true)) + || ($genericType instanceof ConstTypeNode && $genericType->constExpr instanceof ConstExprIntegerNode); + + if (!$isValid) { + return false; + } + } + + return true; + } + + return false; + } + + private function getNextSemicolonInSameScope(File $phpcsFile, int $scopePointer, int $searchAt): int + { + $semicolonPointer = null; + + do { + $semicolonPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $searchAt); + + if (ScopeHelper::isInSameScope($phpcsFile, $scopePointer, $semicolonPointer)) { + break; + } + + $searchAt = $semicolonPointer + 1; + + } while (true); + + return $semicolonPointer; + } + + /** + * @param IdentifierTypeNode|ThisTypeNode|UnionTypeNode|IntersectionTypeNode|GenericTypeNode $typeNode + */ + private function createAssert(string $variableName, TypeNode $typeNode): ?string + { + $conditions = []; + + if ( + $typeNode instanceof IdentifierTypeNode + || $typeNode instanceof ThisTypeNode + || $typeNode instanceof GenericTypeNode + ) { + $conditions = $this->createConditions($variableName, $typeNode); + + return $conditions !== [] ? sprintf('\assert(%s);', implode(' || ', $conditions)) : null; + } + + /** @var IdentifierTypeNode|ThisTypeNode|GenericTypeNode $innerTypeNode */ + foreach ($typeNode->types as $innerTypeNode) { + $innerTypeConditions = $this->createConditions($variableName, $innerTypeNode); + + if ($innerTypeConditions === []) { + return null; + } + + $conditions = array_merge($conditions, $innerTypeConditions); + } + + $operator = $typeNode instanceof IntersectionTypeNode ? '&&' : '||'; + + $formattedConditions = []; + + foreach (array_unique($conditions) as $condition) { + $formattedConditions[] = $operator === '||' && strpos($condition, '&&') !== false ? sprintf('(%s)', $condition) : $condition; + } + + return sprintf('\assert(%s);', implode(sprintf(' %s ', $operator), $formattedConditions)); + } + + /** + * @param IdentifierTypeNode|ThisTypeNode|GenericTypeNode $typeNode + * @return list + */ + private function createConditions(string $variableName, TypeNode $typeNode): array + { + if ($typeNode instanceof GenericTypeNode) { + $conditions = [sprintf('\is_int(%s)', $variableName)]; + + if ($typeNode->genericTypes[0] instanceof ConstTypeNode) { + $conditions[] = sprintf('%s >= %s', $variableName, (string) $typeNode->genericTypes[0]); + } + + if ($typeNode->genericTypes[1] instanceof ConstTypeNode) { + $conditions[] = sprintf('%s <= %s', $variableName, (string) $typeNode->genericTypes[1]); + } + + return [implode(' && ', $conditions)]; + } + + if ($typeNode instanceof ThisTypeNode) { + return [sprintf('%s instanceof $this', $variableName)]; + } + + if ($typeNode->name === 'self') { + return [sprintf('%s instanceof %s', $variableName, $typeNode->name)]; + } + + if ($typeNode->name === 'static') { + return [sprintf('%s instanceof static', $variableName)]; + } + + if (in_array($typeNode->name, ['true', 'false', 'null'], true)) { + return [sprintf('%s === %s', $variableName, $typeNode->name)]; + } + + if ( + $typeNode->name === 'mixed' + || TypeHintHelper::isVoidTypeHint($typeNode->name) + || TypeHintHelper::isNeverTypeHint($typeNode->name) + ) { + return []; + } + + if (TypeHintHelper::isSimpleTypeHint($typeNode->name)) { + return [sprintf('\is_%s(%s)', TypeHintHelper::convertLongSimpleTypeHintToShort($typeNode->name), $variableName)]; + } + + if (in_array($typeNode->name, ['resource', 'object'], true)) { + return [sprintf('\is_%s(%s)', $typeNode->name, $variableName)]; + } + + if ($typeNode->name === 'numeric') { + return [ + sprintf('\is_int(%s)', $variableName), + sprintf('\is_float(%s)', $variableName), + ]; + } + + if ($typeNode->name === 'scalar') { + return [ + sprintf('\is_int(%s)', $variableName), + sprintf('\is_float(%s)', $variableName), + sprintf('\is_bool(%s)', $variableName), + sprintf('\is_string(%s)', $variableName), + ]; + } + + if ($this->enableIntegerRanges) { + if ($typeNode->name === 'positive-int') { + return [sprintf('\is_int(%1$s) && %1$s > 0', $variableName)]; + } + + if ($typeNode->name === 'negative-int') { + return [sprintf('\is_int(%1$s) && %1$s < 0', $variableName)]; + } + } + + if ( + $this->enableAdvancedStringTypes + && in_array($typeNode->name, ['non-empty-string', 'non-falsy-string', 'callable-string', 'numeric-string'], true) + ) { + $conditions = [sprintf('\is_string(%s)', $variableName)]; + + if ($typeNode->name === 'non-empty-string') { + $conditions[] = sprintf("%s !== ''", $variableName); + } elseif ($typeNode->name === 'non-falsy-string') { + $conditions[] = sprintf('(bool) %s === true', $variableName); + } elseif ($typeNode->name === 'callable-string') { + $conditions[] = sprintf('\is_callable(%s)', $variableName); + } else { + $conditions[] = sprintf('\is_numeric(%s)', $variableName); + } + + return [implode(' && ', $conditions)]; + } + + if (TypeHintHelper::isSimpleUnofficialTypeHints($typeNode->name)) { + return []; + } + + return [sprintf('%s instanceof %s', $variableName, $typeNode->name)]; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireNowdocSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireNowdocSniff.php new file mode 100644 index 0000000..88e6f23 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/RequireNowdocSniff.php @@ -0,0 +1,74 @@ + + */ + public function register(): array + { + return [ + T_START_HEREDOC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $heredocStartPointer + */ + public function process(File $phpcsFile, $heredocStartPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $heredocEndPointer = TokenHelper::findNext($phpcsFile, T_END_HEREDOC, $heredocStartPointer + 1); + + $heredocContentPointers = []; + for ($i = $heredocStartPointer + 1; $i < $heredocEndPointer; $i++) { + if ($tokens[$i]['code'] === T_HEREDOC) { + if (preg_match('~^([^\\\\$]|\\\\[^nrtvef0-7xu])*$~', $tokens[$i]['content']) === 0) { + return; + } + + $heredocContentPointers[] = $i; + } + } + + $fix = $phpcsFile->addFixableError('Use nowdoc syntax instead of heredoc.', $heredocStartPointer, self::CODE_REQUIRED_NOWDOC); + if (!$fix) { + return; + } + + $nowdocStart = preg_replace('~^<<<"?(\w+)"?~', '<<<\'$1\'', $tokens[$heredocStartPointer]['content']); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($heredocStartPointer, $nowdocStart); + + foreach ($heredocContentPointers as $heredocContentPointer) { + $heredocContent = $tokens[$heredocContentPointer]['content']; + $nowdocContent = preg_replace( + '~\\\\(\\\\[nrtvef]|\$|\\\\|\\\\[0-7]{1,3}|\\\\x[0-9A-Fa-f]{1,2}|\\\\u\{[0-9A-Fa-f]+\})~', + '$1', + $heredocContent + ); + + $phpcsFile->fixer->replaceToken($heredocContentPointer, $nowdocContent); + } + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ShortListSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ShortListSniff.php new file mode 100644 index 0000000..493261b --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/ShortListSniff.php @@ -0,0 +1,50 @@ + + */ + public function register(): array + { + return [T_LIST]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $fix = $phpcsFile->addFixableError('list(...) is forbidden, use [...] instead.', $pointer, self::CODE_LONG_LIST_USED); + + if (!$fix) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + /** @var int $startPointer */ + $startPointer = TokenHelper::findNext($phpcsFile, [T_OPEN_PARENTHESIS], $pointer + 1); + $endPointer = $tokens[$startPointer]['parenthesis_closer']; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $pointer, $startPointer - 1); + $phpcsFile->fixer->replaceToken($startPointer, '['); + $phpcsFile->fixer->replaceToken($endPointer, ']'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/TypeCastSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/TypeCastSniff.php new file mode 100644 index 0000000..a5b17bd --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/TypeCastSniff.php @@ -0,0 +1,119 @@ + null, + 'boolean' => 'bool', + 'double' => 'float', + 'integer' => 'int', + 'real' => 'float', + 'unset' => null, + ]; + + /** + * @return array + */ + public function register(): array + { + return [ + T_STRING_CAST, + T_BOOL_CAST, + T_DOUBLE_CAST, + T_INT_CAST, + T_UNSET_CAST, + T_BINARY_CAST, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $tokens = $phpcsFile->getTokens(); + $cast = $tokens[$pointer]['content']; + + preg_match('~^\(\s*(\S+)\s*\)\z~i', $cast, $matches); + + if (!array_key_exists(1, $matches)) { + return; + } + + $castName = $matches[1]; + $castNameLower = strtolower($castName); + + if (!array_key_exists($castNameLower, self::INVALID_CASTS)) { + return; + } + + if ($castNameLower === 'unset') { + $phpcsFile->addError( + sprintf('Cast "%s" is forbidden, use "unset(...)" or assign "null" instead.', $cast), + $pointer, + self::CODE_FORBIDDEN_CAST_USED + ); + + return; + } + + if ($castNameLower === 'binary') { + $fix = $phpcsFile->addFixableError( + sprintf('"Cast "%s" is forbidden and has no effect.', $cast), + $pointer, + self::CODE_FORBIDDEN_CAST_USED + ); + + if (!$fix) { + return; + } + + $end = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $pointer, $end - 1); + + $phpcsFile->fixer->endChangeset(); + + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Cast "%s" is forbidden, use "(%s)" instead.', $cast, self::INVALID_CASTS[$castNameLower]), + $pointer, + self::CODE_INVALID_CAST_USED + ); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($pointer, '(' . self::INVALID_CASTS[$castNameLower] . ')'); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessParenthesesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessParenthesesSniff.php new file mode 100644 index 0000000..17c78a0 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessParenthesesSniff.php @@ -0,0 +1,579 @@ + 1, + T_MULTIPLY => 2, + T_DIVIDE => 2, + T_MODULUS => 3, + T_PLUS => 4, + T_MINUS => 4, + T_STRING_CONCAT => 5, + ]; + + /** @var bool */ + public $ignoreComplexTernaryConditions = false; + + /** + * @return array + */ + public function register(): array + { + return [ + T_OPEN_PARENTHESIS, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $parenthesisOpenerPointer + */ + public function process(File $phpcsFile, $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (array_key_exists('parenthesis_owner', $tokens[$parenthesisOpenerPointer])) { + return; + } + + if (!array_key_exists('parenthesis_closer', $tokens[$parenthesisOpenerPointer])) { + return; + } + + /** @var int $pointerBeforeParenthesisOpener */ + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if (in_array($tokens[$pointerBeforeParenthesisOpener]['code'], array_merge( + TokenHelper::getNameTokenCodes(), + [ + T_VARIABLE, + T_ISSET, + T_UNSET, + T_EMPTY, + T_CLOSURE, + T_FN, + T_USE, + T_ANON_CLASS, + T_NEW, + T_SELF, + T_STATIC, + T_PARENT, + T_EXIT, + T_CLOSE_PARENTHESIS, + T_EVAL, + T_LIST, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + T_INT_CAST, + T_DOUBLE_CAST, + T_STRING_CAST, + T_ARRAY_CAST, + T_OBJECT_CAST, + T_BOOL_CAST, + T_UNSET_CAST, + T_MATCH, + ] + ), true) + ) { + return; + } + + /** @var int $pointerAfterParenthesisOpener */ + $pointerAfterParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + if (in_array( + $tokens[$pointerAfterParenthesisOpener]['code'], + [T_NEW, T_CLONE, T_YIELD, T_YIELD_FROM, T_REQUIRE, T_REQUIRE_ONCE, T_INCLUDE, T_INCLUDE_ONCE, T_ARRAY_CAST], + true + )) { + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + T_EQUAL, + $parenthesisOpenerPointer + 1, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ) !== null) { + return; + } + + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + 1 + ); + if ( + $pointerAfterParenthesisCloser !== null + && $tokens[$pointerAfterParenthesisCloser]['code'] === T_OPEN_PARENTHESIS + ) { + return; + } + + if (IdentificatorHelper::findStartPointer($phpcsFile, $pointerBeforeParenthesisOpener) !== null) { + return; + } + + $this->checkParenthesesAroundConditionInTernaryOperator($phpcsFile, $parenthesisOpenerPointer); + $this->checkParenthesesAroundCaseInSwitch($phpcsFile, $parenthesisOpenerPointer); + $this->checkParenthesesAroundVariableOrFunctionCall($phpcsFile, $parenthesisOpenerPointer); + $this->checkParenthesesAroundString($phpcsFile, $parenthesisOpenerPointer); + $this->checkParenthesesAroundOperators($phpcsFile, $parenthesisOpenerPointer); + } + + private function checkParenthesesAroundConditionInTernaryOperator(File $phpcsFile, int $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisCloserPointer = $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + + $ternaryOperatorPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisCloserPointer + 1); + if ($tokens[$ternaryOperatorPointer]['code'] !== T_INLINE_THEN) { + return; + } + + if (TokenHelper::findNext( + $phpcsFile, + [T_LOGICAL_AND, T_LOGICAL_OR, T_LOGICAL_XOR], + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null) { + return; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if ($tokens[$pointerBeforeParenthesisOpener]['code'] === T_BOOLEAN_NOT) { + return; + } + + if (in_array($tokens[$pointerBeforeParenthesisOpener]['code'], Tokens::$comparisonTokens, true)) { + return; + } + + if (in_array($tokens[$pointerBeforeParenthesisOpener]['code'], Tokens::$booleanOperators, true)) { + return; + } + + if ($this->ignoreComplexTernaryConditions) { + if (TokenHelper::findNext( + $phpcsFile, + Tokens::$booleanOperators, + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null) { + return; + } + + if (TokenHelper::findNextContent( + $phpcsFile, + T_WHITESPACE, + $phpcsFile->eolChar, + $parenthesisOpenerPointer + 1, + $parenthesisCloserPointer + ) !== null) { + return; + } + } + + $contentStartPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + $contentEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisCloserPointer - 1); + + for ($i = $contentStartPointer; $i <= $contentEndPointer; $i++) { + if ($tokens[$i]['code'] === T_INLINE_THEN) { + return; + } + } + + $fix = $phpcsFile->addFixableError('Useless parentheses.', $parenthesisOpenerPointer, self::CODE_USELESS_PARENTHESES); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $parenthesisOpenerPointer, $contentStartPointer - 1); + FixerHelper::removeBetweenIncluding($phpcsFile, $contentEndPointer + 1, $parenthesisCloserPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkParenthesesAroundCaseInSwitch(File $phpcsFile, int $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if ($tokens[$pointerBeforeParenthesisOpener]['code'] !== T_CASE) { + return; + } + + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + 1 + ); + if ($tokens[$pointerAfterParenthesisCloser]['code'] !== T_COLON) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless parentheses.', $parenthesisOpenerPointer, self::CODE_USELESS_PARENTHESES); + + if (!$fix) { + return; + } + + $contentStartPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + $contentEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] - 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $parenthesisOpenerPointer, $contentStartPointer - 1); + FixerHelper::removeBetweenIncluding($phpcsFile, $contentEndPointer + 1, $tokens[$parenthesisOpenerPointer]['parenthesis_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkParenthesesAroundVariableOrFunctionCall(File $phpcsFile, int $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $operatorsPointers = TokenHelper::findNextAll( + $phpcsFile, + self::OPERATORS, + $parenthesisOpenerPointer + 1, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ); + if ($operatorsPointers !== []) { + return; + } + + $casePointer = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if ($tokens[$casePointer]['code'] === T_CASE) { + return; + } + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if (in_array($tokens[$pointerBeforeParenthesisOpener]['code'], Tokens::$booleanOperators, true)) { + return; + } + + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + 1 + ); + if (in_array($tokens[$pointerAfterParenthesisCloser]['code'], [T_INLINE_THEN, T_OPEN_PARENTHESIS, T_SR], true)) { + return; + } + + /** @var int $contentStartPointer */ + $contentStartPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + + if ($tokens[$contentStartPointer]['code'] === T_CONSTANT_ENCAPSED_STRING) { + return; + } + + $notBooleanNotOperatorPointer = $contentStartPointer; + + if ($tokens[$contentStartPointer]['code'] === T_BOOLEAN_NOT) { + /** @var int $notBooleanNotOperatorPointer */ + $notBooleanNotOperatorPointer = TokenHelper::findNextEffective($phpcsFile, $contentStartPointer + 1); + } + + if (in_array( + $tokens[$notBooleanNotOperatorPointer]['code'], + array_merge([T_SELF, T_STATIC, T_PARENT, T_VARIABLE, T_DOLLAR], TokenHelper::getNameTokenCodes()), + true + )) { + $contentEndPointer = IdentificatorHelper::findEndPointer($phpcsFile, $notBooleanNotOperatorPointer); + + if ( + $contentEndPointer === null + && in_array($tokens[$notBooleanNotOperatorPointer]['code'], TokenHelper::getNameTokenCodes(), true) + ) { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $contentStartPointer + 1); + if ($tokens[$nextPointer]['code'] === T_OPEN_PARENTHESIS) { + $contentEndPointer = $contentStartPointer; + } + } + + do { + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $contentEndPointer + 1); + if ($tokens[$nextPointer]['code'] !== T_OPEN_PARENTHESIS) { + break; + } + + $contentEndPointer = $tokens[$nextPointer]['parenthesis_closer']; + } while (true); + } else { + $nextPointer = TokenHelper::findNext($phpcsFile, T_OPEN_PARENTHESIS, $notBooleanNotOperatorPointer + 1); + if ($nextPointer === null || !isset($tokens[$nextPointer]['parenthesis_closer'])) { + return; + } + + $contentEndPointer = $tokens[$nextPointer]['parenthesis_closer']; + } + + $pointerAfterContent = TokenHelper::findNextEffective($phpcsFile, $contentEndPointer + 1); + + if ($pointerAfterContent !== $tokens[$parenthesisOpenerPointer]['parenthesis_closer']) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless parentheses.', $parenthesisOpenerPointer, self::CODE_USELESS_PARENTHESES); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $parenthesisOpenerPointer, $contentStartPointer - 1); + FixerHelper::removeBetweenIncluding($phpcsFile, $contentEndPointer + 1, $tokens[$parenthesisOpenerPointer]['parenthesis_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkParenthesesAroundString(File $phpcsFile, int $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $stringPointer */ + $stringPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + + if ($tokens[$stringPointer]['code'] !== T_CONSTANT_ENCAPSED_STRING) { + return; + } + + $pointerAfterString = TokenHelper::findNextEffective($phpcsFile, $stringPointer + 1); + if ($pointerAfterString !== $tokens[$parenthesisOpenerPointer]['parenthesis_closer']) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless parentheses.', $parenthesisOpenerPointer, self::CODE_USELESS_PARENTHESES); + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $parenthesisOpenerPointer, $stringPointer - 1); + FixerHelper::removeBetweenIncluding($phpcsFile, $stringPointer + 1, $tokens[$parenthesisOpenerPointer]['parenthesis_closer']); + + $phpcsFile->fixer->endChangeset(); + } + + private function checkParenthesesAroundOperators(File $phpcsFile, int $parenthesisOpenerPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + $pointerAfterParenthesisCloser = TokenHelper::findNextEffective( + $phpcsFile, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + 1 + ); + + if ($tokens[$pointerBeforeParenthesisOpener]['code'] === T_MINUS) { + $pointerBeforeMinus = TokenHelper::findPreviousEffective($phpcsFile, $pointerBeforeParenthesisOpener - 1); + if (!in_array($tokens[$pointerBeforeMinus]['code'], [T_DNUMBER, T_LNUMBER], true)) { + return; + } + } + + if ( + in_array($tokens[$pointerBeforeParenthesisOpener]['code'], Tokens::$booleanOperators, true) + || in_array($tokens[$pointerAfterParenthesisCloser]['code'], Tokens::$booleanOperators, true) + ) { + return; + } + + $operatorsPointers = []; + $actualStartPointer = $parenthesisOpenerPointer + 1; + while (true) { + $pointer = TokenHelper::findNext( + $phpcsFile, + array_merge( + self::OPERATORS, + [T_OPEN_PARENTHESIS, T_INLINE_THEN, T_COALESCE, T_BITWISE_AND, T_BITWISE_OR, T_BITWISE_XOR], + Tokens::$comparisonTokens + ), + $actualStartPointer, + $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] + ); + + if ($pointer === null) { + break; + } + + if (in_array($tokens[$pointer]['code'], [T_INLINE_THEN, T_COALESCE, T_BITWISE_AND, T_BITWISE_OR, T_BITWISE_XOR], true)) { + return; + } + + if (in_array($tokens[$pointer]['code'], Tokens::$comparisonTokens, true)) { + return; + } + + if ($tokens[$pointer]['code'] === T_OPEN_PARENTHESIS) { + $actualStartPointer = $tokens[$pointer]['parenthesis_closer'] + 1; + continue; + } + + $operatorsPointers[] = $pointer; + $actualStartPointer = $pointer + 1; + } + + if (count($operatorsPointers) === 0) { + return; + } + + if ( + $tokens[$pointerBeforeParenthesisOpener]['code'] !== T_EQUAL + || $tokens[$pointerAfterParenthesisCloser]['code'] !== T_SEMICOLON + ) { + $operatorsGroups = array_map(static function (int $operatorPointer) use ($tokens): int { + return self::OPERATOR_GROUPS[$tokens[$operatorPointer]['code']]; + }, $operatorsPointers); + + if (count($operatorsGroups) > 1) { + return; + } + } + + $firstOperatorPointer = $operatorsPointers[0]; + if (in_array($tokens[$pointerBeforeParenthesisOpener]['code'], self::OPERATORS, true)) { + if (self::OPERATOR_GROUPS[$tokens[$firstOperatorPointer]['code']] !== self::OPERATOR_GROUPS[$tokens[$pointerBeforeParenthesisOpener]['code']]) { + return; + } + + if ( + $tokens[$pointerBeforeParenthesisOpener]['code'] === T_MINUS + && in_array($tokens[$firstOperatorPointer]['code'], [T_PLUS, T_MINUS], true) + ) { + return; + } + + if ( + $tokens[$pointerBeforeParenthesisOpener]['code'] === T_DIVIDE + && in_array($tokens[$firstOperatorPointer]['code'], [T_DIVIDE, T_MULTIPLY], true) + ) { + return; + } + + if ( + $tokens[$pointerBeforeParenthesisOpener]['code'] === T_MODULUS + && $tokens[$firstOperatorPointer]['code'] === T_MODULUS + ) { + return; + } + } + + $lastOperatorPointer = $operatorsPointers[count($operatorsPointers) - 1]; + if ( + in_array($tokens[$pointerAfterParenthesisCloser]['code'], self::OPERATORS, true) + && self::OPERATOR_GROUPS[$tokens[$lastOperatorPointer]['code']] !== self::OPERATOR_GROUPS[$tokens[$pointerAfterParenthesisCloser]['code']] + ) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless parentheses.', $parenthesisOpenerPointer, self::CODE_USELESS_PARENTHESES); + + if (!$fix) { + return; + } + + $contentStartPointer = TokenHelper::findNextEffective($phpcsFile, $parenthesisOpenerPointer + 1); + $contentEndPointer = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$parenthesisOpenerPointer]['parenthesis_closer'] - 1); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $parenthesisOpenerPointer, $contentStartPointer - 1); + FixerHelper::removeBetweenIncluding($phpcsFile, $contentEndPointer + 1, $tokens[$parenthesisOpenerPointer]['parenthesis_closer']); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessSemicolonSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessSemicolonSniff.php new file mode 100644 index 0000000..09bba51 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/PHP/UselessSemicolonSniff.php @@ -0,0 +1,160 @@ + + */ + public function register(): array + { + return [ + T_SEMICOLON, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $semicolonPointer + */ + public function process(File $phpcsFile, $semicolonPointer): void + { + $this->checkMultipleSemicolons($phpcsFile, $semicolonPointer); + $this->checkSemicolonAtTheBeginningOfScope($phpcsFile, $semicolonPointer); + $this->checkSemicolonAfterScope($phpcsFile, $semicolonPointer); + } + + private function checkMultipleSemicolons(File $phpcsFile, int $semicolonPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $semicolonPointer - 1); + if ($tokens[$previousPointer]['code'] !== T_SEMICOLON) { + return; + } + + $possibleEndScopePointer = TokenHelper::findNextLocal($phpcsFile, T_CLOSE_PARENTHESIS, $semicolonPointer + 1); + if ( + $possibleEndScopePointer !== null + && $tokens[$possibleEndScopePointer]['parenthesis_opener'] < $semicolonPointer + && array_key_exists('parenthesis_owner', $tokens[$possibleEndScopePointer]) + && $tokens[$tokens[$possibleEndScopePointer]['parenthesis_owner']]['code'] === T_FOR + ) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless semicolon.', $semicolonPointer, self::CODE_USELESS_SEMICOLON); + + if (!$fix) { + return; + } + + $this->removeUselessSemicolon($phpcsFile, $semicolonPointer); + } + + private function checkSemicolonAtTheBeginningOfScope(File $phpcsFile, int $semicolonPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $semicolonPointer - 1); + if (!in_array($tokens[$previousPointer]['code'], [T_OPEN_TAG, T_OPEN_CURLY_BRACKET], true)) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless semicolon.', $semicolonPointer, self::CODE_USELESS_SEMICOLON); + + if (!$fix) { + return; + } + + $this->removeUselessSemicolon($phpcsFile, $semicolonPointer); + } + + private function checkSemicolonAfterScope(File $phpcsFile, int $semicolonPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $semicolonPointer - 1); + if ($tokens[$previousPointer]['code'] !== T_CLOSE_CURLY_BRACKET) { + return; + } + + if (!array_key_exists('scope_condition', $tokens[$previousPointer])) { + return; + } + + $scopeOpenerPointer = $tokens[$previousPointer]['scope_condition']; + if (in_array($tokens[$scopeOpenerPointer]['code'], [T_CLOSURE, T_FN, T_ANON_CLASS, T_MATCH], true)) { + return; + } + + $fix = $phpcsFile->addFixableError('Useless semicolon.', $semicolonPointer, self::CODE_USELESS_SEMICOLON); + + if (!$fix) { + return; + } + + $this->removeUselessSemicolon($phpcsFile, $semicolonPointer); + } + + private function removeUselessSemicolon(File $phpcsFile, int $semicolonPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $fixStartPointer = $semicolonPointer; + do { + if ($tokens[$fixStartPointer - 1]['code'] !== T_WHITESPACE) { + break; + } + + $fixStartPointer--; + + if ($tokens[$fixStartPointer]['content'] === $phpcsFile->eolChar) { + break; + } + } while (true); + + $fixEndPointer = $semicolonPointer; + while ($fixEndPointer < count($tokens) - 1) { + if ($tokens[$fixEndPointer + 1]['code'] !== T_WHITESPACE) { + break; + } + + if ($tokens[$fixEndPointer + 1]['content'] === $phpcsFile->eolChar) { + break; + } + + $fixEndPointer++; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetweenIncluding($phpcsFile, $fixStartPointer, $fixEndPointer); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php new file mode 100644 index 0000000..45a8c40 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Strings/DisallowVariableParsingSniff.php @@ -0,0 +1,154 @@ + + */ + public function register(): array + { + return [ + T_DOUBLE_QUOTED_STRING, + T_HEREDOC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $stringPointer + */ + public function process(File $phpcsFile, $stringPointer): void + { + if (!$this->disallowDollarCurlySyntax && !$this->disallowCurlyDollarSyntax && !$this->disallowSimpleSyntax) { + throw new UnexpectedValueException('No option is set.'); + } + + $tokens = $phpcsFile->getTokens(); + $tokenContent = $tokens[$stringPointer]['content']; + + if (strpos($tokenContent, '$') === false) { + return; + } + + $stringTokens = $tokens[$stringPointer]['code'] === T_HEREDOC + ? token_get_all('disallowDollarCurlySyntax && $this->getTokenContent($stringToken) === '${') { + $usedVariable = $stringToken[1]; + + for ($j = $i + 1; $j < count($stringTokens); $j++) { + $usedVariable .= $this->getTokenContent($stringTokens[$j]); + + if ($this->getTokenContent($stringTokens[$j]) === '}') { + $phpcsFile->addError( + sprintf( + 'Using variable syntax "${...}" inside string is disallowed as syntax "${...}" is deprecated as of PHP 8.2, found "%s".', + $usedVariable + ), + $stringPointer, + self::CODE_DISALLOWED_DOLLAR_CURLY_SYNTAX + ); + + break; + } + } + } elseif ($stringToken[0] === T_VARIABLE) { + if ($this->disallowCurlyDollarSyntax && $this->getTokenContent($stringTokens[$i - 1]) === '{') { + $usedVariable = $stringToken[1]; + + for ($j = $i + 1; $j < count($stringTokens); $j++) { + $stringTokenContent = $this->getTokenContent($stringTokens[$j]); + if ($stringTokenContent === '}') { + break; + } + + $usedVariable .= $stringTokenContent; + } + + $phpcsFile->addError( + sprintf( + 'Using variable syntax "{$...}" inside string is disallowed, found "{%s}".', + $usedVariable + ), + $stringPointer, + self::CODE_DISALLOWED_CURLY_DOLLAR_SYNTAX + ); + } elseif ($this->disallowSimpleSyntax) { + $error = true; + + for ($j = $i - 1; $j >= 0; $j--) { + $stringTokenContent = $this->getTokenContent($stringTokens[$j]); + + if (in_array($stringTokenContent, ['{', '${'], true)) { + $error = false; + break; + } + + if ($stringTokenContent === '}') { + break; + } + } + + if ($error) { + $phpcsFile->addError( + sprintf( + 'Using variable syntax "$..." inside string is disallowed, found "%s".', + $this->getTokenContent($stringToken) + ), + $stringPointer, + self::CODE_DISALLOWED_SIMPLE_SYNTAX + ); + } + } + } + } + } + + /** + * @param array{0: int, 1: string}|string $token + */ + private function getTokenContent($token): string + { + return is_array($token) ? $token[1] : $token; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php new file mode 100644 index 0000000..b418c78 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TestCase.php @@ -0,0 +1,236 @@ +> $sniffProperties + * @param list $codesToCheck + * @param list $cliArgs + */ + protected static function checkFile(string $filePath, array $sniffProperties = [], array $codesToCheck = [], array $cliArgs = []): File + { + if (defined('PHP_CODESNIFFER_CBF') === false) { + define('PHP_CODESNIFFER_CBF', false); + } + $codeSniffer = new Runner(); + $codeSniffer->config = new Config(array_merge(['-s'], $cliArgs)); + $codeSniffer->init(); + + if (count($sniffProperties) > 0) { + /** @phpstan-ignore-next-line */ + if (version_compare(Config::VERSION, '3.8.0', '>=')) { + foreach ($sniffProperties as $name => $value) { + $sniffProperties[$name] = [ + 'value' => $value, + 'scope' => 'sniff', + ]; + } + } + + $codeSniffer->ruleset->ruleset[self::getSniffName()]['properties'] = $sniffProperties; + } + + $sniffClassName = static::getSniffClassName(); + /** @var Sniff $sniff */ + $sniff = new $sniffClassName(); + + $codeSniffer->ruleset->sniffs = [$sniffClassName => $sniff]; + + if (count($codesToCheck) > 0) { + foreach (self::getSniffClassReflection()->getConstants() as $constantName => $constantValue) { + if (strpos($constantName, 'CODE_') !== 0 || in_array($constantValue, $codesToCheck, true)) { + continue; + } + + $codeSniffer->ruleset->ruleset[sprintf('%s.%s', self::getSniffName(), $constantValue)]['severity'] = 0; + } + } + + $codeSniffer->ruleset->populateTokenListeners(); + + $file = new LocalFile($filePath, $codeSniffer->ruleset, $codeSniffer->config); + $file->process(); + + return $file; + } + + protected static function assertNoSniffErrorInFile(File $phpcsFile): void + { + $errors = $phpcsFile->getErrors(); + self::assertEmpty($errors, sprintf('No errors expected, but %d errors found.', count($errors))); + } + + protected static function assertNoSniffWarningInFile(File $phpcsFile): void + { + $warnings = $phpcsFile->getWarnings(); + self::assertEmpty($warnings, sprintf('No warnings expected, but %d warnings found.', count($warnings))); + } + + protected static function assertSniffError(File $phpcsFile, int $line, string $code, ?string $message = null): void + { + $errors = $phpcsFile->getErrors(); + self::assertTrue(isset($errors[$line]), sprintf('Expected error on line %s, but none found.', $line)); + + $sniffCode = sprintf('%s.%s', self::getSniffName(), $code); + + self::assertTrue( + self::hasError($errors[$line], $sniffCode, $message), + sprintf( + 'Expected error %s%s, but none found on line %d.%sErrors found on line %d:%s%s%s', + $sniffCode, + $message !== null + ? sprintf(' with message "%s"', $message) + : '', + $line, + PHP_EOL . PHP_EOL, + $line, + PHP_EOL, + self::getFormattedErrors($errors[$line]), + PHP_EOL + ) + ); + } + + protected static function assertSniffWarning(File $phpcsFile, int $line, string $code, ?string $message = null): void + { + $errors = $phpcsFile->getWarnings(); + self::assertTrue(isset($errors[$line]), sprintf('Expected warning on line %s, but none found.', $line)); + + $sniffCode = sprintf('%s.%s', self::getSniffName(), $code); + + self::assertTrue( + self::hasError($errors[$line], $sniffCode, $message), + sprintf( + 'Expected warning %s%s, but none found on line %d.%sWarnings found on line %d:%s%s%s', + $sniffCode, + $message !== null + ? sprintf(' with message "%s"', $message) + : '', + $line, + PHP_EOL . PHP_EOL, + $line, + PHP_EOL, + self::getFormattedErrors($errors[$line]), + PHP_EOL + ) + ); + } + + protected static function assertNoSniffError(File $phpcsFile, int $line): void + { + $errors = $phpcsFile->getErrors(); + self::assertFalse( + isset($errors[$line]), + sprintf( + 'Expected no error on line %s, but found:%s%s%s', + $line, + PHP_EOL . PHP_EOL, + isset($errors[$line]) ? self::getFormattedErrors($errors[$line]) : '', + PHP_EOL + ) + ); + } + + protected static function assertAllFixedInFile(File $phpcsFile): void + { + $phpcsFile->disableCaching(); + $phpcsFile->fixer->fixFile(); + self::assertStringEqualsFile(preg_replace('~(\\.php)$~', '.fixed\\1', $phpcsFile->getFilename()), $phpcsFile->fixer->getContents()); + } + + /** + * @return class-string + */ + protected static function getSniffClassName(): string + { + /** @var class-string $sniffClassName */ + $sniffClassName = substr(static::class, 0, -strlen('Test')); + + return $sniffClassName; + } + + protected static function getSniffName(): string + { + return Common::getSniffCode(static::getSniffClassName()); + } + + private static function getSniffClassReflection(): ReflectionClass + { + static $reflections = []; + + $className = static::getSniffClassName(); + + return $reflections[$className] ?? $reflections[$className] = new ReflectionClass($className); + } + + /** + * @param list> $errorsOnLine + */ + private static function hasError(array $errorsOnLine, string $sniffCode, ?string $message): bool + { + $hasError = false; + + foreach ($errorsOnLine as $errorsOnPosition) { + foreach ($errorsOnPosition as $error) { + /** @var string $errorSource */ + $errorSource = $error['source']; + /** @var string $errorMessage */ + $errorMessage = $error['message']; + + if ( + $errorSource === $sniffCode + && ( + $message === null + || strpos($errorMessage, $message) !== false + ) + ) { + $hasError = true; + break; + } + } + } + + return $hasError; + } + + /** + * @param list> $errors + */ + private static function getFormattedErrors(array $errors): string + { + return implode(PHP_EOL, array_map(static function (array $errors): string { + return implode(PHP_EOL, array_map(static function (array $error): string { + return sprintf("\t%s: %s", $error['source'], $error['message']); + }, $errors)); + }, $errors)); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php new file mode 100644 index 0000000..9987981 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DeclareStrictTypesSniff.php @@ -0,0 +1,262 @@ + + */ + public function register(): array + { + return [ + T_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $openTagPointer + */ + public function process(File $phpcsFile, $openTagPointer): void + { + $this->linesCountBeforeDeclare = SniffSettingsHelper::normalizeInteger($this->linesCountBeforeDeclare); + $this->linesCountAfterDeclare = SniffSettingsHelper::normalizeInteger($this->linesCountAfterDeclare); + $this->spacesCountAroundEqualsSign = SniffSettingsHelper::normalizeInteger($this->spacesCountAroundEqualsSign); + + if (TokenHelper::findPrevious($phpcsFile, T_OPEN_TAG, $openTagPointer - 1) !== null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $declarePointer = TokenHelper::findNextEffective($phpcsFile, $openTagPointer + 1); + + if ($declarePointer === null || $tokens[$declarePointer]['code'] !== T_DECLARE) { + $fix = $phpcsFile->addFixableError( + sprintf('Missing declare(%s).', $this->getStrictTypeDeclaration()), + $openTagPointer, + self::CODE_DECLARE_STRICT_TYPES_MISSING + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent( + $openTagPointer, + sprintf('declare(%s);%s', $this->getStrictTypeDeclaration(), $phpcsFile->eolChar) + ); + $phpcsFile->fixer->endChangeset(); + } + return; + } + + $strictTypesPointer = null; + for ($i = $tokens[$declarePointer]['parenthesis_opener'] + 1; $i < $tokens[$declarePointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_STRING || $tokens[$i]['content'] !== 'strict_types') { + continue; + } + + $strictTypesPointer = $i; + break; + } + + if ($strictTypesPointer === null) { + $fix = $phpcsFile->addFixableError( + sprintf('Missing declare(%s).', $this->getStrictTypeDeclaration()), + $declarePointer, + self::CODE_DECLARE_STRICT_TYPES_MISSING + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore( + $tokens[$declarePointer]['parenthesis_closer'], + ', ' . $this->getStrictTypeDeclaration() + ); + $phpcsFile->fixer->endChangeset(); + } + return; + } + + /** @var int $numberPointer */ + $numberPointer = TokenHelper::findNext($phpcsFile, T_LNUMBER, $strictTypesPointer + 1); + if ($tokens[$numberPointer]['content'] !== '1') { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %s, found %s.', + $this->getStrictTypeDeclaration(), + TokenHelper::getContent($phpcsFile, $strictTypesPointer, $numberPointer) + ), + $declarePointer, + self::CODE_DECLARE_STRICT_TYPES_MISSING + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($numberPointer, '1'); + $phpcsFile->fixer->endChangeset(); + } + return; + } + + $strictTypesContent = TokenHelper::getContent($phpcsFile, $strictTypesPointer, $numberPointer); + $format = sprintf('strict_types%1$s=%1$s1', str_repeat(' ', $this->spacesCountAroundEqualsSign)); + if ($strictTypesContent !== $format) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %s, found %s.', + $format, + $strictTypesContent + ), + $strictTypesPointer, + self::CODE_INCORRECT_STRICT_TYPES_FORMAT + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $strictTypesPointer, $numberPointer, $format); + + $phpcsFile->fixer->endChangeset(); + } + } + + $pointerBeforeDeclare = TokenHelper::findPreviousNonWhitespace($phpcsFile, $declarePointer - 1); + + $whitespaceBefore = ''; + if ($pointerBeforeDeclare === $openTagPointer) { + $whitespaceBefore .= substr($tokens[$openTagPointer]['content'], strlen('declareOnFirstLine) { + if ($whitespaceBefore !== ' ') { + $fix = $phpcsFile->addFixableError( + 'There must be a single space between the PHP open tag and declare statement.', + $declarePointer, + self::CODE_INCORRECT_WHITESPACE_BEFORE_DECLARE + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $openTagPointer, $declarePointer - 1, 'fixer->endChangeset(); + } + } + } else { + $declareOnFirstLine = $tokens[$declarePointer]['line'] === $tokens[$openTagPointer]['line']; + $linesCountBefore = $declareOnFirstLine ? 0 : substr_count($whitespaceBefore, $phpcsFile->eolChar) - 1; + if ($declareOnFirstLine || $linesCountBefore !== $this->linesCountBeforeDeclare) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s before declare statement, found %d.', + $this->linesCountBeforeDeclare, + $this->linesCountBeforeDeclare === 1 ? '' : 's', + $linesCountBefore + ), + $declarePointer, + self::CODE_INCORRECT_WHITESPACE_BEFORE_DECLARE + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + + if ($pointerBeforeDeclare === $openTagPointer) { + $phpcsFile->fixer->replaceToken($openTagPointer, 'linesCountBeforeDeclare; $i++) { + $phpcsFile->fixer->addNewline($pointerBeforeDeclare); + } + $phpcsFile->fixer->endChangeset(); + } + } + } + + /** @var int $declareSemicolonPointer */ + $declareSemicolonPointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$declarePointer]['parenthesis_closer'] + 1); + $pointerAfterWhitespaceEnd = TokenHelper::findNextNonWhitespace($phpcsFile, $declareSemicolonPointer + 1); + if ($pointerAfterWhitespaceEnd === null) { + return; + } + + $whitespaceAfter = TokenHelper::getContent($phpcsFile, $declareSemicolonPointer + 1, $pointerAfterWhitespaceEnd - 1); + + $newLinesAfter = substr_count($whitespaceAfter, $phpcsFile->eolChar); + $linesCountAfter = $newLinesAfter > 0 ? $newLinesAfter - 1 : 0; + + if ($linesCountAfter === $this->linesCountAfterDeclare) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Expected %d line%s after declare statement, found %d.', + $this->linesCountAfterDeclare, + $this->linesCountAfterDeclare === 1 ? '' : 's', + $linesCountAfter + ), + $declarePointer, + self::CODE_INCORRECT_WHITESPACE_AFTER_DECLARE + ); + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::removeBetween($phpcsFile, $declareSemicolonPointer, $pointerAfterWhitespaceEnd); + + for ($i = 0; $i <= $this->linesCountAfterDeclare; $i++) { + $phpcsFile->fixer->addNewline($declareSemicolonPointer); + } + + $phpcsFile->fixer->endChangeset(); + } + + protected function getStrictTypeDeclaration(): string + { + return sprintf( + 'strict_types%s=%s1', + str_repeat(' ', $this->spacesCountAroundEqualsSign), + str_repeat(' ', $this->spacesCountAroundEqualsSign) + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php new file mode 100644 index 0000000..bc8bc62 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowArrayTypeHintSyntaxSniff.php @@ -0,0 +1,307 @@ + */ + public $traversableTypeHints = []; + + /** @var array|null */ + private $normalizedTraversableTypeHints; + + /** + * @return array + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + $arrayTypeNodes = $this->getArrayTypeNodes($annotation->getValue()); + + foreach ($arrayTypeNodes as $arrayTypeNode) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'Usage of array type hint syntax in "%s" is disallowed, use generic type hint syntax instead.', + AnnotationTypeHelper::print($arrayTypeNode) + ), + $annotation->getStartPointer(), + self::CODE_DISALLOWED_ARRAY_TYPE_HINT_SYNTAX + ); + + if (!$fix) { + continue; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + /** @var list $unionTypeNodes */ + $unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class); + + $unionTypeNode = $this->findUnionTypeThatContainsArrayType($arrayTypeNode, $unionTypeNodes); + + if ($unionTypeNode !== null) { + $genericIdentifier = $this->findGenericIdentifier( + $phpcsFile, + $docCommentOpenPointer, + $unionTypeNode, + $annotation->getValue() + ); + if ($genericIdentifier !== null) { + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode($genericIdentifier), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $unionTypeNode, + $genericTypeNode + ); + } else { + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode('array'), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $arrayTypeNode, + $genericTypeNode + ); + } + } else { + $genericIdentifier = $this->findGenericIdentifier( + $phpcsFile, + $docCommentOpenPointer, + $arrayTypeNode, + $annotation->getValue() + ) ?? 'array'; + + $genericTypeNode = new GenericTypeNode( + new IdentifierTypeNode($genericIdentifier), + [$this->fixArrayNode($arrayTypeNode->type)] + ); + $fixedDocComment = AnnotationHelper::fixAnnotation($parsedDocComment, $annotation, $arrayTypeNode, $genericTypeNode); + } + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } + } + } + + /** + * @return list + */ + public function getArrayTypeNodes(Node $node): array + { + static $visitor; + static $traverser; + + if ($visitor === null) { + $visitor = new class extends AbstractNodeVisitor { + + /** @var list */ + private $nodes = []; + + /** + * @return Node|list|NodeTraverser::*|null + */ + public function enterNode(Node $node) + { + if ($node instanceof ArrayTypeNode) { + $this->nodes[] = $node; + + if ($node->type instanceof ArrayTypeNode) { + return NodeTraverser::DONT_TRAVERSE_CHILDREN; + } + } + + return null; + } + + public function cleanNodes(): void + { + $this->nodes = []; + } + + /** + * @return list + */ + public function getNodes(): array + { + return $this->nodes; + } + + }; + } + + if ($traverser === null) { + $traverser = new NodeTraverser([$visitor]); + } + + $visitor->cleanNodes(); + + $traverser->traverse([$node]); + + return $visitor->getNodes(); + } + + private function fixArrayNode(TypeNode $node): TypeNode + { + if (!$node instanceof ArrayTypeNode) { + return $node; + } + + return new GenericTypeNode(new IdentifierTypeNode('array'), [$this->fixArrayNode($node->type)]); + } + + /** + * @param list $unionTypeNodes + */ + private function findUnionTypeThatContainsArrayType(ArrayTypeNode $arrayTypeNode, array $unionTypeNodes): ?UnionTypeNode + { + foreach ($unionTypeNodes as $unionTypeNode) { + if (in_array($arrayTypeNode, $unionTypeNode->types, true)) { + return $unionTypeNode; + } + } + + return null; + } + + private function findGenericIdentifier( + File $phpcsFile, + int $docCommentOpenPointer, + TypeNode $typeNode, + PhpDocTagValueNode $annotationValue + ): ?string + { + if (!$typeNode instanceof UnionTypeNode) { + if (!$annotationValue instanceof ParamTagValueNode && !$annotationValue instanceof ReturnTagValueNode) { + return null; + } + + $functionPointer = TokenHelper::findNext($phpcsFile, TokenHelper::$functionTokenCodes, $docCommentOpenPointer + 1); + + if ($functionPointer === null || $phpcsFile->getTokens()[$functionPointer]['code'] !== T_FUNCTION) { + return null; + } + + if ($annotationValue instanceof ParamTagValueNode) { + $parameterTypeHints = FunctionHelper::getParametersTypeHints($phpcsFile, $functionPointer); + return array_key_exists( + $annotationValue->parameterName, + $parameterTypeHints + ) && $parameterTypeHints[$annotationValue->parameterName] !== null + ? $parameterTypeHints[$annotationValue->parameterName]->getTypeHint() + : null; + } + + $returnType = FunctionHelper::findReturnTypeHint($phpcsFile, $functionPointer); + return $returnType !== null ? $returnType->getTypeHint() : null; + } + + if (count($typeNode->types) !== 2) { + return null; + } + + if ( + $typeNode->types[0] instanceof ArrayTypeNode + && $typeNode->types[1] instanceof IdentifierTypeNode + && $this->isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeNode->types[1]->name) + ) + ) { + return $typeNode->types[1]->name; + } + + if ( + $typeNode->types[1] instanceof ArrayTypeNode + && $typeNode->types[0] instanceof IdentifierTypeNode + && $this->isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $docCommentOpenPointer, $typeNode->types[0]->name) + ) + ) { + return $typeNode->types[0]->name; + } + + return null; + } + + private function isTraversableType(string $type): bool + { + return TypeHintHelper::isSimpleIterableTypeHint($type) || array_key_exists($type, $this->getNormalizedTraversableTypeHints()); + } + + /** + * @return array + */ + private function getNormalizedTraversableTypeHints(): array + { + if ($this->normalizedTraversableTypeHints === null) { + $this->normalizedTraversableTypeHints = array_flip(array_map(static function (string $typeHint): string { + return NamespaceHelper::isFullyQualifiedName($typeHint) + ? $typeHint + : sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $typeHint); + }, SniffSettingsHelper::normalizeArray($this->traversableTypeHints))); + } + return $this->normalizedTraversableTypeHints; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php new file mode 100644 index 0000000..2c29985 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/DisallowMixedTypeHintSniff.php @@ -0,0 +1,72 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + if (SuppressHelper::isSniffSuppressed( + $phpcsFile, + $docCommentOpenPointer, + $this->getSniffName(self::CODE_DISALLOWED_MIXED_TYPE_HINT) + )) { + return; + } + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + if (strtolower($typeHint) !== 'mixed') { + continue; + } + + $phpcsFile->addError( + 'Usage of "mixed" type hint is disallowed.', + $annotation->getStartPointer(), + self::CODE_DISALLOWED_MIXED_TYPE_HINT + ); + } + } + } + + private function getSniffName(string $sniffName): string + { + return sprintf('%s.%s', self::NAME, $sniffName); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php new file mode 100644 index 0000000..8bc9c2f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/LongTypeHintsSniff.php @@ -0,0 +1,92 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + /** @var list $identifierTypeNodes */ + $identifierTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), IdentifierTypeNode::class); + + foreach ($identifierTypeNodes as $typeHintNode) { + $typeHint = $typeHintNode->name; + + $lowercasedTypeHint = strtolower($typeHint); + + $shortTypeHint = null; + if ($lowercasedTypeHint === 'integer') { + $shortTypeHint = 'int'; + } elseif ($lowercasedTypeHint === 'boolean') { + $shortTypeHint = 'bool'; + } + + if ($shortTypeHint === null) { + continue; + } + + $fix = $phpcsFile->addFixableError(sprintf( + 'Expected "%s" but found "%s" in %s annotation.', + $shortTypeHint, + $typeHint, + $annotation->getName() + ), $annotation->getStartPointer(), self::CODE_USED_LONG_TYPE_HINT); + + if (!$fix) { + continue; + } + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation( + $parsedDocComment, + $annotation, + $typeHintNode, + new IdentifierTypeNode($shortTypeHint) + ); + + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php new file mode 100644 index 0000000..eb7a3a4 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullTypeHintOnLastPositionSniff.php @@ -0,0 +1,109 @@ + + */ + public function register(): array + { + return [ + T_DOC_COMMENT_OPEN_TAG, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $docCommentOpenPointer + */ + public function process(File $phpcsFile, $docCommentOpenPointer): void + { + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach ($annotations as $annotation) { + /** @var list $unionTypeNodes */ + $unionTypeNodes = AnnotationHelper::getAnnotationNodesByType($annotation->getNode(), UnionTypeNode::class); + + foreach ($unionTypeNodes as $unionTypeNode) { + $nullTypeNode = null; + $nullPosition = 0; + $position = 0; + foreach ($unionTypeNode->types as $typeNode) { + if ($typeNode instanceof IdentifierTypeNode && strtolower($typeNode->name) === 'null') { + $nullTypeNode = $typeNode; + $nullPosition = $position; + break; + } + + $position++; + } + + if ($nullTypeNode === null) { + continue; + } + + if ($nullPosition === count($unionTypeNode->types) - 1) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Null type hint should be on last position in "%s".', AnnotationTypeHelper::print($unionTypeNode)), + $annotation->getStartPointer(), + self::CODE_NULL_TYPE_HINT_NOT_ON_LAST_POSITION + ); + + if (!$fix) { + continue; + } + + $fixedTypeNodes = []; + foreach ($unionTypeNode->types as $typeNode) { + if ($typeNode === $nullTypeNode) { + continue; + } + + $fixedTypeNodes[] = $typeNode; + } + $fixedTypeNodes[] = $nullTypeNode; + + $fixedUnionTypeNode = PhpDocParserHelper::cloneNode($unionTypeNode); + $fixedUnionTypeNode->types = $fixedTypeNodes; + + $phpcsFile->fixer->beginChangeset(); + + $parsedDocComment = DocCommentHelper::parseDocComment($phpcsFile, $docCommentOpenPointer); + + $fixedDocComment = AnnotationHelper::fixAnnotation($parsedDocComment, $annotation, $unionTypeNode, $fixedUnionTypeNode); + + FixerHelper::change( + $phpcsFile, + $parsedDocComment->getOpenPointer(), + $parsedDocComment->getClosePointer(), + $fixedDocComment + ); + + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullableTypeForNullDefaultValueSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullableTypeForNullDefaultValueSniff.php new file mode 100644 index 0000000..9d97cb1 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/NullableTypeForNullDefaultValueSniff.php @@ -0,0 +1,125 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + if (SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, self::NAME)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + $startPointer = $tokens[$functionPointer]['parenthesis_opener'] + 1; + $endPointer = $tokens[$functionPointer]['parenthesis_closer']; + + $typeHintTokenCodes = TokenHelper::getOnlyTypeHintTokenCodes(); + + for ($i = $startPointer; $i < $endPointer; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + $parameterName = $tokens[$i]['content']; + + $afterVariablePointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$afterVariablePointer]['code'] !== T_EQUAL) { + continue; + } + + $afterEqualsPointer = TokenHelper::findNextEffective($phpcsFile, $afterVariablePointer + 1); + if ($tokens[$afterEqualsPointer]['code'] !== T_NULL) { + continue; + } + + $ignoreTokensToFindTypeHint = array_merge(TokenHelper::$ineffectiveTokenCodes, [T_BITWISE_AND, T_ELLIPSIS]); + $typeHintEndPointer = TokenHelper::findPreviousExcluding($phpcsFile, $ignoreTokensToFindTypeHint, $i - 1, $startPointer); + + if ( + $typeHintEndPointer === null + || !in_array($tokens[$typeHintEndPointer]['code'], $typeHintTokenCodes, true) + ) { + continue; + } + + $typeHintStartPointer = TypeHintHelper::getStartPointer($phpcsFile, $typeHintEndPointer); + + $typeHint = TokenHelper::getContent($phpcsFile, $typeHintStartPointer, $typeHintEndPointer); + + if (strtolower($typeHint) === 'mixed') { + continue; + } + + $nullableSymbolPointer = TokenHelper::findPreviousEffective( + $phpcsFile, + $typeHintStartPointer - 1, + $tokens[$functionPointer]['parenthesis_opener'] + ); + + if ($nullableSymbolPointer !== null && $tokens[$nullableSymbolPointer]['code'] === T_NULLABLE) { + continue; + } + + if (preg_match('~(?:^|(?:\|\s*))null(?:(?:\s*\|)|$)~i', $typeHint) === 1) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Parameter %s has null default value, but is not marked as nullable.', $parameterName), + $i, + self::CODE_NULLABILITY_TYPE_MISSING + ); + + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + + if (substr_count($typeHint, '|') > 0) { + $phpcsFile->fixer->addContent($typeHintEndPointer, '|null'); + } else { + $phpcsFile->fixer->addContentBefore($typeHintStartPointer, '?'); + } + + $phpcsFile->fixer->endChangeset(); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php new file mode 100644 index 0000000..fa71a58 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php @@ -0,0 +1,688 @@ + */ + public $traversableTypeHints = []; + + /** @var array|null */ + private $normalizedTraversableTypeHints; + + /** + * @return array + */ + public function register(): array + { + return [ + T_FUNCTION, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $this->enableObjectTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableObjectTypeHint, 70200); + $this->enableMixedTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableMixedTypeHint, 80000); + $this->enableUnionTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableUnionTypeHint, 80000); + $this->enableIntersectionTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableIntersectionTypeHint, 80100); + $this->enableStandaloneNullTrueFalseTypeHints = SniffSettingsHelper::isEnabledByPhpVersion( + $this->enableStandaloneNullTrueFalseTypeHints, + 80200 + ); + + if (SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, self::NAME)) { + return; + } + + if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $functionPointer)) { + return; + } + + $parametersTypeHints = FunctionHelper::getParametersTypeHints($phpcsFile, $functionPointer); + $parametersAnnotations = FunctionHelper::getValidParametersAnnotations($phpcsFile, $functionPointer); + $prefixedParametersAnnotations = FunctionHelper::getValidPrefixedParametersAnnotations($phpcsFile, $functionPointer); + + $this->checkTypeHints($phpcsFile, $functionPointer, $parametersTypeHints, $parametersAnnotations, $prefixedParametersAnnotations); + $this->checkTraversableTypeHintSpecification( + $phpcsFile, + $functionPointer, + $parametersTypeHints, + $parametersAnnotations, + $prefixedParametersAnnotations + ); + $this->checkUselessAnnotations($phpcsFile, $functionPointer, $parametersTypeHints, $parametersAnnotations); + } + + /** + * @param array $parametersTypeHints + * @param array|Annotation|Annotation> $parametersAnnotations + * @param array|Annotation> $prefixedParametersAnnotations + */ + private function checkTypeHints( + File $phpcsFile, + int $functionPointer, + array $parametersTypeHints, + array $parametersAnnotations, + array $prefixedParametersAnnotations + ): void + { + $suppressNameAnyTypeHint = self::getSniffName(self::CODE_MISSING_ANY_TYPE_HINT); + $isSuppressedAnyTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressNameAnyTypeHint); + + $suppressNameNativeTypeHint = $this->getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT); + $isSuppressedNativeTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressNameNativeTypeHint); + + $suppressedErrors = 0; + + $parametersWithoutTypeHint = array_keys( + array_filter($parametersTypeHints, static function (?TypeHint $parameterTypeHint = null): bool { + return $parameterTypeHint === null; + }) + ); + + $tokens = $phpcsFile->getTokens(); + + $isConstructor = FunctionHelper::isMethod($phpcsFile, $functionPointer) + && strtolower(FunctionHelper::getName($phpcsFile, $functionPointer)) === '__construct'; + + foreach ($parametersWithoutTypeHint as $parameterName) { + $isPropertyPromotion = false; + + if ($isConstructor) { + $parameterPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $parameterName, + $tokens[$functionPointer]['parenthesis_opener'], + $tokens[$functionPointer]['parenthesis_closer'] + ); + + $pointerBeforeParameter = TokenHelper::findPrevious($phpcsFile, [T_COMMA, T_OPEN_PARENTHESIS], $parameterPointer - 1); + + $visibilityPointer = TokenHelper::findNextEffective($phpcsFile, $pointerBeforeParameter + 1); + + $isPropertyPromotion = in_array($tokens[$visibilityPointer]['code'], Tokens::$scopeModifiers, true); + } + + if ( + !array_key_exists($parameterName, $parametersAnnotations) + || $parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode + ) { + if (array_key_exists($parameterName, $prefixedParametersAnnotations)) { + continue; + } + + if ($isSuppressedAnyTypeHint) { + $suppressedErrors++; + continue; + } + + $phpcsFile->addError( + sprintf( + '%s %s() does not have parameter type hint nor @param annotation for its parameter %s.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + $parameterName + ), + $functionPointer, + self::CODE_MISSING_ANY_TYPE_HINT + ); + + continue; + } + + $parameterTypeNode = $parametersAnnotations[$parameterName]->getValue()->type; + + if ( + $parameterTypeNode instanceof IdentifierTypeNode + && strtolower($parameterTypeNode->name) === 'null' + && !$this->enableStandaloneNullTrueFalseTypeHints + ) { + continue; + } + + $originalParameterTypeNode = $parameterTypeNode; + if ($parameterTypeNode instanceof NullableTypeNode) { + $parameterTypeNode = $parameterTypeNode->type; + } + + $canTryUnionTypeHint = $this->enableUnionTypeHint && $parameterTypeNode instanceof UnionTypeNode; + + $typeHints = []; + $traversableTypeHints = []; + $nullableParameterTypeHint = false; + + if (AnnotationTypeHelper::containsOneType($parameterTypeNode)) { + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $parameterTypeNode */ + $parameterTypeNode = $parameterTypeNode; + $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType( + $parameterTypeNode, + false, + $this->enableStandaloneNullTrueFalseTypeHints + ); + + } elseif ( + $parameterTypeNode instanceof UnionTypeNode + || $parameterTypeNode instanceof IntersectionTypeNode + ) { + $traversableTypeHints = []; + foreach ($parameterTypeNode->types as $typeNode) { + if (!AnnotationTypeHelper::containsOneType($typeNode)) { + continue 2; + } + + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode|ConstTypeNode $typeNode */ + $typeNode = $typeNode; + + $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, $canTryUnionTypeHint); + + if (strtolower($typeHint) === 'null') { + $nullableParameterTypeHint = true; + continue; + } + + $isTraversable = TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $functionPointer, $typeHint), + $this->getTraversableTypeHints() + ); + + if ( + !$typeNode instanceof ArrayTypeNode + && !$typeNode instanceof ArrayShapeNode + && $isTraversable + ) { + $traversableTypeHints[] = $typeHint; + } + + $typeHints[] = $typeHint; + } + + $traversableTypeHints = array_values(array_unique($traversableTypeHints)); + if (count($traversableTypeHints) > 1 && !$canTryUnionTypeHint) { + continue; + } + } + + $typeHints = array_values(array_unique($typeHints)); + + if (count($traversableTypeHints) > 0) { + /** @var UnionTypeNode|IntersectionTypeNode $parameterTypeNode */ + $parameterTypeNode = $parameterTypeNode; + + $itemsSpecificationTypeHint = AnnotationTypeHelper::getItemsSpecificationTypeFromType($parameterTypeNode); + if ($itemsSpecificationTypeHint !== null) { + $typeHints = AnnotationTypeHelper::getTraversableTypeHintsFromType( + $parameterTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints(), + $canTryUnionTypeHint + ); + } + } + + if (count($typeHints) === 0) { + continue; + } + + $typeHintsWithConvertedUnion = []; + foreach ($typeHints as $typeHint) { + if ($this->enableUnionTypeHint && TypeHintHelper::isUnofficialUnionTypeHint($typeHint)) { + $canTryUnionTypeHint = true; + $typeHintsWithConvertedUnion = array_merge( + $typeHintsWithConvertedUnion, + TypeHintHelper::convertUnofficialUnionTypeHintToOfficialTypeHints($typeHint) + ); + } else { + $typeHintsWithConvertedUnion[] = $typeHint; + } + } + $typeHintsWithConvertedUnion = array_unique($typeHintsWithConvertedUnion); + + if ( + count($typeHintsWithConvertedUnion) > 1 + && ( + ($parameterTypeNode instanceof UnionTypeNode && !$canTryUnionTypeHint) + || ($parameterTypeNode instanceof IntersectionTypeNode && !$this->enableIntersectionTypeHint) + ) + ) { + continue; + } + + foreach ($typeHintsWithConvertedUnion as $typeHintNo => $typeHint) { + if ($canTryUnionTypeHint && $typeHint === 'false') { + continue; + } + + if ($isPropertyPromotion && $typeHint === 'callable') { + continue 2; + } + + if (!TypeHintHelper::isValidTypeHint( + $typeHint, + $this->enableObjectTypeHint, + false, + $this->enableMixedTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + continue 2; + } + + if (TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $functionPointer, $typeHint)) { + continue 2; + } + + $typeHintsWithConvertedUnion[$typeHintNo] = TypeHintHelper::convertLongSimpleTypeHintToShort($typeHint); + } + + if ($originalParameterTypeNode instanceof NullableTypeNode) { + $nullableParameterTypeHint = true; + } + + if ($isSuppressedNativeTypeHint) { + $suppressedErrors++; + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() does not have native type hint for its parameter %s but it should be possible to add it based on @param annotation "%s".', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + $parameterName, + AnnotationTypeHelper::print($parameterTypeNode) + ), + $functionPointer, + self::CODE_MISSING_NATIVE_TYPE_HINT + ); + if (!$fix) { + continue; + } + + if (in_array('mixed', $typeHintsWithConvertedUnion, true)) { + $parameterTypeHint = 'mixed'; + } elseif ($originalParameterTypeNode instanceof IntersectionTypeNode) { + $parameterTypeHint = implode('&', $typeHintsWithConvertedUnion); + } else { + $parameterTypeHint = implode('|', $typeHintsWithConvertedUnion); + if ($nullableParameterTypeHint) { + if (count($typeHintsWithConvertedUnion) > 1) { + $parameterTypeHint .= '|null'; + } else { + $parameterTypeHint = '?' . $parameterTypeHint; + } + } + } + + $tokens = $phpcsFile->getTokens(); + /** @var int $parameterPointer */ + $parameterPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $parameterName, + $tokens[$functionPointer]['parenthesis_opener'], + $tokens[$functionPointer]['parenthesis_closer'] + ); + + $beforeParameterPointer = $parameterPointer; + do { + $previousPointer = TokenHelper::findPreviousEffective( + $phpcsFile, + $beforeParameterPointer - 1, + $tokens[$functionPointer]['parenthesis_opener'] + 1 + ); + if ( + $previousPointer === null + || !in_array($tokens[$previousPointer]['code'], [T_BITWISE_AND, T_ELLIPSIS], true) + ) { + break; + } + + /** @var int $beforeParameterPointer */ + $beforeParameterPointer = $previousPointer; + } while (true); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContentBefore( + $beforeParameterPointer, + sprintf('%s ', $parameterTypeHint) + ); + $phpcsFile->fixer->endChangeset(); + } + + if ($suppressedErrors > 0) { + return; + } + + if ($isSuppressedAnyTypeHint) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $suppressNameAnyTypeHint); + } + + if ($isSuppressedNativeTypeHint) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $suppressNameNativeTypeHint); + } + } + + /** + * @param array $parametersTypeHints + * @param array|Annotation|Annotation> $parametersAnnotations + * @param array|Annotation> $prefixedParametersAnnotations + */ + private function checkTraversableTypeHintSpecification( + File $phpcsFile, + int $functionPointer, + array $parametersTypeHints, + array $parametersAnnotations, + array $prefixedParametersAnnotations + ): void + { + $suppressName = self::getSniffName(self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION); + $isSniffSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressName); + $suppressUseless = true; + + foreach ($parametersTypeHints as $parameterName => $parameterTypeHint) { + if (array_key_exists($parameterName, $prefixedParametersAnnotations)) { + continue; + } + + $hasTraversableTypeHint = false; + if ( + $parameterTypeHint !== null + && TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $functionPointer, $parameterTypeHint->getTypeHint()), + $this->getTraversableTypeHints() + ) + ) { + $hasTraversableTypeHint = true; + } elseif ( + array_key_exists($parameterName, $parametersAnnotations) + && !$parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode + && AnnotationTypeHelper::containsTraversableType( + $parametersAnnotations[$parameterName]->getValue()->type, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + ) + ) { + $hasTraversableTypeHint = true; + } + + if ($hasTraversableTypeHint && !array_key_exists($parameterName, $parametersAnnotations)) { + $suppressUseless = false; + + if (!$isSniffSuppressed) { + $phpcsFile->addError( + sprintf( + '%s %s() does not have @param annotation for its traversable parameter %s.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + $parameterName + ), + $functionPointer, + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + + continue; + } + + if (!array_key_exists($parameterName, $parametersAnnotations)) { + continue; + } + + if ($parametersAnnotations[$parameterName]->getValue() instanceof TypelessParamTagValueNode) { + continue; + } + + $parameterTypeNode = $parametersAnnotations[$parameterName]->getValue()->type; + + if ( + ( + !$hasTraversableTypeHint + && !AnnotationTypeHelper::containsTraversableType( + $parameterTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + ) + ) + || AnnotationTypeHelper::containsItemsSpecificationForTraversable( + $parameterTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + ) + ) { + continue; + } + + $suppressUseless = false; + + if ($isSniffSuppressed) { + continue; + } + + $phpcsFile->addError( + sprintf( + '@param annotation of %s %s() does not specify type hint for items of its traversable parameter %s.', + lcfirst(FunctionHelper::getTypeLabel($phpcsFile, $functionPointer)), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + $parameterName + ), + $parametersAnnotations[$parameterName]->getStartPointer(), + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + + if ($isSniffSuppressed && $suppressUseless) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $suppressName); + } + } + + /** + * @param array $parametersTypeHints + * @param array $parametersAnnotations + */ + private function checkUselessAnnotations( + File $phpcsFile, + int $functionPointer, + array $parametersTypeHints, + array $parametersAnnotations + ): void + { + $suppressName = self::getSniffName(self::CODE_USELESS_ANNOTATION); + $isSniffSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressName); + $suppressUseless = true; + + foreach ($parametersTypeHints as $parameterName => $parameterTypeHint) { + if (!array_key_exists($parameterName, $parametersAnnotations)) { + continue; + } + + $parameterAnnotation = $parametersAnnotations[$parameterName]; + + if ($parameterAnnotation->getValue() instanceof TypelessParamTagValueNode) { + continue; + } + + if (!AnnotationHelper::isAnnotationUseless( + $phpcsFile, + $functionPointer, + $parameterTypeHint, + $parameterAnnotation, + $this->getTraversableTypeHints(), + $this->enableUnionTypeHint, + $this->enableIntersectionTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + continue; + } + + $suppressUseless = false; + + if ($isSniffSuppressed) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() has useless @param annotation for parameter %s.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + $parameterName + ), + $parameterAnnotation->getStartPointer(), + self::CODE_USELESS_ANNOTATION + ); + if (!$fix) { + continue; + } + + $docCommentOpenPointer = $parameterAnnotation->getValue() instanceof VarTagValueNode + ? TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_OPEN_TAG, $parameterAnnotation->getStartPointer() - 1) + : DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $functionPointer); + + $starPointer = TokenHelper::findPrevious( + $phpcsFile, + T_DOC_COMMENT_STAR, + $parameterAnnotation->getStartPointer() - 1, + $docCommentOpenPointer + ); + + $changeStart = $starPointer ?? $parameterAnnotation->getStartPointer(); + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], + $parameterAnnotation->getEndPointer() + ) - 1; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + $phpcsFile->fixer->endChangeset(); + } + + if ($isSniffSuppressed && $suppressUseless) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $suppressName); + } + } + + private function reportUselessSuppress(File $phpcsFile, int $pointer, string $suppressName): void + { + $fix = $phpcsFile->addFixableError( + sprintf('Useless %s %s', SuppressHelper::ANNOTATION, $suppressName), + $pointer, + self::CODE_USELESS_SUPPRESS + ); + + if ($fix) { + SuppressHelper::removeSuppressAnnotation($phpcsFile, $pointer, $suppressName); + } + } + + private function getSniffName(string $sniffName): string + { + return sprintf('%s.%s', self::NAME, $sniffName); + } + + /** + * @return list + */ + private function getTraversableTypeHints(): array + { + if ($this->normalizedTraversableTypeHints === null) { + $this->normalizedTraversableTypeHints = array_map(static function (string $typeHint): string { + return NamespaceHelper::isFullyQualifiedName($typeHint) + ? $typeHint + : sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $typeHint); + }, SniffSettingsHelper::normalizeArray($this->traversableTypeHints)); + } + return $this->normalizedTraversableTypeHints; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSpacingSniff.php new file mode 100644 index 0000000..69beede --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSpacingSniff.php @@ -0,0 +1,154 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $parametersStartPointer = $tokens[$functionPointer]['parenthesis_opener'] + 1; + $parametersEndPointer = $tokens[$functionPointer]['parenthesis_closer'] - 1; + + $typeHintTokenCodes = TokenHelper::getTypeHintTokenCodes(); + + for ($i = $parametersStartPointer; $i <= $parametersEndPointer; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + $parameterPointer = $i; + $parameterName = $tokens[$parameterPointer]['content']; + + $parameterStartPointer = TokenHelper::findPrevious($phpcsFile, T_COMMA, $parameterPointer - 1, $parametersStartPointer); + if ($parameterStartPointer === null) { + $parameterStartPointer = $parametersStartPointer; + } + + $parameterEndPointer = TokenHelper::findNext($phpcsFile, T_COMMA, $parameterPointer + 1, $parametersEndPointer + 1); + if ($parameterEndPointer === null) { + $parameterEndPointer = $parametersEndPointer; + } + + $attributeCloserPointer = TokenHelper::findPrevious($phpcsFile, T_ATTRIBUTE_END, $parameterPointer - 1, $parameterStartPointer); + + $typeHintEndPointer = TokenHelper::findPrevious( + $phpcsFile, + $typeHintTokenCodes, + $parameterPointer - 1, + $attributeCloserPointer ?? $parameterStartPointer + ); + if ($typeHintEndPointer === null) { + continue; + } + + $typeHintStartPointer = TypeHintHelper::getStartPointer($phpcsFile, $typeHintEndPointer); + + $nextTokenNames = [ + T_VARIABLE => sprintf('parameter %s', $parameterName), + T_BITWISE_AND => sprintf('reference sign of parameter %s', $parameterName), + T_ELLIPSIS => sprintf('varadic parameter %s', $parameterName), + ]; + $nextTokenPointer = TokenHelper::findNext( + $phpcsFile, + array_keys($nextTokenNames), + $typeHintEndPointer + 1, + $parameterEndPointer + 1 + ); + + if ($tokens[$typeHintEndPointer + 1]['code'] !== T_WHITESPACE) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'There must be exactly one space between parameter type hint and %s.', + $nextTokenNames[$tokens[$nextTokenPointer]['code']] + ), + $typeHintEndPointer, + self::CODE_NO_SPACE_BETWEEN_TYPE_HINT_AND_PARAMETER + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($typeHintEndPointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$typeHintEndPointer + 1]['content'] !== ' ') { + $fix = $phpcsFile->addFixableError( + sprintf( + 'There must be exactly one space between parameter type hint and %s.', + $nextTokenNames[$tokens[$nextTokenPointer]['code']] + ), + $typeHintEndPointer, + self::CODE_MULTIPLE_SPACES_BETWEEN_TYPE_HINT_AND_PARAMETER + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($typeHintEndPointer + 1, ' '); + $phpcsFile->fixer->endChangeset(); + } + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $typeHintStartPointer - 1, $parameterStartPointer); + $nullabilitySymbolPointer = $previousPointer !== null && $tokens[$previousPointer]['code'] === T_NULLABLE + ? $previousPointer + : null; + + if ($nullabilitySymbolPointer === null) { + continue; + } + + if ($nullabilitySymbolPointer + 1 === $typeHintStartPointer) { + continue; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'There must be no whitespace between parameter type hint nullability symbol and parameter type hint of parameter %s.', + $parameterName + ), + $typeHintStartPointer, + self::CODE_WHITESPACE_AFTER_NULLABILITY_SYMBOL + ); + if (!$fix) { + continue; + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($nullabilitySymbolPointer + 1, ''); + $phpcsFile->fixer->endChangeset(); + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php new file mode 100644 index 0000000..82a100f --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php @@ -0,0 +1,692 @@ + */ + public $traversableTypeHints = []; + + /** @var array|null */ + private $normalizedTraversableTypeHints; + + /** + * @return array + */ + public function register(): array + { + return [ + T_VAR, + T_PUBLIC, + T_PROTECTED, + T_PRIVATE, + T_STATIC, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->enableNativeTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableNativeTypeHint, 70400); + $this->enableMixedTypeHint = $this->enableNativeTypeHint + ? SniffSettingsHelper::isEnabledByPhpVersion($this->enableMixedTypeHint, 80000) + : false; + $this->enableUnionTypeHint = $this->enableNativeTypeHint + ? SniffSettingsHelper::isEnabledByPhpVersion($this->enableUnionTypeHint, 80000) + : false; + $this->enableIntersectionTypeHint = $this->enableNativeTypeHint + ? SniffSettingsHelper::isEnabledByPhpVersion($this->enableIntersectionTypeHint, 80100) + : false; + $this->enableStandaloneNullTrueFalseTypeHints = $this->enableNativeTypeHint + ? SniffSettingsHelper::isEnabledByPhpVersion($this->enableStandaloneNullTrueFalseTypeHints, 80200) + : false; + + $tokens = $phpcsFile->getTokens(); + + $asPointer = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1); + if ($tokens[$asPointer]['code'] === T_AS) { + return; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + if (in_array($tokens[$nextPointer]['code'], [T_VAR, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_READONLY, T_STATIC], true)) { + // We don't want to report the same property twice + return; + } + + $propertyPointer = TokenHelper::findNext($phpcsFile, [T_FUNCTION, T_CONST, T_VARIABLE], $pointer + 1); + + if ($propertyPointer === null || $tokens[$propertyPointer]['code'] !== T_VARIABLE) { + return; + } + + if (!PropertyHelper::isProperty($phpcsFile, $propertyPointer)) { + return; + } + + if (SuppressHelper::isSniffSuppressed($phpcsFile, $propertyPointer, self::NAME)) { + return; + } + + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + if ($docCommentOpenPointer !== null) { + if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $docCommentOpenPointer)) { + return; + } + + $varAnnotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer, '@var'); + $prefixedPropertyAnnotations = $this->getValidPrefixedAnnotations($phpcsFile, $docCommentOpenPointer); + + $propertyAnnotation = count($varAnnotations) > 0 ? current($varAnnotations) : null; + } else { + $propertyAnnotation = null; + $prefixedPropertyAnnotations = []; + } + + $propertyTypeHint = PropertyHelper::findTypeHint($phpcsFile, $propertyPointer); + + $this->checkTypeHint($phpcsFile, $propertyPointer, $propertyTypeHint, $propertyAnnotation, $prefixedPropertyAnnotations); + $this->checkTraversableTypeHintSpecification( + $phpcsFile, + $propertyPointer, + $propertyTypeHint, + $propertyAnnotation, + $prefixedPropertyAnnotations + ); + $this->checkUselessAnnotation($phpcsFile, $propertyPointer, $propertyTypeHint, $propertyAnnotation); + } + + /** + * @param Annotation|null $propertyAnnotation + * @param list> $prefixedPropertyAnnotations + */ + private function checkTypeHint( + File $phpcsFile, + int $propertyPointer, + ?TypeHint $propertyTypeHint, + ?Annotation $propertyAnnotation, + array $prefixedPropertyAnnotations + ): void + { + $suppressNameAnyTypeHint = $this->getSniffName(self::CODE_MISSING_ANY_TYPE_HINT); + $isSuppressedAnyTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $propertyPointer, $suppressNameAnyTypeHint); + + $suppressNameNativeTypeHint = $this->getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT); + $isSuppressedNativeTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $propertyPointer, $suppressNameNativeTypeHint); + + if ($propertyTypeHint !== null) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedAnyTypeHint, $suppressNameAnyTypeHint); + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + if (!$this->hasAnnotation($propertyAnnotation)) { + if (count($prefixedPropertyAnnotations) !== 0) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedAnyTypeHint, $suppressNameAnyTypeHint); + return; + } + + if (!$isSuppressedAnyTypeHint) { + $phpcsFile->addError( + sprintf( + $this->enableNativeTypeHint + ? 'Property %s does not have native type hint nor @var annotation for its value.' + : 'Property %s does not have @var annotation for its value.', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer) + ), + $propertyPointer, + self::CODE_MISSING_ANY_TYPE_HINT + ); + } + + return; + } + + if (!$this->enableNativeTypeHint) { + return; + } + + $typeNode = $propertyAnnotation->getValue()->type; + $originalTypeNode = $typeNode; + if ($typeNode instanceof NullableTypeNode) { + $typeNode = $typeNode->type; + } + + $canTryUnionTypeHint = $this->enableUnionTypeHint && $typeNode instanceof UnionTypeNode; + + $typeHints = []; + $traversableTypeHints = []; + $nullableTypeHint = false; + + if (AnnotationTypeHelper::containsOneType($typeNode)) { + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ + $typeNode = $typeNode; + $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, false, $this->enableStandaloneNullTrueFalseTypeHints); + + } elseif ($typeNode instanceof UnionTypeNode || $typeNode instanceof IntersectionTypeNode) { + $traversableTypeHints = []; + foreach ($typeNode->types as $innerTypeNode) { + if (!AnnotationTypeHelper::containsOneType($innerTypeNode)) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $innerTypeNode */ + $innerTypeNode = $innerTypeNode; + + $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($innerTypeNode, $canTryUnionTypeHint); + + if (strtolower($typeHint) === 'null') { + $nullableTypeHint = true; + continue; + } + + $isTraversable = TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $propertyPointer, $typeHint), + $this->getTraversableTypeHints() + ); + + if ( + !$innerTypeNode instanceof ArrayTypeNode + && !$innerTypeNode instanceof ArrayShapeNode + && $isTraversable + ) { + $traversableTypeHints[] = $typeHint; + } + + $typeHints[] = $typeHint; + } + + $traversableTypeHints = array_values(array_unique($traversableTypeHints)); + if (count($traversableTypeHints) > 1 && !$canTryUnionTypeHint) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + } + + $typeHints = array_values(array_unique($typeHints)); + + if (count($traversableTypeHints) > 0) { + /** @var UnionTypeNode|IntersectionTypeNode $typeNode */ + $typeNode = $typeNode; + + $itemsSpecificationTypeHint = AnnotationTypeHelper::getItemsSpecificationTypeFromType($typeNode); + if ($itemsSpecificationTypeHint !== null) { + $typeHints = AnnotationTypeHelper::getTraversableTypeHintsFromType( + $typeNode, + $phpcsFile, + $propertyPointer, + $this->getTraversableTypeHints(), + $this->enableUnionTypeHint + ); + } + } + + if (count($typeHints) === 0) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + $typeHintsWithConvertedUnion = []; + foreach ($typeHints as $typeHint) { + if ($this->enableUnionTypeHint && TypeHintHelper::isUnofficialUnionTypeHint($typeHint)) { + $canTryUnionTypeHint = true; + $typeHintsWithConvertedUnion = array_merge( + $typeHintsWithConvertedUnion, + TypeHintHelper::convertUnofficialUnionTypeHintToOfficialTypeHints($typeHint) + ); + } else { + $typeHintsWithConvertedUnion[] = $typeHint; + } + } + $typeHintsWithConvertedUnion = array_unique($typeHintsWithConvertedUnion); + + if ( + count($typeHintsWithConvertedUnion) > 1 + && ( + ($typeNode instanceof UnionTypeNode && !$canTryUnionTypeHint) + || ($typeNode instanceof IntersectionTypeNode && !$this->enableIntersectionTypeHint) + ) + ) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + foreach ($typeHintsWithConvertedUnion as $typeHintNo => $typeHint) { + if ($typeHint === 'callable') { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + if ($canTryUnionTypeHint && $typeHint === 'false') { + continue; + } + + if (!TypeHintHelper::isValidTypeHint( + $typeHint, + true, + false, + $this->enableMixedTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + if (TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $propertyPointer, $typeHint)) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + $typeHintsWithConvertedUnion[$typeHintNo] = TypeHintHelper::convertLongSimpleTypeHintToShort($typeHint); + } + + if ($originalTypeNode instanceof NullableTypeNode) { + $nullableTypeHint = true; + } + + if ($isSuppressedNativeTypeHint) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Property %s does not have native type hint for its value but it should be possible to add it based on @var annotation "%s".', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer), + AnnotationTypeHelper::print($typeNode) + ), + $propertyPointer, + self::CODE_MISSING_NATIVE_TYPE_HINT + ); + if (!$fix) { + return; + } + + if (in_array('mixed', $typeHintsWithConvertedUnion, true)) { + $propertyTypeHint = 'mixed'; + } elseif ($originalTypeNode instanceof IntersectionTypeNode) { + $propertyTypeHint = implode('&', $typeHintsWithConvertedUnion); + } else { + $propertyTypeHint = implode('|', $typeHintsWithConvertedUnion); + if ($nullableTypeHint) { + if (count($typeHintsWithConvertedUnion) > 1) { + $propertyTypeHint .= '|null'; + } else { + $propertyTypeHint = '?' . $propertyTypeHint; + } + } + } + + $propertyStartPointer = TokenHelper::findPrevious( + $phpcsFile, + [T_PRIVATE, T_PROTECTED, T_PUBLIC, T_VAR, T_STATIC, T_READONLY], + $propertyPointer - 1 + ); + + $tokens = $phpcsFile->getTokens(); + + $pointerAfterProperty = null; + if ($nullableTypeHint) { + $pointerAfterProperty = TokenHelper::findNextEffective($phpcsFile, $propertyPointer + 1); + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($propertyStartPointer, sprintf(' %s', $propertyTypeHint)); + + if ( + $pointerAfterProperty !== null + && in_array($tokens[$pointerAfterProperty]['code'], [T_SEMICOLON, T_COMMA], true) + ) { + $phpcsFile->fixer->addContent($propertyPointer, ' = null'); + } + + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param Annotation|null $propertyAnnotation + * @param list> $prefixedPropertyAnnotations + */ + private function checkTraversableTypeHintSpecification( + File $phpcsFile, + int $propertyPointer, + ?TypeHint $propertyTypeHint, + ?Annotation $propertyAnnotation, + array $prefixedPropertyAnnotations + ): void + { + $suppressName = $this->getSniffName(self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION); + $isSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $propertyPointer, $suppressName); + + $hasTraversableTypeHint = $this->hasTraversableTypeHint($phpcsFile, $propertyPointer, $propertyTypeHint, $propertyAnnotation); + $hasAnnotation = $this->hasAnnotation($propertyAnnotation); + + if (!$hasAnnotation) { + if ($hasTraversableTypeHint) { + if (count($prefixedPropertyAnnotations) !== 0) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressed, $suppressName); + return; + } + + if (!$isSuppressed) { + $phpcsFile->addError( + sprintf( + '@var annotation of property %s does not specify type hint for its items.', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer) + ), + $propertyPointer, + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + } + + return; + } + + $typeNode = $propertyAnnotation->getValue()->type; + + if ( + !$hasTraversableTypeHint + && !AnnotationTypeHelper::containsTraversableType($typeNode, $phpcsFile, $propertyPointer, $this->getTraversableTypeHints()) + ) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressed, $suppressName); + return; + } + + if (AnnotationTypeHelper::containsItemsSpecificationForTraversable( + $typeNode, + $phpcsFile, + $propertyPointer, + $this->getTraversableTypeHints() + )) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressed, $suppressName); + return; + } + + if ($isSuppressed) { + return; + } + + $phpcsFile->addError( + sprintf( + '@var annotation of property %s does not specify type hint for its items.', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer) + ), + $propertyAnnotation->getStartPointer(), + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + + private function checkUselessAnnotation( + File $phpcsFile, + int $propertyPointer, + ?TypeHint $propertyTypeHint, + ?Annotation $propertyAnnotation + ): void + { + if ($propertyAnnotation === null) { + return; + } + + $suppressName = self::getSniffName(self::CODE_USELESS_ANNOTATION); + $isSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $propertyPointer, $suppressName); + + if (!AnnotationHelper::isAnnotationUseless( + $phpcsFile, + $propertyPointer, + $propertyTypeHint, + $propertyAnnotation, + $this->getTraversableTypeHints(), + $this->enableUnionTypeHint, + $this->enableIntersectionTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + $this->reportUselessSuppress($phpcsFile, $propertyPointer, $isSuppressed, $suppressName); + return; + } + + if ($isSuppressed) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + 'Property %s has useless @var annotation.', + PropertyHelper::getFullyQualifiedName($phpcsFile, $propertyPointer) + ), + $propertyAnnotation->getStartPointer(), + self::CODE_USELESS_ANNOTATION + ); + + if (!$fix) { + return; + } + + if ($this->isDocCommentUseless($phpcsFile, $propertyPointer)) { + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $propertyPointer); + $docCommentClosePointer = $phpcsFile->getTokens()[$docCommentOpenPointer]['comment_closer']; + + $changeStart = $docCommentOpenPointer; + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNextEffective($phpcsFile, $docCommentClosePointer + 1) - 1; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + $phpcsFile->fixer->endChangeset(); + + return; + } + + /** @var int $changeStart */ + $changeStart = TokenHelper::findPrevious($phpcsFile, T_DOC_COMMENT_STAR, $propertyAnnotation->getStartPointer() - 1); + + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], + $propertyAnnotation->getEndPointer() + 1 + ) - 1; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + $phpcsFile->fixer->endChangeset(); + } + + private function isDocCommentUseless(File $phpcsFile, int $propertyPointer): bool + { + if (DocCommentHelper::hasDocCommentDescription($phpcsFile, $propertyPointer)) { + return false; + } + + foreach (AnnotationHelper::getAnnotations($phpcsFile, $propertyPointer) as $annotation) { + if ($annotation->getName() !== '@var') { + return false; + } + } + + return true; + } + + private function reportUselessSuppress(File $phpcsFile, int $pointer, bool $isSuppressed, string $suppressName): void + { + if (!$isSuppressed) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Useless %s %s', SuppressHelper::ANNOTATION, $suppressName), + $pointer, + self::CODE_USELESS_SUPPRESS + ); + + if ($fix) { + SuppressHelper::removeSuppressAnnotation($phpcsFile, $pointer, $suppressName); + } + } + + private function getSniffName(string $sniffName): string + { + return sprintf('%s.%s', self::NAME, $sniffName); + } + + /** + * @return list + */ + private function getTraversableTypeHints(): array + { + if ($this->normalizedTraversableTypeHints === null) { + $this->normalizedTraversableTypeHints = array_map(static function (string $typeHint): string { + return NamespaceHelper::isFullyQualifiedName($typeHint) + ? $typeHint + : sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $typeHint); + }, SniffSettingsHelper::normalizeArray($this->traversableTypeHints)); + } + return $this->normalizedTraversableTypeHints; + } + + private function hasAnnotation(?Annotation $propertyAnnotation): bool + { + return $propertyAnnotation !== null && $propertyAnnotation->getValue() instanceof VarTagValueNode; + } + + /** + * @param Annotation|null $propertyAnnotation + */ + private function hasTraversableTypeHint( + File $phpcsFile, + int $propertyPointer, + ?TypeHint $propertyTypeHint, + ?Annotation $propertyAnnotation + ): bool + { + if ( + $propertyTypeHint !== null + && TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint( + $phpcsFile, + $propertyPointer, + $propertyTypeHint->getTypeHintWithoutNullabilitySymbol() + ), + $this->getTraversableTypeHints() + ) + ) { + return true; + } + + return + $this->hasAnnotation($propertyAnnotation) + && AnnotationTypeHelper::containsTraversableType( + $propertyAnnotation->getValue()->type, + $phpcsFile, + $propertyPointer, + $this->getTraversableTypeHints() + ); + } + + /** + * @return list> + */ + private function getValidPrefixedAnnotations(File $phpcsFile, int $docCommentOpenPointer): array + { + $varAnnotations = []; + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $docCommentOpenPointer); + + foreach (AnnotationHelper::STATIC_ANALYSIS_PREFIXES as $prefix) { + foreach ($annotations as $annotation) { + if ($annotation->isInvalid()) { + continue; + } + + if ($annotation->getName() === sprintf('@%s-var', $prefix)) { + $varAnnotations[] = $annotation; + } + } + } + + return $varAnnotations; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php new file mode 100644 index 0000000..594dc77 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php @@ -0,0 +1,732 @@ + */ + public $traversableTypeHints = []; + + /** @var array|null */ + private $normalizedTraversableTypeHints; + + /** + * @return array + */ + public function register(): array + { + return [ + T_FUNCTION, + T_CLOSURE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->enableObjectTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableObjectTypeHint, 70200); + $this->enableStaticTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableStaticTypeHint, 80000); + $this->enableMixedTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableMixedTypeHint, 80000); + $this->enableUnionTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableUnionTypeHint, 80000); + $this->enableIntersectionTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableIntersectionTypeHint, 80100); + $this->enableNeverTypeHint = SniffSettingsHelper::isEnabledByPhpVersion($this->enableNeverTypeHint, 80100); + $this->enableStandaloneNullTrueFalseTypeHints = SniffSettingsHelper::isEnabledByPhpVersion( + $this->enableStandaloneNullTrueFalseTypeHints, + 80200 + ); + + if (SuppressHelper::isSniffSuppressed($phpcsFile, $pointer, self::NAME)) { + return; + } + + if (DocCommentHelper::hasInheritdocAnnotation($phpcsFile, $pointer)) { + return; + } + + $token = $phpcsFile->getTokens()[$pointer]; + + if ($token['code'] === T_FUNCTION) { + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $pointer); + $returnAnnotation = FunctionHelper::findReturnAnnotation($phpcsFile, $pointer); + $prefixedReturnAnnotations = FunctionHelper::getValidPrefixedReturnAnnotations($phpcsFile, $pointer); + + $this->checkFunctionTypeHint($phpcsFile, $pointer, $returnTypeHint, $returnAnnotation, $prefixedReturnAnnotations); + $this->checkFunctionTraversableTypeHintSpecification( + $phpcsFile, + $pointer, + $returnTypeHint, + $returnAnnotation, + $prefixedReturnAnnotations + ); + $this->checkFunctionUselessAnnotation($phpcsFile, $pointer, $returnTypeHint, $returnAnnotation); + } elseif ($token['code'] === T_CLOSURE) { + $this->checkClosureTypeHint($phpcsFile, $pointer); + } + } + + /** + * @param list $prefixedReturnAnnotations + */ + private function checkFunctionTypeHint( + File $phpcsFile, + int $functionPointer, + ?TypeHint $returnTypeHint, + ?Annotation $returnAnnotation, + array $prefixedReturnAnnotations + ): void + { + $suppressNameAnyTypeHint = $this->getSniffName(self::CODE_MISSING_ANY_TYPE_HINT); + $isSuppressedAnyTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressNameAnyTypeHint); + + $suppressNameNativeTypeHint = $this->getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT); + $isSuppressedNativeTypeHint = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressNameNativeTypeHint); + + $hasReturnAnnotation = $this->hasReturnAnnotation($returnAnnotation); + $returnTypeNode = $this->getReturnTypeNode($returnAnnotation); + $isAnnotationReturnTypeNever = $returnTypeNode instanceof IdentifierTypeNode + && TypeHintHelper::isNeverTypeHint(strtolower($returnTypeNode->name)); + + if ($returnTypeHint !== null) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedAnyTypeHint, $suppressNameAnyTypeHint); + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + + if ($this->enableNeverTypeHint && $returnTypeHint->getTypeHint() === 'void' && $isAnnotationReturnTypeNever) { + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() has return type hint "void" but it should be possible to add "never" based on @return annotation "%s".', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + AnnotationTypeHelper::print($returnTypeNode) + ), + $functionPointer, + self::CODE_LESS_SPECIFIC_NATIVE_TYPE_HINT + ); + + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($returnTypeHint->getStartPointer(), 'never'); + $phpcsFile->fixer->endChangeset(); + } + } + + return; + } + + $methodsWithoutVoidSupport = ['__construct' => true, '__destruct' => true, '__clone' => true]; + + if (array_key_exists(FunctionHelper::getName($phpcsFile, $functionPointer), $methodsWithoutVoidSupport)) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedAnyTypeHint, $suppressNameAnyTypeHint); + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + $isAnnotationReturnTypeVoidOrNever = $returnTypeNode instanceof IdentifierTypeNode + && ( + TypeHintHelper::isVoidTypeHint(strtolower($returnTypeNode->name)) + || $isAnnotationReturnTypeNever + ); + + $isAbstract = FunctionHelper::isAbstract($phpcsFile, $functionPointer); + $returnsValue = $isAbstract + ? ($hasReturnAnnotation && !$isAnnotationReturnTypeVoidOrNever) + : FunctionHelper::returnsValue($phpcsFile, $functionPointer); + + if ($returnsValue && !$hasReturnAnnotation) { + if (count($prefixedReturnAnnotations) !== 0) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedAnyTypeHint, $suppressNameAnyTypeHint); + return; + } + + if (!$isSuppressedAnyTypeHint) { + $phpcsFile->addError( + sprintf( + '%s %s() does not have return type hint nor @return annotation for its return value.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ), + $functionPointer, + self::CODE_MISSING_ANY_TYPE_HINT + ); + } + + return; + } + + if ( + !$returnsValue + && ( + !$hasReturnAnnotation + || $isAnnotationReturnTypeVoidOrNever + ) + ) { + if (!$isSuppressedNativeTypeHint) { + $message = !$hasReturnAnnotation + ? sprintf( + '%s %s() does not have void return type hint.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ) + : sprintf( + '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + AnnotationTypeHelper::print($returnTypeNode) + ); + + $fix = $phpcsFile->addFixableError($message, $functionPointer, self::getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT)); + + if ($fix) { + $fixedReturnType = $this->enableNeverTypeHint && $isAnnotationReturnTypeNever + ? 'never' + : 'void'; + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent( + $phpcsFile->getTokens()[$functionPointer]['parenthesis_closer'], + sprintf(': %s', $fixedReturnType) + ); + $phpcsFile->fixer->endChangeset(); + } + } + + return; + } + + if (!$isSuppressedNativeTypeHint && $returnsValue && $isAnnotationReturnTypeVoidOrNever) { + $message = sprintf( + '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + AnnotationTypeHelper::print($returnTypeNode) + ); + + $phpcsFile->addError($message, $functionPointer, self::getSniffName(self::CODE_MISSING_NATIVE_TYPE_HINT)); + return; + } + + $canTryUnionTypeHint = $this->enableUnionTypeHint && $returnTypeNode instanceof UnionTypeNode; + + $typeHints = []; + $traversableTypeHints = []; + $nullableReturnTypeHint = false; + + $originalReturnTypeNode = $returnTypeNode; + if ($returnTypeNode instanceof NullableTypeNode) { + $returnTypeNode = $returnTypeNode->type; + } + + if (AnnotationTypeHelper::containsOneType($returnTypeNode)) { + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $returnTypeNode */ + $returnTypeNode = $returnTypeNode; + $typeHints[] = AnnotationTypeHelper::getTypeHintFromOneType( + $returnTypeNode, + false, + $this->enableStandaloneNullTrueFalseTypeHints + ); + + } elseif ($returnTypeNode instanceof UnionTypeNode || $returnTypeNode instanceof IntersectionTypeNode) { + $traversableTypeHints = []; + foreach ($returnTypeNode->types as $typeNode) { + if (!AnnotationTypeHelper::containsOneType($typeNode)) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + /** @var ArrayTypeNode|ArrayShapeNode|ObjectShapeNode|IdentifierTypeNode|ThisTypeNode|GenericTypeNode|CallableTypeNode $typeNode */ + $typeNode = $typeNode; + + $typeHint = AnnotationTypeHelper::getTypeHintFromOneType($typeNode, $canTryUnionTypeHint); + + if (strtolower($typeHint) === 'null') { + $nullableReturnTypeHint = true; + continue; + } + + $isTraversable = TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint($phpcsFile, $functionPointer, $typeHint), + $this->getTraversableTypeHints() + ); + + if ( + !$typeNode instanceof ArrayTypeNode + && !$typeNode instanceof ArrayShapeNode + && $isTraversable + ) { + $traversableTypeHints[] = $typeHint; + } + + $typeHints[] = $typeHint; + } + + $traversableTypeHints = array_values(array_unique($traversableTypeHints)); + if (count($traversableTypeHints) > 1 && !$canTryUnionTypeHint) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + } + + $typeHints = array_values(array_unique($typeHints)); + + if (count($traversableTypeHints) > 0) { + /** @var UnionTypeNode|IntersectionTypeNode $returnTypeNode */ + $returnTypeNode = $returnTypeNode; + + $itemsSpecificationTypeHint = AnnotationTypeHelper::getItemsSpecificationTypeFromType($returnTypeNode); + if ($itemsSpecificationTypeHint !== null) { + $typeHints = AnnotationTypeHelper::getTraversableTypeHintsFromType( + $returnTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints(), + $canTryUnionTypeHint + ); + } + } + + if (count($typeHints) === 0) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + $typeHintsWithConvertedUnion = []; + foreach ($typeHints as $typeHint) { + if ($this->enableUnionTypeHint && TypeHintHelper::isUnofficialUnionTypeHint($typeHint)) { + $canTryUnionTypeHint = true; + $typeHintsWithConvertedUnion = array_merge( + $typeHintsWithConvertedUnion, + TypeHintHelper::convertUnofficialUnionTypeHintToOfficialTypeHints($typeHint) + ); + } else { + $typeHintsWithConvertedUnion[] = $typeHint; + } + } + $typeHintsWithConvertedUnion = array_unique($typeHintsWithConvertedUnion); + + if ( + count($typeHintsWithConvertedUnion) > 1 + && ( + ($returnTypeNode instanceof UnionTypeNode && !$canTryUnionTypeHint) + || ($returnTypeNode instanceof IntersectionTypeNode && !$this->enableIntersectionTypeHint) + ) + ) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + foreach ($typeHintsWithConvertedUnion as $typeHintNo => $typeHint) { + if ($canTryUnionTypeHint && $typeHint === 'false') { + continue; + } + + if (!TypeHintHelper::isValidTypeHint( + $typeHint, + $this->enableObjectTypeHint, + $this->enableStaticTypeHint, + $this->enableMixedTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + if (TypeHintHelper::isTypeDefinedInAnnotation($phpcsFile, $functionPointer, $typeHint)) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressedNativeTypeHint, $suppressNameNativeTypeHint); + return; + } + + $typeHintsWithConvertedUnion[$typeHintNo] = TypeHintHelper::isVoidTypeHint($typeHint) + ? 'null' + : TypeHintHelper::convertLongSimpleTypeHintToShort($typeHint); + } + + if ($originalReturnTypeNode instanceof NullableTypeNode) { + $nullableReturnTypeHint = true; + } + + if ($isSuppressedNativeTypeHint) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() does not have native return type hint for its return value but it should be possible to add it based on @return annotation "%s".', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer), + AnnotationTypeHelper::print($returnTypeNode) + ), + $functionPointer, + self::CODE_MISSING_NATIVE_TYPE_HINT + ); + if (!$fix) { + return; + } + + if (in_array('mixed', $typeHintsWithConvertedUnion, true)) { + $returnTypeHint = 'mixed'; + } elseif ($originalReturnTypeNode instanceof IntersectionTypeNode) { + $returnTypeHint = implode('&', $typeHintsWithConvertedUnion); + } else { + $returnTypeHint = implode('|', $typeHintsWithConvertedUnion); + if ($nullableReturnTypeHint) { + if (count($typeHintsWithConvertedUnion) > 1) { + $returnTypeHint .= '|null'; + } else { + $returnTypeHint = '?' . $returnTypeHint; + } + } + } + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent( + $phpcsFile->getTokens()[$functionPointer]['parenthesis_closer'], + sprintf(': %s', $returnTypeHint) + ); + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param list $prefixedReturnAnnotations + */ + private function checkFunctionTraversableTypeHintSpecification( + File $phpcsFile, + int $functionPointer, + ?TypeHint $returnTypeHint, + ?Annotation $returnAnnotation, + array $prefixedReturnAnnotations + ): void + { + $suppressName = $this->getSniffName(self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION); + $isSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressName); + + $hasTraversableTypeHint = $this->hasTraversableTypeHint($phpcsFile, $functionPointer, $returnTypeHint, $returnAnnotation); + $hasReturnAnnotation = $this->hasReturnAnnotation($returnAnnotation); + + if (!$hasReturnAnnotation) { + if ($hasTraversableTypeHint) { + if (count($prefixedReturnAnnotations) !== 0) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressed, $suppressName); + return; + } + + if (!$isSuppressed) { + $phpcsFile->addError( + sprintf( + '%s %s() does not have @return annotation for its traversable return value.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ), + $functionPointer, + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + } + + return; + } + + $returnTypeNode = $this->getReturnTypeNode($returnAnnotation); + + if ( + !$hasTraversableTypeHint + && !AnnotationTypeHelper::containsTraversableType( + $returnTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + ) + ) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressed, $suppressName); + return; + } + + if (AnnotationTypeHelper::containsItemsSpecificationForTraversable( + $returnTypeNode, + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + )) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressed, $suppressName); + return; + } + + if ($isSuppressed) { + return; + } + + /** @var Annotation $returnAnnotation */ + $returnAnnotation = $returnAnnotation; + + $phpcsFile->addError( + sprintf( + '@return annotation of %s %s() does not specify type hint for items of its traversable return value.', + lcfirst(FunctionHelper::getTypeLabel($phpcsFile, $functionPointer)), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ), + $returnAnnotation->getStartPointer(), + self::CODE_MISSING_TRAVERSABLE_TYPE_HINT_SPECIFICATION + ); + } + + private function checkFunctionUselessAnnotation( + File $phpcsFile, + int $functionPointer, + ?TypeHint $returnTypeHint, + ?Annotation $returnAnnotation + ): void + { + if ($returnAnnotation === null) { + return; + } + + $suppressName = self::getSniffName(self::CODE_USELESS_ANNOTATION); + $isSuppressed = SuppressHelper::isSniffSuppressed($phpcsFile, $functionPointer, $suppressName); + + if (!AnnotationHelper::isAnnotationUseless( + $phpcsFile, + $functionPointer, + $returnTypeHint, + $returnAnnotation, + $this->getTraversableTypeHints(), + $this->enableUnionTypeHint, + $this->enableIntersectionTypeHint, + $this->enableStandaloneNullTrueFalseTypeHints + )) { + $this->reportUselessSuppress($phpcsFile, $functionPointer, $isSuppressed, $suppressName); + return; + } + + if ($isSuppressed) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf( + '%s %s() has useless @return annotation.', + FunctionHelper::getTypeLabel($phpcsFile, $functionPointer), + FunctionHelper::getFullyQualifiedName($phpcsFile, $functionPointer) + ), + $returnAnnotation->getStartPointer(), + self::CODE_USELESS_ANNOTATION + ); + + if (!$fix) { + return; + } + + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $functionPointer); + $starPointer = TokenHelper::findPrevious( + $phpcsFile, + T_DOC_COMMENT_STAR, + $returnAnnotation->getStartPointer() - 1, + $docCommentOpenPointer + ); + + $changeStart = $starPointer ?? $returnAnnotation->getStartPointer(); + + /** @var int $changeEnd */ + $changeEnd = TokenHelper::findNext( + $phpcsFile, + [T_DOC_COMMENT_CLOSE_TAG, T_DOC_COMMENT_STAR], + $returnAnnotation->getEndPointer() + 1 + ) - 1; + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $changeStart, $changeEnd); + $phpcsFile->fixer->endChangeset(); + } + + private function checkClosureTypeHint(File $phpcsFile, int $closurePointer): void + { + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $closurePointer); + $returnsValue = FunctionHelper::returnsValue($phpcsFile, $closurePointer); + + if ($returnsValue || $returnTypeHint !== null) { + return; + } + + $fix = $phpcsFile->addFixableError( + 'Closure does not have void return type hint.', + $closurePointer, + self::CODE_MISSING_NATIVE_TYPE_HINT + ); + + if (!$fix) { + return; + } + + $tokens = $phpcsFile->getTokens(); + /** @var int $position */ + $position = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$closurePointer]['scope_opener'] - 1, $closurePointer); + + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($position, ': void'); + $phpcsFile->fixer->endChangeset(); + } + + /** + * @param Annotation|null $returnAnnotation + */ + private function getReturnTypeNode(?Annotation $returnAnnotation): ?TypeNode + { + if ($this->hasReturnAnnotation($returnAnnotation)) { + return $returnAnnotation->getValue()->type; + } + + return null; + } + + private function hasTraversableTypeHint( + File $phpcsFile, + int $functionPointer, + ?TypeHint $returnTypeHint, + ?Annotation $returnAnnotation + ): bool + { + if ( + $returnTypeHint !== null + && TypeHintHelper::isTraversableType( + TypeHintHelper::getFullyQualifiedTypeHint( + $phpcsFile, + $functionPointer, + $returnTypeHint->getTypeHintWithoutNullabilitySymbol() + ), + $this->getTraversableTypeHints() + ) + ) { + return true; + } + + return + $this->hasReturnAnnotation($returnAnnotation) + && AnnotationTypeHelper::containsTraversableType( + $this->getReturnTypeNode($returnAnnotation), + $phpcsFile, + $functionPointer, + $this->getTraversableTypeHints() + ); + } + + private function hasReturnAnnotation(?Annotation $returnAnnotation): bool + { + return $returnAnnotation !== null && !$returnAnnotation->isInvalid(); + } + + private function reportUselessSuppress(File $phpcsFile, int $pointer, bool $isSuppressed, string $suppressName): void + { + if (!$isSuppressed) { + return; + } + + $fix = $phpcsFile->addFixableError( + sprintf('Useless %s %s', SuppressHelper::ANNOTATION, $suppressName), + $pointer, + self::CODE_USELESS_SUPPRESS + ); + + if ($fix) { + SuppressHelper::removeSuppressAnnotation($phpcsFile, $pointer, $suppressName); + } + } + + private function getSniffName(string $sniffName): string + { + return sprintf('%s.%s', self::NAME, $sniffName); + } + + /** + * @return array + */ + private function getTraversableTypeHints(): array + { + if ($this->normalizedTraversableTypeHints === null) { + $this->normalizedTraversableTypeHints = array_map(static function (string $typeHint): string { + return NamespaceHelper::isFullyQualifiedName($typeHint) + ? $typeHint + : sprintf('%s%s', NamespaceHelper::NAMESPACE_SEPARATOR, $typeHint); + }, SniffSettingsHelper::normalizeArray($this->traversableTypeHints)); + } + return $this->normalizedTraversableTypeHints; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php new file mode 100644 index 0000000..a2dda34 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php @@ -0,0 +1,172 @@ + + */ + public function register(): array + { + return TokenHelper::$functionTokenCodes; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $functionPointer + */ + public function process(File $phpcsFile, $functionPointer): void + { + $this->spacesCountBeforeColon = SniffSettingsHelper::normalizeInteger($this->spacesCountBeforeColon); + + $typeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $functionPointer); + + if ($typeHint === null) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $typeHintStartPointer = $typeHint->getStartPointer(); + + /** @var int $colonPointer */ + $colonPointer = TokenHelper::findPreviousEffective($phpcsFile, $typeHintStartPointer - 1); + + if ($tokens[$typeHintStartPointer]['code'] !== T_NULLABLE) { + if ($tokens[$colonPointer + 1]['code'] !== T_WHITESPACE) { + $fix = $phpcsFile->addFixableError( + 'There must be exactly one space between return type hint colon and return type hint.', + $typeHintStartPointer, + self::CODE_NO_SPACE_BETWEEN_COLON_AND_TYPE_HINT + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($colonPointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$colonPointer + 1]['content'] !== ' ') { + $fix = $phpcsFile->addFixableError( + 'There must be exactly one space between return type hint colon and return type hint.', + $typeHintStartPointer, + self::CODE_MULTIPLE_SPACES_BETWEEN_COLON_AND_TYPE_HINT + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($colonPointer + 1, ' '); + $phpcsFile->fixer->endChangeset(); + } + } + } else { + if ($tokens[$colonPointer + 1]['code'] !== T_WHITESPACE) { + $fix = $phpcsFile->addFixableError( + 'There must be exactly one space between return type hint colon and return type hint nullability symbol.', + $typeHintStartPointer, + self::CODE_NO_SPACE_BETWEEN_COLON_AND_NULLABILITY_SYMBOL + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($colonPointer, ' '); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$colonPointer + 1]['content'] !== ' ') { + $fix = $phpcsFile->addFixableError( + 'There must be exactly one space between return type hint colon and return type hint nullability symbol.', + $typeHintStartPointer, + self::CODE_MULTIPLE_SPACES_BETWEEN_COLON_AND_NULLABILITY_SYMBOL + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($colonPointer + 1, ' '); + $phpcsFile->fixer->endChangeset(); + } + } + + if ($tokens[$typeHintStartPointer + 1]['code'] === T_WHITESPACE) { + $fix = $phpcsFile->addFixableError( + 'There must be no whitespace between return type hint nullability symbol and return type hint.', + $typeHintStartPointer, + self::CODE_WHITESPACE_AFTER_NULLABILITY_SYMBOL + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($typeHintStartPointer + 1, ''); + $phpcsFile->fixer->endChangeset(); + } + } + } + + $expectedSpaces = str_repeat(' ', $this->spacesCountBeforeColon); + + if ( + $tokens[$colonPointer - 1]['code'] !== T_CLOSE_PARENTHESIS + && $tokens[$colonPointer - 1]['content'] !== $expectedSpaces + ) { + $fix = $this->spacesCountBeforeColon === 0 + ? $phpcsFile->addFixableError( + 'There must be no whitespace between closing parenthesis and return type colon.', + $typeHintStartPointer, + self::CODE_WHITESPACE_BEFORE_COLON + ) + : $phpcsFile->addFixableError( + sprintf( + 'There must be exactly %d whitespace%s between closing parenthesis and return type colon.', + $this->spacesCountBeforeColon, + $this->spacesCountBeforeColon !== 1 ? 's' : '' + ), + $typeHintStartPointer, + self::CODE_INCORRECT_SPACES_BEFORE_COLON + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->replaceToken($colonPointer - 1, $expectedSpaces); + $phpcsFile->fixer->endChangeset(); + } + } elseif ($tokens[$colonPointer - 1]['code'] === T_CLOSE_PARENTHESIS && $this->spacesCountBeforeColon !== 0) { + $fix = $phpcsFile->addFixableError( + sprintf( + 'There must be exactly %d whitespace%s between closing parenthesis and return type colon.', + $this->spacesCountBeforeColon, + $this->spacesCountBeforeColon !== 1 ? 's' : '' + ), + $typeHintStartPointer, + self::CODE_INCORRECT_SPACES_BEFORE_COLON + ); + if ($fix) { + $phpcsFile->fixer->beginChangeset(); + $phpcsFile->fixer->addContent($colonPointer - 1, $expectedSpaces); + $phpcsFile->fixer->endChangeset(); + } + } + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php new file mode 100644 index 0000000..2e18948 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UnionTypeHintFormatSniff.php @@ -0,0 +1,248 @@ + + */ + public function register(): array + { + return array_merge( + [T_VARIABLE], + TokenHelper::$functionTokenCodes + ); + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $this->enable = SniffSettingsHelper::isEnabledByPhpVersion($this->enable, 80000); + + if (!$this->enable) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$pointer]['code'] === T_VARIABLE) { + if (!PropertyHelper::isProperty($phpcsFile, $pointer)) { + return; + } + + $propertyTypeHint = PropertyHelper::findTypeHint($phpcsFile, $pointer); + if ($propertyTypeHint !== null) { + $this->checkTypeHint($phpcsFile, $propertyTypeHint); + } + + return; + } + + $returnTypeHint = FunctionHelper::findReturnTypeHint($phpcsFile, $pointer); + if ($returnTypeHint !== null) { + $this->checkTypeHint($phpcsFile, $returnTypeHint); + } + + foreach (FunctionHelper::getParametersTypeHints($phpcsFile, $pointer) as $parameterTypeHint) { + if ($parameterTypeHint !== null) { + $this->checkTypeHint($phpcsFile, $parameterTypeHint); + } + } + } + + private function checkTypeHint(File $phpcsFile, TypeHint $typeHint): void + { + $tokens = $phpcsFile->getTokens(); + + $typeHintsCount = substr_count($typeHint->getTypeHint(), '|') + 1; + + if ($typeHintsCount > 1) { + if ($this->withSpaces === self::NO) { + $whitespacePointer = TokenHelper::findNext( + $phpcsFile, + T_WHITESPACE, + $typeHint->getStartPointer() + 1, + $typeHint->getEndPointer() + ); + if ($whitespacePointer !== null) { + $originalTypeHint = TokenHelper::getContent($phpcsFile, $typeHint->getStartPointer(), $typeHint->getEndPointer()); + $fix = $phpcsFile->addFixableError( + sprintf('Spaces in type hint "%s" are disallowed.', $originalTypeHint), + $typeHint->getStartPointer(), + self::CODE_DISALLOWED_WHITESPACE + ); + if ($fix) { + $this->fixTypeHint($phpcsFile, $typeHint, $typeHint->getTypeHint()); + } + } + } elseif ($this->withSpaces === self::YES) { + $error = false; + foreach (TokenHelper::findNextAll( + $phpcsFile, + [T_TYPE_UNION], + $typeHint->getStartPointer(), + $typeHint->getEndPointer() + ) as $unionSeparator) { + if ($tokens[$unionSeparator - 1]['content'] !== ' ') { + $error = true; + break; + } + if ($tokens[$unionSeparator + 1]['content'] !== ' ') { + $error = true; + break; + } + } + + if ($error) { + $originalTypeHint = TokenHelper::getContent($phpcsFile, $typeHint->getStartPointer(), $typeHint->getEndPointer()); + $fix = $phpcsFile->addFixableError( + sprintf('One space required before and after each "|" in type hint "%s".', $originalTypeHint), + $typeHint->getStartPointer(), + self::CODE_REQUIRED_WHITESPACE + ); + if ($fix) { + $fixedTypeHint = implode(' | ', explode('|', $typeHint->getTypeHint())); + $this->fixTypeHint($phpcsFile, $typeHint, $fixedTypeHint); + } + } + } + } + + if (!$typeHint->isNullable()) { + return; + } + + $hasShortNullable = strpos($typeHint->getTypeHint(), '?') === 0; + + if ($this->shortNullable === self::YES && $typeHintsCount === 2 && !$hasShortNullable) { + $fix = $phpcsFile->addFixableError( + sprintf('Short nullable type hint in "%s" is required.', $typeHint->getTypeHint()), + $typeHint->getStartPointer(), + self::CODE_REQUIRED_SHORT_NULLABLE + ); + if ($fix) { + $typeHintWithoutNull = self::getTypeHintContentWithoutNull($phpcsFile, $typeHint); + $this->fixTypeHint($phpcsFile, $typeHint, '?' . $typeHintWithoutNull); + } + } elseif ($this->shortNullable === self::NO && $hasShortNullable) { + $fix = $phpcsFile->addFixableError( + sprintf('Usage of short nullable type hint in "%s" is disallowed.', $typeHint->getTypeHint()), + $typeHint->getStartPointer(), + self::CODE_DISALLOWED_SHORT_NULLABLE + ); + if ($fix) { + $this->fixTypeHint($phpcsFile, $typeHint, substr($typeHint->getTypeHint(), 1) . '|null'); + } + } + + if ($hasShortNullable || ($this->shortNullable === self::YES && $typeHintsCount === 2)) { + return; + } + + if ($this->nullPosition === self::FIRST && strtolower($tokens[$typeHint->getStartPointer()]['content']) !== 'null') { + $fix = $phpcsFile->addFixableError( + sprintf('Null type hint should be on first position in "%s".', $typeHint->getTypeHint()), + $typeHint->getStartPointer(), + self::CODE_NULL_TYPE_HINT_NOT_ON_FIRST_POSITION + ); + if ($fix) { + $this->fixTypeHint($phpcsFile, $typeHint, 'null|' . self::getTypeHintContentWithoutNull($phpcsFile, $typeHint)); + } + } elseif ($this->nullPosition === self::LAST && strtolower($tokens[$typeHint->getEndPointer()]['content']) !== 'null') { + $fix = $phpcsFile->addFixableError( + sprintf('Null type hint should be on last position in "%s".', $typeHint->getTypeHint()), + $typeHint->getStartPointer(), + self::CODE_NULL_TYPE_HINT_NOT_ON_LAST_POSITION + ); + if ($fix) { + $this->fixTypeHint($phpcsFile, $typeHint, self::getTypeHintContentWithoutNull($phpcsFile, $typeHint) . '|null'); + } + } + } + + private function getTypeHintContentWithoutNull(File $phpcsFile, TypeHint $typeHint): string + { + $tokens = $phpcsFile->getTokens(); + + if (strtolower($tokens[$typeHint->getEndPointer()]['content']) === 'null') { + $previousTypeHintPointer = TokenHelper::findPrevious( + $phpcsFile, + TokenHelper::getOnlyTypeHintTokenCodes(), + $typeHint->getEndPointer() - 1 + ); + return TokenHelper::getContent($phpcsFile, $typeHint->getStartPointer(), $previousTypeHintPointer); + } + + $content = ''; + + for ($i = $typeHint->getStartPointer(); $i <= $typeHint->getEndPointer(); $i++) { + if (strtolower($tokens[$i]['content']) === 'null') { + $i = TokenHelper::findNext($phpcsFile, TokenHelper::getOnlyTypeHintTokenCodes(), $i + 1); + } + + $content .= $tokens[$i]['content']; + } + + return $content; + } + + private function fixTypeHint(File $phpcsFile, TypeHint $typeHint, string $fixedTypeHint): void + { + $phpcsFile->fixer->beginChangeset(); + + FixerHelper::change($phpcsFile, $typeHint->getStartPointer(), $typeHint->getEndPointer(), $fixedTypeHint); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php new file mode 100644 index 0000000..b061adc --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/UselessConstantTypeHintSniff.php @@ -0,0 +1,85 @@ + + */ + public function register(): array + { + return [ + T_CONST, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $constantPointer + */ + public function process(File $phpcsFile, $constantPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $docCommentOpenPointer = DocCommentHelper::findDocCommentOpenPointer($phpcsFile, $constantPointer); + if ($docCommentOpenPointer === null) { + return; + } + + $annotations = AnnotationHelper::getAnnotations($phpcsFile, $constantPointer, '@var'); + + if ($annotations === []) { + return; + } + + $uselessDocComment = !DocCommentHelper::hasDocCommentDescription($phpcsFile, $constantPointer) && count($annotations) === 1; + if ($uselessDocComment) { + $fix = $phpcsFile->addFixableError('Useless documentation comment.', $docCommentOpenPointer, self::CODE_USELESS_DOC_COMMENT); + + /** @var int $fixerStart */ + $fixerStart = TokenHelper::findLastTokenOnPreviousLine($phpcsFile, $docCommentOpenPointer); + $fixerEnd = $tokens[$docCommentOpenPointer]['comment_closer']; + } else { + $annotation = $annotations[0]; + + $fix = $phpcsFile->addFixableError( + 'Useless @var annotation.', + $annotation->getStartPointer(), + self::CODE_USELESS_VAR_ANNOTATION + ); + + /** @var int $fixerStart */ + $fixerStart = TokenHelper::findPreviousContent( + $phpcsFile, + T_DOC_COMMENT_WHITESPACE, + $phpcsFile->eolChar, + $annotation->getStartPointer() - 1 + ); + $fixerEnd = $annotation->getEndPointer(); + } + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + FixerHelper::removeBetweenIncluding($phpcsFile, $fixerStart, $fixerEnd); + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowSuperGlobalVariableSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowSuperGlobalVariableSniff.php new file mode 100644 index 0000000..716f749 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowSuperGlobalVariableSniff.php @@ -0,0 +1,52 @@ + + */ + public function register(): array + { + return [ + T_VARIABLE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $variablePointer + */ + public function process(File $phpcsFile, $variablePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if (!in_array($tokens[$variablePointer]['content'], self::SUPER_GLOBALS, true)) { + return; + } + + $phpcsFile->addError('Use of super global variable is disallowed.', $variablePointer, self::CODE_DISALLOWED_SUPER_GLOBAL_VARIABLE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php new file mode 100644 index 0000000..ecd92b5 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DisallowVariableVariableSniff.php @@ -0,0 +1,35 @@ + + */ + public function register(): array + { + return [ + T_DOLLAR, + T_DOLLAR_OPEN_CURLY_BRACES, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $pointer + */ + public function process(File $phpcsFile, $pointer): void + { + $phpcsFile->addError('Use of variable variable is disallowed.', $pointer, self::CODE_DISALLOWED_VARIABLE_VARIABLE); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DuplicateAssignmentToVariableSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DuplicateAssignmentToVariableSniff.php new file mode 100644 index 0000000..2e73d89 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/DuplicateAssignmentToVariableSniff.php @@ -0,0 +1,70 @@ + + */ + public function register(): array + { + return [ + T_EQUAL, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $assignmentPointer + */ + public function process(File $phpcsFile, $assignmentPointer): void + { + $tokens = $phpcsFile->getTokens(); + + $variablePointer = TokenHelper::findPreviousEffective($phpcsFile, $assignmentPointer - 1); + if ($tokens[$variablePointer]['code'] !== T_VARIABLE) { + return; + } + + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + if (in_array($tokens[$pointerBeforeVariable]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + return; + } + + /** @var int $secondVariablePointer */ + $secondVariablePointer = TokenHelper::findNextEffective($phpcsFile, $assignmentPointer + 1); + if ($tokens[$secondVariablePointer]['code'] !== T_VARIABLE) { + return; + } + + if ($tokens[$variablePointer]['content'] !== $tokens[$secondVariablePointer]['content']) { + return; + } + + $pointerAfterSecondVariable = TokenHelper::findNextEffective($phpcsFile, $secondVariablePointer + 1); + if ($tokens[$pointerAfterSecondVariable]['code'] !== T_EQUAL) { + return; + } + + $phpcsFile->addError( + sprintf('Duplicate assignment to variable %s.', $tokens[$secondVariablePointer]['content']), + $secondVariablePointer, + self::CODE_DUPLICATE_ASSIGNMENT + ); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php new file mode 100644 index 0000000..20a5daa --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php @@ -0,0 +1,709 @@ + + */ + public function register(): array + { + return [ + T_VARIABLE, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $variablePointer + */ + public function process(File $phpcsFile, $variablePointer): void + { + if (!$this->isAssignment($phpcsFile, $variablePointer)) { + return; + } + + $tokens = $phpcsFile->getTokens(); + + $variableName = $tokens[$variablePointer]['content']; + + if (in_array($variableName, [ + '$this', + '$GLOBALS', + '$_SERVER', + '$_GET', + '$_POST', + '$_FILES', + '$_COOKIE', + '$_SESSION', + '$_REQUEST', + '$_ENV', + ], true)) { + return; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + + if (in_array($tokens[$previousPointer]['code'], [T_OBJECT_OPERATOR, T_DOUBLE_COLON], true)) { + // Property + return; + } + + if (in_array($tokens[$previousPointer]['code'], Tokens::$castTokens, true)) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + if (in_array($tokens[$previousPointer]['code'], [ + T_EQUAL, + T_PLUS_EQUAL, + T_MINUS_EQUAL, + T_MUL_EQUAL, + T_DIV_EQUAL, + T_POW_EQUAL, + T_MOD_EQUAL, + T_AND_EQUAL, + T_OR_EQUAL, + T_XOR_EQUAL, + T_SL_EQUAL, + T_SR_EQUAL, + T_CONCAT_EQUAL, + T_YIELD, + ], true)) { + return; + } + + if ($this->isUsedAsParameter($phpcsFile, $variablePointer)) { + return; + } + + if ($this->isUsedInForLoopCondition($phpcsFile, $variablePointer, $variableName)) { + return; + } + + if ($this->isDefinedInDoConditionAndUsedInLoop($phpcsFile, $variablePointer, $variableName)) { + return; + } + + if ($this->isUsedInLoopCycle($phpcsFile, $variablePointer, $variableName)) { + return; + } + + if ($this->isUsedAsKeyOrValueInArray($phpcsFile, $variablePointer)) { + return; + } + + if ($this->isValueInForeachAndErrorIsIgnored($phpcsFile, $variablePointer)) { + return; + } + + $scopeOwnerPointer = ScopeHelper::getRootPointer($phpcsFile, $variablePointer - 1); + foreach (array_reverse($tokens[$variablePointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (in_array($conditionTokenCode, TokenHelper::$functionTokenCodes, true)) { + $scopeOwnerPointer = $conditionPointer; + break; + } + } + + if (in_array($tokens[$scopeOwnerPointer]['code'], TokenHelper::$functionTokenCodes, true)) { + if ($this->isStaticOrGlobalVariable($phpcsFile, $scopeOwnerPointer, $variableName)) { + return; + } + + if ($this->isParameterPassedByReference($phpcsFile, $scopeOwnerPointer, $variableName)) { + return; + } + + if ( + $tokens[$scopeOwnerPointer]['code'] === T_CLOSURE + && $this->isInheritedVariablePassedByReference($phpcsFile, $scopeOwnerPointer, $variableName) + ) { + return; + } + } + + if ($this->isReference($phpcsFile, $scopeOwnerPointer, $variablePointer)) { + return; + } + + if (VariableHelper::isUsedInScopeAfterPointer($phpcsFile, $scopeOwnerPointer, $variablePointer, $variablePointer + 1)) { + return; + } + + if ($this->isPartOfStatementAndWithIncrementOrDecrementOperator($phpcsFile, $variablePointer)) { + return; + } + + $phpcsFile->addError( + sprintf('Unused variable %s.', $variableName), + $variablePointer, + self::CODE_UNUSED_VARIABLE + ); + } + + private function isAssignment(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $variablePointer + 1); + if (in_array($tokens[$nextPointer]['code'], [ + T_EQUAL, + T_PLUS_EQUAL, + T_MINUS_EQUAL, + T_MUL_EQUAL, + T_DIV_EQUAL, + T_POW_EQUAL, + T_MOD_EQUAL, + T_AND_EQUAL, + T_OR_EQUAL, + T_XOR_EQUAL, + T_SL_EQUAL, + T_SR_EQUAL, + T_CONCAT_EQUAL, + ], true)) { + if ($tokens[$nextPointer]['code'] === T_EQUAL) { + if (PropertyHelper::isProperty($phpcsFile, $variablePointer)) { + return false; + } + + if (ParameterHelper::isParameter($phpcsFile, $variablePointer)) { + return false; + } + } + + return true; + } + + $actualPointer = $variablePointer; + do { + $parenthesisOpenerPointer = $this->findOpenerOfNestedParentheses($phpcsFile, $actualPointer); + $parenthesisOwnerPointer = $this->findOwnerOfNestedParentheses($phpcsFile, $actualPointer); + + $actualPointer = $parenthesisOpenerPointer; + } while ($parenthesisOwnerPointer === null && isset($tokens[$actualPointer]['nested_parenthesis'])); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + + if ( + in_array($tokens[$nextPointer]['code'], [T_INC, T_DEC], true) + || in_array($tokens[$previousPointer]['code'], [T_INC, T_DEC], true) + ) { + if ($parenthesisOwnerPointer === null) { + return true; + } + + return !in_array($tokens[$parenthesisOwnerPointer]['code'], [T_FOR, T_WHILE, T_IF, T_ELSEIF], true); + } + + if ($parenthesisOwnerPointer !== null && $tokens[$parenthesisOwnerPointer]['code'] === T_FOREACH) { + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + return in_array($tokens[$pointerBeforeVariable]['code'], [T_AS, T_DOUBLE_ARROW], true); + } + + if ($parenthesisOpenerPointer !== null) { + $pointerBeforeParenthesisOpener = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1); + if ($tokens[$pointerBeforeParenthesisOpener]['code'] === T_LIST) { + return true; + } + } + + $possibleShortListCloserPointer = TokenHelper::findNextExcluding( + $phpcsFile, + array_merge(TokenHelper::$ineffectiveTokenCodes, [T_VARIABLE, T_COMMA]), + $variablePointer + 1 + ); + if ($tokens[$possibleShortListCloserPointer]['code'] === T_CLOSE_SHORT_ARRAY) { + return $tokens[TokenHelper::findNextEffective($phpcsFile, $possibleShortListCloserPointer + 1)]['code'] === T_EQUAL; + } + + return false; + } + + private function isUsedAsParameter(File $phpcsFile, int $variablePointer): bool + { + $parenthesisOpenerPointer = $this->findOpenerOfNestedParentheses($phpcsFile, $variablePointer); + if ($parenthesisOpenerPointer === null) { + return false; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $parenthesisOpenerPointer, $variablePointer)) { + return false; + } + + return $phpcsFile->getTokens()[TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpenerPointer - 1)]['code'] === T_STRING; + } + + private function isUsedInForLoopCondition(File $phpcsFile, int $variablePointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $this->findOpenerOfNestedParentheses($phpcsFile, $variablePointer); + if ($parenthesisOpenerPointer === null) { + return false; + } + + $parenthesisOwnerPointer = $this->findOwnerOfNestedParentheses($phpcsFile, $variablePointer); + if ($parenthesisOwnerPointer === null) { + return false; + } + + if ($tokens[$parenthesisOwnerPointer]['code'] !== T_FOR) { + return false; + } + + for ($i = $parenthesisOpenerPointer + 1; $i < $tokens[$parenthesisOwnerPointer]['parenthesis_closer']; $i++) { + if ($i === $variablePointer) { + continue; + } + + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + return true; + } + + return false; + } + + private function isDefinedInDoConditionAndUsedInLoop(File $phpcsFile, int $variablePointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpener = TokenHelper::findPrevious($phpcsFile, T_OPEN_PARENTHESIS, $variablePointer - 1); + if ($parenthesisOpener === null || $tokens[$parenthesisOpener]['parenthesis_closer'] < $variablePointer) { + return false; + } + + $whilePointer = TokenHelper::findPreviousEffective($phpcsFile, $parenthesisOpener - 1); + if ($tokens[$whilePointer]['code'] !== T_WHILE) { + return false; + } + + $loopCloserPointer = TokenHelper::findPreviousEffective($phpcsFile, $whilePointer - 1); + if ($tokens[$loopCloserPointer]['code'] !== T_CLOSE_CURLY_BRACKET) { + return false; + } + + $doPointer = TokenHelper::findPreviousEffective($phpcsFile, $tokens[$loopCloserPointer]['bracket_opener'] - 1); + if ($tokens[$doPointer]['code'] !== T_DO) { + return false; + } + + return TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$loopCloserPointer]['bracket_opener'] + 1, + $loopCloserPointer + ) !== null; + } + + private function isUsedInLoopCycle(File $phpcsFile, int $variablePointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + $loopPointer = null; + foreach (array_reverse($tokens[$variablePointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (in_array($conditionTokenCode, TokenHelper::$functionTokenCodes, true)) { + break; + } + + if (!in_array($conditionTokenCode, [T_FOREACH, T_FOR, T_DO, T_WHILE], true)) { + continue; + } + + $loopPointer = $conditionPointer; + + $loopConditionPointer = $conditionTokenCode === T_DO + ? TokenHelper::findNextEffective($phpcsFile, $tokens[$loopPointer]['scope_closer'] + 1) + : $loopPointer; + + $variableUsedInLoopConditionPointer = TokenHelper::findNextContent( + $phpcsFile, + T_VARIABLE, + $variableName, + $tokens[$loopConditionPointer]['parenthesis_opener'] + 1, + $tokens[$loopConditionPointer]['parenthesis_closer'] + ); + if ( + $variableUsedInLoopConditionPointer === null + || $variableUsedInLoopConditionPointer === $variablePointer + ) { + continue; + } + + if ($conditionTokenCode !== T_FOREACH) { + return true; + } + + $pointerBeforeVariableUsedInLoopCondition = TokenHelper::findPreviousEffective( + $phpcsFile, + $variableUsedInLoopConditionPointer - 1 + ); + if ($tokens[$pointerBeforeVariableUsedInLoopCondition]['code'] === T_BITWISE_AND) { + return true; + } + } + + if ($loopPointer === null) { + return false; + } + + for ($i = $tokens[$loopPointer]['scope_opener'] + 1; $i < $tokens[$loopPointer]['scope_closer']; $i++) { + if ( + in_array($tokens[$i]['code'], [T_DOUBLE_QUOTED_STRING, T_HEREDOC], true) + && VariableHelper::isUsedInScopeInString($phpcsFile, $variableName, $i) + ) { + return true; + } + + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + if (!$this->isAssignment($phpcsFile, $i)) { + return true; + } + + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if (!in_array($tokens[$nextPointer]['code'], [ + T_INC, + T_DEC, + T_PLUS_EQUAL, + T_MINUS_EQUAL, + T_MUL_EQUAL, + T_DIV_EQUAL, + T_POW_EQUAL, + T_MOD_EQUAL, + T_AND_EQUAL, + T_OR_EQUAL, + T_XOR_EQUAL, + T_SL_EQUAL, + T_SR_EQUAL, + T_CONCAT_EQUAL, + ], true)) { + continue; + } + + $parenthesisOwnerPointer = $this->findNestedParenthesisWithOwner($phpcsFile, $i); + if ( + $parenthesisOwnerPointer !== null + && in_array($tokens[$parenthesisOwnerPointer]['code'], [T_IF, T_ELSEIF], true) + ) { + return true; + } + } + + return false; + } + + private function isUsedAsKeyOrValueInArray(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $squareBracketOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_SQUARE_BRACKET, $variablePointer - 1); + if ( + $squareBracketOpenerPointer !== null + && $tokens[$squareBracketOpenerPointer]['bracket_closer'] > $variablePointer + ) { + return true; + } + + $arrayOpenerPointer = TokenHelper::findPrevious($phpcsFile, T_OPEN_SHORT_ARRAY, $variablePointer - 1); + if ($arrayOpenerPointer === null) { + return false; + } + + $arrayCloserPointer = $tokens[$arrayOpenerPointer]['bracket_closer']; + if ($arrayCloserPointer < $variablePointer) { + return false; + } + + $pointerAfterArrayCloser = TokenHelper::findNextEffective($phpcsFile, $arrayCloserPointer + 1); + if ($tokens[$pointerAfterArrayCloser]['code'] === T_EQUAL) { + return false; + } + + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + + if (in_array($tokens[$pointerBeforeVariable]['code'], [T_INC, T_DEC], true)) { + $pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $pointerBeforeVariable - 1); + } + + return in_array($tokens[$pointerBeforeVariable]['code'], [T_OPEN_SHORT_ARRAY, T_COMMA, T_DOUBLE_ARROW], true); + } + + private function isValueInForeachAndErrorIsIgnored(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOwnerPointer = $this->findNestedParenthesisWithOwner($phpcsFile, $variablePointer); + $isInForeach = $parenthesisOwnerPointer !== null && $tokens[$parenthesisOwnerPointer]['code'] === T_FOREACH; + + if (!$isInForeach) { + return false; + } + + $pointerAfterVariable = TokenHelper::findNextEffective($phpcsFile, $variablePointer + 1); + if ($pointerAfterVariable !== null && $tokens[$pointerAfterVariable]['code'] === T_DOUBLE_ARROW) { + return false; + } + + return $this->ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach; + } + + private function isStaticOrGlobalVariable(File $phpcsFile, int $functionPointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $tokens[$functionPointer]['scope_opener'] + 1; $i < $tokens[$functionPointer]['scope_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + $pointerBeforeParameter = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if (in_array($tokens[$pointerBeforeParameter]['code'], [T_STATIC, T_GLOBAL], true)) { + return true; + } + } + + return false; + } + + private function isParameterPassedByReference(File $phpcsFile, int $functionPointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + $pointerBeforeParameter = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if ($tokens[$pointerBeforeParameter]['code'] === T_BITWISE_AND) { + return true; + } + } + + return false; + } + + private function isInheritedVariablePassedByReference(File $phpcsFile, int $functionPointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + $usePointer = TokenHelper::findNextEffective($phpcsFile, $tokens[$functionPointer]['parenthesis_closer'] + 1); + if ($tokens[$usePointer]['code'] !== T_USE) { + return false; + } + + $useParenthesisOpener = TokenHelper::findNextEffective($phpcsFile, $usePointer + 1); + for ($i = $useParenthesisOpener + 1; $i < $tokens[$useParenthesisOpener]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + $pointerBeforeInheritedVariable = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if ($tokens[$pointerBeforeInheritedVariable]['code'] === T_BITWISE_AND) { + return true; + } + } + + return false; + } + + private function isReference(File $phpcsFile, int $scopeOwnerPointer, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $scopeOpenerPointer = $tokens[$scopeOwnerPointer]['code'] === T_OPEN_TAG + ? $scopeOwnerPointer + : $tokens[$scopeOwnerPointer]['scope_opener']; + + for ($i = $scopeOpenerPointer + 1; $i < $variablePointer; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $tokens[$variablePointer]['content']) { + continue; + } + + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $i + 1); + if ($tokens[$assignmentPointer]['code'] !== T_EQUAL) { + continue; + } + + $referencePointer = TokenHelper::findNextEffective($phpcsFile, $assignmentPointer + 1); + if ($tokens[$referencePointer]['code'] === T_BITWISE_AND) { + return true; + } + } + + return false; + } + + private function isPartOfStatementAndWithIncrementOrDecrementOperator(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $variablePointer - 1); + $nextPointer = TokenHelper::findNextEffective($phpcsFile, $variablePointer + 1); + + if (in_array($tokens[$previousPointer]['code'], [T_DEC, T_INC], true)) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } elseif ($nextPointer !== null && in_array($tokens[$nextPointer]['code'], [T_DEC, T_INC], true)) { + // Nothing + } else { + return false; + } + + if ($tokens[$previousPointer]['code'] === T_OPEN_PARENTHESIS) { + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $previousPointer - 1); + } + + return in_array( + $tokens[$previousPointer]['code'], + array_merge( + [T_STRING_CONCAT, T_ECHO, T_RETURN, T_EXIT, T_PRINT, T_COMMA, T_EMPTY, T_EVAL, T_YIELD], + Tokens::$operators, + Tokens::$assignmentTokens, + Tokens::$booleanOperators, + Tokens::$castTokens + ), + true + ); + } + + private function findNestedParenthesisWithOwner(File $phpcsFile, int $pointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('nested_parenthesis', $tokens[$pointer])) { + return null; + } + + foreach (array_reverse(array_keys($tokens[$pointer]['nested_parenthesis'])) as $nestedParenthesisOpener) { + if (array_key_exists('parenthesis_owner', $tokens[$nestedParenthesisOpener])) { + return $tokens[$nestedParenthesisOpener]['parenthesis_owner']; + } + } + + return null; + } + + private function findOpenerOfNestedParentheses(File $phpcsFile, int $pointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + if (!array_key_exists('nested_parenthesis', $tokens[$pointer])) { + return null; + } + + return array_reverse(array_keys($tokens[$pointer]['nested_parenthesis']))[0]; + } + + private function findOwnerOfNestedParentheses(File $phpcsFile, int $pointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = $this->findOpenerOfNestedParentheses($phpcsFile, $pointer); + + if ($parenthesisOpenerPointer === null) { + return null; + } + + return array_key_exists('parenthesis_owner', $tokens[$parenthesisOpenerPointer]) + ? $tokens[$parenthesisOpenerPointer]['parenthesis_owner'] + : null; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php new file mode 100644 index 0000000..38cce83 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UselessVariableSniff.php @@ -0,0 +1,417 @@ + + */ + public function register(): array + { + return [ + T_RETURN, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $returnPointer + */ + public function process(File $phpcsFile, $returnPointer): void + { + $tokens = $phpcsFile->getTokens(); + + /** @var int $variablePointer */ + $variablePointer = TokenHelper::findNextEffective($phpcsFile, $returnPointer + 1); + if ($tokens[$variablePointer]['code'] !== T_VARIABLE) { + return; + } + + $returnSemicolonPointer = TokenHelper::findNextEffective($phpcsFile, $variablePointer + 1); + if ($tokens[$returnSemicolonPointer]['code'] !== T_SEMICOLON) { + return; + } + + $variableName = $tokens[$variablePointer]['content']; + + $functionPointer = $this->findFunctionPointer($phpcsFile, $variablePointer); + + if ($functionPointer !== null) { + if ($this->isReturnedByReference($phpcsFile, $functionPointer)) { + return; + } + + if ($this->isStaticVariable($phpcsFile, $functionPointer, $variablePointer, $variableName)) { + return; + } + + if ($this->isFunctionParameter($phpcsFile, $functionPointer, $variableName)) { + return; + } + } + + $previousVariablePointer = $this->findPreviousVariablePointer($phpcsFile, $returnPointer, $variableName); + if ($previousVariablePointer === null) { + return; + } + + if (!$this->isAssignmentToVariable($phpcsFile, $previousVariablePointer)) { + return; + } + + if ($this->isAssignedInControlStructure($phpcsFile, $previousVariablePointer)) { + return; + } + + if ($this->isAssignedInFunctionCall($phpcsFile, $previousVariablePointer)) { + return; + } + + if ($this->hasVariableVarAnnotation($phpcsFile, $previousVariablePointer)) { + return; + } + + if ($this->hasAnotherAssignmentBefore($phpcsFile, $previousVariablePointer, $variableName)) { + return; + } + + if (!$this->areBothPointersNearby($phpcsFile, $previousVariablePointer, $returnPointer)) { + return; + } + + $errorParameters = [ + sprintf('Useless variable %s.', $variableName), + $previousVariablePointer, + self::CODE_USELESS_VARIABLE, + ]; + + $pointerBeforePreviousVariable = TokenHelper::findPreviousEffective($phpcsFile, $previousVariablePointer - 1); + + if ( + !in_array($tokens[$pointerBeforePreviousVariable]['code'], [T_SEMICOLON, T_OPEN_CURLY_BRACKET, T_CLOSE_CURLY_BRACKET], true) + && TokenHelper::findNextEffective($phpcsFile, $returnSemicolonPointer + 1) !== null + ) { + $phpcsFile->addError(...$errorParameters); + return; + } + + $fix = $phpcsFile->addFixableError(...$errorParameters); + + if (!$fix) { + return; + } + + /** @var int $assignmentPointer */ + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $previousVariablePointer + 1); + + $assignmentFixerMapping = [ + T_PLUS_EQUAL => '+', + T_MINUS_EQUAL => '-', + T_MUL_EQUAL => '*', + T_DIV_EQUAL => '/', + T_POW_EQUAL => '**', + T_MOD_EQUAL => '%', + T_AND_EQUAL => '&', + T_OR_EQUAL => '|', + T_XOR_EQUAL => '^', + T_SL_EQUAL => '<<', + T_SR_EQUAL => '>>', + T_CONCAT_EQUAL => '.', + ]; + + $previousVariableSemicolonPointer = $this->findSemicolon($phpcsFile, $previousVariablePointer); + + $phpcsFile->fixer->beginChangeset(); + + if ($tokens[$assignmentPointer]['code'] === T_EQUAL) { + FixerHelper::change($phpcsFile, $previousVariablePointer, $assignmentPointer, 'return'); + } else { + $phpcsFile->fixer->addContentBefore($previousVariablePointer, 'return '); + $phpcsFile->fixer->replaceToken($assignmentPointer, $assignmentFixerMapping[$tokens[$assignmentPointer]['code']]); + } + + FixerHelper::removeBetweenIncluding($phpcsFile, $previousVariableSemicolonPointer + 1, $returnSemicolonPointer); + + $phpcsFile->fixer->endChangeset(); + } + + private function findPreviousVariablePointer(File $phpcsFile, int $pointer, string $variableName): ?int + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $pointer - 1; $i >= 0; $i--) { + if ( + in_array($tokens[$i]['code'], TokenHelper::$functionTokenCodes, true) + && ScopeHelper::isInSameScope($phpcsFile, $tokens[$i]['scope_opener'] + 1, $pointer) + ) { + return null; + } + + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + $previousPointer = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if ($tokens[$previousPointer]['code'] === T_DOUBLE_COLON) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $i, $pointer)) { + continue; + } + + return $i; + } + + return null; + } + + private function isAssignedInControlStructure(File $phpcsFile, int $pointer): bool + { + $controlStructure = TokenHelper::findPrevious($phpcsFile, [ + T_WHILE, + T_FOR, + T_FOREACH, + T_SWITCH, + T_IF, + T_ELSEIF, + ], $pointer - 1); + + if ($controlStructure === null) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + + return $tokens[$controlStructure]['parenthesis_opener'] < $pointer && $pointer < $tokens[$controlStructure]['parenthesis_closer']; + } + + private function isAssignedInFunctionCall(File $phpcsFile, int $pointer): bool + { + $possibleFunctionNamePointer = TokenHelper::findPrevious($phpcsFile, T_STRING, $pointer - 1); + + if ($possibleFunctionNamePointer === null) { + return false; + } + + $tokens = $phpcsFile->getTokens(); + + $parenthesisOpenerPointer = TokenHelper::findNextEffective($phpcsFile, $possibleFunctionNamePointer + 1); + if ($tokens[$parenthesisOpenerPointer]['code'] !== T_OPEN_PARENTHESIS) { + return false; + } + + return $parenthesisOpenerPointer < $pointer && $pointer < $tokens[$parenthesisOpenerPointer]['parenthesis_closer']; + } + + private function isAssignmentToVariable(File $phpcsFile, int $pointer): bool + { + $assignmentPointer = TokenHelper::findNextEffective($phpcsFile, $pointer + 1); + return in_array($phpcsFile->getTokens()[$assignmentPointer]['code'], [ + T_EQUAL, + T_PLUS_EQUAL, + T_MINUS_EQUAL, + T_MUL_EQUAL, + T_DIV_EQUAL, + T_POW_EQUAL, + T_MOD_EQUAL, + T_AND_EQUAL, + T_OR_EQUAL, + T_XOR_EQUAL, + T_SL_EQUAL, + T_SR_EQUAL, + T_CONCAT_EQUAL, + ], true); + } + + private function findFunctionPointer(File $phpcsFile, int $pointer): ?int + { + $tokens = $phpcsFile->getTokens(); + + foreach (array_reverse($tokens[$pointer]['conditions'], true) as $conditionPointer => $conditionTokenCode) { + if (in_array($conditionTokenCode, TokenHelper::$functionTokenCodes, true)) { + return $conditionPointer; + } + } + + return null; + } + + private function isStaticVariable(File $phpcsFile, int $functionPointer, int $variablePointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $tokens[$functionPointer]['scope_opener'] + 1; $i < $variablePointer; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + $pointerBeforeParameter = TokenHelper::findPreviousEffective($phpcsFile, $i - 1); + if ($tokens[$pointerBeforeParameter]['code'] === T_STATIC) { + return true; + } + } + + return false; + } + + private function isFunctionParameter(File $phpcsFile, int $functionPointer, string $variableName): bool + { + $tokens = $phpcsFile->getTokens(); + + for ($i = $tokens[$functionPointer]['parenthesis_opener'] + 1; $i < $tokens[$functionPointer]['parenthesis_closer']; $i++) { + if ($tokens[$i]['code'] !== T_VARIABLE) { + continue; + } + if ($tokens[$i]['content'] !== $variableName) { + continue; + } + + return true; + } + + return false; + } + + private function isReturnedByReference(File $phpcsFile, int $functionPointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $referencePointer = TokenHelper::findNextEffective($phpcsFile, $functionPointer + 1); + return $tokens[$referencePointer]['code'] === T_BITWISE_AND; + } + + private function hasVariableVarAnnotation(File $phpcsFile, int $variablePointer): bool + { + $tokens = $phpcsFile->getTokens(); + + $pointerBeforeVariable = TokenHelper::findPreviousNonWhitespace($phpcsFile, $variablePointer - 1); + if ($tokens[$pointerBeforeVariable]['code'] !== T_DOC_COMMENT_CLOSE_TAG) { + return false; + } + + $docCommentContent = TokenHelper::getContent($phpcsFile, $tokens[$pointerBeforeVariable]['comment_opener'], $pointerBeforeVariable); + return preg_match( + '~@(?:(?:phpstan|psalm)-)?var\\s+.+\\s+' . preg_quote($tokens[$variablePointer]['content'], '~') . '(?:\\s|$)~', + $docCommentContent + ) !== 0; + } + + private function hasAnotherAssignmentBefore(File $phpcsFile, int $variablePointer, string $variableName): bool + { + $previousVariablePointer = $this->findPreviousVariablePointer($phpcsFile, $variablePointer, $variableName); + if ($previousVariablePointer === null) { + return false; + } + + if (!$this->isAssignmentToVariable($phpcsFile, $previousVariablePointer)) { + return false; + } + + return $this->areBothVariablesNearby($phpcsFile, $previousVariablePointer, $variablePointer); + } + + private function areBothPointersNearby(File $phpcsFile, int $firstPointer, int $secondPointer): bool + { + $firstVariableSemicolonPointer = $this->findSemicolon($phpcsFile, $firstPointer); + $pointerAfterFirstVariableSemicolon = TokenHelper::findNextEffective($phpcsFile, $firstVariableSemicolonPointer + 1); + + return $pointerAfterFirstVariableSemicolon === $secondPointer; + } + + private function areBothVariablesNearby(File $phpcsFile, int $firstVariablePointer, int $secondVariablePointer): bool + { + if ($this->areBothPointersNearby($phpcsFile, $firstVariablePointer, $secondVariablePointer)) { + return true; + } + + $tokens = $phpcsFile->getTokens(); + + $lastConditionPointer = array_reverse(array_keys($tokens[$firstVariablePointer]['conditions']))[0]; + $lastConditionScopeCloserPointer = $tokens[$lastConditionPointer]['scope_closer']; + if ($tokens[$lastConditionPointer]['code'] === T_DO) { + $lastConditionScopeCloserPointer = TokenHelper::findNext($phpcsFile, T_SEMICOLON, $lastConditionScopeCloserPointer + 1); + } + + return TokenHelper::findNextEffective($phpcsFile, $lastConditionScopeCloserPointer + 1) === $secondVariablePointer; + } + + private function findSemicolon(File $phpcsFile, int $pointer): int + { + $tokens = $phpcsFile->getTokens(); + + $semicolonPointer = null; + for ($i = $pointer + 1; $i < count($tokens) - 1; $i++) { + if ($tokens[$i]['code'] !== T_SEMICOLON) { + continue; + } + + if (!ScopeHelper::isInSameScope($phpcsFile, $pointer, $i)) { + continue; + } + + $semicolonPointer = $i; + break; + } + + /** @var int $semicolonPointer */ + $semicolonPointer = $semicolonPointer; + return $semicolonPointer; + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php new file mode 100644 index 0000000..8dbecc5 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Whitespaces/DuplicateSpacesSniff.php @@ -0,0 +1,175 @@ + + */ + public function register(): array + { + return [ + T_WHITESPACE, + T_DOC_COMMENT_WHITESPACE, + T_DOC_COMMENT_STRING, + ]; + } + + /** + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + * @param int $whitespacePointer + */ + public function process(File $phpcsFile, $whitespacePointer): void + { + $tokens = $phpcsFile->getTokens(); + + if ($tokens[$whitespacePointer]['column'] === 1) { + return; + } + + $content = $tokens[$whitespacePointer]['content']; + + if ($content === $phpcsFile->eolChar) { + return; + } + + if ($tokens[$whitespacePointer]['code'] === T_WHITESPACE) { + if ($this->ignoreSpacesBeforeAssignment) { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $whitespacePointer + 1); + if ( + $pointerAfter !== null + && in_array($tokens[$pointerAfter]['code'], Tokens::$assignmentTokens, true) + ) { + return; + } + } + + if ($this->ignoreSpacesInParameters) { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $whitespacePointer + 1); + if ( + $pointerAfter !== null + && $tokens[$pointerAfter]['code'] === T_VARIABLE + && ParameterHelper::isParameter($phpcsFile, $pointerAfter) + ) { + return; + } + } + + if ($this->ignoreSpacesInMatch) { + $pointerAfter = TokenHelper::findNextNonWhitespace($phpcsFile, $whitespacePointer + 1); + if ( + $pointerAfter !== null + && $tokens[$pointerAfter]['code'] === T_MATCH_ARROW + ) { + return; + } + } + } else { + if ($this->ignoreSpacesInComment) { + return; + } + + if ( + $tokens[$whitespacePointer - 1]['code'] === T_DOC_COMMENT_STAR + && $tokens[$whitespacePointer + 1]['code'] === T_DOC_COMMENT_STRING + ) { + return; + } + + if ($this->ignoreSpacesInAnnotation) { + $pointerBefore = TokenHelper::findPrevious($phpcsFile, [T_DOC_COMMENT_OPEN_TAG, T_DOC_COMMENT_TAG], $whitespacePointer - 1); + if ( + $pointerBefore !== null + && $tokens[$pointerBefore]['code'] === T_DOC_COMMENT_TAG + && $tokens[$whitespacePointer + 1]['code'] !== T_DOC_COMMENT_CLOSE_TAG + ) { + return; + } + } + } + + $matchResult = preg_match_all('~ {2,}~', $content, $matches, PREG_OFFSET_CAPTURE); + if ($matchResult === false || $matchResult === 0) { + return; + } + + $tabWidth = $phpcsFile->config->tabWidth; + + $fix = false; + foreach ($matches[0] as [$match, $offset]) { + $firstPointerOnLine = TokenHelper::findFirstNonWhitespaceOnLine($phpcsFile, $whitespacePointer - 1); + $indentation = IndentationHelper::getIndentation($phpcsFile, $firstPointerOnLine); + $indentationWithoutTabs = str_replace( + IndentationHelper::TAB_INDENT, + $tabWidth === 0 ? IndentationHelper::SPACES_INDENT : str_repeat(' ', $tabWidth), + $indentation + ); + + $position = $tokens[$whitespacePointer]['column'] + $offset - strlen($indentation) + strlen($indentationWithoutTabs); + + $fixable = $phpcsFile->addFixableError( + sprintf('Duplicate spaces at position %d.', $position), + $whitespacePointer, + self::CODE_DUPLICATE_SPACES + ); + + if ($fixable) { + $fix = true; + } + } + + if (!$fix) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + + $phpcsFile->fixer->replaceToken($whitespacePointer, preg_replace('~ {2,}~', ' ', $content)); + + $phpcsFile->fixer->endChangeset(); + } + +} diff --git a/vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml b/vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml new file mode 100644 index 0000000..185a529 --- /dev/null +++ b/vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml @@ -0,0 +1,4 @@ + + + ./../autoload-bootstrap.php + diff --git a/vendor/slevomat/coding-standard/autoload-bootstrap.php b/vendor/slevomat/coding-standard/autoload-bootstrap.php new file mode 100644 index 0000000..0a480f1 --- /dev/null +++ b/vendor/slevomat/coding-standard/autoload-bootstrap.php @@ -0,0 +1,11 @@ + + + + + + + + + + +``` + +#### SlevomatCodingStandard.Attributes.DisallowAttributesJoining 🔧 + +Requires that only one attribute can be placed inside `#[]` (no comma-separated list). In case of more attributes applied, they are split into individual `#[]` blocks. + +#### SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine 🔧 + +Disallows multiple attributes of some target on same line. +This sniff treats multiple attributes declared inside one `#[]` as a single attribute. See `DisallowAttributesJoining` to modify this behavior. + +#### SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment 🔧 + +Requires that attributes are always after documentation comment. + diff --git a/vendor/slevomat/coding-standard/doc/classes.md b/vendor/slevomat/coding-standard/doc/classes.md new file mode 100644 index 0000000..5bbed25 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/classes.md @@ -0,0 +1,284 @@ +## Classes + +#### SlevomatCodingStandard.Classes.BackedEnumTypeSpacing 🔧 + +* Checks number of spaces before `:` and before type. + +Sniff provides the following settings: + +* `spacesCountBeforeColon`: the number of spaces before `:`. +* `spacesCountBeforeType`: the number of spaces before type. + +#### SlevomatCodingStandard.Classes.ClassLength + +Disallows long classes. This sniff provides the following settings: + +* `includeComments`: should comments be included in the count (default value is false). +* `includeWhitespace`: should empty lines be included in the count (default value is false). +* `maxLinesLength`: specifies max allowed function lines length (default value is 250). + +#### SlevomatCodingStandard.Classes.ClassConstantVisibility 🔧 + +In PHP 7.1+ it's possible to declare [visibility of class constants](https://wiki.php.net/rfc/class_const_visibility). In a similar vein to optional declaration of visibility for properties and methods which is actually required in sane coding standards, this sniff also requires declaring visibility for all class constants. + +Sniff provides the following settings: + +* `fixable`: the sniff is not fixable by default because we think it's better to decide about each constant one by one, however you can enable fixability with this option. + +```php +const FOO = 1; // visibility missing! +public const BAR = 2; // correct +``` + +#### SlevomatCodingStandard.Classes.ClassMemberSpacing 🔧 + +Sniff checks lines count between different class members, e.g. between last property and first method. + +Sniff provides the following settings: + +* `linesCountBetweenMembers`: lines count between different class members + +#### SlevomatCodingStandard.Classes.ClassStructure 🔧 + +Checks that class/trait/interface members are in the correct order. + +Sniff provides the following settings: + +* `groups`: order of groups. Use multiple groups in one `` to not differentiate among them. You can use specific groups or shortcuts. + +**List of supported groups**: +uses, +enum cases, +public constants, protected constants, private constants, +public properties, public static properties, protected properties, protected static properties, private properties, private static properties, +constructor, static constructors, destructor, magic methods, +public methods, protected methods, private methods, +public final methods, public static final methods, protected final methods, protected static final methods, +public abstract methods, public static abstract methods, protected abstract methods, protected static abstract methods, +public static methods, protected static methods, private static methods, +private methods + +**List of supported shortcuts**: +constants, properties, static properties, methods, all public methods, all protected methods, all private methods, static methods, final methods, abstract methods + +```xml + + + + + + + + + + + + + + + + + + + + + + +``` + +#### SlevomatCodingStandard.Classes.ConstantSpacing 🔧 + +Checks that there is a certain number of blank lines between constants. + +Sniff provides the following settings: + +* `minLinesCountBeforeWithComment`: minimum number of lines before constant with a documentation comment or attribute +* `maxLinesCountBeforeWithComment`: maximum number of lines before constant with a documentation comment or attribute +* `minLinesCountBeforeWithoutComment`: minimum number of lines before constant without a documentation comment or attribute +* `maxLinesCountBeforeWithoutComment`: maximum number of lines before constant without a documentation comment or attribute + +#### SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion + +Disallows usage of constructor property promotion. + +#### SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants 🔧 + +Disallows late static binding for constants. + +#### SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition 🔧 + +Disallows multi constant definition. + +#### SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition 🔧 + +Disallows multi property definition. + +#### SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition 🔧 + +Disallows multi property definition. + +#### SlevomatCodingStandard.Classes.DisallowStringExpressionPropertyFetch 🔧 + +Disallows string expression property fetch `$object->{'foo'}` when the property name is compatible with identifier access. + +#### SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces 🔧 + +Enforces one configurable number of lines after opening class/interface/trait brace and one empty line before the closing brace. + +Sniff provides the following settings: + +* `linesCountAfterOpeningBrace`: allows to configure the number of lines after opening brace. +* `linesCountBeforeClosingBrace`: allows to configure the number of lines before closing brace. + +#### SlevomatCodingStandard.Classes.EnumCaseSpacing 🔧 + +Checks that there is a certain number of blank lines between enum cases. + +Sniff provides the following settings: + +* `minLinesCountBeforeWithComment`: minimum number of lines before enum case with a documentation comment or attribute +* `maxLinesCountBeforeWithComment`: maximum number of lines before enum case with a documentation comment or attribute +* `minLinesCountBeforeWithoutComment`: minimum number of lines before enum case without a documentation comment or attribute +* `maxLinesCountBeforeWithoutComment`: maximum number of lines before enum case without a documentation comment or attribute + +#### SlevomatCodingStandard.Classes.ForbiddenPublicProperty + +Disallows using public properties. + +This sniff provides the following setting: + +* `checkPromoted`: will check promoted properties too. + +#### SlevomatCodingStandard.Classes.MethodSpacing 🔧 + +Checks that there is a certain number of blank lines between methods. + +Sniff provides the following settings: + +* `minLinesCount`: minimum number of blank lines +* `maxLinesCount`: maximum number of blank lines + +#### SlevomatCodingStandard.Classes.ModernClassNameReference 🔧 + +Reports use of `__CLASS__`, `get_parent_class()`, `get_called_class()`, `get_class()` and `get_class($this)`. +Class names should be referenced via `::class` constant when possible. + +Sniff provides the following settings: + +* `enableOnObjects`: Enable `::class` on all objects. It's on by default if you're on PHP 8.0+ + +#### SlevomatCodingStandard.Classes.ParentCallSpacing 🔧 + +Enforces configurable number of lines around parent method call. + +Sniff provides the following settings: + +* `linesCountBefore`: allows to configure the number of lines before parent call. +* `linesCountBeforeFirst`: allows to configure the number of lines before first parent call. +* `linesCountAfter`: allows to configure the number of lines after parent call. +* `linesCountAfterLast`: allows to configure the number of lines after last parent call. + +#### SlevomatCodingStandard.Classes.PropertyDeclaration 🔧 + +* Checks that there's a single space between a typehint and a property name: `Foo $foo` +* Checks that there's no whitespace between a nullability symbol and a typehint: `?Foo` +* Checks that there's a single space before nullability symbol or a typehint: `private ?Foo` or `private Foo` +* Checks order of modifiers + +Sniff provides the following settings: + +* `modifiersOrder`: allows to configure order of modifiers. +* `checkPromoted`: will check promoted properties too. +* `enableMultipleSpacesBetweenModifiersCheck`: checks multiple spaces between modifiers. + +#### SlevomatCodingStandard.Classes.PropertySpacing 🔧 + +Checks that there is a certain number of blank lines between properties. + +Sniff provides the following settings: + +* `minLinesCountBeforeWithComment`: minimum number of lines before property with a documentation comment or attribute +* `maxLinesCountBeforeWithComment`: maximum number of lines before property with a documentation comment or attribute +* `minLinesCountBeforeWithoutComment`: minimum number of lines before property without a documentation comment or attribute +* `maxLinesCountBeforeWithoutComment`: maximum number of lines before property without a documentation comment or attribute + +#### SlevomatCodingStandard.Classes.RequireAbstractOrFinal 🔧 + +Requires the class to be declared either as abstract or as final. + +#### SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion 🔧 + +Requires use of constructor property promotion. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. + +#### SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature 🔧 + +Enforces method signature to be split to more lines so each parameter is on its own line. + +Sniff provides the following settings: + +* `minLineLength`: specifies min line length to enforce signature to be split. Use 0 value to enforce for all methods, regardless of length. +* `minParametersCount`: specifies min parameters count to enforce signature to be split. + +* `includedMethodPatterns`: allows to configure which methods are included in sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `excludedMethodPatterns`, as it will not work properly. + +* `excludedMethodPatterns`: allows to configure which methods are excluded from sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `includedMethodPatterns`, as it will not work properly. + +#### SlevomatCodingStandard.Classes.RequireSelfReference 🔧 + +Requires `self` for local reference. + +#### SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature 🔧 + +Enforces method signature to be on a single line. + +Sniff provides the following settings: + +* `maxLineLength`: specifies max allowed line length. If signature fit on it, it's enforced. Use 0 value to enforce for all methods, regardless of length. + +* `includedMethodPatterns`: allows to configure which methods are included in sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `excludedMethodPatterns`, as it will not work properly. + +* `excludedMethodPatterns`: allows to configure which methods are excluded from sniff detection. This is an array of regular expressions (PCRE) with delimiters. You should not use this with `includedMethodPatterns`, as it will not work properly. + +#### SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming + +Reports use of superfluous prefix or suffix "Abstract" for abstract classes. + +#### SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming + +Reports use of superfluous prefix or suffix "Interface" for interfaces. + +#### SlevomatCodingStandard.Classes.SuperfluousExceptionNaming + +Reports use of superfluous suffix "Exception" for exceptions. + +#### SlevomatCodingStandard.Classes.SuperfluousErrorNaming + +Reports use of superfluous suffix "Error" for errors. + +#### SlevomatCodingStandard.Classes.SuperfluousTraitNaming + +Reports use of superfluous suffix "Trait" for traits. + +#### SlevomatCodingStandard.Classes.TraitUseDeclaration 🔧 + +Prohibits multiple traits separated by commas in one `use` statement. + +#### SlevomatCodingStandard.Classes.TraitUseSpacing 🔧 + +Enforces configurable number of lines before first `use`, after last `use` and between two `use` statements. + +Sniff provides the following settings: + +* `linesCountBeforeFirstUse`: allows to configure the number of lines before first `use`. +* `linesCountBeforeFirstUseWhenFirstInClass`: allows to configure the number of lines before first `use` when the `use` is the first statement in the class. +* `linesCountBetweenUses`: allows to configure the number of lines between two `use` statements. +* `linesCountAfterLastUse`: allows to configure the number of lines after last `use`. +* `linesCountAfterLastUseWhenLastInClass`: allows to configure the number of lines after last `use` when the `use` is the last statement in the class. + +#### SlevomatCodingStandard.Classes.UselessLateStaticBinding 🔧 + +Reports useless late static binding. diff --git a/vendor/slevomat/coding-standard/doc/commenting.md b/vendor/slevomat/coding-standard/doc/commenting.md new file mode 100644 index 0000000..0c48627 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/commenting.md @@ -0,0 +1,118 @@ +## Commenting + +#### SlevomatCodingStandard.Commenting.AnnotationName 🔧 + +Reports incorrect annotation name. It reports standard annotation names used by phpDocumentor, PHPUnit, PHPStan and Psalm by default. +Unknown annotation names are ignored. + +Sniff provides the following settings: + +* `annotations`: allows to configure which annotations are checked and how. + +#### SlevomatCodingStandard.Commenting.DeprecatedAnnotationDeclaration + +Reports `@deprecated` annotations without description. + +#### SlevomatCodingStandard.Commenting.DisallowCommentAfterCode 🔧 + +Sniff disallows comments after code at the same line. + +#### SlevomatCodingStandard.Commenting.ForbiddenAnnotations 🔧 + +Reports forbidden annotations. No annotations are forbidden by default, the configuration is completely up to the user. It's recommended to forbid obsolete and inappropriate annotations like: + +* `@author`, `@created`, `@version`: we have version control systems. +* `@package`: we have namespaces. +* `@copyright`, `@license`: it's not necessary to repeat licensing information in each file. +* `@throws`: it's not possible to enforce this annotation and the information can become outdated. + +Sniff provides the following settings: + +* `forbiddenAnnotations`: allows to configure which annotations are forbidden to be used. + +#### SlevomatCodingStandard.Commenting.ForbiddenComments 🔧 + +Reports forbidden comments in descriptions. Nothing is forbidden by default, the configuration is completely up to the user. It's recommended to forbid generated or inappropriate messages like: + +* `Constructor.` +* `Created by PhpStorm.` + +Sniff provides the following settings: + +* `forbiddenCommentPatterns`: allows to configure which comments are forbidden to be used. This is an array of regular expressions (PCRE) with delimiters. + +#### SlevomatCodingStandard.Commenting.DocCommentSpacing 🔧 + +Enforces configurable number of lines before first content (description or annotation), after last content (description or annotation), +between description and annotations, between two different annotation types (eg. between `@param` and `@return`). + +Sniff provides the following settings: + +* `linesCountBeforeFirstContent`: allows to configure the number of lines before first content (description or annotation). +* `linesCountBetweenDescriptionAndAnnotations`: allows to configure the number of lines between description and annotations. +* `linesCountBetweenDifferentAnnotationsTypes`: allows to configure the number of lines between two different annotation types. +* `linesCountBetweenAnnotationsGroups`: allows to configure the number of lines between annotation groups. +* `linesCountAfterLastContent`: allows to configure the number of lines after last content (description or annotation). +* `annotationsGroups`: allows to configure order of annotation groups and even order of annotations in every group. Supports prefixes, eg. `@ORM\`. + +```xml + + + + + + + + +``` + +If `annotationsGroups` is set, `linesCountBetweenDifferentAnnotationsTypes` is ignored and `linesCountBetweenAnnotationsGroups` is applied. +If `annotationsGroups` is not set, `linesCountBetweenAnnotationsGroups` is ignored and `linesCountBetweenDifferentAnnotationsTypes` is applied. + +Annotations not in any group are placed to automatically created last group. + +#### SlevomatCodingStandard.Commenting.EmptyComment 🔧 + +Reports empty comments. + +#### SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration 🔧 + +Reports invalid inline phpDocs with `@var`. + +Sniff provides the following settings: + +* `allowDocCommentAboveReturn`: Allows documentation comments without variable name above `return` statement. +* `allowAboveNonAssignment`: Allows documentation comments above non-assignment if the line contains the right variable name. + +#### SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment 🔧 + +Requires property comments with single-line content to be written as one-liners. + +#### SlevomatCodingStandard.Commenting.RequireOneLineDocComment 🔧 + +Sniff requires comments with single-line content to be written as one-liners. + +#### SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment 🔧 + +Sniff requires comments with single-line content to be written as multi-liners. + +#### SlevomatCodingStandard.Commenting.UselessFunctionDocComment 🔧 + +* Checks for useless doc comments. If the native method declaration contains everything and the phpDoc does not add anything useful, it's reported as useless and can optionally be automatically removed with `phpcbf`. +* Some phpDocs might still be useful even if they do not add any typehint information. They can contain textual descriptions of code elements and also some meaningful annotations like `@expectException` or `@dataProvider`. + +Sniff provides the following settings: + +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. + +This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. + +#### SlevomatCodingStandard.Commenting.UselessInheritDocComment 🔧 + +Reports documentation comments containing only `{@inheritDoc}` annotation because inheritance is automatic, and it's not needed to use a special annotation for it. diff --git a/vendor/slevomat/coding-standard/doc/complexity.md b/vendor/slevomat/coding-standard/doc/complexity.md new file mode 100644 index 0000000..f77bfcf --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/complexity.md @@ -0,0 +1,10 @@ +## Complexity + +#### SlevomatCodingStandard.Complexity.Cognitive + +Enforces maximum [cognitive complexity](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) for functions. + +Sniff provides the following setting: + +* `warningThreshold`: defaults to 6 +* `errorThreshold` : defaults to 6 diff --git a/vendor/slevomat/coding-standard/doc/control-structures.md b/vendor/slevomat/coding-standard/doc/control-structures.md new file mode 100644 index 0000000..760aaa5 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/control-structures.md @@ -0,0 +1,258 @@ +## Control structures + +#### SlevomatCodingStandard.ControlStructures.AssignmentInCondition + +Disallows assignments in `if`, `elseif` and `do-while` loop conditions: + +```php +if ($file = findFile($path)) { + +} +``` + +Assignment in `while` loop condition is specifically allowed because it's commonly used. + +This is a great addition to already existing `SlevomatCodingStandard.ControlStructures.DisallowYodaComparison` because it prevents the danger of assigning something by mistake instead of using a comparison operator like `===`. + +Sniff provides the following settings: +* `ignoreAssignmentsInsideFunctionCalls`: ignores assignment inside function calls, like this: + +```php +if (in_array(1, $haystack, $strict = true)) { + +} +``` + +#### SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing 🔧 + +Enforces configurable number of lines around block control structures (if, foreach, ...). + +Sniff provides the following settings: + +* `linesCountBefore`: allows to configure the number of lines before control structure. +* `linesCountBeforeFirst`: allows to configure the number of lines before first control structure. +* `linesCountAfter`: allows to configure the number of lines after control structure. +* `linesCountAfterLast`: allows to configure the number of lines after last control structure. +* `controlStructures`: allows to narrow the list of checked control structures. + +For example, with the following setting, only `if` and `switch` keywords are checked. + +```xml + + + + + + + + +``` + +#### SlevomatCodingStandard.ControlStructures.EarlyExit 🔧 + +Requires use of early exit. + +Sniff provides the following settings: + +* `ignoreStandaloneIfInScope`: ignores `if` that is standalone in scope, like this: + +```php +foreach ($values as $value) { + if ($value) { + doSomething(); + } +} +``` + +* `ignoreOneLineTrailingIf`: ignores `if` that has one line content and is on the last position in scope, like this: + +```php +foreach ($values as $value) { + $value .= 'whatever'; + + if ($value) { + doSomething(); + } +} +``` + +* `ignoreTrailingIfWithOneInstruction`: ignores `if` that has only one instruction and is on the last position in scope, like this: + +```php +foreach ($values as $value) { + $value .= 'whatever'; + + if ($value) { + doSomething(function () { + // Anything + }); + } +} +``` + +#### SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch 🔧 + +Disallows use of `continue` without integer operand in `switch` because it emits a warning in PHP 7.3 and higher. + +#### SlevomatCodingStandard.ControlStructures.DisallowEmpty + +Disallows use of `empty()`. + +#### SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator + +Disallows using `?->` operator. + +#### SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator 🔧 + +Disallows short ternary operator `?:`. + +Sniff provides the following settings: + +* `fixable`: the sniff is fixable by default, however in strict code it makes sense to forbid this weakly typed form of ternary altogether, you can disable fixability with this option. + +#### SlevomatCodingStandard.ControlStructures.DisallowTrailingMultiLineTernaryOperator 🔧 + +Ternary operator has to be reformatted when the operator is not leading the line. + +```php +# wrong +$t = $someCondition ? + $thenThis : + $otherwiseThis; + +# correct +$t = $someCondition + ? $thenThis + : $otherwiseThis; +``` + +#### SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing 🔧 + +Enforces configurable number of lines around jump statements (continue, return, ...). + +Sniff provides the following settings: + +* `allowSingleLineYieldStacking`: whether or not to allow multiple yield/yield from statements in a row without blank lines. +* `linesCountBefore`: allows to configure the number of lines before jump statement. +* `linesCountBeforeFirst`: allows to configure the number of lines before first jump statement. +* `linesCountBeforeWhenFirstInCaseOrDefault`: allows to configure the number of lines before jump statement that is first in `case` or `default` +* `linesCountAfter`: allows to configure the number of lines after jump statement. +* `linesCountAfterLast`: allows to configure the number of lines after last jump statement. +* `linesCountAfterWhenLastInCaseOrDefault`: allows to configure the number of lines after jump statement that is last in `case` or `default` +* `linesCountAfterWhenLastInLastCaseOrDefault`: allows to configure the number of lines after jump statement that is last in last `case` or `default` +* `jumpStatements`: allows to narrow the list of checked jump statements. + +For example, with the following setting, only `continue` and `break` keywords are checked. + +```xml + + + + + + + + +``` + +#### SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses 🔧 + +`LanguageConstructWithParenthesesSniff` checks and fixes language construct used with parentheses. + +#### SlevomatCodingStandard.ControlStructures.NewWithParentheses 🔧 + +Requires `new` with parentheses. + +#### SlevomatCodingStandard.ControlStructures.NewWithoutParentheses 🔧 + +Reports `new` with useless parentheses. + +#### SlevomatCodingStandard.ControlStructures.RequireMultiLineCondition 🔧 + +Enforces conditions of `if`, `elseif`, `while` and `do-while` with one or more boolean operators to be split to more lines +so each condition part is on its own line. + +Sniff provides the following settings: + +* `minLineLength`: specifies minimum line length to enforce condition to be split. Use 0 value to enforce for all conditions, regardless of length. +* `booleanOperatorOnPreviousLine`: boolean operator is placed at the end of previous line when fixing. +* `alwaysSplitAllConditionParts`: require all condition parts to be on its own line - it reports error even if condition is already multi-line but there are some condition parts on the same line. + +#### SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator 🔧 + +Ternary operator has to be reformatted to more lines when the line length exceeds the given limit. + +Sniff provides the following settings: + +* `lineLengthLimit` (defaults to `0`) +* `minExpressionsLength` (defaults to `null`): when the expressions after `?` are shorter than this length, the ternary operator does not have to be reformatted. + +#### SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator 🔧 + +Requires use of null coalesce equal operator when possible. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 7.4 or higher. + +#### SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator 🔧 + +Requires use of null coalesce operator when possible. + +#### SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator 🔧 + +Requires using `?->` operator. + +Sniff provides the following settings: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. + +#### SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition 🔧 + +Enforces conditions of `if`, `elseif`, `while` and `do-while` to be on a single line. + +Sniff provides the following settings: + +* `maxLineLength`: specifies max allowed line length. If condition (and the rest of the line) would fit on it, it's enforced. Use 0 value to enforce for all conditions, regardless of length. +* `alwaysForSimpleConditions`: allows to enforce single line for all simple conditions (i.e no `&&`, `||` or `xor`), regardless of length. + +#### SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator 🔧 + +Requires short ternary operator `?:` when possible. + +#### SlevomatCodingStandard.ControlStructures.RequireTernaryOperator 🔧 + +Requires ternary operator when possible. + +Sniff provides the following settings: + +* `ignoreMultiLine` (defaults to `false`): ignores multi-line statements. + +#### SlevomatCodingStandard.ControlStructures.DisallowYodaComparison 🔧 +#### SlevomatCodingStandard.ControlStructures.RequireYodaComparison 🔧 + +[Yoda conditions](https://en.wikipedia.org/wiki/Yoda_conditions) decrease code comprehensibility and readability by switching operands around comparison operators forcing the reader to read the code in an unnatural way. + +Sniff provides the following settings: + +* `alwaysVariableOnRight` (defaults to `false`): moves variables always to right. + +`DisallowYodaComparison` looks for and fixes such comparisons not only in `if` statements but in the whole code. + +However, if you prefer Yoda conditions, you can use `RequireYodaComparison`. + +#### SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn 🔧 + +Reports useless conditions where both branches return `true` or `false`. + +Sniff provides the following settings: + +* `assumeAllConditionExpressionsAreAlreadyBoolean` (defaults to `false`). + +#### SlevomatCodingStandard.ControlStructures.UselessTernaryOperator 🔧 + +Reports useless ternary operator where both branches return `true` or `false`. + +Sniff provides the following settings: + +* `assumeAllConditionExpressionsAreAlreadyBoolean` (defaults to `false`). diff --git a/vendor/slevomat/coding-standard/doc/exceptions.md b/vendor/slevomat/coding-standard/doc/exceptions.md new file mode 100644 index 0000000..bc675f2 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/exceptions.md @@ -0,0 +1,31 @@ +## Exceptions + +#### SlevomatCodingStandard.Exceptions.DeadCatch + +This sniff finds unreachable catch blocks: + +```php +try { + doStuff(); +} catch (\Throwable $e) { + log($e); +} catch (\InvalidArgumentException $e) { + // unreachable! +} +``` + +#### SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch + +This sniff forbids use of non-capturing catch introduced in PHP 8.0 [PHP RFC: non-capturing catches](https://wiki.php.net/rfc/non-capturing_catches). + +#### SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly 🔧🚧 + +In PHP 7.0, a [`Throwable` interface was added](https://wiki.php.net/rfc/throwable-interface) that allows catching and handling errors in more cases than `Exception` previously allowed. So, if the catch statement contained `Exception` on PHP 5.x, it means it should probably be rewritten to reference `Throwable` on PHP 7.x. This sniff enforces that. + +#### SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch 🔧 + +Sniff provides the following settings: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. + +It requires non-capturing catch when the variable with exception is not used. diff --git a/vendor/slevomat/coding-standard/doc/files.md b/vendor/slevomat/coding-standard/doc/files.md new file mode 100644 index 0000000..096c65b --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/files.md @@ -0,0 +1,59 @@ +## Files + +#### SlevomatCodingStandard.Files.FileLength + +Disallows long files. This sniff provides the following settings: + +* `includeComments`: should comments be included in the count (default value is false). +* `includeWhitespace`: should empty lines be included in the count (default value is false). +* `maxLinesLength`: specifies max allowed function lines length (default value is 250). + +#### SlevomatCodingStandard.Files.LineLength + +Enforces maximum length of a single line of code. + +Sniff provides the following settings: + +* `lineLengthLimit`: actual limit of the line length +* `ignoreComments`: whether to ignore line length of comments +* `ignoreImports`: whether to ignore line length of import (use) statements + +#### SlevomatCodingStandard.Files.TypeNameMatchesFileName + +For projects not following the [PSR-0](http://www.php-fig.org/psr/psr-0/) or [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading standards, this sniff checks whether a namespace and a name of a class/interface/trait follows agreed-on way to organize code into directories and files. + +Other than enforcing that the type name must match the name of the file it's contained in, this sniff is very configurable. Consider the following sample configuration: + +```xml + + + + + + + + + + + + + + + + + + + + + + + + +``` + +Sniff provides the following settings: + +* `rootNamespaces` property expects configuration similar to PSR-4 - project directories mapped to certain namespaces. +* `skipDirs` are not taken into consideration when comparing a path to a namespace. For example, with the above settings, file at path `app/services/Product/Product.php` is expected to contain `Slevomat\Product\Product`, not `Slevomat\services\Product\Product`. +* `extensions`: allow different file extensions. Default is `php`. +* `ignoredNamespaces`: sniff is not performed on these namespaces. diff --git a/vendor/slevomat/coding-standard/doc/functions.md b/vendor/slevomat/coding-standard/doc/functions.md new file mode 100644 index 0000000..2766552 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/functions.md @@ -0,0 +1,136 @@ +## Functions + +#### SlevomatCodingStandard.Functions.ArrowFunctionDeclaration 🔧 + +Checks `fn` declaration. + +Sniff provides the following settings: + +* `spacesCountAfterKeyword`: the number of spaces after `fn`. +* `spacesCountBeforeArrow`: the number of spaces before `=>`. +* `spacesCountAfterArrow`: the number of spaces after `=>`. +* `allowMultiLine`: allows multi-line declaration. + +#### SlevomatCodingStandard.Functions.DisallowArrowFunction + +Disallows arrow functions. + +#### SlevomatCodingStandard.Functions.DisallowEmptyFunction + +Reports empty functions body and requires at least a comment inside. + +#### SlevomatCodingStandard.Functions.FunctionLength + +Disallows long functions. This sniff provides the following setting: + +* `includeComments`: should comments be included in the count (default value is false). +* `includeWhitespace`: should empty lines be included in the count (default value is false). +* `maxLinesLength`: specifies max allowed function lines length (default value is 20). + +#### SlevomatCodingStandard.Functions.RequireArrowFunction 🔧 + +Requires arrow functions. + +Sniff provides the following settings: + +* `allowNested` (defaults to `true`) +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 7.4 or higher. + +#### SlevomatCodingStandard.Functions.RequireMultiLineCall 🔧 + +Enforces function call to be split to more lines so each parameter is on its own line. + +Sniff provides the following settings: + +* `minLineLength`: specifies min line length to enforce call to be split. Use 0 value to enforce for all calls, regardless of length. + +#### SlevomatCodingStandard.Functions.RequireSingleLineCall 🔧 + +Enforces function call to be on a single line. + +Sniff provides the following settings: + +* `maxLineLength`: specifies max allowed line length. If call would fit on it, it's enforced. Use 0 value to enforce for all calls, regardless of length. +* `ignoreWithComplexParameter` (defaults to `true`): ignores calls with arrays, closures, arrow functions and nested calls. + +#### SlevomatCodingStandard.Functions.DisallowNamedArguments + +This sniff disallows usage of named arguments. + +#### SlevomatCodingStandard.Functions.NamedArgumentSpacing 🔧 + +Checks spacing in named argument. + +#### SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall 🔧 + +This sniff disallows trailing commas in multi-line calls. + +This sniff provides the following setting: + +* `onlySingleLine`: to enable checks only for single-line calls. + +#### SlevomatCodingStandard.Functions.RequireTrailingCommaInCall 🔧 + +Commas after the last parameter in function or method call make adding a new parameter easier and result in a cleaner versioning diff. + +This sniff enforces trailing commas in multi-line calls. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 7.3 or higher. + +#### SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse 🔧 + +This sniff disallows trailing commas in multi-line `use` of closure declaration. + +This sniff provides the following setting: + +* `onlySingleLine`: to enable checks only for single-line `use` declarations. + +#### SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse 🔧 + +Commas after the last inherited variable in multi-line `use` of closure declaration make adding a new variable easier and result in a cleaner versioning diff. + +This sniff enforces trailing commas in multi-line declarations. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. + +#### SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration 🔧 + +This sniff disallows trailing commas in multi-line declarations. + +This sniff provides the following setting: + +* `onlySingleLine`: to enable checks only for single-line declarations. + +#### SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration 🔧 + +Commas after the last parameter in function or method declaration make adding a new parameter easier and result in a cleaner versioning diff. + +This sniff enforces trailing commas in multi-line declarations. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. + +#### SlevomatCodingStandard.Functions.StaticClosure 🔧 + +Reports closures not using `$this` that are not declared `static`. + +#### SlevomatCodingStandard.Functions.StrictCall + +Some functions have `$strict` parameter. This sniff reports calls to these functions without the parameter or with `$strict = false`. + +#### SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure 🔧 + +Looks for unused inherited variables passed to closure via `use`. + +#### SlevomatCodingStandard.Functions.UnusedParameter 🚧 + +Looks for unused parameters. + +#### SlevomatCodingStandard.Functions.UselessParameterDefaultValue 🚧 + +Looks for useless parameter default value. diff --git a/vendor/slevomat/coding-standard/doc/namespaces.md b/vendor/slevomat/coding-standard/doc/namespaces.md new file mode 100644 index 0000000..3c5d6cd --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/namespaces.md @@ -0,0 +1,186 @@ +## Namespaces + +#### SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses 🔧 + +Sniff checks whether `use` declarations at the top of a file are alphabetically sorted. Follows natural sorting and takes edge cases with special symbols into consideration. The following code snippet is an example of correctly sorted uses: + +```php +use LogableTrait; +use LogAware; +use LogFactory; +use LoggerInterface; +use LogLevel; +use LogStandard; +``` + +Sniff provides the following settings: + + +* `psr12Compatible` (defaults to `true`): sets the required order to `classes`, `functions` and `constants`. `false` sets the required order to `classes`, `constants` and `functions`. +* `caseSensitive`: compare namespaces case sensitively, which makes this order correct: + +```php +use LogAware; +use LogFactory; +use LogLevel; +use LogStandard; +use LogableTrait; +use LoggerInterface; +``` + +#### SlevomatCodingStandard.Namespaces.DisallowGroupUse + +[Group use declarations](https://wiki.php.net/rfc/group_use_declarations) are ugly, make diffs ugly and this sniff prohibits them. + +#### SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions 🔧 + +This sniff reduces confusion in the following code snippet: + +```php +try { + $this->foo(); +} catch (Exception $e) { + // Is this the general exception all exceptions must extend from? Or Exception from the current namespace? +} +``` + +All references to types named `Exception` or ending with `Exception` must be referenced via a fully qualified name: + +```php +try { + $this->foo(); +} catch (\FooCurrentNamespace\Exception $e) { + +} catch (\Exception $e) { + +} +``` + +Sniff provides the following settings: + +* Exceptions with different names can be configured in `specialExceptionNames` property. +* If your codebase uses classes that look like exceptions (because they have `Exception` or `Error` suffixes) but aren't, you can add them to `ignoredNames` property and the sniff won't enforce them to be fully qualified. Classes with `Error` suffix have to be added to ignored only if they are in the root namespace (like `LibXMLError`). + +#### SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants 🔧 + +All references to global constants must be referenced via a fully qualified name. + +Sniff provides the following settings: + +* `include`: list of global constants that must be referenced via FQN. If not set all constants are considered. +* `exclude`: list of global constants that are allowed not to be referenced via FQN. + +#### SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions 🔧 + +All references to global functions must be referenced via a fully qualified name. + +Sniff provides the following settings: + +* `include`: list of global functions that must be referenced via FQN. If not set all functions are considered. +* `includeSpecialFunctions`: include complete list of PHP internal functions that could be optimized when referenced via FQN. +* `exclude`: list of global functions that are allowed not to be referenced via FQN. + +#### SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation 🔧 + +Enforces fully qualified names of classes and interfaces in phpDocs - in annotations. This results in unambiguous phpDocs. + +Sniff provides the following settings: + +* `ignoredAnnotationNames`: case-sensitive list of annotation names that the sniff should ignore. Useful for custom annotation names like `@apiParam` + +#### SlevomatCodingStandard.Namespaces.MultipleUsesPerLine + +Prohibits multiple uses separated by commas: + +```php +use Foo, Bar; +``` + +#### SlevomatCodingStandard.Namespaces.NamespaceDeclaration 🔧 + +Enforces one space after `namespace`, disallows content between namespace name and semicolon and disallows use of bracketed syntax. + +#### SlevomatCodingStandard.Namespaces.NamespaceSpacing 🔧 + +Enforces configurable number of lines before and after `namespace`. + +Sniff provides the following settings: + +* `linesCountBeforeNamespace`: allows to configure the number of lines before `namespace`. +* `linesCountAfterNamespace`: allows to configure the number of lines after `namespace`. + +#### SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile + +Requires only one namespace in a file. + +#### SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly 🔧 + +Sniff provides the following settings: + +* `searchAnnotations` (defaults to `false`): enables searching for mentions in annotations. +* `namespacesRequiredToUse`: if not set, all namespaces are required to be used. When set, only mentioned namespaces are required to be used. Useful in tandem with UseOnlyWhitelistedNamespaces sniff. +* `allowFullyQualifiedExceptions`, `specialExceptionNames` & `ignoredNames`: allows fully qualified exceptions. Useful in tandem with FullyQualifiedExceptions sniff. +* `allowFullyQualifiedNameForCollidingClasses`: allow fully qualified name for a class with a colliding use statement. +* `allowFullyQualifiedNameForCollidingFunctions`: allow fully qualified name for a function with a colliding use statement. +* `allowFullyQualifiedNameForCollidingConstants`: allow fully qualified name for a constant with a colliding use statement. +* `allowFullyQualifiedGlobalClasses`: allows using fully qualified classes from global space (i.e. `\DateTimeImmutable`). +* `allowFullyQualifiedGlobalFunctions`: allows using fully qualified functions from global space (i.e. `\phpversion()`). +* `allowFullyQualifiedGlobalConstants`: allows using fully qualified constants from global space (i.e. `\PHP_VERSION`). +* `allowFallbackGlobalFunctions`: allows using global functions via fallback name without `use` (i.e. `phpversion()`). +* `allowFallbackGlobalConstants`: allows using global constants via fallback name without `use` (i.e. `PHP_VERSION`). +* `allowPartialUses`: allows using and referencing whole namespaces. + +#### SlevomatCodingStandard.Namespaces.UseFromSameNamespace 🔧 + +Sniff prohibits uses from the same namespace: + +```php +namespace Foo; + +use Foo\Bar; +``` + +#### SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash 🔧 + +Disallows leading backslash in use statement: + +```php +use \Foo\Bar; +``` + +#### SlevomatCodingStandard.Namespaces.UseSpacing 🔧 + +Enforces configurable number of lines before first `use`, after last `use` and between two different types of `use` (eg. between `use function` and `use const`). Also enforces zero number of lines between same types of `use`. + +Sniff provides the following settings: + +* `linesCountBeforeFirstUse`: allows to configure the number of lines before first `use`. +* `linesCountBetweenUseTypes`: allows to configure the number of lines between two different types of `use`. +* `linesCountAfterLastUse`: allows to configure the number of lines after last `use`. + +#### SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces + +Sniff disallows uses of other than configured namespaces. + +Sniff provides the following settings: + +* `namespacesRequiredToUse`: namespaces in this array are the only ones allowed to be used. E.g. root project namespace. +* `allowUseFromRootNamespace`: also allow using top-level namespace: + +```php +use DateTimeImmutable; +``` + +#### SlevomatCodingStandard.Namespaces.UselessAlias 🔧 + +Looks for `use` alias that is same as unqualified name. + +#### SlevomatCodingStandard.Namespaces.UnusedUses 🔧 + +Looks for unused imports from other namespaces. + +Sniff provides the following settings: + +* `searchAnnotations` (defaults to `false`): enables searching for class names in annotations. +* `ignoredAnnotationNames`: case-sensitive list of annotation names that the sniff should ignore (only the name is ignored, annotation content is still searched). Useful for name collisions like `@testCase` annotation and `TestCase` class. +* `ignoredAnnotations`: case-sensitive list of annotation names that the sniff ignore completely (both name and content are ignored). Useful for name collisions like `@group Cache` annotation and `Cache` class. diff --git a/vendor/slevomat/coding-standard/doc/numbers.md b/vendor/slevomat/coding-standard/doc/numbers.md new file mode 100644 index 0000000..8df99a2 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/numbers.md @@ -0,0 +1,16 @@ +## Numbers + +#### SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator 🔧 + +Disallows numeric literal separators. + +#### SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator + +Requires use of numeric literal separators. + +This sniff provides the following setting: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 7.4 or higher. +* `minDigitsBeforeDecimalPoint`: the minimum digits before decimal point to require separator. +* `minDigitsAfterDecimalPoint`: the minimum digits after decimal point to require separator. +* `ignoreOctalNumbers`: to ignore octal numbers. diff --git a/vendor/slevomat/coding-standard/doc/operators.md b/vendor/slevomat/coding-standard/doc/operators.md new file mode 100644 index 0000000..0fcd6e4 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/operators.md @@ -0,0 +1,33 @@ +## Operators + +#### SlevomatCodingStandard.Operators.DisallowEqualOperators 🔧 + +Disallows using loose `==` and `!=` comparison operators. Use `===` and `!==` instead, they are much more secure and predictable. + +#### SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators + +Disallows using `++` and `--` operators. + +#### SlevomatCodingStandard.Operators.NegationOperatorSpacing 🔧 + +Checks if there is the same number of spaces after negation operator as expected. + +Sniff provides the following settings: + +* `spacesCount`: the number of spaces expected after the negation operator + +#### SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator 🔧 + +Requires using combined assignment operators, eg `+=`, `.=` etc. + +#### SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators + +Reports `++` and `--` operators not used standalone. + +#### SlevomatCodingStandard.Operators.SpreadOperatorSpacing 🔧 + +Enforces configurable number of spaces after the `...` operator. + +Sniff provides the following settings: + +* `spacesCountAfterOperator`: the number of spaces after the `...` operator. diff --git a/vendor/slevomat/coding-standard/doc/php.md b/vendor/slevomat/coding-standard/doc/php.md new file mode 100644 index 0000000..e174028 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/php.md @@ -0,0 +1,80 @@ +## PHP + +#### SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall 🔧 + +Disallows direct call of `__invoke()`. + +#### SlevomatCodingStandard.PHP.DisallowReference + +Sniff disallows usage of references. + +#### SlevomatCodingStandard.PHP.ForbiddenClasses 🔧 + +Reports usage of forbidden classes, interfaces, parent classes and traits. And provide the following settings: + +* `forbiddenClasses`: forbids creating instances with `new` keyword or accessing with `::` operator +* `forbiddenExtends`: forbids extending with `extends` keyword +* `forbiddenInterfaces`: forbids usage in `implements` section +* `forbiddenTraits`: forbids imports with `use` keyword + +Optionally can be passed as an alternative for auto fixes. See `phpcs.xml` file example: + +```xml + + + + + + + + + + +``` + +#### SlevomatCodingStandard.PHP.ReferenceSpacing 🔧 + +Enforces configurable number of spaces after reference. + +Sniff provides the following settings: + +* `spacesCountAfterReference`: the number of spaces after `&`. + +#### SlevomatCodingStandard.PHP.RequireExplicitAssertion 🔧 + +Requires assertion via `assert` instead of inline documentation comments. + +Sniff provides the following settings: + +* `enableIntegerRanges` (defaults to `false`): enables support for `positive-int`, `negative-int` and `int<0, 100>`. +* `enableAdvancedStringTypes` (defaults to `false`): enables support for `callable-string`, `numeric-string` and `non-empty-string`. + +#### SlevomatCodingStandard.PHP.RequireNowdoc 🔧 + +Requires nowdoc syntax instead of heredoc when possible. + +#### SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking + +PHP optimizes some internal functions into special opcodes on VM level. Such optimization results in much faster execution compared to calling standard functions. This only works when these functions are not invoked with argument unpacking (`...`). + +The list of these functions varies across PHP versions, but is the same as functions that must be referenced by their global name (either by `\ ` prefix or using `use function`), not a fallback name inside namespaced code. + +#### SlevomatCodingStandard.PHP.ShortList 🔧 + +Enforces using short form of list syntax, `[...]` instead of `list(...)`. + +#### SlevomatCodingStandard.PHP.TypeCast 🔧 + +Enforces using shorthand cast operators, forbids use of unset and binary cast operators: `(bool)` instead of `(boolean)`, `(int)` instead of `(integer)`, `(float)` instead of `(double)` or `(real)`. `(binary)` and `(unset)` are forbidden. + +#### SlevomatCodingStandard.PHP.UselessParentheses 🔧 + +Looks for useless parentheses. + +Sniff provides the following settings: + +* `ignoreComplexTernaryConditions` (defaults to `false`): ignores complex ternary conditions - condition must contain `&&`, `||` etc. or end of line. + +#### SlevomatCodingStandard.PHP.UselessSemicolon 🔧 + +Looks for useless semicolons. diff --git a/vendor/slevomat/coding-standard/doc/strings.md b/vendor/slevomat/coding-standard/doc/strings.md new file mode 100644 index 0000000..17fcc7c --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/strings.md @@ -0,0 +1,11 @@ +## Strings + +#### SlevomatCodingStandard.Strings.DisallowVariableParsing + +Disallows variable parsing inside strings. + +Sniff provides the following settings: + +* `disallowDollarCurlySyntax`: disallows usage of `${...}`, enabled by default. +* `disallowCurlyDollarSyntax`: disallows usage of `{$...}`, disabled by default. +* `disallowSimpleSyntax`: disallows usage of `$...`, disabled by default. diff --git a/vendor/slevomat/coding-standard/doc/type-hints.md b/vendor/slevomat/coding-standard/doc/type-hints.md new file mode 100644 index 0000000..f52e2b1 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/type-hints.md @@ -0,0 +1,130 @@ +## Type hints + +#### SlevomatCodingStandard.TypeHints.DeclareStrictTypes 🔧 + +Enforces having `declare(strict_types = 1)` at the top of each PHP file. Allows configuring how many newlines should be between the ``, `array>`). + +Sniff provides the following settings: + +* `traversableTypeHints`: helps fixer detect traversable type hints so `\Traversable|int[]` can be converted to `\Traversable`. + +#### SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint + +Disallows usage of "mixed" type hint in phpDocs. + +#### SlevomatCodingStandard.TypeHints.LongTypeHints 🔧 + +Enforces using shorthand scalar typehint variants in phpDocs: `int` instead of `integer` and `bool` instead of `boolean`. This is for consistency with native scalar typehints which also allow shorthand variants only. + +#### SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition 🔧 + +Enforces `null` type hint on last position in annotations. + +#### SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue 🔧🚧 + +Checks whether the nullablity `?` symbol is present before each nullable and optional parameter (which are marked as `= null`): + +```php +function foo( + int $foo = null, // ? missing + ?int $bar = null // correct +) { + +} +``` + +#### SlevomatCodingStandard.TypeHints.ParameterTypeHint 🔧🚧 + +* Checks for missing parameter typehints in case they can be declared natively. If the phpDoc contains something that can be written as a native PHP 7.0+ typehint, this sniff reports that. +* Checks for useless `@param` annotations. If the native method declaration contains everything and the phpDoc does not add anything useful, it's reported as useless and can optionally be automatically removed with `phpcbf`. +* Forces to specify what's in traversable types like `array`, `iterable` and `\Traversable`. + +Sniff provides the following settings: + +* `enableObjectTypeHint`: enforces to transform `@param object` into native `object` typehint. It's on by default if you're on PHP 7.2+ +* `enableMixedTypeHint`: enforces to transform `@param mixed` into native `mixed` typehint. It's on by default if you're on PHP 8.0+ +* `enableUnionTypeHint`: enforces to transform `@param string|int` into native `string|int` typehint. It's on by default if you're on PHP 8.0+ +* `enableIntersectionTypeHint`: enforces to transform `@param Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+ +* `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@param true`, `@param false` or `@param null` into native typehints. It's on by default if you're on PHP 8.2+ +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. + +This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. + +#### SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing 🔧 + +* Checks that there's a single space between a typehint and a parameter name: `Foo $foo` +* Checks that there's no whitespace between a nullability symbol and a typehint: `?Foo` + +#### SlevomatCodingStandard.TypeHints.PropertyTypeHint 🔧🚧 + +* Checks for missing property typehints in case they can be declared natively. If the phpDoc contains something that can be written as a native PHP 7.4+ typehint, this sniff reports that. +* Checks for useless `@var` annotations. If the native method declaration contains everything and the phpDoc does not add anything useful, it's reported as useless and can optionally be automatically removed with `phpcbf`. +* Forces to specify what's in traversable types like `array`, `iterable` and `\Traversable`. + +Sniff provides the following settings: + +* `enableNativeTypeHint`: enforces to transform `@var int` into native `int` typehint. It's on by default if you're on PHP 7.4+ +* `enableMixedTypeHint`: enforces to transform `@var mixed` into native `mixed` typehint. It's on by default if you're on PHP 8.0+. It can be enabled only when `enableNativeTypeHint` is enabled too. +* `enableUnionTypeHint`: enforces to transform `@var string|int` into native `string|int` typehint. It's on by default if you're on PHP 8.0+. It can be enabled only when `enableNativeTypeHint` is enabled too. +* `enableIntersectionTypeHint`: enforces to transform `@var Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+. It can be enabled only when `enableNativeTypeHint` is enabled too. +* `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@var true`, `@var false` or `@var null` into native typehints. It's on by default if you're on PHP 8.2+. It can be enabled only when `enableNativeTypeHint` is enabled too. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. + +This sniff can cause an error if you're overriding parent property which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint` annotation to the property to have this sniff skip it. + +#### SlevomatCodingStandard.TypeHints.ReturnTypeHint 🔧🚧 + +* Checks for missing return typehints in case they can be declared natively. If the phpDoc contains something that can be written as a native PHP 7.0+ typehint, this sniff reports that. +* Checks for useless `@return` annotations. If the native method declaration contains everything and the phpDoc does not add anything useful, it's reported as useless and can optionally be automatically removed with `phpcbf`. +* Forces to specify what's in traversable types like `array`, `iterable` and `\Traversable`. + +Sniff provides the following settings: + +* `enableObjectTypeHint`: enforces to transform `@return object` into native `object` typehint. It's on by default if you're on PHP 7.2+ +* `enableStaticTypeHint`: enforces to transform `@return static` into native `static` typehint. It's on by default if you're on PHP 8.0+ +* `enableMixedTypeHint`: enforces to transform `@return mixed` into native `mixed` typehint. It's on by default if you're on PHP 8.0+ +* `enableUnionTypeHint`: enforces to transform `@return string|int` into native `string|int` typehint. It's on by default if you're on PHP 8.0+. +* `enableIntersectionTypeHint`: enforces to transform `@return Foo&Bar` into native `Foo&Bar` typehint. It's on by default if you're on PHP 8.1+. +* `enableNeverTypeHint`: enforces to transform `@return never` into native `never` typehint. It's on by default if you're on PHP 8.1+. +* `enableStandaloneNullTrueFalseTypeHints`: enforces to transform `@return true`, `@return false` or `@return null` into native typehints. It's on by default if you're on PHP 8.2+. +* `traversableTypeHints`: enforces which typehints must have specified contained type. E.g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`. + +This sniff can cause an error if you're overriding or implementing a parent method which does not have typehints. In such cases add `@phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint` annotation to the method to have this sniff skip it. + +#### SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing 🔧 + +Enforces consistent formatting of return typehints, like this: + +```php +function foo(): ?int +``` + +Sniff provides the following settings: + +* `spacesCountBeforeColon`: the number of spaces expected between closing brace and colon. + +#### SlevomatCodingStandard.TypeHints.UnionTypeHintFormat 🔧 + +Checks format of union type hints. + +Sniff provides the following settings: + +* `enable`: either to enable or not this sniff. By default, it is enabled for PHP versions 8.0 or higher. +* `withSpaces`: `yes` requires spaces around `|`, `no` requires no space around `|`. None is set by default so both are enabled. +* `shortNullable`: `yes` requires usage of `?` for nullable type hint, `no` disallows it. None is set by default so both are enabled. +* `nullPosition`: `first` requires `null` on first position in the type hint, `last` requires last position. None is set by default so `null` can be everywhere. + +#### SlevomatCodingStandard.TypeHints.UselessConstantTypeHint 🔧 + +Reports useless `@var` annotation (or whole documentation comment) for constants because the type of constant is always clear. diff --git a/vendor/slevomat/coding-standard/doc/variables.md b/vendor/slevomat/coding-standard/doc/variables.md new file mode 100644 index 0000000..c1f6c29 --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/variables.md @@ -0,0 +1,31 @@ +## Variables + +#### SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable + +Disallows use of super global variables. + +#### SlevomatCodingStandard.Variables.DisallowVariableVariable + +Disallows use of variable variables. + +#### SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable + +Looks for duplicate assignments to a variable. + +#### SlevomatCodingStandard.Variables.UnusedVariable + +Looks for unused variables. + +Sniff provides the following settings: + +* `ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach` (defaults to `false`): ignore unused `$value` in foreach when only `$key` is used + +```php +foreach ($values as $key => $value) { + echo $key; +} +``` + +#### SlevomatCodingStandard.Variables.UselessVariable 🔧 + +Looks for useless variables. diff --git a/vendor/slevomat/coding-standard/doc/whitespaces.md b/vendor/slevomat/coding-standard/doc/whitespaces.md new file mode 100644 index 0000000..4f3a92f --- /dev/null +++ b/vendor/slevomat/coding-standard/doc/whitespaces.md @@ -0,0 +1,13 @@ +## Whitespaces + +#### SlevomatCodingStandard.Whitespaces.DuplicateSpaces 🔧 + +Checks duplicate spaces anywhere because there aren't sniffs for every part of code to check formatting. + +Sniff provides the following settings: + +* `ignoreSpacesBeforeAssignment`: to allow multiple spaces to align assignments. +* `ignoreSpacesInAnnotation`: to allow multiple spaces to align annotations. +* `ignoreSpacesInComment`: to allow multiple spaces to align content of the comment. +* `ignoreSpacesInParameters`: to allow multiple spaces to align parameters. +* `ignoreSpacesInMatch`: to allow multiple spaces to align `match` expressions. diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer.conf b/vendor/squizlabs/php_codesniffer/CodeSniffer.conf new file mode 100644 index 0000000..d0252f3 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer.conf @@ -0,0 +1,5 @@ + '../../slevomat/coding-standard', +); +?> \ No newline at end of file