Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-10-10 04:11:41 +0300
committerRich Trott <rtrott@gmail.com>2021-10-12 04:37:33 +0300
commit8ca76eba73cf75a72cc008b09c2ae537fe6e6d0f (patch)
tree28dc44d1bc746b3c65536bbb40d5ef6d94b3e7f4 /tools/node_modules
parentdd8e219d71e999a66c5fa4e01436c179425a4c8a (diff)
tools: update ESLint to 8.0.0
PR-URL: https://github.com/nodejs/node/pull/40394 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'tools/node_modules')
-rw-r--r--tools/node_modules/eslint-plugin-markdown/lib/processor.js7
-rwxr-xr-xtools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md2
-rwxr-xr-xtools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json6
-rw-r--r--tools/node_modules/eslint-plugin-markdown/package.json2
-rw-r--r--tools/node_modules/eslint/LICENSE2
-rw-r--r--tools/node_modules/eslint/README.md10
-rwxr-xr-xtools/node_modules/eslint/bin/eslint.js2
-rw-r--r--tools/node_modules/eslint/conf/eslint-recommended.js6
-rw-r--r--tools/node_modules/eslint/conf/rule-type-list.json (renamed from tools/node_modules/eslint/conf/category-list.json)11
-rw-r--r--tools/node_modules/eslint/lib/api.js24
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/cli-engine.js46
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/file-enumerator.js7
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/formatters/codeframe.js138
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/formatters/html.js2
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/formatters/table.js159
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/formatters/tap.js2
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/hash.js4
-rw-r--r--tools/node_modules/eslint/lib/cli-engine/xml-escape.js2
-rw-r--r--tools/node_modules/eslint/lib/config/flat-config-array.js4
-rw-r--r--tools/node_modules/eslint/lib/config/flat-config-schema.js2
-rw-r--r--tools/node_modules/eslint/lib/config/rule-validator.js33
-rw-r--r--tools/node_modules/eslint/lib/eslint/eslint.js8
-rw-r--r--tools/node_modules/eslint/lib/init/autoconfig.js41
-rw-r--r--tools/node_modules/eslint/lib/init/config-file.js8
-rw-r--r--tools/node_modules/eslint/lib/init/config-initializer.js29
-rw-r--r--tools/node_modules/eslint/lib/init/config-rule.js31
-rw-r--r--tools/node_modules/eslint/lib/init/npm-utils.js31
-rw-r--r--tools/node_modules/eslint/lib/init/source-code-utils.js11
-rw-r--r--tools/node_modules/eslint/lib/linter/apply-disable-directives.js215
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js151
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js1
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js5
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js19
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js4
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js1
-rw-r--r--tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js1
-rw-r--r--tools/node_modules/eslint/lib/linter/config-comment-parser.js8
-rw-r--r--tools/node_modules/eslint/lib/linter/linter.js103
-rw-r--r--tools/node_modules/eslint/lib/linter/node-event-generator.js5
-rw-r--r--tools/node_modules/eslint/lib/linter/report-translator.js24
-rw-r--r--tools/node_modules/eslint/lib/linter/rules.js3
-rw-r--r--tools/node_modules/eslint/lib/linter/safe-emitter.js4
-rw-r--r--tools/node_modules/eslint/lib/linter/source-code-fixer.js4
-rw-r--r--tools/node_modules/eslint/lib/linter/timing.js4
-rw-r--r--tools/node_modules/eslint/lib/options.js4
-rw-r--r--tools/node_modules/eslint/lib/rule-tester/rule-tester.js48
-rw-r--r--tools/node_modules/eslint/lib/rules/accessor-pairs.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/array-bracket-newline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/array-bracket-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/array-callback-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/array-element-newline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/arrow-body-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/arrow-parens.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/arrow-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/block-scoped-var.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/block-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/brace-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/callback-return.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/camelcase.js412
-rw-r--r--tools/node_modules/eslint/lib/rules/capitalized-comments.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/class-methods-use-this.js66
-rw-r--r--tools/node_modules/eslint/lib/rules/comma-dangle.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/comma-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/comma-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/complexity.js103
-rw-r--r--tools/node_modules/eslint/lib/rules/computed-property-spacing.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/consistent-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/consistent-this.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/constructor-super.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/curly.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/default-case-last.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/default-case.js5
-rw-r--r--tools/node_modules/eslint/lib/rules/default-param-last.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/dot-location.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/dot-notation.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/eol-last.js8
-rw-r--r--tools/node_modules/eslint/lib/rules/eqeqeq.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/for-direction.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/func-call-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/func-name-matching.js15
-rw-r--r--tools/node_modules/eslint/lib/rules/func-names.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/func-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/function-call-argument-newline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/function-paren-newline.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/generator-star-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/getter-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/global-require.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/grouped-accessor-pairs.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/guard-for-in.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/handle-callback-err.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/id-blacklist.js17
-rw-r--r--tools/node_modules/eslint/lib/rules/id-denylist.js58
-rw-r--r--tools/node_modules/eslint/lib/rules/id-length.js43
-rw-r--r--tools/node_modules/eslint/lib/rules/id-match.js59
-rw-r--r--tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/indent-legacy.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/indent.js58
-rw-r--r--tools/node_modules/eslint/lib/rules/index.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/init-declarations.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/jsx-quotes.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/key-spacing.js9
-rw-r--r--tools/node_modules/eslint/lib/rules/keyword-spacing.js25
-rw-r--r--tools/node_modules/eslint/lib/rules/line-comment-position.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/linebreak-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/lines-around-comment.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/lines-around-directive.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/lines-between-class-members.js53
-rw-r--r--tools/node_modules/eslint/lib/rules/max-classes-per-file.js39
-rw-r--r--tools/node_modules/eslint/lib/rules/max-depth.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/max-len.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/max-lines-per-function.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/max-lines.js17
-rw-r--r--tools/node_modules/eslint/lib/rules/max-nested-callbacks.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/max-params.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/max-statements-per-line.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/max-statements.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/multiline-comment-style.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/multiline-ternary.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/new-cap.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/new-parens.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/newline-after-var.js9
-rw-r--r--tools/node_modules/eslint/lib/rules/newline-before-return.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/newline-per-chained-call.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-alert.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-array-constructor.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-async-promise-executor.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-await-in-loop.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-bitwise.js11
-rw-r--r--tools/node_modules/eslint/lib/rules/no-buffer-constructor.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-caller.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-case-declarations.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-catch-shadow.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-class-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-cond-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-confusing-arrow.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-console.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-const-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-constant-condition.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-constructor-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-continue.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-control-regex.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-debugger.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-delete-var.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-div-regex.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-dupe-args.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-dupe-class-members.js10
-rw-r--r--tools/node_modules/eslint/lib/rules/no-dupe-else-if.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-dupe-keys.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-duplicate-case.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-duplicate-imports.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-else-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-empty-character-class.js26
-rw-r--r--tools/node_modules/eslint/lib/rules/no-empty-function.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-empty-pattern.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-empty.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-eq-null.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-eval.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-ex-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extend-native.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-bind.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-label.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-parens.js24
-rw-r--r--tools/node_modules/eslint/lib/rules/no-extra-semi.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-fallthrough.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-floating-decimal.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-func-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-global-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-implicit-coercion.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-implicit-globals.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-implied-eval.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-import-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-inline-comments.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-inner-declarations.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-invalid-regexp.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-invalid-this.js5
-rw-r--r--tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-iterator.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-label-var.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-labels.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-lone-blocks.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-lonely-if.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-loop-func.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-loss-of-precision.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-magic-numbers.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-misleading-character-class.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-mixed-operators.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-mixed-requires.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-multi-assign.js22
-rw-r--r--tools/node_modules/eslint/lib/rules/no-multi-spaces.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-multi-str.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-multiple-empty-lines.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-native-reassign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-negated-condition.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-negated-in-lhs.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-nested-ternary.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-func.js41
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-object.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-require.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-symbol.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new-wrappers.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-new.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js8
-rw-r--r--tools/node_modules/eslint/lib/rules/no-obj-calls.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-octal-escape.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-octal.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-param-reassign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-path-concat.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-plusplus.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-process-env.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-process-exit.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-promise-executor-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-proto.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-prototype-builtins.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-redeclare.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-regex-spaces.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-exports.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-globals.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-imports.js11
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-modules.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-properties.js5
-rw-r--r--tools/node_modules/eslint/lib/rules/no-restricted-syntax.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-return-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-return-await.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-script-url.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-self-assign.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-self-compare.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-sequences.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-setter-return.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-shadow.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-spaced-func.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-sparse-arrays.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-sync.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/no-tabs.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-template-curly-in-string.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-ternary.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-this-before-super.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-throw-literal.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-trailing-spaces.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-undef-init.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-undef.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-undefined.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-underscore-dangle.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unreachable-loop.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unreachable.js49
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unsafe-finally.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unsafe-negation.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unused-expressions.js9
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unused-labels.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-unused-vars.js54
-rw-r--r--tools/node_modules/eslint/lib/rules/no-use-before-define.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-backreference.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-call.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-catch.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-computed-key.js92
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-concat.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-constructor.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-escape.js23
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-rename.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-useless-return.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-var.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-void.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-warning-comments.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/no-with.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/nonblock-statement-body-position.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/object-curly-newline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/object-curly-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/object-property-newline.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/object-shorthand.js11
-rw-r--r--tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/one-var.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/operator-assignment.js13
-rw-r--r--tools/node_modules/eslint/lib/rules/operator-linebreak.js30
-rw-r--r--tools/node_modules/eslint/lib/rules/padded-blocks.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/padding-line-between-statements.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-const.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-destructuring.js9
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-object-spread.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-reflect.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-regex-literals.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-rest-params.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-spread.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/prefer-template.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/quote-props.js17
-rw-r--r--tools/node_modules/eslint/lib/rules/quotes.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/radix.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/require-atomic-updates.js33
-rw-r--r--tools/node_modules/eslint/lib/rules/require-await.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/require-jsdoc.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/require-unicode-regexp.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/require-yield.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/rest-spread-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/semi-spacing.js4
-rw-r--r--tools/node_modules/eslint/lib/rules/semi-style.js19
-rw-r--r--tools/node_modules/eslint/lib/rules/semi.js72
-rw-r--r--tools/node_modules/eslint/lib/rules/sort-imports.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/sort-keys.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/sort-vars.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/space-before-blocks.js17
-rw-r--r--tools/node_modules/eslint/lib/rules/space-before-function-paren.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/space-in-parens.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/space-infix-ops.js27
-rw-r--r--tools/node_modules/eslint/lib/rules/space-unary-ops.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/spaced-comment.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/strict.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/switch-colon-spacing.js15
-rw-r--r--tools/node_modules/eslint/lib/rules/symbol-description.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/template-curly-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/template-tag-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/unicode-bom.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/use-isnan.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/utils/ast-utils.js123
-rw-r--r--tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js6
-rw-r--r--tools/node_modules/eslint/lib/rules/valid-jsdoc.js2
-rw-r--r--tools/node_modules/eslint/lib/rules/valid-typeof.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/vars-on-top.js3
-rw-r--r--tools/node_modules/eslint/lib/rules/wrap-iife.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/wrap-regex.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/yield-star-spacing.js1
-rw-r--r--tools/node_modules/eslint/lib/rules/yoda.js1
-rw-r--r--tools/node_modules/eslint/lib/shared/ajv.js2
-rw-r--r--tools/node_modules/eslint/lib/shared/config-validator.js23
-rw-r--r--tools/node_modules/eslint/lib/shared/logging.js2
-rw-r--r--tools/node_modules/eslint/lib/shared/relative-module-resolver.js10
-rw-r--r--tools/node_modules/eslint/lib/shared/runtime-info.js3
-rw-r--r--tools/node_modules/eslint/lib/shared/traverser.js4
-rw-r--r--tools/node_modules/eslint/lib/shared/types.js4
-rw-r--r--tools/node_modules/eslint/lib/source-code/source-code.js16
-rw-r--r--tools/node_modules/eslint/lib/source-code/token-store/cursor.js2
-rw-r--r--tools/node_modules/eslint/lib/unsupported-api.js23
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE22
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/code-frame/README.md19
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js167
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/code-frame/package.json25
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/LICENSE22
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md19
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js84
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/index.js57
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/keyword.js38
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json26
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js75
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE22
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/README.md19
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js116
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js165
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license9
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json56
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md147
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js228
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js.flow93
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/license9
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json71
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/readme.md314
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/templates.js128
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE21
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md68
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js868
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js78
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json46
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js97
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE8
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md11
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js152
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json25
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js11
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json41
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md27
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js8
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license9
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json44
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md70
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js5
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js131
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license9
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json53
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md66
-rw-r--r--tools/node_modules/eslint/node_modules/@babel/highlight/package.json29
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/config-schema.js4
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/environments.js5
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.cjs (renamed from tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.cjs (renamed from tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs1068
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs4236
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js19
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js36
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js35
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js5
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js5
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js13
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js13
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js14
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js20
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index-universal.js29
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index.js74
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js165
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js219
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js21
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js5
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js3
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js56
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/types.js3
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE (renamed from tools/node_modules/eslint/node_modules/js-tokens/LICENSE)4
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/README.md257
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/index.js (renamed from tools/node_modules/eslint/node_modules/argparse/index.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/append.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append/constant.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/append/constant.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/count.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/count.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/help.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/help.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/store.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/constant.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/store/constant.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/false.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/store/false.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/true.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/store/true.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/subparsers.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/subparsers.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/version.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action/version.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action_container.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/action_container.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argparse.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/argparse.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/error.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/argument/error.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/exclusive.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/argument/exclusive.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/group.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/argument/group.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument_parser.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/argument_parser.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/const.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/const.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/added_formatters.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/help/added_formatters.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/formatter.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/help/formatter.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/namespace.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/namespace.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/utils.js (renamed from tools/node_modules/eslint/node_modules/argparse/lib/utils.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/package.json34
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE (renamed from tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/license)4
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md299
-rwxr-xr-xtools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js132
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js3989
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js1
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js7
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/common.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/dumper.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/exception.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/loader.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/mark.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/core.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/json.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/binary.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/bool.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/float.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/int.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/function.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/map.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/merge.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/null.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/omap.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/pairs.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/seq.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/set.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/str.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js (renamed from tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js)0
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json49
-rw-r--r--tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json43
-rw-r--r--tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md10
-rw-r--r--tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/api.js72
-rw-r--r--tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/package.json4
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/LICENSE2
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/README.md45
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/dist/acorn.js1178
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs1178
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/dist/bin.js49
-rw-r--r--tools/node_modules/eslint/node_modules/acorn/package.json13
-rw-r--r--tools/node_modules/eslint/node_modules/ansi-regex/index.js2
-rw-r--r--tools/node_modules/eslint/node_modules/ansi-regex/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/ansi-regex/readme.md2
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/LICENSE275
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/README.md247
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/argparse.js3707
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/lib/sub.js67
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/lib/textwrap.js440
-rw-r--r--tools/node_modules/eslint/node_modules/argparse/package.json29
-rw-r--r--tools/node_modules/eslint/node_modules/astral-regex/index.js6
-rw-r--r--tools/node_modules/eslint/node_modules/astral-regex/license9
-rw-r--r--tools/node_modules/eslint/node_modules/astral-regex/package.json33
-rw-r--r--tools/node_modules/eslint/node_modules/astral-regex/readme.md46
-rw-r--r--tools/node_modules/eslint/node_modules/deep-is/package.json7
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/LICENSE-MIT.txt20
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/README.md73
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js6
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js6
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/index.js6
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/package.json50
-rw-r--r--tools/node_modules/eslint/node_modules/emoji-regex/text.js6
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/README.md34
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/dist/eslint-scope.cjs2213
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/definition.js15
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/index.js63
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/pattern-visitor.js11
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/reference.js17
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/referencer.js51
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/scope-manager.js57
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js62
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/variable.js7
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/lib/version.js3
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-scope/package.json52
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/index.js262
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/index.mjs262
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md2
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json5
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json5
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-utils/package.json29
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md8
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs364
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js86
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js (renamed from tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json)181
-rw-r--r--tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json42
-rw-r--r--tools/node_modules/eslint/node_modules/espree/README.md37
-rw-r--r--tools/node_modules/eslint/node_modules/espree/dist/espree.cjs989
-rw-r--r--tools/node_modules/eslint/node_modules/espree/espree.js32
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/ast-node-types.js4
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/espree.js87
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/features.js4
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/options.js72
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/token-translator.js8
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/version.js3
-rw-r--r--tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js123
-rw-r--r--tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE201
-rw-r--r--tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/README.md98
-rw-r--r--tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js81
-rw-r--r--tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json284
-rw-r--r--tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json40
-rw-r--r--tools/node_modules/eslint/node_modules/espree/package.json60
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/LICENSE.BSD19
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/README.md153
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js801
-rw-r--r--tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json40
-rw-r--r--tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD19
-rw-r--r--tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/README.md153
-rw-r--r--tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js801
-rw-r--r--tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json40
-rw-r--r--tools/node_modules/eslint/node_modules/estraverse/estraverse.js21
-rw-r--r--tools/node_modules/eslint/node_modules/estraverse/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/glob-parent/LICENSE2
-rw-r--r--tools/node_modules/eslint/node_modules/glob-parent/README.md49
-rw-r--r--tools/node_modules/eslint/node_modules/glob-parent/index.js45
-rw-r--r--tools/node_modules/eslint/node_modules/glob-parent/package.json30
-rw-r--r--tools/node_modules/eslint/node_modules/glob/README.md3
-rw-r--r--tools/node_modules/eslint/node_modules/glob/changelog.md67
-rw-r--r--tools/node_modules/eslint/node_modules/glob/common.js2
-rw-r--r--tools/node_modules/eslint/node_modules/glob/glob.js9
-rw-r--r--tools/node_modules/eslint/node_modules/glob/package.json3
-rw-r--r--tools/node_modules/eslint/node_modules/glob/sync.js9
-rw-r--r--tools/node_modules/eslint/node_modules/globals/globals.json1
-rw-r--r--tools/node_modules/eslint/node_modules/globals/package.json2
-rw-r--r--tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js50
-rw-r--r--tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license9
-rw-r--r--tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json42
-rw-r--r--tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md39
-rw-r--r--tools/node_modules/eslint/node_modules/is-glob/README.md2
-rw-r--r--tools/node_modules/eslint/node_modules/is-glob/index.js150
-rw-r--r--tools/node_modules/eslint/node_modules/is-glob/package.json4
-rw-r--r--tools/node_modules/eslint/node_modules/js-tokens/README.md240
-rw-r--r--tools/node_modules/eslint/node_modules/js-tokens/index.js23
-rw-r--r--tools/node_modules/eslint/node_modules/js-tokens/package.json30
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/README.md107
-rwxr-xr-xtools/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js40
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js6223
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js3
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.mjs3851
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/index.js44
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/common.js59
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/dumper.js965
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/exception.js55
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/loader.js1727
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/schema.js121
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js11
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js22
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js17
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js19
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/snippet.js101
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type.js66
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js125
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js35
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/float.js97
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/int.js156
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/map.js8
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/merge.js12
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/null.js35
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js44
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js53
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/seq.js8
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/set.js29
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/str.js8
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js88
-rw-r--r--tools/node_modules/eslint/node_modules/js-yaml/package.json41
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE47
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.clonedeep/README.md18
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.clonedeep/index.js1748
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.clonedeep/package.json17
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.truncate/LICENSE47
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.truncate/README.md18
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.truncate/index.js632
-rw-r--r--tools/node_modules/eslint/node_modules/lodash.truncate/package.json17
-rw-r--r--tools/node_modules/eslint/node_modules/require-from-string/index.js34
-rw-r--r--tools/node_modules/eslint/node_modules/require-from-string/license21
-rw-r--r--tools/node_modules/eslint/node_modules/require-from-string/package.json28
-rw-r--r--tools/node_modules/eslint/node_modules/require-from-string/readme.md56
-rwxr-xr-xtools/node_modules/eslint/node_modules/slice-ansi/index.js103
-rw-r--r--tools/node_modules/eslint/node_modules/slice-ansi/license10
-rw-r--r--tools/node_modules/eslint/node_modules/slice-ansi/package.json52
-rw-r--r--tools/node_modules/eslint/node_modules/slice-ansi/readme.md66
-rw-r--r--tools/node_modules/eslint/node_modules/string-width/index.js47
-rw-r--r--tools/node_modules/eslint/node_modules/string-width/license9
-rw-r--r--tools/node_modules/eslint/node_modules/string-width/package.json56
-rw-r--r--tools/node_modules/eslint/node_modules/string-width/readme.md50
-rw-r--r--tools/node_modules/eslint/node_modules/strip-ansi/package.json4
-rw-r--r--tools/node_modules/eslint/node_modules/table/LICENSE24
-rw-r--r--tools/node_modules/eslint/node_modules/table/README.md759
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/alignString.js59
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/alignTableData.js13
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js11
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/calculateCellWidths.js16
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/calculateColumnWidths.js16
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/calculateRowHeights.js18
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/createStream.js72
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/drawBorder.js100
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/drawContent.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/drawHeader.js29
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/drawRow.js20
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/drawTable.js38
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/generated/validators.js2170
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js88
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/index.js20
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js47
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/makeTableConfig.js66
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeights.js44
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/padTableData.js16
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/table.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js23
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/types/api.js2
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/types/internal.js2
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/utils.js92
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/validateConfig.js25
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/validateTableData.js31
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/wrapCell.js32
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/wrapString.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/dist/wrapWord.js41
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/.runkit_example.js23
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE22
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md204
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js55
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2020.js49
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js44
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js147
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js697
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js143
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js123
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js242
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js350
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js218
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js14
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js28
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ref_error.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js153
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js178
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js19
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js50
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js202
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js35
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js510
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js124
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js81
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js611
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js66
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json13
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js28
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json53
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json17
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json57
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json14
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json37
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json90
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json39
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js30
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json48
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json17
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json51
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json14
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json37
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json15
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json90
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json55
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json137
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json151
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json88
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js118
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/equal.js7
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js182
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js30
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js42
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js24
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js11
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js81
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js35
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js3
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js3
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js3
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js49
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js106
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js23
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js87
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js85
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js11
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js66
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js44
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js52
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js30
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js60
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js75
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js54
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js38
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js13
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js127
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js10
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js16
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js122
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js93
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js9
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js23
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js17
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js30
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js51
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js9
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js16
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js10
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js3
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js92
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js6
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js71
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js24
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js43
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js20
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js29
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js25
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js22
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js15
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js146
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js66
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js69
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js48
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js18
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js8
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js7
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js40
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js65
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js25
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js12
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js47
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js33
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js15
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js24
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js27
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js27
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js24
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js26
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js24
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js79
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js64
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json13
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json53
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json17
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json57
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json14
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json37
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json90
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json39
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json48
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json17
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json51
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json14
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json37
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json15
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json90
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json55
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json137
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json151
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json88
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json123
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE21
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md95
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js93
-rw-r--r--tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json43
-rw-r--r--tools/node_modules/eslint/node_modules/table/package.json94
-rw-r--r--tools/node_modules/eslint/package.json53
814 files changed, 34444 insertions, 31517 deletions
diff --git a/tools/node_modules/eslint-plugin-markdown/lib/processor.js b/tools/node_modules/eslint-plugin-markdown/lib/processor.js
index a79f24356f7..63aa9159060 100644
--- a/tools/node_modules/eslint-plugin-markdown/lib/processor.js
+++ b/tools/node_modules/eslint-plugin-markdown/lib/processor.js
@@ -321,6 +321,13 @@ function adjustBlock(block) {
* @returns {Message} The same message, but adjusted to the correct location.
*/
return function adjustMessage(message) {
+ if (!Number.isInteger(message.line)) {
+ return {
+ ...message,
+ line: blockStart,
+ column: block.position.start.column
+ };
+ }
const lineInCode = message.line - leadingCommentLines;
diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md
index 120083c91f5..45df54e56ec 100755
--- a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md
+++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/README.md
@@ -8,7 +8,7 @@ This package contains type definitions for Mdast (https://github.com/syntax-tree
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast.
### Additional Details
- * Last updated: Fri, 16 Jul 2021 17:31:26 GMT
+ * Last updated: Mon, 23 Aug 2021 20:18:29 GMT
* Dependencies: [@types/unist](https://npmjs.com/package/@types/unist)
* Global values: none
diff --git a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json
index cfd3ff28b00..a61222d2afe 100755
--- a/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json
+++ b/tools/node_modules/eslint-plugin-markdown/node_modules/@types/mdast/package.json
@@ -1,6 +1,6 @@
{
"name": "@types/mdast",
- "version": "3.0.7",
+ "version": "3.0.10",
"description": "TypeScript definitions for Mdast",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast",
"license": "MIT",
@@ -37,6 +37,6 @@
"dependencies": {
"@types/unist": "*"
},
- "typesPublisherContentHash": "666079441041567c5bdfa2b8ff46e900b18d544357be5b8cdcecfb412129e903",
- "typeScriptVersion": "3.6"
+ "typesPublisherContentHash": "87d2054120bead1983528802563a50cbb2f2efd6677d446e5ec34071f50bddcc",
+ "typeScriptVersion": "3.7"
} \ No newline at end of file
diff --git a/tools/node_modules/eslint-plugin-markdown/package.json b/tools/node_modules/eslint-plugin-markdown/package.json
index 2742d65e815..d1a50208729 100644
--- a/tools/node_modules/eslint-plugin-markdown/package.json
+++ b/tools/node_modules/eslint-plugin-markdown/package.json
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-markdown",
- "version": "2.2.0",
+ "version": "2.2.1",
"description": "An ESLint plugin to lint JavaScript in Markdown code fences.",
"license": "MIT",
"author": {
diff --git a/tools/node_modules/eslint/LICENSE b/tools/node_modules/eslint/LICENSE
index 7fe552a8661..b607bb36e96 100644
--- a/tools/node_modules/eslint/LICENSE
+++ b/tools/node_modules/eslint/LICENSE
@@ -1,4 +1,4 @@
-Copyright JS Foundation and other contributors, https://js.foundation
+Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
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/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md
index 804310d8c1f..43bcdaa3f29 100644
--- a/tools/node_modules/eslint/README.md
+++ b/tools/node_modules/eslint/README.md
@@ -43,7 +43,7 @@ ESLint is a tool for identifying and reporting on patterns found in ECMAScript/J
## <a name="installation-and-usage"></a>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:
@@ -123,7 +123,7 @@ Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [confi
### What ECMAScript versions does ESLint support?
-ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, and 2020. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
+ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021 and 2022. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/user-guide/configuring).
### What about experimental features?
@@ -296,9 +296,9 @@ The following companies, organizations, and individuals support ESLint's ongoing
<!--sponsorsstart-->
<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/photomatt/d0ef3e1/logo.png" alt="Automattic" height="undefined"></a></p><h3>Gold Sponsors</h3>
-<p><a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://google.com/chrome"><img src="https://images.opencollective.com/chrome/dc55bd4/logo.png" alt="Chrome's Web Framework & Tools Performance Fund" height="96"></a> <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://coinbase.com"><img src="https://avatars.githubusercontent.com/u/1885080?v=4" alt="Coinbase" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
-<p><a href="https://retool.com/"><img src="https://images.opencollective.com/retool/98ea68e/logo.png" alt="Retool" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
-<p><a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="null"><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://www.practiceignition.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Practice Ignition" height="32"></a></p>
+<p><a href="https://nx.dev"><img src="https://images.opencollective.com/nx/0efbe42/logo.png" alt="Nx (by Nrwl)" height="96"></a> <a href="https://google.com/chrome"><img src="https://images.opencollective.com/chrome/dc55bd4/logo.png" alt="Chrome's Web Framework & Tools Performance Fund" height="96"></a> <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo.png" alt="Salesforce" height="96"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="96"></a> <a href="https://coinbase.com"><img src="https://avatars.githubusercontent.com/u/1885080?v=4" alt="Coinbase" height="96"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301?v=4" alt="American Express" height="96"></a> <a href="https://substack.com/"><img src="https://avatars.githubusercontent.com/u/53023767?v=4" alt="Substack" height="96"></a></p><h3>Silver Sponsors</h3>
+<p><a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a></p><h3>Bronze Sponsors</h3>
+<p><a href="https://launchdarkly.com"><img src="https://images.opencollective.com/launchdarkly/574bb9e/logo.png" alt="launchdarkly" height="32"></a> <a href="https://troypoint.com"><img src="https://images.opencollective.com/troypoint/080f96f/avatar.png" alt="TROYPOINT" height="32"></a> <a href="https://mobilen.nu"><img src="https://images.opencollective.com/mobilen/e19860d/logo.png" alt="Mobilen" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="null"><img src="https://images.opencollective.com/bugsnag-stability-monitoring/c2cef36/logo.png" alt="Bugsnag Stability Monitoring" height="32"></a> <a href="https://mixpanel.com"><img src="https://images.opencollective.com/mixpanel/cd682f7/logo.png" alt="Mixpanel" height="32"></a> <a href="https://www.vpsserver.com"><img src="https://images.opencollective.com/vpsservercom/logo.png" alt="VPS Server" height="32"></a> <a href="https://icons8.com"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8: free icons, photos, illustrations, and music" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://themeisle.com"><img src="https://images.opencollective.com/themeisle/d5592fe/logo.png" alt="ThemeIsle" height="32"></a> <a href="https://www.firesticktricks.com"><img src="https://images.opencollective.com/fire-stick-tricks/b8fbe2c/logo.png" alt="Fire Stick Tricks" height="32"></a> <a href="https://www.practiceignition.com"><img src="https://avatars.githubusercontent.com/u/5753491?v=4" alt="Practice Ignition" height="32"></a></p>
<!--sponsorsend-->
## <a name="technology-sponsors"></a>Technology Sponsors
diff --git a/tools/node_modules/eslint/bin/eslint.js b/tools/node_modules/eslint/bin/eslint.js
index 5fa5766828e..6b05356b9db 100755
--- a/tools/node_modules/eslint/bin/eslint.js
+++ b/tools/node_modules/eslint/bin/eslint.js
@@ -5,7 +5,7 @@
* @author Nicholas C. Zakas
*/
-/* eslint no-console:off */
+/* eslint no-console:off -- CLI */
"use strict";
diff --git a/tools/node_modules/eslint/conf/eslint-recommended.js b/tools/node_modules/eslint/conf/eslint-recommended.js
index 2137685fb7c..6f639855a96 100644
--- a/tools/node_modules/eslint/conf/eslint-recommended.js
+++ b/tools/node_modules/eslint/conf/eslint-recommended.js
@@ -6,7 +6,7 @@
"use strict";
-/* eslint sort-keys: ["error", "asc"] */
+/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
/** @type {import("../lib/shared/types").ConfigData} */
module.exports = {
@@ -42,9 +42,11 @@ module.exports = {
"no-inner-declarations": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
+ "no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-mixed-spaces-and-tabs": "error",
"no-new-symbol": "error",
+ "no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-prototype-builtins": "error",
@@ -60,8 +62,10 @@ module.exports = {
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
+ "no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-vars": "error",
+ "no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
diff --git a/tools/node_modules/eslint/conf/category-list.json b/tools/node_modules/eslint/conf/rule-type-list.json
index cd3b816b657..f362aa412f9 100644
--- a/tools/node_modules/eslint/conf/category-list.json
+++ b/tools/node_modules/eslint/conf/rule-type-list.json
@@ -1,11 +1,8 @@
{
- "categories": [
- { "name": "Possible Errors", "description": "These rules relate to possible syntax or logic errors in JavaScript code:" },
- { "name": "Best Practices", "description": "These rules relate to better ways of doing things to help you avoid problems:" },
- { "name": "Strict Mode", "description": "These rules relate to strict mode directives:" },
- { "name": "Variables", "description": "These rules relate to variable declarations:" },
- { "name": "Stylistic Issues", "description": "These rules relate to style guidelines, and are therefore quite subjective:" },
- { "name": "ECMAScript 6", "description": "These rules relate to ES6, also known as ES2015:" }
+ "types": [
+ { "name": "problem", "displayName": "Possible Problems", "description": "These rules relate to possible logic errors in code:" },
+ { "name": "suggestion", "displayName": "Suggestions", "description": "These rules suggest alternate ways of doing things:" },
+ { "name": "layout", "displayName": "Layout & Formatting", "description": "These rules care about how the code looks rather than how it executes:" }
],
"deprecated": {
"name": "Deprecated",
diff --git a/tools/node_modules/eslint/lib/api.js b/tools/node_modules/eslint/lib/api.js
index e4b6643b447..3dde0985505 100644
--- a/tools/node_modules/eslint/lib/api.js
+++ b/tools/node_modules/eslint/lib/api.js
@@ -5,30 +5,22 @@
"use strict";
-const { CLIEngine } = require("./cli-engine");
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
const { ESLint } = require("./eslint");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
const { SourceCode } = require("./source-code");
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
module.exports = {
Linter,
- CLIEngine,
ESLint,
RuleTester,
SourceCode
};
-
-// DOTO: remove deprecated API.
-let deprecatedLinterInstance = null;
-
-Object.defineProperty(module.exports, "linter", {
- enumerable: false,
- get() {
- if (!deprecatedLinterInstance) {
- deprecatedLinterInstance = new Linter();
- }
-
- return deprecatedLinterInstance;
- }
-});
diff --git a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js b/tools/node_modules/eslint/lib/cli-engine/cli-engine.js
index 24f6a10d14b..aae71607d2c 100644
--- a/tools/node_modules/eslint/lib/cli-engine/cli-engine.js
+++ b/tools/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
@@ -55,8 +55,8 @@ const validFixTypes = new Set(["problem", "suggestion", "layout"]);
/** @typedef {import("../shared/types").Plugin} Plugin */
/** @typedef {import("../shared/types").RuleConf} RuleConf */
/** @typedef {import("../shared/types").Rule} Rule */
-/** @typedef {ReturnType<CascadingConfigArrayFactory["getConfigArrayForFile"]>} ConfigArray */
-/** @typedef {ReturnType<ConfigArray["extractConfig"]>} ExtractedConfig */
+/** @typedef {ReturnType<CascadingConfigArrayFactory.getConfigArrayForFile>} ConfigArray */
+/** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
/**
* The options to configure a CLI engine with.
@@ -280,7 +280,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
*/
@@ -332,6 +332,23 @@ function getRule(ruleId, configArrays) {
}
/**
+ * 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.
* @returns {IterableIterator<DeprecatedRuleInfo>} Used deprecated rules.
@@ -463,6 +480,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<string,boolean>} The boolean map.
*/
function toBooleanMap(keys, defaultValue, displayName) {
@@ -526,6 +544,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,6 +562,9 @@ function directoryExists(resolvedPath) {
// Public Interface
//------------------------------------------------------------------------------
+/**
+ * Core CLI.
+ */
class CLIEngine {
/**
@@ -623,12 +645,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);
}
}
@@ -730,6 +747,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 +954,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,6 +1003,7 @@ 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.
+ * @throws {any} As may be thrown by requiring of formatter
* @returns {(Function|null)} The formatter function or null if the `format` is not a string.
*/
getFormatter(format) {
@@ -1019,7 +1039,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/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js b/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js
index ade28517b42..f1442d150b8 100644
--- a/tools/node_modules/eslint/lib/cli-engine/file-enumerator.js
+++ b/tools/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<CascadingConfigArrayFactory["getConfigArrayForFile"]>} ConfigArray */
+/** @typedef {ReturnType<CascadingConfigArrayFactory.getConfigArrayForFile>} 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
*/
@@ -132,6 +133,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
*/
@@ -173,7 +175,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 +191,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.
*/
@@ -270,6 +270,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<FileAndConfig>} The found files.
*/
*iterateFiles(patternOrPatterns) {
diff --git a/tools/node_modules/eslint/lib/cli-engine/formatters/codeframe.js b/tools/node_modules/eslint/lib/cli-engine/formatters/codeframe.js
deleted file mode 100644
index 41e3ab7b0af..00000000000
--- a/tools/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/tools/node_modules/eslint/lib/cli-engine/formatters/html.js b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js
index baddb63079d..e28996f6cd2 100644
--- a/tools/node_modules/eslint/lib/cli-engine/formatters/html.js
+++ b/tools/node_modules/eslint/lib/cli-engine/formatters/html.js
@@ -281,8 +281,8 @@ function resultTemplate(it) {
`.trimLeft();
}
-// 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/tools/node_modules/eslint/lib/cli-engine/formatters/table.js b/tools/node_modules/eslint/lib/cli-engine/formatters/table.js
deleted file mode 100644
index a74cce0d516..00000000000
--- a/tools/node_modules/eslint/lib/cli-engine/formatters/table.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/**
- * @fileoverview "table reporter.
- * @author Gajus Kuizinas <gajus@gajus.com>
- */
-"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<Object>} 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/tools/node_modules/eslint/lib/cli-engine/formatters/tap.js b/tools/node_modules/eslint/lib/cli-engine/formatters/tap.js
index 354872a0c92..e4148a3b392 100644
--- a/tools/node_modules/eslint/lib/cli-engine/formatters/tap.js
+++ b/tools/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/tools/node_modules/eslint/lib/cli-engine/hash.js b/tools/node_modules/eslint/lib/cli-engine/hash.js
index 6d7ef8bf1b2..8e467734a02 100644
--- a/tools/node_modules/eslint/lib/cli-engine/hash.js
+++ b/tools/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/tools/node_modules/eslint/lib/cli-engine/xml-escape.js b/tools/node_modules/eslint/lib/cli-engine/xml-escape.js
index 175c2c0c2dd..2e52dbaac02 100644
--- a/tools/node_modules/eslint/lib/cli-engine/xml-escape.js
+++ b/tools/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 "&lt;";
diff --git a/tools/node_modules/eslint/lib/config/flat-config-array.js b/tools/node_modules/eslint/lib/config/flat-config-array.js
index ecf396a3314..ef9cb33ca28 100644
--- a/tools/node_modules/eslint/lib/config/flat-config-array.js
+++ b/tools/node_modules/eslint/lib/config/flat-config-array.js
@@ -61,7 +61,7 @@ class FlatConfigArray extends ConfigArray {
this.unshift(baseConfig);
}
- /* 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
@@ -118,7 +118,7 @@ class FlatConfigArray extends ConfigArray {
return config;
}
- /* eslint-enable class-methods-use-this */
+ /* eslint-enable class-methods-use-this -- Desired as instance method */
}
diff --git a/tools/node_modules/eslint/lib/config/flat-config-schema.js b/tools/node_modules/eslint/lib/config/flat-config-schema.js
index 80785476133..c8cc7114940 100644
--- a/tools/node_modules/eslint/lib/config/flat-config-schema.js
+++ b/tools/node_modules/eslint/lib/config/flat-config-schema.js
@@ -336,7 +336,7 @@ const rulesSchema = {
// avoid hairy edge case
if (ruleId === "__proto__") {
- /* eslint-disable-next-line no-proto */
+ /* eslint-disable-next-line no-proto -- Though deprecated, may still be present */
delete result.__proto__;
continue;
}
diff --git a/tools/node_modules/eslint/lib/config/rule-validator.js b/tools/node_modules/eslint/lib/config/rule-validator.js
index f162dd81a05..527a56e1799 100644
--- a/tools/node_modules/eslint/lib/config/rule-validator.js
+++ b/tools/node_modules/eslint/lib/config/rule-validator.js
@@ -19,6 +19,7 @@ const ajv = require("../shared/ajv")();
* Finds a rule with the given ID in the given config.
* @param {string} ruleId The ID of the rule to find.
* @param {Object} config The config to search in.
+ * @throws {TypeError} For missing plugin or rule.
* @returns {{create: Function, schema: (Array|null)}} THe rule object.
*/
function findRuleDefinition(ruleId, config) {
@@ -34,16 +35,33 @@ function findRuleDefinition(ruleId, config) {
pluginName = ruleIdParts.join("/");
}
- 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 plugin = config.plugins[pluginName];
+
+ // first check for exact rule match
+ if (plugin.rules && plugin.rules[ruleName]) {
+ return config.plugins[pluginName].rules[ruleName];
+ }
- return config.plugins[pluginName].rules[ruleName];
+ errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`;
+
+ // otherwise, let's see if we can find the rule name elsewhere
+ for (const [otherPluginName, otherPlugin] of Object.entries(config.plugins)) {
+ if (otherPlugin.rules && otherPlugin.rules[ruleName]) {
+ errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`;
+ break;
+ }
+ }
+
+ // falls through to throw error
+ }
+ throw new TypeError(errorMessage);
}
/**
@@ -98,7 +116,6 @@ class RuleValidator {
* A collection of compiled validators for rules that have already
* been validated.
* @type {WeakMap}
- * @property validators
*/
this.validators = new WeakMap();
}
diff --git a/tools/node_modules/eslint/lib/eslint/eslint.js b/tools/node_modules/eslint/lib/eslint/eslint.js
index 056e04b5945..b4a1d028db9 100644
--- a/tools/node_modules/eslint/lib/eslint/eslint.js
+++ b/tools/node_modules/eslint/lib/eslint/eslint.js
@@ -125,7 +125,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 +151,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 +238,7 @@ function processOptions({
errors.push("'fix' must be a boolean or a function.");
}
if (fixTypes !== null && !isFixTypeArray(fixTypes)) {
- errors.push("'fixTypes' must be an array of any of \"problem\", \"suggestion\", and \"layout\".");
+ errors.push("'fixTypes' must be an array of any of \"directive\", \"problem\", \"suggestion\", and \"layout\".");
}
if (typeof globInputPaths !== "boolean") {
errors.push("'globInputPaths' must be a boolean.");
@@ -421,6 +422,9 @@ function compareResultsByFilePath(a, b) {
return 0;
}
+/**
+ * Main API.
+ */
class ESLint {
/**
diff --git a/tools/node_modules/eslint/lib/init/autoconfig.js b/tools/node_modules/eslint/lib/init/autoconfig.js
index 054c538496f..ea2523421c2 100644
--- a/tools/node_modules/eslint/lib/init/autoconfig.js
+++ b/tools/node_modules/eslint/lib/init/autoconfig.js
@@ -11,7 +11,11 @@
const equal = require("fast-deep-equal"),
recConfig = require("../../conf/eslint-recommended"),
- ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
+ {
+ Legacy: {
+ ConfigOps
+ }
+ } = require("@eslint/eslintrc"),
{ Linter } = require("../linter"),
configRule = require("./config-rule");
@@ -32,9 +36,9 @@ const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only
/**
* 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
+ * @property {ruleConfig} config A valid configuration for the rule
+ * @property {number} specificity The number of elements in the ruleConfig array
+ * @property {number} errorCount The number of errors encountered when linting with the config
*/
/**
@@ -45,8 +49,8 @@ const MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only
/**
* 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
+ * @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) => {
@@ -69,7 +73,6 @@ function makeRegistryItems(rulesConfig) {
*/
class Registry {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations
*/
@@ -100,7 +103,7 @@ class Registry {
* configurations.
*
* The length of the returned array will be <= MAX_CONFIG_COMBINATIONS.
- * @returns {Object[]} "rules" configurations to use for linting
+ * @returns {Object[]} "rules" configurations to use for linting
*/
buildRuleSets() {
let idx = 0;
@@ -112,7 +115,7 @@ class Registry {
*
* 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.
+ * @param {string} rule The ruleId to add.
* @returns {void}
*/
const addRuleToRuleSet = function(rule) {
@@ -199,7 +202,7 @@ class Registry {
* 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.
+ * @returns {Registry} A registry of failing rules.
*/
getFailingRulesRegistry() {
const ruleIds = Object.keys(this.rules),
@@ -236,8 +239,8 @@ class Registry {
/**
* 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
+ * @param {number} specificity Only keep configs with this specificity
+ * @returns {Registry} A registry of rules
*/
filterBySpecificity(specificity) {
const ruleIds = Object.keys(this.rules),
@@ -253,10 +256,10 @@ class Registry {
/**
* 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
+ * @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();
@@ -301,7 +304,7 @@ class Registry {
ruleSetIdx += 1;
if (cb) {
- cb(totalFilesLinting); // eslint-disable-line node/callback-return
+ cb(totalFilesLinting); // eslint-disable-line node/callback-return -- End of function
}
});
@@ -318,8 +321,8 @@ class Registry {
*
* 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"]`
+ * @param {Object} config config object
+ * @returns {Object} config object using `"extends": ["eslint:recommended"]`
*/
function extendFromRecommended(config) {
const newConfig = Object.assign({}, config);
diff --git a/tools/node_modules/eslint/lib/init/config-file.js b/tools/node_modules/eslint/lib/init/config-file.js
index 4c648ac0551..9eb10fab3a4 100644
--- a/tools/node_modules/eslint/lib/init/config-file.js
+++ b/tools/node_modules/eslint/lib/init/config-file.js
@@ -23,9 +23,9 @@ const debug = require("debug")("eslint:config-file");
* 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
+ * @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;
@@ -63,7 +63,7 @@ function writeYAMLConfigFile(config, filePath) {
// lazy load YAML to improve performance when not used
const yaml = require("js-yaml");
- const content = yaml.safeDump(config, { sortKeys: true });
+ const content = yaml.dump(config, { sortKeys: true });
fs.writeFileSync(filePath, content, "utf8");
}
diff --git a/tools/node_modules/eslint/lib/init/config-initializer.js b/tools/node_modules/eslint/lib/init/config-initializer.js
index 3c7f2ba0944..3c244b7bcc0 100644
--- a/tools/node_modules/eslint/lib/init/config-initializer.js
+++ b/tools/node_modules/eslint/lib/init/config-initializer.js
@@ -18,9 +18,13 @@ const util = require("util"),
semver = require("semver"),
espree = require("espree"),
recConfig = require("../../conf/eslint-recommended"),
- ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops"),
+ {
+ Legacy: {
+ ConfigOps,
+ naming
+ }
+ } = require("@eslint/eslintrc"),
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"),
@@ -98,8 +102,8 @@ 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.
+ * @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) {
@@ -157,9 +161,10 @@ function getModulesList(config, installESLint) {
*
* 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
+ * @param {Object} answers answers received from enquirer
+ * @param {Object} config config object
+ * @throws {Error} If source code retrieval fails or source code file count is 0.
+ * @returns {Object} config object with configured rules
*/
function configureRules(answers, config) {
const BAR_TOTAL = 20,
@@ -411,7 +416,7 @@ function hasESLintVersionConflict(answers) {
/**
* Install modules.
- * @param {string[]} modules Modules to be installed.
+ * @param {string[]} modules Modules to be installed.
* @returns {void}
*/
function installModules(modules) {
@@ -422,9 +427,9 @@ function installModules(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.
+ * @param {string[]} modules Array of modules to be installed.
+ * @param {boolean} packageJsonExists Indicates if package.json is existed.
+ * @returns {Promise<void>} Answer that indicates if user wants to install.
*/
function askInstallModules(modules, packageJsonExists) {
@@ -460,7 +465,7 @@ function askInstallModules(modules, packageJsonExists) {
/* 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
+ * @returns {Promise<void>} The promise with the result of the prompt
*/
function promptUser() {
diff --git a/tools/node_modules/eslint/lib/init/config-rule.js b/tools/node_modules/eslint/lib/init/config-rule.js
index 7aec89c3df0..131e84a60c5 100644
--- a/tools/node_modules/eslint/lib/init/config-rule.js
+++ b/tools/node_modules/eslint/lib/init/config-rule.js
@@ -17,8 +17,8 @@ const builtInRules = require("../rules");
/**
* Wrap all of the elements of an array into arrays.
- * @param {*[]} xs Any array.
- * @returns {Array[]} An array of arrays.
+ * @param {*[]} xs Any array.
+ * @returns {Array[]} An array of arrays.
*/
function explodeArray(xs) {
return xs.reduce((accumulator, x) => {
@@ -33,9 +33,9 @@ function explodeArray(xs) {
*
* 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.
+ * @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 = [];
@@ -70,8 +70,8 @@ function combineArrays(arr1, arr2) {
* [{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
+ * @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) => {
@@ -97,7 +97,7 @@ function groupByProperty(objects) {
* 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).
+ * @param {number} 0 The rule's severity (0, 1, 2).
*/
/**
@@ -131,9 +131,9 @@ function groupByProperty(objects) {
* {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
+ * @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 = [];
@@ -174,7 +174,6 @@ function combinePropertyObjects(objArr1, objArr2) {
*/
class RuleConfigSet {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {ruleConfig[]} configs Valid rule configurations
*/
@@ -206,7 +205,7 @@ class RuleConfigSet {
/**
* Add rule configs from an array of strings (schema enums)
- * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"])
+ * @param {string[]} enums Array of valid rule options (e.g. ["always", "never"])
* @returns {void}
*/
addEnums(enums) {
@@ -215,7 +214,7 @@ class RuleConfigSet {
/**
* Add rule configurations from a schema object
- * @param {Object} obj Schema item with type === "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) {
@@ -260,8 +259,8 @@ class RuleConfigSet {
/**
* Generate valid rule configurations based on a schema object
- * @param {Object} schema A rule's schema object
- * @returns {Array[]} Valid rule configurations
+ * @param {Object} schema A rule's schema object
+ * @returns {Array[]} Valid rule configurations
*/
function generateConfigsFromSchema(schema) {
const configSet = new RuleConfigSet();
diff --git a/tools/node_modules/eslint/lib/init/npm-utils.js b/tools/node_modules/eslint/lib/init/npm-utils.js
index b91a824b126..4a8efe964f3 100644
--- a/tools/node_modules/eslint/lib/init/npm-utils.js
+++ b/tools/node_modules/eslint/lib/init/npm-utils.js
@@ -21,8 +21,8 @@ const fs = require("fs"),
/**
* 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
+ * @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());
@@ -45,7 +45,7 @@ function findPackageJson(startDir) {
/**
* Install node modules synchronously and save to devDependencies in package.json
- * @param {string|string[]} packages Node module or modules to install
+ * @param {string|string[]} packages Node module or modules to install
* @returns {void}
*/
function installSyncSaveDev(packages) {
@@ -86,12 +86,13 @@ function fetchPeerDependencies(packageName) {
/**
* 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
+ * @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
+ * @throws {Error} If cannot find valid `package.json` file.
+ * @returns {Object} An object whose keys are the module names
* and values are booleans indicating installation.
*/
function check(packages, opt) {
@@ -133,9 +134,9 @@ function check(packages, opt) {
* 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
+ * @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) {
@@ -147,8 +148,8 @@ function checkDeps(packages, rootDir) {
* 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
+ * @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) {
@@ -157,7 +158,7 @@ function checkDevDeps(packages) {
/**
* Check whether package.json is found in current path.
- * @param {string} [startDir] Starting directory
+ * @param {string} [startDir] Starting directory
* @returns {boolean} Whether a package.json is found in current path.
*/
function checkPackageJson(startDir) {
diff --git a/tools/node_modules/eslint/lib/init/source-code-utils.js b/tools/node_modules/eslint/lib/init/source-code-utils.js
index dca6541d1ed..08c20e5d56e 100644
--- a/tools/node_modules/eslint/lib/init/source-code-utils.js
+++ b/tools/node_modules/eslint/lib/init/source-code-utils.js
@@ -23,7 +23,7 @@ const { CLIEngine } = require("../cli-engine");
* 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 { getCLIEngineInternalSlots } = require("../cli-engine/cli-engine"); // eslint-disable-line node/no-restricted-require -- Todo
const debug = require("debug")("eslint:source-code-utils");
@@ -33,9 +33,10 @@ const debug = require("debug")("eslint:source-code-utils");
/**
* 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
+ * @param {string} filename The fully resolved filename to get SourceCode from.
+ * @param {Object} engine A CLIEngine.
+ * @throws {Error} Upon fatal errors from execution.
+ * @returns {Array} Array of the SourceCode object representing the file
* and fatal error message.
*/
function getSourceCodeOfFile(filename, engine) {
@@ -97,7 +98,7 @@ function getSourceCodeOfFiles(patterns, options, callback) {
sourceCodes[filename] = sourceCode;
}
if (callback) {
- callback(filenames.length); // eslint-disable-line node/callback-return
+ callback(filenames.length); // eslint-disable-line node/callback-return -- End of function
}
});
diff --git a/tools/node_modules/eslint/lib/linter/apply-disable-directives.js b/tools/node_modules/eslint/lib/linter/apply-disable-directives.js
index 0ba69ca9cc4..e5f2e528ef8 100644
--- a/tools/node_modules/eslint/lib/linter/apply-disable-directives.js
+++ b/tools/node_modules/eslint/lib/linter/apply-disable-directives.js
@@ -5,6 +5,8 @@
"use strict";
+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
@@ -17,6 +19,177 @@ function compareLocations(itemA, itemB) {
}
/**
+ * Groups a set of directives into sub-arrays by their parent comment.
+ * @param {Directive[]} directives Unused directives to be removed.
+ * @returns {Directive[][]} Directives grouped by their parent comment.
+ */
+function groupByParentComment(directives) {
+ const groups = new Map();
+
+ for (const directive of directives) {
+ const { unprocessedDirective: { parentComment } } = directive;
+
+ if (groups.has(parentComment)) {
+ groups.get(parentComment).push(directive);
+ } else {
+ groups.set(parentComment, [directive]);
+ }
+ }
+
+ return [...groups.values()];
+}
+
+/**
+ * Creates removal details for a set of directives within the same comment.
+ * @param {Directive[]} directives Unused directives to be removed.
+ * @param {Token} commentToken The backing Comment token.
+ * @returns {{ description, fix, position }[]} 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
+ .trimRight(); // remove all whitespace after the list
+
+ /*
+ * We can assume that `listText` contains multiple elements.
+ * Otherwise, this function wouldn't be called - if there is
+ * only one rule in the list, then the whole comment must be removed.
+ */
+
+ return directives.map(directive => {
+ const { ruleId } = directive;
+
+ const regex = new RegExp(String.raw`(?:^|\s*,\s*)${escapeRegExp(ruleId)}(?:\s*,\s*|$)`, "u");
+ const match = regex.exec(listText);
+ const matchedText = match[0];
+ const matchStartOffset = listStartOffset + match.index;
+ const matchEndOffset = matchStartOffset + matchedText.length;
+
+ const firstIndexOfComma = matchedText.indexOf(",");
+ const lastIndexOfComma = matchedText.lastIndexOf(",");
+
+ let removalStartOffset, removalEndOffset;
+
+ if (firstIndexOfComma !== lastIndexOfComma) {
+
+ /*
+ * Since there are two commas, this must one of the elements in the middle of the list.
+ * Matched range starts where the previous rule name ends, and ends where the next rule name starts.
+ *
+ * // eslint-disable-line rule-one , rule-two , rule-three -- comment
+ * ^^^^^^^^^^^^^^
+ *
+ * We want to remove only the content between the two commas, and also one of the commas.
+ *
+ * // eslint-disable-line rule-one , rule-two , rule-three -- comment
+ * ^^^^^^^^^^^
+ */
+ removalStartOffset = matchStartOffset + firstIndexOfComma;
+ removalEndOffset = matchStartOffset + lastIndexOfComma;
+
+ } else {
+
+ /*
+ * This is either the first element or the last element.
+ *
+ * If this is the first element, matched range starts where the first rule name starts
+ * and ends where the second rule name starts. This is exactly the range we want
+ * to remove so that the second rule name will start where the first one was starting
+ * and thus preserve the original formatting.
+ *
+ * // eslint-disable-line rule-one , rule-two , rule-three -- comment
+ * ^^^^^^^^^^^
+ *
+ * Similarly, if this is the last element, we've already matched the range we want to
+ * remove. The previous rule name will end where the last one was ending, relative
+ * to the content on the right side.
+ *
+ * // eslint-disable-line rule-one , rule-two , rule-three -- comment
+ * ^^^^^^^^^^^^^
+ */
+ removalStartOffset = matchStartOffset;
+ removalEndOffset = matchEndOffset;
+ }
+
+ return {
+ description: `'${ruleId}'`,
+ fix: {
+ range: [
+ commentValueStart + removalStartOffset,
+ commentValueStart + removalEndOffset
+ ],
+ text: ""
+ },
+ position: 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, position }} 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: " "
+ },
+ position: directives[0].unprocessedDirective
+ };
+}
+
+/**
+ * Parses details from directives to create output Problems.
+ * @param {Directive[]} allDirectives Unused directives to be removed.
+ * @returns {{ description, fix, position }[]} Details for later creation of output Problems.
+ */
+function processUnusedDisableDirectives(allDirectives) {
+ const directiveGroups = groupByParentComment(allDirectives);
+
+ return directiveGroups.flatMap(
+ directives => {
+ const { parentComment } = directives[0].unprocessedDirective;
+ const remainingRuleIds = new Set(parentComment.ruleIds);
+
+ for (const directive of directives) {
+ remainingRuleIds.delete(directive.ruleId);
+ }
+
+ return remainingRuleIds.size
+ ? createIndividualDirectivesRemoval(directives, parentComment.commentToken)
+ : [createCommentRemoval(directives, parentComment.commentToken)];
+ }
+ );
+}
+
+/**
* This is the same as the exported function, except that it
* doesn't handle disable-line and disable-next-line directives, and it always reports unused
* disable directives.
@@ -82,17 +255,22 @@ function applyDirectives(options) {
}
}
- const unusedDisableDirectives = options.directives
- .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive))
- .map(directive => ({
+ const unusedDisableDirectivesToReport = options.directives
+ .filter(directive => directive.type === "disable" && !usedDisableDirectives.has(directive));
+
+ const processed = processUnusedDisableDirectives(unusedDisableDirectivesToReport);
+
+ const unusedDisableDirectives = processed
+ .map(({ description, fix, position }) => ({
ruleId: null,
- message: directive.ruleId
- ? `Unused eslint-disable directive (no problems were reported from '${directive.ruleId}').`
+ message: description
+ ? `Unused eslint-disable directive (no problems were reported from ${description}).`
: "Unused eslint-disable directive (no problems were reported).",
- line: directive.unprocessedDirective.line,
- column: directive.unprocessedDirective.column,
+ line: position.line,
+ column: position.column,
severity: options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
- nodeType: null
+ nodeType: null,
+ ...options.disableFixes ? {} : { fix }
}));
return { problems, unusedDisableDirectives };
@@ -113,30 +291,17 @@ function applyDirectives(options) {
* @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
+ * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties.
* @returns {{ruleId: (string|null), line: number, column: number}[]}
* A list of reported problems that were not disabled by the directive comments.
*/
-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,11 +327,13 @@ module.exports = ({ directives, problems, reportUnusedDisableDirectives = "off"
const blockDirectivesResult = applyDirectives({
problems,
directives: blockDirectives,
+ disableFixes,
reportUnusedDisableDirectives
});
const lineDirectivesResult = applyDirectives({
problems: blockDirectivesResult.problems,
directives: lineDirectives,
+ disableFixes,
reportUnusedDisableDirectives
});
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js
index 47427c11a3d..d66c2f1be32 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js
+++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js
@@ -30,6 +30,18 @@ function isCaseNode(node) {
}
/**
+ * 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.
* @param {string} operator The operator found in the LogicalExpression node
@@ -138,6 +150,7 @@ function isIdentifierReference(node) {
return parent.id !== node;
case "Property":
+ case "PropertyDefinition":
case "MethodDefinition":
return (
parent.key !== node ||
@@ -388,29 +401,64 @@ function processCodePathToEnter(analyzer, node) {
let state = codePath && CodePath.getState(codePath);
const parent = node.parent;
+ /**
+ * Creates a new code path and trigger the onCodePathStart event
+ * based on the currently selected node.
+ * @param {string} origin The reason the code path was started.
+ * @returns {void}
+ */
+ function startCodePath(origin) {
+ if (codePath) {
+
+ // Emits onCodePathSegmentStart events if updated.
+ forwardCurrentToHead(analyzer, node);
+ debug.dumpState(node, state, false);
+ }
+
+ // Create the code path of this scope.
+ codePath = analyzer.codePath = new CodePath({
+ id: analyzer.idGenerator.next(),
+ origin,
+ upper: codePath,
+ onLooped: analyzer.onLooped
+ });
+ state = CodePath.getState(codePath);
+
+ // Emits onCodePathStart events.
+ debug.dump(`onCodePathStart ${codePath.id}`);
+ analyzer.emitter.emit("onCodePathStart", codePath, node);
+ }
+
+ /*
+ * Special case: The right side of class field initializer is considered
+ * to be its own function, so we need to start a new code path in this
+ * case.
+ */
+ if (isPropertyDefinitionValue(node)) {
+ startCodePath("class-field-initializer");
+
+ /*
+ * Intentional fall through because `node` needs to also be
+ * processed by the code below. For example, if we have:
+ *
+ * class Foo {
+ * a = () => {}
+ * }
+ *
+ * In this case, we also need start a second code path.
+ */
+
+ }
+
switch (node.type) {
case "Program":
+ startCodePath("program");
+ break;
+
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
- if (codePath) {
-
- // Emits onCodePathSegmentStart events if updated.
- forwardCurrentToHead(analyzer, node);
- debug.dumpState(node, state, false);
- }
-
- // Create the code path of this scope.
- codePath = analyzer.codePath = new CodePath(
- analyzer.idGenerator.next(),
- codePath,
- analyzer.onLooped
- );
- state = CodePath.getState(codePath);
-
- // Emits onCodePathStart events.
- debug.dump(`onCodePathStart ${codePath.id}`);
- analyzer.emitter.emit("onCodePathStart", codePath, node);
+ startCodePath("function");
break;
case "ChainExpression":
@@ -503,6 +551,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 +676,38 @@ 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);
- }
+ endCodePath();
break;
}
@@ -662,6 +721,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 +754,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/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js
index ca96ad34189..fad559a2ad2 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js
+++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-segment.js
@@ -33,7 +33,6 @@ function isReachable(segment) {
*/
class CodePathSegment {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {string} id An identifier.
* @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js
index f75e60e28a8..118f70a1707 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js
+++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path-state.js
@@ -219,7 +219,6 @@ function finalizeTestSegmentsOfFor(context, choiceContext, head) {
*/
class CodePathState {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {IdGenerator} idGenerator An id generator to generate id for code
* path segments.
@@ -360,6 +359,7 @@ class CodePathState {
/**
* Pops the last choice context and finalizes it.
+ * @throws {Error} (Unreachable.)
* @returns {ChoiceContext} The popped context.
*/
popChoiceContext() {
@@ -450,6 +450,7 @@ class CodePathState {
/**
* Makes a code path segment of the right-hand operand of a logical
* expression.
+ * @throws {Error} (Unreachable.)
* @returns {void}
*/
makeLogicalRight() {
@@ -965,6 +966,7 @@ class CodePathState {
* `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`,
* and `ForStatement`.
* @param {string|null} label A label of the node which was triggered.
+ * @throws {Error} (Unreachable - unknown type.)
* @returns {void}
*/
pushLoopContext(type, label) {
@@ -1036,6 +1038,7 @@ class CodePathState {
/**
* Pops the last context of a loop statement and finalizes it.
+ * @throws {Error} (Unreachable - unknown type.)
* @returns {void}
*/
popLoopContext() {
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js
index 49b37c6b227..f225c09a1d5 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/code-path.js
+++ b/tools/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.
@@ -37,6 +39,13 @@ class CodePath {
this.id = id;
/**
+ * The reason that this code path was started. May be "program",
+ * "function", or "class-field-initializer".
+ * @type {string}
+ */
+ this.origin = origin;
+
+ /**
* The code path of the upper function scope.
* @type {CodePath|null}
*/
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js
index a4cb99a22e0..ca64862db32 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js
+++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/debug-helpers.js
@@ -21,7 +21,7 @@ const debug = require("debug")("eslint:code-path");
* @returns {string} Id of the segment.
*/
/* istanbul ignore next */
-function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc
+function getId(segment) { // eslint-disable-line jsdoc/require-jsdoc -- Ignoring
return segment.id + (segment.reachable ? "" : "!");
}
@@ -115,7 +115,7 @@ module.exports = {
const traceMap = Object.create(null);
const arrows = this.makeDotArrows(codePath, traceMap);
- for (const id in traceMap) { // eslint-disable-line guard-for-in
+ for (const id in traceMap) { // eslint-disable-line guard-for-in -- Want ability to traverse prototype
const segment = traceMap[id];
text += `${id}[`;
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js
index 2e872b5c0db..04c59b5e417 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js
+++ b/tools/node_modules/eslint/lib/linter/code-path-analysis/fork-context.js
@@ -97,7 +97,6 @@ function mergeExtraSegments(context, segments) {
*/
class ForkContext {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {IdGenerator} idGenerator An identifier generator for segments.
* @param {ForkContext|null} upper An upper fork context.
diff --git a/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js b/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js
index 4cb2e0e3d87..83787a4ea5a 100644
--- a/tools/node_modules/eslint/lib/linter/code-path-analysis/id-generator.js
+++ b/tools/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.
*/
diff --git a/tools/node_modules/eslint/lib/linter/config-comment-parser.js b/tools/node_modules/eslint/lib/linter/config-comment-parser.js
index 07bbead281c..34675a76b55 100644
--- a/tools/node_modules/eslint/lib/linter/config-comment-parser.js
+++ b/tools/node_modules/eslint/lib/linter/config-comment-parser.js
@@ -3,7 +3,7 @@
* @author Nicholas C. Zakas
*/
-/* eslint-disable class-methods-use-this*/
+/* eslint class-methods-use-this: off -- Methods desired on instance */
"use strict";
//------------------------------------------------------------------------------
@@ -11,7 +11,11 @@
//------------------------------------------------------------------------------
const levn = require("levn"),
- ConfigOps = require("@eslint/eslintrc/lib/shared/config-ops");
+ {
+ Legacy: {
+ ConfigOps
+ }
+ } = require("@eslint/eslintrc/universal"); // eslint-disable-line node/no-missing-require -- false positive
const debug = require("debug")("eslint:config-comment-parser");
diff --git a/tools/node_modules/eslint/lib/linter/linter.js b/tools/node_modules/eslint/lib/linter/linter.js
index 4e80926a895..fab6c26113f 100644
--- a/tools/node_modules/eslint/lib/linter/linter.js
+++ b/tools/node_modules/eslint/lib/linter/linter.js
@@ -16,11 +16,15 @@ 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"),
+ {
+ Legacy: {
+ ConfigOps,
+ ConfigValidator,
+ environments: BuiltInEnvironments
+ }
+ } = require("@eslint/eslintrc/universal"), // eslint-disable-line node/no-missing-require -- false positive
Traverser = require("../shared/traverser"),
{ SourceCode } = require("../source-code"),
CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"),
@@ -46,8 +50,8 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser");
// Typedefs
//------------------------------------------------------------------------------
-/** @typedef {InstanceType<import("../cli-engine/config-array")["ConfigArray"]>} ConfigArray */
-/** @typedef {InstanceType<import("../cli-engine/config-array")["ExtractedConfig"]>} ExtractedConfig */
+/** @typedef {InstanceType<import("../cli-engine/config-array").ConfigArray>} ConfigArray */
+/** @typedef {InstanceType<import("../cli-engine/config-array").ExtractedConfig>} ExtractedConfig */
/** @typedef {import("../shared/types").ConfigData} ConfigData */
/** @typedef {import("../shared/types").Environment} Environment */
/** @typedef {import("../shared/types").GlobalConf} GlobalConf */
@@ -56,17 +60,19 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser");
/** @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
*/
/**
@@ -94,12 +100,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.
*/
@@ -242,14 +248,14 @@ 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 {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, ruleMapper } = options;
const ruleIds = Object.keys(commentParser.parseListConfig(value));
const directiveRules = ruleIds.length ? ruleIds : [null];
const result = {
@@ -257,13 +263,15 @@ 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 });
+ result.directives.push({ parentComment, type, line: commentToken.loc.start.line, column: commentToken.loc.start.column + 1, ruleId });
} else {
- result.directiveProblems.push(createLintingProblem({ ruleId, loc }));
+ result.directiveProblems.push(createLintingProblem({ ruleId, loc: commentToken.loc }));
}
}
return result;
@@ -344,7 +352,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, ruleMapper };
const { directives, directiveProblems } = createDisableDirectives(options);
disableDirectives.push(...directives);
@@ -452,7 +460,7 @@ function normalizeEcmaVersion(parser, ecmaVersion) {
return ecmaVersion >= 2015 ? ecmaVersion - 2009 : ecmaVersion;
}
-const eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//gsu;
+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 +473,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(stripDirectiveComment(match[1]))
+ );
+ }
}
return retv;
@@ -758,6 +768,7 @@ function markVariableAsUsed(scopeManager, currentNode, parserOptions, name) {
* Runs a rule, and gets its listeners
* @param {Rule} rule A normalized rule with a `create` method
* @param {Context} ruleContext The context that should be passed to the rule
+ * @throws {any} Any error during the rule's `create`
* @returns {Object} A map of selector listeners provided by the rule
*/
function createRuleListeners(rule, ruleContext) {
@@ -925,8 +936,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);
}
@@ -936,13 +955,31 @@ function runRules(sourceCode, configuredRules, ruleMapper, parserOptions, parser
const ruleListeners = 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;
+ }
+ };
+ }
+
// 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 +1064,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;
}
@@ -1050,7 +1087,7 @@ 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.
*/
constructor({ cwd } = {}) {
internalSlotsMap.set(this, {
@@ -1078,6 +1115,7 @@ 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.
+ * @throws {Error} If during rule execution.
* @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
*/
_verifyWithoutProcessors(textOrSourceCode, providedConfig, providedOptions) {
@@ -1203,11 +1241,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),
@@ -1295,8 +1339,7 @@ class Linter {
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"));
diff --git a/tools/node_modules/eslint/lib/linter/node-event-generator.js b/tools/node_modules/eslint/lib/linter/node-event-generator.js
index 8b619fdff83..89ebd281048 100644
--- a/tools/node_modules/eslint/lib/linter/node-event-generator.js
+++ b/tools/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())];
}
/**
@@ -239,7 +237,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/tools/node_modules/eslint/lib/linter/report-translator.js b/tools/node_modules/eslint/lib/linter/report-translator.js
index 75005c16e58..781b3136ec5 100644
--- a/tools/node_modules/eslint/lib/linter/report-translator.js
+++ b/tools/node_modules/eslint/lib/linter/report-translator.js
@@ -32,18 +32,18 @@ const interpolate = require("./interpolate");
/**
* Information about the report
* @typedef {Object} ReportInfo
- * @property {string} ruleId
- * @property {(0|1|2)} severity
- * @property {(string|undefined)} message
- * @property {(string|undefined)} [messageId]
- * @property {number} line
- * @property {number} column
- * @property {(number|undefined)} [endLine]
- * @property {(number|undefined)} [endColumn]
- * @property {(string|null)} nodeType
- * @property {string} source
- * @property {({text: string, range: (number[]|null)}|null)} [fix]
- * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions]
+ * @property {string} ruleId The rule ID
+ * @property {(0|1|2)} severity Severity of the error
+ * @property {(string|undefined)} message The message
+ * @property {(string|undefined)} [messageId] The message ID
+ * @property {number} line The line number
+ * @property {number} column The column number
+ * @property {(number|undefined)} [endLine] The ending line number
+ * @property {(number|undefined)} [endColumn] The ending column number
+ * @property {(string|null)} nodeType Type of node
+ * @property {string} source Source text
+ * @property {({text: string, range: (number[]|null)}|null)} [fix] The fix object
+ * @property {Array<{text: string, range: (number[]|null)}|null>} [suggestions] Suggestion info
*/
//------------------------------------------------------------------------------
diff --git a/tools/node_modules/eslint/lib/linter/rules.js b/tools/node_modules/eslint/lib/linter/rules.js
index a153266efb3..647bab68784 100644
--- a/tools/node_modules/eslint/lib/linter/rules.js
+++ b/tools/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/tools/node_modules/eslint/lib/linter/safe-emitter.js b/tools/node_modules/eslint/lib/linter/safe-emitter.js
index ab212230d39..f4837c1ddcf 100644
--- a/tools/node_modules/eslint/lib/linter/safe-emitter.js
+++ b/tools/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/tools/node_modules/eslint/lib/linter/source-code-fixer.js b/tools/node_modules/eslint/lib/linter/source-code-fixer.js
index 53dc1dc6be7..15386c926c2 100644
--- a/tools/node_modules/eslint/lib/linter/source-code-fixer.js
+++ b/tools/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/tools/node_modules/eslint/lib/linter/timing.js b/tools/node_modules/eslint/lib/linter/timing.js
index 58230306855..c9ab01ec649 100644
--- a/tools/node_modules/eslint/lib/linter/timing.js
+++ b/tools/node_modules/eslint/lib/linter/timing.js
@@ -116,7 +116,7 @@ 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 */
@@ -126,7 +126,7 @@ module.exports = (function() {
/**
* 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
diff --git a/tools/node_modules/eslint/lib/options.js b/tools/node_modules/eslint/lib/options.js
index e3661ec81d5..2dd186de3e8 100644
--- a/tools/node_modules/eslint/lib/options.js
+++ b/tools/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
@@ -151,7 +151,7 @@ module.exports = optionator({
{
option: "fix-type",
type: "Array",
- description: "Specify the types of fixes to apply (problem, suggestion, layout)"
+ description: "Specify the types of fixes to apply (directive, problem, suggestion, layout)"
},
{
heading: "Ignoring files"
diff --git a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
index 2b5524923be..324af7b2cae 100644
--- a/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
+++ b/tools/node_modules/eslint/lib/rule-tester/rule-tester.js
@@ -4,7 +4,7 @@
*/
"use strict";
-/* global describe, it */
+/* eslint-env mocha -- Mocha wrapper */
/*
* This is a wrapper around mocha to allow for DRY unittests for eslint
@@ -55,12 +55,15 @@ 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 */
+/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
/**
* A test case that is expected to pass lint.
* @typedef {Object} ValidTestCase
@@ -103,6 +106,7 @@ const parserSymbol = Symbol.for("eslint.RuleTester.parser");
* @property {number} [endLine] The 1-based line number of the reported end location.
* @property {number} [endColumn] The 1-based column number of the reported end location.
*/
+/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
//------------------------------------------------------------------------------
// Private Members
@@ -210,7 +214,7 @@ function freezeDeeply(x) {
*/
function sanitize(text) {
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 +288,17 @@ 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."
+ );
+}
+
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
@@ -298,6 +313,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 +338,9 @@ function describeDefaultHandler(text, method) {
return method.call(this);
}
+/**
+ * Mocha test wrapper.
+ */
class RuleTester {
/**
@@ -353,6 +372,7 @@ class RuleTester {
/**
* Set the configuration to use for all future tests
* @param {Object} config the configuration to use.
+ * @throws {TypeError} If non-object config.
* @returns {void}
*/
static setDefaultConfig(config) {
@@ -468,6 +488,8 @@ class RuleTester {
* valid: (ValidTestCase | string)[],
* invalid: InvalidTestCase[]
* }} test The collection of tests to run.
+ * @throws {TypeError|Error} If non-object `test`, or if a required
+ * scenario of the given type is missing.
* @returns {void}
*/
run(ruleName, rule, test) {
@@ -511,6 +533,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
*/
@@ -607,7 +630,16 @@ class RuleTester {
validate(config, "rule-tester", id => (id === ruleName ? rule : null));
// Verify the code.
- const messages = linter.verify(code, config, filename);
+ const { getComments } = SourceCode.prototype;
+ let messages;
+
+ try {
+ SourceCode.prototype.getComments = getCommentsDeprecation;
+ messages = linter.verify(code, config, filename);
+ } finally {
+ SourceCode.prototype.getComments = getComments;
+ }
+
const fatalErrorMessage = messages.find(m => m.fatal);
assert(!fatalErrorMessage, `A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`);
@@ -921,16 +953,6 @@ class RuleTester {
);
}
- // Rules that produce fixes must have `meta.fixable` property.
- if (result.output !== item.code) {
- assert.ok(
- hasOwnProperty(rule, "meta"),
- "Fixable rules should export a `meta.fixable` property."
- );
-
- // Linter throws if a rule that produced a fix has `meta` but doesn't have `meta.fixable`.
- }
-
assertASTDidntChange(result.beforeAST, result.afterAST);
}
diff --git a/tools/node_modules/eslint/lib/rules/accessor-pairs.js b/tools/node_modules/eslint/lib/rules/accessor-pairs.js
index 0e0d07a00c9..f0472526680 100644
--- a/tools/node_modules/eslint/lib/rules/accessor-pairs.js
+++ b/tools/node_modules/eslint/lib/rules/accessor-pairs.js
@@ -140,7 +140,6 @@ module.exports = {
docs: {
description: "enforce getter and setter pairs in objects and classes",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/accessor-pairs"
},
diff --git a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js
index b4b4dd430f6..28a05b35043 100644
--- a/tools/node_modules/eslint/lib/rules/array-bracket-newline.js
+++ b/tools/node_modules/eslint/lib/rules/array-bracket-newline.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce linebreaks after opening and before closing array brackets",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/array-bracket-newline"
},
diff --git a/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js b/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js
index c2b77a641f7..1eea99c14ca 100644
--- a/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/array-bracket-spacing.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing inside array brackets",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/array-bracket-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/array-callback-return.js b/tools/node_modules/eslint/lib/rules/array-callback-return.js
index 7267347149d..d13ecd71790 100644
--- a/tools/node_modules/eslint/lib/rules/array-callback-return.js
+++ b/tools/node_modules/eslint/lib/rules/array-callback-return.js
@@ -139,7 +139,6 @@ module.exports = {
docs: {
description: "enforce `return` statements in callbacks of array methods",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/array-callback-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/array-element-newline.js b/tools/node_modules/eslint/lib/rules/array-element-newline.js
index b7a967865b9..535fa2155a2 100644
--- a/tools/node_modules/eslint/lib/rules/array-element-newline.js
+++ b/tools/node_modules/eslint/lib/rules/array-element-newline.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce line breaks after each array element",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/array-element-newline"
},
diff --git a/tools/node_modules/eslint/lib/rules/arrow-body-style.js b/tools/node_modules/eslint/lib/rules/arrow-body-style.js
index 5b8a5f01167..3a3f544444e 100644
--- a/tools/node_modules/eslint/lib/rules/arrow-body-style.js
+++ b/tools/node_modules/eslint/lib/rules/arrow-body-style.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "require braces around arrow function bodies",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/arrow-body-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/arrow-parens.js b/tools/node_modules/eslint/lib/rules/arrow-parens.js
index eaa1aab0238..4f4dea0e237 100644
--- a/tools/node_modules/eslint/lib/rules/arrow-parens.js
+++ b/tools/node_modules/eslint/lib/rules/arrow-parens.js
@@ -33,7 +33,6 @@ module.exports = {
docs: {
description: "require parentheses around arrow function arguments",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/arrow-parens"
},
diff --git a/tools/node_modules/eslint/lib/rules/arrow-spacing.js b/tools/node_modules/eslint/lib/rules/arrow-spacing.js
index e5110c6c87d..9e1ed71d4bd 100644
--- a/tools/node_modules/eslint/lib/rules/arrow-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/arrow-spacing.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before and after the arrow in arrow functions",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/arrow-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/block-scoped-var.js b/tools/node_modules/eslint/lib/rules/block-scoped-var.js
index 481057ba6c7..10125e61fde 100644
--- a/tools/node_modules/eslint/lib/rules/block-scoped-var.js
+++ b/tools/node_modules/eslint/lib/rules/block-scoped-var.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "enforce the use of variables within the scope they are defined",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/block-scoped-var"
},
diff --git a/tools/node_modules/eslint/lib/rules/block-spacing.js b/tools/node_modules/eslint/lib/rules/block-spacing.js
index c4b30b0b70b..13cfbf0e2cb 100644
--- a/tools/node_modules/eslint/lib/rules/block-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/block-spacing.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow or enforce spaces inside of blocks after opening block and before closing block",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/block-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/brace-style.js b/tools/node_modules/eslint/lib/rules/brace-style.js
index 07223d10d4a..60aa5326935 100644
--- a/tools/node_modules/eslint/lib/rules/brace-style.js
+++ b/tools/node_modules/eslint/lib/rules/brace-style.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce consistent brace style for blocks",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/brace-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/callback-return.js b/tools/node_modules/eslint/lib/rules/callback-return.js
index fa66e6383b7..449b9a96227 100644
--- a/tools/node_modules/eslint/lib/rules/callback-return.js
+++ b/tools/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";
@@ -18,7 +19,6 @@ module.exports = {
docs: {
description: "require `return` statements after callbacks",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/callback-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/camelcase.js b/tools/node_modules/eslint/lib/rules/camelcase.js
index d34656cfabe..7e8fc68da63 100644
--- a/tools/node_modules/eslint/lib/rules/camelcase.js
+++ b/tools/node_modules/eslint/lib/rules/camelcase.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce camelcase naming convention",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/camelcase"
},
@@ -55,32 +54,25 @@ module.exports = {
],
messages: {
- notCamelCase: "Identifier '{{name}}' is not in camel case."
+ notCamelCase: "Identifier '{{name}}' is not in camel case.",
+ notCamelCasePrivate: "#{{name}} is not in camel case."
}
},
create(context) {
-
const options = context.options[0] || {};
- let properties = options.properties || "";
+ const properties = options.properties === "never" ? "never" : "always";
const ignoreDestructuring = options.ignoreDestructuring;
const ignoreImports = options.ignoreImports;
const ignoreGlobals = options.ignoreGlobals;
const allow = options.allow || [];
- let globalScope;
-
- if (properties !== "always" && properties !== "never") {
- properties = "always";
- }
-
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
// contains reported nodes to avoid reporting twice on destructuring with shorthand notation
- const reported = [];
- const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]);
+ const reported = new Set();
/**
* Checks if a string contains an underscore and isn't all upper-case
@@ -89,9 +81,10 @@ module.exports = {
* @private
*/
function isUnderscored(name) {
+ const nameBody = name.replace(/^_+|_+$/gu, "");
// if there's an underscore, it might be A_CONSTANT, which is okay
- return name.includes("_") && name !== name.toUpperCase();
+ return nameBody.includes("_") && nameBody !== nameBody.toUpperCase();
}
/**
@@ -107,219 +100,292 @@ module.exports = {
}
/**
- * Checks if a parent of a node is an ObjectPattern.
- * @param {ASTNode} node The node to check.
- * @returns {boolean} if the node is inside an ObjectPattern
+ * Checks if a given name is good or not.
+ * @param {string} name The name to check.
+ * @returns {boolean} `true` if the name is good.
* @private
*/
- function isInsideObjectPattern(node) {
- let current = node;
-
- while (current) {
- const parent = current.parent;
+ function isGoodName(name) {
+ return !isUnderscored(name) || isAllowed(name);
+ }
- if (parent && parent.type === "Property" && parent.computed && parent.key === current) {
- return false;
- }
+ /**
+ * Checks if a given identifier reference or member expression is an assignment
+ * target.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node is an assignment target.
+ */
+ function isAssignmentTarget(node) {
+ const parent = node.parent;
- if (current.type === "ObjectPattern") {
+ switch (parent.type) {
+ case "AssignmentExpression":
+ case "AssignmentPattern":
+ return parent.left === node;
+
+ case "Property":
+ return (
+ parent.parent.type === "ObjectPattern" &&
+ parent.value === node
+ );
+ case "ArrayPattern":
+ case "RestElement":
return true;
- }
- current = parent;
+ default:
+ return false;
}
-
- return false;
}
/**
- * Checks whether the given node represents assignment target property in destructuring.
- *
- * For examples:
- * ({a: b.foo} = c); // => true for `foo`
- * ([a.foo] = b); // => true for `foo`
- * ([a.foo = 1] = b); // => true for `foo`
- * ({...a.foo} = b); // => true for `foo`
- * @param {ASTNode} node An Identifier node to check
- * @returns {boolean} True if the node is an assignment target property in destructuring.
+ * Checks if a given binding identifier uses the original name as-is.
+ * - If it's in object destructuring, the original name is its property name.
+ * - If it's in import declaration, the original name is its exported name.
+ * @param {ASTNode} node The `Identifier` node to check.
+ * @returns {boolean} `true` if the identifier uses the original name as-is.
*/
- function isAssignmentTargetPropertyInDestructuring(node) {
- if (
- node.parent.type === "MemberExpression" &&
- node.parent.property === node &&
- !node.parent.computed
- ) {
- const effectiveParent = node.parent.parent;
-
- return (
- effectiveParent.type === "Property" &&
- effectiveParent.value === node.parent &&
- effectiveParent.parent.type === "ObjectPattern" ||
- effectiveParent.type === "ArrayPattern" ||
- effectiveParent.type === "RestElement" ||
- (
- effectiveParent.type === "AssignmentPattern" &&
- effectiveParent.left === node.parent
- )
- );
+ function equalsToOriginalName(node) {
+ const localName = node.name;
+ const valueNode = node.parent.type === "AssignmentPattern"
+ ? node.parent
+ : node;
+ const parent = valueNode.parent;
+
+ switch (parent.type) {
+ case "Property":
+ return (
+ parent.parent.type === "ObjectPattern" &&
+ parent.value === valueNode &&
+ !parent.computed &&
+ parent.key.type === "Identifier" &&
+ parent.key.name === localName
+ );
+
+ case "ImportSpecifier":
+ return (
+ parent.local === node &&
+ parent.imported.name === localName
+ );
+
+ default:
+ return false;
}
- return false;
}
/**
- * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
- * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
- * @param {ASTNode} node `Identifier` node to check.
- * @returns {boolean} `true` if the node is a reference to a global variable.
+ * Reports an AST node as a rule violation.
+ * @param {ASTNode} node The node to report.
+ * @returns {void}
+ * @private
*/
- function isReferenceToGlobalVariable(node) {
- const variable = globalScope.set.get(node.name);
-
- return variable && variable.defs.length === 0 &&
- variable.references.some(ref => ref.identifier === node);
+ function report(node) {
+ if (reported.has(node.range[0])) {
+ return;
+ }
+ reported.add(node.range[0]);
+
+ // Report it.
+ context.report({
+ node,
+ messageId: node.type === "PrivateIdentifier"
+ ? "notCamelCasePrivate"
+ : "notCamelCase",
+ data: { name: node.name }
+ });
}
/**
- * Checks whether the given node represents a reference to a property of an object in an object literal expression.
- * This allows to differentiate between a global variable that is allowed to be used as a reference, and the key
- * of the expressed object (which shouldn't be allowed).
- * @param {ASTNode} node `Identifier` node to check.
- * @returns {boolean} `true` if the node is a property name of an object literal expression
+ * Reports an identifier reference or a binding identifier.
+ * @param {ASTNode} node The `Identifier` node to report.
+ * @returns {void}
*/
- function isPropertyNameInObjectLiteral(node) {
- const parent = node.parent;
+ function reportReferenceId(node) {
- return (
- parent.type === "Property" &&
- parent.parent.type === "ObjectExpression" &&
- !parent.computed &&
- parent.key === node
- );
- }
+ /*
+ * For backward compatibility, if it's in callings then ignore it.
+ * Not sure why it is.
+ */
+ if (
+ node.parent.type === "CallExpression" ||
+ node.parent.type === "NewExpression"
+ ) {
+ return;
+ }
- /**
- * Reports an AST node as a rule violation.
- * @param {ASTNode} node The node to report.
- * @returns {void}
- * @private
- */
- function report(node) {
- if (!reported.includes(node)) {
- reported.push(node);
- context.report({ node, messageId: "notCamelCase", data: { name: node.name } });
+ /*
+ * For backward compatibility, if it's a default value of
+ * destructuring/parameters then ignore it.
+ * Not sure why it is.
+ */
+ if (
+ node.parent.type === "AssignmentPattern" &&
+ node.parent.right === node
+ ) {
+ return;
}
+
+ /*
+ * The `ignoreDestructuring` flag skips the identifiers that uses
+ * the property name as-is.
+ */
+ if (ignoreDestructuring && equalsToOriginalName(node)) {
+ return;
+ }
+
+ report(node);
}
return {
+ // Report camelcase of global variable references ------------------
Program() {
- globalScope = context.getScope();
- },
-
- Identifier(node) {
+ const scope = context.getScope();
- /*
- * Leading and trailing underscores are commonly used to flag
- * private/protected identifiers, strip them before checking if underscored
- */
- const name = node.name,
- nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/gu, "")),
- effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent;
+ if (!ignoreGlobals) {
- // First, we ignore the node if it match the ignore list
- if (isAllowed(name)) {
- return;
- }
+ // Defined globals in config files or directive comments.
+ for (const variable of scope.variables) {
+ if (
+ variable.identifiers.length > 0 ||
+ isGoodName(variable.name)
+ ) {
+ continue;
+ }
+ for (const reference of variable.references) {
- // Check if it's a global variable
- if (ignoreGlobals && isReferenceToGlobalVariable(node) && !isPropertyNameInObjectLiteral(node)) {
- return;
+ /*
+ * For backward compatibility, this rule reports read-only
+ * references as well.
+ */
+ reportReferenceId(reference.identifier);
+ }
+ }
}
- // MemberExpressions get special rules
- if (node.parent.type === "MemberExpression") {
+ // Undefined globals.
+ for (const reference of scope.through) {
+ const id = reference.identifier;
- // "never" check properties
- if (properties === "never") {
- return;
+ if (isGoodName(id.name)) {
+ continue;
}
- // Always report underscored object names
- if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) {
- report(node);
-
- // Report AssignmentExpressions only if they are the left side of the assignment
- } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) {
- report(node);
+ /*
+ * For backward compatibility, this rule reports read-only
+ * references as well.
+ */
+ reportReferenceId(id);
+ }
+ },
- } else if (isAssignmentTargetPropertyInDestructuring(node) && nameIsUnderscored) {
- report(node);
+ // Report camelcase of declared variables --------------------------
+ [[
+ "VariableDeclaration",
+ "FunctionDeclaration",
+ "FunctionExpression",
+ "ArrowFunctionExpression",
+ "ClassDeclaration",
+ "ClassExpression",
+ "CatchClause"
+ ]](node) {
+ for (const variable of context.getDeclaredVariables(node)) {
+ if (isGoodName(variable.name)) {
+ continue;
}
+ const id = variable.identifiers[0];
- /*
- * Properties have their own rules, and
- * AssignmentPattern nodes can be treated like Properties:
- * e.g.: const { no_camelcased = false } = bar;
- */
- } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") {
-
- if (node.parent.parent && node.parent.parent.type === "ObjectPattern") {
- if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) {
- report(node);
- }
-
- const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name;
-
- if (nameIsUnderscored && node.parent.computed) {
- report(node);
- }
+ // Report declaration.
+ if (!(ignoreDestructuring && equalsToOriginalName(id))) {
+ report(id);
+ }
- // prevent checking righthand side of destructured object
- if (node.parent.key === node && node.parent.value !== node) {
- return;
+ /*
+ * For backward compatibility, report references as well.
+ * It looks unnecessary because declarations are reported.
+ */
+ for (const reference of variable.references) {
+ if (reference.init) {
+ continue; // Skip the write references of initializers.
}
+ reportReferenceId(reference.identifier);
+ }
+ }
+ },
- const valueIsUnderscored = node.parent.value.name && nameIsUnderscored;
+ // Report camelcase in properties ----------------------------------
+ [[
+ "ObjectExpression > Property[computed!=true] > Identifier.key",
+ "MethodDefinition[computed!=true] > Identifier.key",
+ "PropertyDefinition[computed!=true] > Identifier.key",
+ "MethodDefinition > PrivateIdentifier.key",
+ "PropertyDefinition > PrivateIdentifier.key"
+ ]](node) {
+ if (properties === "never" || isGoodName(node.name)) {
+ return;
+ }
+ report(node);
+ },
+ "MemberExpression[computed!=true] > Identifier.property"(node) {
+ if (
+ properties === "never" ||
+ !isAssignmentTarget(node.parent) || // ā† ignore read-only references.
+ isGoodName(node.name)
+ ) {
+ return;
+ }
+ report(node);
+ },
- // ignore destructuring if the option is set, unless a new identifier is created
- if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) {
- report(node);
- }
+ // Report camelcase in import --------------------------------------
+ ImportDeclaration(node) {
+ for (const variable of context.getDeclaredVariables(node)) {
+ if (isGoodName(variable.name)) {
+ continue;
}
+ const id = variable.identifiers[0];
- // "never" check properties or always ignore destructuring
- if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) {
- return;
+ // Report declaration.
+ if (!(ignoreImports && equalsToOriginalName(id))) {
+ report(id);
}
- // don't check right hand side of AssignmentExpression to prevent duplicate warnings
- if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) {
- report(node);
+ /*
+ * For backward compatibility, report references as well.
+ * It looks unnecessary because declarations are reported.
+ */
+ for (const reference of variable.references) {
+ reportReferenceId(reference.identifier);
}
+ }
+ },
- // Check if it's an import specifier
- } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].includes(node.parent.type)) {
-
- if (node.parent.type === "ImportSpecifier" && ignoreImports) {
- return;
- }
+ // Report camelcase in re-export -----------------------------------
+ [[
+ "ExportAllDeclaration > Identifier.exported",
+ "ExportSpecifier > Identifier.exported"
+ ]](node) {
+ if (isGoodName(node.name)) {
+ return;
+ }
+ report(node);
+ },
- // Report only if the local imported identifier is underscored
- if (
- node.parent.local &&
- node.parent.local.name === node.name &&
- nameIsUnderscored
- ) {
- report(node);
- }
+ // Report camelcase in labels --------------------------------------
+ [[
+ "LabeledStatement > Identifier.label",
- // Report anything that is underscored that isn't a CallExpression
- } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) {
- report(node);
+ /*
+ * For backward compatibility, report references as well.
+ * It looks unnecessary because declarations are reported.
+ */
+ "BreakStatement > Identifier.label",
+ "ContinueStatement > Identifier.label"
+ ]](node) {
+ if (isGoodName(node.name)) {
+ return;
}
+ report(node);
}
-
};
-
}
};
diff --git a/tools/node_modules/eslint/lib/rules/capitalized-comments.js b/tools/node_modules/eslint/lib/rules/capitalized-comments.js
index d7524b878d2..e5f429356b2 100644
--- a/tools/node_modules/eslint/lib/rules/capitalized-comments.js
+++ b/tools/node_modules/eslint/lib/rules/capitalized-comments.js
@@ -105,7 +105,6 @@ module.exports = {
docs: {
description: "enforce or disallow capitalization of the first letter of a comment",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/capitalized-comments"
},
diff --git a/tools/node_modules/eslint/lib/rules/class-methods-use-this.js b/tools/node_modules/eslint/lib/rules/class-methods-use-this.js
index 2cc5cc41842..034ba3abcaf 100644
--- a/tools/node_modules/eslint/lib/rules/class-methods-use-this.js
+++ b/tools/node_modules/eslint/lib/rules/class-methods-use-this.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "enforce that class methods utilize `this`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/class-methods-use-this"
},
@@ -34,6 +33,10 @@ module.exports = {
items: {
type: "string"
}
+ },
+ enforceForClassFields: {
+ type: "boolean",
+ default: true
}
},
additionalProperties: false
@@ -45,18 +48,35 @@ 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.
* @returns {void}
* @private
*/
function enterFunction() {
- stack.push(false);
+ pushContext();
}
/**
@@ -66,7 +86,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 +103,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 +127,12 @@ module.exports = {
* @private
*/
function exitFunction(node) {
- const methodUsesThis = stack.pop();
+ const methodUsesThis = popContext();
if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) {
context.report({
node,
+ loc: astUtils.getFunctionHeadLoc(node, context.getSourceCode()),
messageId: "missingThis",
data: {
name: astUtils.getFunctionNameWithKind(node)
@@ -118,8 +157,21 @@ module.exports = {
"FunctionDeclaration:exit": exitFunction,
FunctionExpression: enterFunction,
"FunctionExpression:exit": exitFunction,
+
+ /*
+ * Class field value are implicit functions.
+ */
+ "PropertyDefinition:exit": popContext,
+ "PropertyDefinition > *.key:exit": pushContext,
+
ThisExpression: markThisUsed,
- Super: markThisUsed
+ Super: markThisUsed,
+ ...(
+ enforceForClassFields && {
+ "PropertyDefinition > ArrowFunctionExpression.value": enterFunction,
+ "PropertyDefinition > ArrowFunctionExpression.value:exit": exitFunction
+ }
+ )
};
}
};
diff --git a/tools/node_modules/eslint/lib/rules/comma-dangle.js b/tools/node_modules/eslint/lib/rules/comma-dangle.js
index 798c111ec3b..e97a59886e3 100644
--- a/tools/node_modules/eslint/lib/rules/comma-dangle.js
+++ b/tools/node_modules/eslint/lib/rules/comma-dangle.js
@@ -76,7 +76,6 @@ module.exports = {
docs: {
description: "require or disallow trailing commas",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/comma-dangle"
},
@@ -123,7 +122,8 @@ module.exports = {
}
]
}
- ]
+ ],
+ additionalItems: false
},
messages: {
diff --git a/tools/node_modules/eslint/lib/rules/comma-spacing.js b/tools/node_modules/eslint/lib/rules/comma-spacing.js
index 2bf41a00bb6..d30a5ef320d 100644
--- a/tools/node_modules/eslint/lib/rules/comma-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/comma-spacing.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before and after commas",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/comma-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/comma-style.js b/tools/node_modules/eslint/lib/rules/comma-style.js
index 824ad89b2f9..1d62fcf1c4d 100644
--- a/tools/node_modules/eslint/lib/rules/comma-style.js
+++ b/tools/node_modules/eslint/lib/rules/comma-style.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce consistent comma style",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/comma-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/complexity.js b/tools/node_modules/eslint/lib/rules/complexity.js
index 116c8ad0a63..b833aafc0f7 100644
--- a/tools/node_modules/eslint/lib/rules/complexity.js
+++ b/tools/node_modules/eslint/lib/rules/complexity.js
@@ -23,7 +23,6 @@ module.exports = {
docs: {
description: "enforce a maximum cyclomatic complexity allowed in a program",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/complexity"
},
@@ -75,60 +74,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 +91,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 +106,49 @@ 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 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"
+ ) {
+ return;
+ }
+
+ if (complexity > THRESHOLD) {
+ const name = codePath.origin === "class-field-initializer"
+ ? "class field initializer"
+ : astUtils.getFunctionNameWithKind(node);
+
+ context.report({
+ node,
+ messageId: "complex",
+ data: {
+ name: upperCaseFirst(name),
+ complexity,
+ max: THRESHOLD
+ }
+ });
+ }
}
};
diff --git a/tools/node_modules/eslint/lib/rules/computed-property-spacing.js b/tools/node_modules/eslint/lib/rules/computed-property-spacing.js
index 53fdb8f4e41..c8d8834ea92 100644
--- a/tools/node_modules/eslint/lib/rules/computed-property-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/computed-property-spacing.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing inside computed property brackets",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/computed-property-spacing"
},
@@ -195,7 +194,8 @@ module.exports = {
};
if (enforceForClassMembers) {
- listeners.MethodDefinition = checkSpacing("key");
+ listeners.MethodDefinition =
+ listeners.PropertyDefinition = listeners.Property;
}
return listeners;
diff --git a/tools/node_modules/eslint/lib/rules/consistent-return.js b/tools/node_modules/eslint/lib/rules/consistent-return.js
index 0e20209af56..b509c36564f 100644
--- a/tools/node_modules/eslint/lib/rules/consistent-return.js
+++ b/tools/node_modules/eslint/lib/rules/consistent-return.js
@@ -46,7 +46,6 @@ module.exports = {
docs: {
description: "require `return` statements to either always or never specify values",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/consistent-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/consistent-this.js b/tools/node_modules/eslint/lib/rules/consistent-this.js
index e5bc9678dae..025f3d0a340 100644
--- a/tools/node_modules/eslint/lib/rules/consistent-this.js
+++ b/tools/node_modules/eslint/lib/rules/consistent-this.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "enforce consistent naming when capturing the current execution context",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/consistent-this"
},
@@ -47,7 +46,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) {
diff --git a/tools/node_modules/eslint/lib/rules/constructor-super.js b/tools/node_modules/eslint/lib/rules/constructor-super.js
index dfec18fb65a..38eb489327d 100644
--- a/tools/node_modules/eslint/lib/rules/constructor-super.js
+++ b/tools/node_modules/eslint/lib/rules/constructor-super.js
@@ -122,7 +122,6 @@ module.exports = {
docs: {
description: "require `super()` calls in constructors",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/constructor-super"
},
diff --git a/tools/node_modules/eslint/lib/rules/curly.js b/tools/node_modules/eslint/lib/rules/curly.js
index 61dcd8024bb..57c2e72e4e4 100644
--- a/tools/node_modules/eslint/lib/rules/curly.js
+++ b/tools/node_modules/eslint/lib/rules/curly.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce consistent brace style for all control statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/curly"
},
diff --git a/tools/node_modules/eslint/lib/rules/default-case-last.js b/tools/node_modules/eslint/lib/rules/default-case-last.js
index 80c5d6bda73..1eeadd1e716 100644
--- a/tools/node_modules/eslint/lib/rules/default-case-last.js
+++ b/tools/node_modules/eslint/lib/rules/default-case-last.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce default clauses in switch statements to be last",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/default-case-last"
},
diff --git a/tools/node_modules/eslint/lib/rules/default-case.js b/tools/node_modules/eslint/lib/rules/default-case.js
index 821e0d72bd1..b839aa20133 100644
--- a/tools/node_modules/eslint/lib/rules/default-case.js
+++ b/tools/node_modules/eslint/lib/rules/default-case.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "require `default` cases in `switch` statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/default-case"
},
@@ -50,8 +49,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/tools/node_modules/eslint/lib/rules/default-param-last.js b/tools/node_modules/eslint/lib/rules/default-param-last.js
index 12e0b5950da..8382d46e760 100644
--- a/tools/node_modules/eslint/lib/rules/default-param-last.js
+++ b/tools/node_modules/eslint/lib/rules/default-param-last.js
@@ -11,7 +11,6 @@ module.exports = {
docs: {
description: "enforce default parameters to be last",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/default-param-last"
},
@@ -25,8 +24,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/tools/node_modules/eslint/lib/rules/dot-location.js b/tools/node_modules/eslint/lib/rules/dot-location.js
index a8d5a760562..d80f87090a7 100644
--- a/tools/node_modules/eslint/lib/rules/dot-location.js
+++ b/tools/node_modules/eslint/lib/rules/dot-location.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce consistent newlines before and after dots",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/dot-location"
},
diff --git a/tools/node_modules/eslint/lib/rules/dot-notation.js b/tools/node_modules/eslint/lib/rules/dot-notation.js
index 3aa9f3110f5..1cd908f7a2c 100644
--- a/tools/node_modules/eslint/lib/rules/dot-notation.js
+++ b/tools/node_modules/eslint/lib/rules/dot-notation.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "enforce dot notation whenever possible",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/dot-notation"
},
@@ -141,6 +140,7 @@ module.exports = {
if (
!allowKeywords &&
!node.computed &&
+ node.property.type === "Identifier" &&
keywords.indexOf(String(node.property.name)) !== -1
) {
context.report({
diff --git a/tools/node_modules/eslint/lib/rules/eol-last.js b/tools/node_modules/eslint/lib/rules/eol-last.js
index 24b0c9279c7..f8b922c2503 100644
--- a/tools/node_modules/eslint/lib/rules/eol-last.js
+++ b/tools/node_modules/eslint/lib/rules/eol-last.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "require or disallow newline at the end of files",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/eol-last"
},
@@ -86,10 +85,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/tools/node_modules/eslint/lib/rules/eqeqeq.js b/tools/node_modules/eslint/lib/rules/eqeqeq.js
index 57926dbed0e..d3e6b5af0b6 100644
--- a/tools/node_modules/eslint/lib/rules/eqeqeq.js
+++ b/tools/node_modules/eslint/lib/rules/eqeqeq.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "require the use of `===` and `!==`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/eqeqeq"
},
@@ -78,7 +77,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/tools/node_modules/eslint/lib/rules/for-direction.js b/tools/node_modules/eslint/lib/rules/for-direction.js
index c15d10e5f84..abe4ad3c6b8 100644
--- a/tools/node_modules/eslint/lib/rules/for-direction.js
+++ b/tools/node_modules/eslint/lib/rules/for-direction.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce \"for\" loop update clause moving the counter in the right direction.",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/for-direction"
},
diff --git a/tools/node_modules/eslint/lib/rules/func-call-spacing.js b/tools/node_modules/eslint/lib/rules/func-call-spacing.js
index 132a5833143..a6ebde4ac0b 100644
--- a/tools/node_modules/eslint/lib/rules/func-call-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/func-call-spacing.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "require or disallow spacing between function identifiers and their invocations",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/func-call-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/func-name-matching.js b/tools/node_modules/eslint/lib/rules/func-name-matching.js
index 755c2ee5075..122cfd8d33c 100644
--- a/tools/node_modules/eslint/lib/rules/func-name-matching.js
+++ b/tools/node_modules/eslint/lib/rules/func-name-matching.js
@@ -74,7 +74,6 @@ module.exports = {
docs: {
description: "require function names to match the name of the variable or property to which they are assigned",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/func-name-matching"
},
@@ -196,21 +195,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/tools/node_modules/eslint/lib/rules/func-names.js b/tools/node_modules/eslint/lib/rules/func-names.js
index ecfedb9e0e9..589903c96a5 100644
--- a/tools/node_modules/eslint/lib/rules/func-names.js
+++ b/tools/node_modules/eslint/lib/rules/func-names.js
@@ -30,7 +30,6 @@ module.exports = {
docs: {
description: "require or disallow named `function` expressions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/func-names"
},
@@ -118,6 +117,7 @@ module.exports = {
return isObjectOrClassMethod(node) ||
(parent.type === "VariableDeclarator" && parent.id.type === "Identifier" && parent.init === node) ||
(parent.type === "Property" && parent.value === node) ||
+ (parent.type === "PropertyDefinition" && parent.value === node) ||
(parent.type === "AssignmentExpression" && parent.left.type === "Identifier" && parent.right === node) ||
(parent.type === "AssignmentPattern" && parent.left.type === "Identifier" && parent.right === node);
}
diff --git a/tools/node_modules/eslint/lib/rules/func-style.js b/tools/node_modules/eslint/lib/rules/func-style.js
index e150b1a76f2..0921ff54cd4 100644
--- a/tools/node_modules/eslint/lib/rules/func-style.js
+++ b/tools/node_modules/eslint/lib/rules/func-style.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "enforce the consistent use of either `function` declarations or expressions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/func-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js b/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js
index b6abbe95fa9..ed4e296fd6e 100644
--- a/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js
+++ b/tools/node_modules/eslint/lib/rules/function-call-argument-newline.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce line breaks between arguments of a function call",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/function-call-argument-newline"
},
diff --git a/tools/node_modules/eslint/lib/rules/function-paren-newline.js b/tools/node_modules/eslint/lib/rules/function-paren-newline.js
index 9d8d67ba141..18435b78978 100644
--- a/tools/node_modules/eslint/lib/rules/function-paren-newline.js
+++ b/tools/node_modules/eslint/lib/rules/function-paren-newline.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce consistent line breaks inside function parentheses",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/function-paren-newline"
},
@@ -183,6 +182,7 @@ module.exports = {
/**
* Gets the left paren and right paren tokens of a node.
* @param {ASTNode} node The node with parens
+ * @throws {TypeError} Unexecpted 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)
diff --git a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js
index 65534f727fa..c50445c9c9b 100644
--- a/tools/node_modules/eslint/lib/rules/generator-star-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/generator-star-spacing.js
@@ -31,7 +31,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing around `*` operators in generator functions",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/generator-star-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/getter-return.js b/tools/node_modules/eslint/lib/rules/getter-return.js
index c54ebfb4ffb..8bb42536e8c 100644
--- a/tools/node_modules/eslint/lib/rules/getter-return.js
+++ b/tools/node_modules/eslint/lib/rules/getter-return.js
@@ -35,7 +35,6 @@ module.exports = {
docs: {
description: "enforce `return` statements in getters",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/getter-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/global-require.js b/tools/node_modules/eslint/lib/rules/global-require.js
index 09d0332007e..f2d29d1df5a 100644
--- a/tools/node_modules/eslint/lib/rules/global-require.js
+++ b/tools/node_modules/eslint/lib/rules/global-require.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Rule for disallowing require() outside of the top-level module context
* @author Jamund Ferguson
+ * @deprecated in ESLint v7.0.0
*/
"use strict";
@@ -57,7 +58,6 @@ module.exports = {
docs: {
description: "require `require()` calls to be placed at top-level module scope",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/global-require"
},
diff --git a/tools/node_modules/eslint/lib/rules/grouped-accessor-pairs.js b/tools/node_modules/eslint/lib/rules/grouped-accessor-pairs.js
index a790f83750b..cc4a4b522a1 100644
--- a/tools/node_modules/eslint/lib/rules/grouped-accessor-pairs.js
+++ b/tools/node_modules/eslint/lib/rules/grouped-accessor-pairs.js
@@ -96,7 +96,6 @@ module.exports = {
docs: {
description: "require grouped accessor pairs in object literals and classes",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/grouped-accessor-pairs"
},
diff --git a/tools/node_modules/eslint/lib/rules/guard-for-in.js b/tools/node_modules/eslint/lib/rules/guard-for-in.js
index 2c0976d997b..6f877bab958 100644
--- a/tools/node_modules/eslint/lib/rules/guard-for-in.js
+++ b/tools/node_modules/eslint/lib/rules/guard-for-in.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require `for-in` loops to include an `if` statement",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/guard-for-in"
},
diff --git a/tools/node_modules/eslint/lib/rules/handle-callback-err.js b/tools/node_modules/eslint/lib/rules/handle-callback-err.js
index b92490ad16b..cdb3a7642ea 100644
--- a/tools/node_modules/eslint/lib/rules/handle-callback-err.js
+++ b/tools/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";
@@ -19,7 +20,6 @@ module.exports = {
docs: {
description: "require error handling in callbacks",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/handle-callback-err"
},
diff --git a/tools/node_modules/eslint/lib/rules/id-blacklist.js b/tools/node_modules/eslint/lib/rules/id-blacklist.js
index 4fbba909fde..77deac70708 100644
--- a/tools/node_modules/eslint/lib/rules/id-blacklist.js
+++ b/tools/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";
@@ -118,7 +119,6 @@ module.exports = {
docs: {
description: "disallow specified identifiers",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/id-blacklist"
},
@@ -205,7 +205,17 @@ module.exports = {
* @private
*/
function report(node) {
- if (!reportedNodes.has(node)) {
+
+ /*
+ * We used the range instead of the node because it's possible
+ * for the same identifier to be represented by two different
+ * nodes, with the most clear example being shorthand properties:
+ * { foo }
+ * In this case, "foo" is represented by one node for the name
+ * and one for the value. The only way to know they are the same
+ * is to look at the range.
+ */
+ if (!reportedNodes.has(node.range.toString())) {
context.report({
node,
messageId: "restricted",
@@ -213,8 +223,9 @@ module.exports = {
name: node.name
}
});
- reportedNodes.add(node);
+ reportedNodes.add(node.range.toString());
}
+
}
return {
diff --git a/tools/node_modules/eslint/lib/rules/id-denylist.js b/tools/node_modules/eslint/lib/rules/id-denylist.js
index 112fd8a9d55..2b346355423 100644
--- a/tools/node_modules/eslint/lib/rules/id-denylist.js
+++ b/tools/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,27 +84,11 @@ 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
//------------------------------------------------------------------------------
@@ -115,7 +99,6 @@ module.exports = {
docs: {
description: "disallow specified identifiers",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/id-denylist"
},
@@ -128,7 +111,8 @@ module.exports = {
uniqueItems: true
},
messages: {
- restricted: "Identifier '{{name}}' is restricted."
+ restricted: "Identifier '{{name}}' is restricted.",
+ restrictedPrivate: "Identifier '#{{name}}' is restricted."
}
},
@@ -187,11 +171,8 @@ module.exports = {
parent.type !== "CallExpression" &&
parent.type !== "NewExpression" &&
!isRenamedImport(node) &&
- !isRenamedInDestructuring(node) &&
- !(
- isReferenceToGlobalVariable(node) &&
- !isShorthandPropertyDefinition(node)
- )
+ !isPropertyNameInDestructuring(node) &&
+ !isReferenceToGlobalVariable(node)
);
}
@@ -202,15 +183,27 @@ module.exports = {
* @private
*/
function report(node) {
- if (!reportedNodes.has(node)) {
+
+ /*
+ * We used the range instead of the node because it's possible
+ * for the same identifier to be represented by two different
+ * nodes, with the most clear example being shorthand properties:
+ * { foo }
+ * In this case, "foo" is represented by one node for the name
+ * and one for the value. The only way to know they are the same
+ * is to look at the range.
+ */
+ if (!reportedNodes.has(node.range.toString())) {
+ const isPrivate = node.type === "PrivateIdentifier";
+
context.report({
node,
- messageId: "restricted",
+ messageId: isPrivate ? "restrictedPrivate" : "restricted",
data: {
name: node.name
}
});
- reportedNodes.add(node);
+ reportedNodes.add(node.range.toString());
}
}
@@ -220,7 +213,10 @@ module.exports = {
globalScope = context.getScope();
},
- Identifier(node) {
+ [[
+ "Identifier",
+ "PrivateIdentifier"
+ ]](node) {
if (isRestricted(node.name) && shouldCheck(node)) {
report(node);
}
diff --git a/tools/node_modules/eslint/lib/rules/id-length.js b/tools/node_modules/eslint/lib/rules/id-length.js
index 4df081ff9fe..ac6385f59c0 100644
--- a/tools/node_modules/eslint/lib/rules/id-length.js
+++ b/tools/node_modules/eslint/lib/rules/id-length.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce minimum and maximum identifier lengths",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/id-length"
},
@@ -55,7 +54,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 +67,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 +100,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,12 +116,16 @@ 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;
@@ -131,11 +138,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/tools/node_modules/eslint/lib/rules/id-match.js b/tools/node_modules/eslint/lib/rules/id-match.js
index 7e400d037a0..7a6cd058f2e 100644
--- a/tools/node_modules/eslint/lib/rules/id-match.js
+++ b/tools/node_modules/eslint/lib/rules/id-match.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require identifiers to match a specified regular expression",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/id-match"
},
@@ -31,6 +30,10 @@ module.exports = {
type: "boolean",
default: false
},
+ classFields: {
+ type: "boolean",
+ default: false
+ },
onlyDeclarations: {
type: "boolean",
default: false
@@ -44,7 +47,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,7 +61,8 @@ 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;
@@ -66,7 +71,7 @@ module.exports = {
//--------------------------------------------------------------------------
// 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"]);
@@ -120,16 +125,30 @@ 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());
}
}
@@ -142,7 +161,7 @@ module.exports = {
if (parent.type === "MemberExpression") {
- if (!properties) {
+ if (!checkProperties) {
return;
}
@@ -176,8 +195,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 +215,7 @@ module.exports = {
}
// never check properties or always ignore destructuring
- if (!properties || (ignoreDestructuring && isInsideObjectPattern(node))) {
+ if (!checkProperties || (ignoreDestructuring && isInsideObjectPattern(node))) {
return;
}
@@ -214,10 +232,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/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
index 409145e7dc1..2d09552440b 100644
--- a/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
+++ b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce the location of arrow function bodies",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/implicit-arrow-linebreak"
},
diff --git a/tools/node_modules/eslint/lib/rules/indent-legacy.js b/tools/node_modules/eslint/lib/rules/indent-legacy.js
index a26ee87b130..54ca9ddd138 100644
--- a/tools/node_modules/eslint/lib/rules/indent-legacy.js
+++ b/tools/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";
@@ -25,7 +26,6 @@ module.exports = {
docs: {
description: "enforce consistent indentation",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/indent-legacy"
},
diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js
index 04f41db9e26..7b17e3e5402 100644
--- a/tools/node_modules/eslint/lib/rules/indent.js
+++ b/tools/node_modules/eslint/lib/rules/indent.js
@@ -60,8 +60,10 @@ const KNOWN_NODES = new Set([
"NewExpression",
"ObjectExpression",
"ObjectPattern",
+ "PrivateIdentifier",
"Program",
"Property",
+ "PropertyDefinition",
"RestElement",
"ReturnStatement",
"SequenceExpression",
@@ -138,7 +140,7 @@ class BinarySearchTree {
/**
* Inserts an entry into the tree.
* @param {number} key The entry's key
- * @param {*} value The entry's value
+ * @param {any} value The entry's value
* @returns {void}
*/
insert(key, value) {
@@ -188,7 +190,6 @@ class BinarySearchTree {
*/
class TokenInfo {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {SourceCode} sourceCode A SourceCode object
*/
@@ -238,7 +239,6 @@ class TokenInfo {
*/
class OffsetStorage {
- // eslint-disable-next-line jsdoc/require-description
/**
* @param {TokenInfo} tokenInfo a TokenInfo instance
* @param {number} indentSize The desired size of each indentation level
@@ -263,7 +263,7 @@ class OffsetStorage {
/**
* Sets the offset column of token B to match the offset column of token A.
- * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In
+ * - **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In
* most cases, `setDesiredOffset` should be used instead.
* @param {Token} baseToken The first token
* @param {Token} offsetToken The second token, whose offset should be matched to the first token
@@ -352,11 +352,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);`
@@ -499,7 +499,6 @@ module.exports = {
docs: {
description: "enforce consistent indentation",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/indent"
},
@@ -1359,6 +1358,45 @@ 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);
+ }
+ },
+
SwitchStatement(node) {
const openingCurly = sourceCode.getTokenAfter(node.discriminant, astUtils.isOpeningBraceToken);
const closingCurly = sourceCode.getLastToken(node);
diff --git a/tools/node_modules/eslint/lib/rules/index.js b/tools/node_modules/eslint/lib/rules/index.js
index 35af38fd108..c88febd85b9 100644
--- a/tools/node_modules/eslint/lib/rules/index.js
+++ b/tools/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");
diff --git a/tools/node_modules/eslint/lib/rules/init-declarations.js b/tools/node_modules/eslint/lib/rules/init-declarations.js
index 6cfdf92c909..d994bbc1ea0 100644
--- a/tools/node_modules/eslint/lib/rules/init-declarations.js
+++ b/tools/node_modules/eslint/lib/rules/init-declarations.js
@@ -48,7 +48,6 @@ module.exports = {
docs: {
description: "require or disallow initialization in variable declarations",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/init-declarations"
},
diff --git a/tools/node_modules/eslint/lib/rules/jsx-quotes.js b/tools/node_modules/eslint/lib/rules/jsx-quotes.js
index 3b282df2f07..cbadc19d5ed 100644
--- a/tools/node_modules/eslint/lib/rules/jsx-quotes.js
+++ b/tools/node_modules/eslint/lib/rules/jsx-quotes.js
@@ -42,7 +42,6 @@ module.exports = {
docs: {
description: "enforce the consistent use of either double or single quotes in JSX attributes",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/jsx-quotes"
},
diff --git a/tools/node_modules/eslint/lib/rules/key-spacing.js b/tools/node_modules/eslint/lib/rules/key-spacing.js
index fc885a117a1..cb176dd00d8 100644
--- a/tools/node_modules/eslint/lib/rules/key-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/key-spacing.js
@@ -139,7 +139,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing between keys and values in object literal properties",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/key-spacing"
},
@@ -531,8 +530,8 @@ module.exports = {
/**
* Creates groups of properties.
- * @param {ASTNode} node ObjectExpression node being evaluated.
- * @returns {Array.<ASTNode[]>} Groups of property AST node lists.
+ * @param {ASTNode} node ObjectExpression node being evaluated.
+ * @returns {Array<ASTNode[]>} Groups of property AST node lists.
*/
function createGroups(node) {
if (node.properties.length === 1) {
@@ -600,7 +599,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 +628,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/tools/node_modules/eslint/lib/rules/keyword-spacing.js b/tools/node_modules/eslint/lib/rules/keyword-spacing.js
index 913cf4682f9..e9441ad1708 100644
--- a/tools/node_modules/eslint/lib/rules/keyword-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/keyword-spacing.js
@@ -22,7 +22,7 @@ const PREV_TOKEN_M = /^[)\]}>*]$/u;
const NEXT_TOKEN_M = /^[{*]$/u;
const TEMPLATE_OPEN_PAREN = /\$\{$/u;
const TEMPLATE_CLOSE_PAREN = /^\}/u;
-const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/u;
+const CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u;
const KEYS = keywords.concat(["as", "async", "await", "from", "get", "let", "of", "set", "yield"]);
// check duplications.
@@ -67,7 +67,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before and after keywords",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/keyword-spacing"
},
@@ -403,7 +402,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 +426,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);
}
/**
@@ -473,6 +488,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) {
@@ -567,6 +583,7 @@ module.exports = {
// Others
ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier,
MethodDefinition: checkSpacingForProperty,
+ PropertyDefinition: checkSpacingForProperty,
Property: checkSpacingForProperty
};
}
diff --git a/tools/node_modules/eslint/lib/rules/line-comment-position.js b/tools/node_modules/eslint/lib/rules/line-comment-position.js
index 77ee147cbec..ad109a4f795 100644
--- a/tools/node_modules/eslint/lib/rules/line-comment-position.js
+++ b/tools/node_modules/eslint/lib/rules/line-comment-position.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce position of line comments",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/line-comment-position"
},
diff --git a/tools/node_modules/eslint/lib/rules/linebreak-style.js b/tools/node_modules/eslint/lib/rules/linebreak-style.js
index b3b393ead77..92996ebd331 100644
--- a/tools/node_modules/eslint/lib/rules/linebreak-style.js
+++ b/tools/node_modules/eslint/lib/rules/linebreak-style.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "enforce consistent linebreak style",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/linebreak-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/lines-around-comment.js b/tools/node_modules/eslint/lib/rules/lines-around-comment.js
index 6806e793cd1..79bcbb7fc19 100644
--- a/tools/node_modules/eslint/lib/rules/lines-around-comment.js
+++ b/tools/node_modules/eslint/lib/rules/lines-around-comment.js
@@ -55,7 +55,6 @@ module.exports = {
docs: {
description: "require empty lines around comments",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/lines-around-comment"
},
diff --git a/tools/node_modules/eslint/lib/rules/lines-around-directive.js b/tools/node_modules/eslint/lib/rules/lines-around-directive.js
index fb439dad6a3..c0c70e1a61f 100644
--- a/tools/node_modules/eslint/lib/rules/lines-around-directive.js
+++ b/tools/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";
@@ -18,7 +18,6 @@ module.exports = {
docs: {
description: "require or disallow newlines around directives",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/lines-around-directive"
},
diff --git a/tools/node_modules/eslint/lib/rules/lines-between-class-members.js b/tools/node_modules/eslint/lib/rules/lines-between-class-members.js
index 97235303699..e4c05f3050c 100644
--- a/tools/node_modules/eslint/lib/rules/lines-between-class-members.js
+++ b/tools/node_modules/eslint/lib/rules/lines-between-class-members.js
@@ -4,6 +4,10 @@
*/
"use strict";
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
@@ -16,7 +20,6 @@ module.exports = {
docs: {
description: "require or disallow an empty line between class members",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/lines-between-class-members"
},
@@ -54,6 +57,51 @@ module.exports = {
const sourceCode = context.getSourceCode();
/**
+ * Gets a pair of tokens that should be used to check lines between two class member nodes.
+ *
+ * In most cases, this returns the very last token of the current node and
+ * the very first token of the next node.
+ * For example:
+ *
+ * class C {
+ * x = 1; // curLast: `;` nextFirst: `in`
+ * in = 2
+ * }
+ *
+ * There is only one exception. If the given node ends with a semicolon, and it looks like
+ * a semicolon-less style's semicolon - one that is not on the same line as the preceding
+ * token, but is on the line where the next class member starts - this returns the preceding
+ * token and the semicolon as boundary tokens.
+ * For example:
+ *
+ * class C {
+ * x = 1 // curLast: `1` nextFirst: `;`
+ * ;in = 2
+ * }
+ * When determining the desired layout of the code, we should treat this semicolon as
+ * a part of the next class member node instead of the one it technically belongs to.
+ * @param {ASTNode} curNode Current class member node.
+ * @param {ASTNode} nextNode Next class member node.
+ * @returns {Token} The actual last token of `node`.
+ * @private
+ */
+ function getBoundaryTokens(curNode, nextNode) {
+ const lastToken = sourceCode.getLastToken(curNode);
+ const prevToken = sourceCode.getTokenBefore(lastToken);
+ const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes
+
+ const isSemicolonLessStyle = (
+ astUtils.isSemicolonToken(lastToken) &&
+ !astUtils.isTokenOnSameLine(prevToken, lastToken) &&
+ astUtils.isTokenOnSameLine(lastToken, nextToken)
+ );
+
+ return isSemicolonLessStyle
+ ? { curLast: prevToken, nextFirst: lastToken }
+ : { curLast: lastToken, nextFirst: nextToken };
+ }
+
+ /**
* Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member.
* @param {Token} prevLastToken The last token in the previous member node.
* @param {Token} nextFirstToken The first token in the next member node.
@@ -101,8 +149,7 @@ module.exports = {
for (let i = 0; i < body.length - 1; i++) {
const curFirst = sourceCode.getFirstToken(body[i]);
- const curLast = sourceCode.getLastToken(body[i]);
- const nextFirst = sourceCode.getFirstToken(body[i + 1]);
+ const { curLast, nextFirst } = getBoundaryTokens(body[i], body[i + 1]);
const isMulti = !astUtils.isTokenOnSameLine(curFirst, curLast);
const skip = !isMulti && options[1].exceptAfterSingleLine;
const beforePadding = findLastConsecutiveTokenAfter(curLast, nextFirst, 1);
diff --git a/tools/node_modules/eslint/lib/rules/max-classes-per-file.js b/tools/node_modules/eslint/lib/rules/max-classes-per-file.js
index bb48a546e95..3d26108a715 100644
--- a/tools/node_modules/eslint/lib/rules/max-classes-per-file.js
+++ b/tools/node_modules/eslint/lib/rules/max-classes-per-file.js
@@ -19,15 +19,31 @@ module.exports = {
docs: {
description: "enforce a maximum number of classes per file",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/max-classes-per-file"
},
schema: [
{
- type: "integer",
- minimum: 1
+ oneOf: [
+ {
+ type: "integer",
+ minimum: 1
+ },
+ {
+ type: "object",
+ properties: {
+ ignoreExpressions: {
+ type: "boolean"
+ },
+ max: {
+ type: "integer",
+ minimum: 1
+ }
+ },
+ additionalProperties: false
+ }
+ ]
}
],
@@ -36,8 +52,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 +64,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/tools/node_modules/eslint/lib/rules/max-depth.js b/tools/node_modules/eslint/lib/rules/max-depth.js
index 5c5296bec00..415598b2929 100644
--- a/tools/node_modules/eslint/lib/rules/max-depth.js
+++ b/tools/node_modules/eslint/lib/rules/max-depth.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce a maximum depth that blocks can be nested",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-depth"
},
diff --git a/tools/node_modules/eslint/lib/rules/max-len.js b/tools/node_modules/eslint/lib/rules/max-len.js
index dd76760c505..8c7985d3e16 100644
--- a/tools/node_modules/eslint/lib/rules/max-len.js
+++ b/tools/node_modules/eslint/lib/rules/max-len.js
@@ -69,7 +69,6 @@ module.exports = {
docs: {
description: "enforce a maximum line length",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-len"
},
@@ -215,7 +214,7 @@ module.exports = {
* Ensure that an array exists at [key] on `object`, and add `value` to it.
* @param {Object} object the object to mutate
* @param {string} key the object's key
- * @param {*} value the value to add
+ * @param {any} value the value to add
* @returns {void}
* @private
*/
diff --git a/tools/node_modules/eslint/lib/rules/max-lines-per-function.js b/tools/node_modules/eslint/lib/rules/max-lines-per-function.js
index 60e2e879f54..b2130ca260b 100644
--- a/tools/node_modules/eslint/lib/rules/max-lines-per-function.js
+++ b/tools/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.<string,Node>} A map with numeric keys (source code line numbers) and comment token values.
+ * @returns {Map<string, Node>} A map with numeric keys (source code line numbers) and comment token values.
*/
function getCommentLineNumbers(comments) {
const map = new Map();
@@ -71,7 +71,6 @@ module.exports = {
docs: {
description: "enforce a maximum number of lines of code in a function",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-lines-per-function"
},
diff --git a/tools/node_modules/eslint/lib/rules/max-lines.js b/tools/node_modules/eslint/lib/rules/max-lines.js
index 8bd5a1c95f4..291d7d9c1a8 100644
--- a/tools/node_modules/eslint/lib/rules/max-lines.js
+++ b/tools/node_modules/eslint/lib/rules/max-lines.js
@@ -34,7 +34,6 @@ module.exports = {
docs: {
description: "enforce a maximum number of lines per file",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-lines"
},
@@ -137,20 +136,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,7 +158,7 @@ module.exports = {
if (skipComments) {
const comments = sourceCode.getAllComments();
- const commentLines = flatMap(comments, comment => getLinesWithoutCode(comment));
+ const commentLines = comments.flatMap(getLinesWithoutCode);
lines = lines.filter(
l => !commentLines.includes(l.lineNumber)
diff --git a/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js b/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js
index df1baceeb41..df24a96da58 100644
--- a/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js
+++ b/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce a maximum depth that callbacks can be nested",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-nested-callbacks"
},
diff --git a/tools/node_modules/eslint/lib/rules/max-params.js b/tools/node_modules/eslint/lib/rules/max-params.js
index 8fb798401cb..c8be60e5774 100644
--- a/tools/node_modules/eslint/lib/rules/max-params.js
+++ b/tools/node_modules/eslint/lib/rules/max-params.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "enforce a maximum number of parameters in function definitions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-params"
},
diff --git a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js
index 5407cff3c54..7c743292bd6 100644
--- a/tools/node_modules/eslint/lib/rules/max-statements-per-line.js
+++ b/tools/node_modules/eslint/lib/rules/max-statements-per-line.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce a maximum number of statements allowed per line",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-statements-per-line"
},
diff --git a/tools/node_modules/eslint/lib/rules/max-statements.js b/tools/node_modules/eslint/lib/rules/max-statements.js
index 65d5539550d..6f48c9218a9 100644
--- a/tools/node_modules/eslint/lib/rules/max-statements.js
+++ b/tools/node_modules/eslint/lib/rules/max-statements.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "enforce a maximum number of statements allowed in function blocks",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/max-statements"
},
diff --git a/tools/node_modules/eslint/lib/rules/multiline-comment-style.js b/tools/node_modules/eslint/lib/rules/multiline-comment-style.js
index 9524818b8bd..da5ee50df4a 100644
--- a/tools/node_modules/eslint/lib/rules/multiline-comment-style.js
+++ b/tools/node_modules/eslint/lib/rules/multiline-comment-style.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce a particular style for multiline comments",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/multiline-comment-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/multiline-ternary.js b/tools/node_modules/eslint/lib/rules/multiline-ternary.js
index 98360b9cad4..6f468c828c0 100644
--- a/tools/node_modules/eslint/lib/rules/multiline-ternary.js
+++ b/tools/node_modules/eslint/lib/rules/multiline-ternary.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce newlines between operands of ternary expressions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/multiline-ternary"
},
diff --git a/tools/node_modules/eslint/lib/rules/new-cap.js b/tools/node_modules/eslint/lib/rules/new-cap.js
index 4249a542802..9abf3379b8a 100644
--- a/tools/node_modules/eslint/lib/rules/new-cap.js
+++ b/tools/node_modules/eslint/lib/rules/new-cap.js
@@ -33,7 +33,8 @@ 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) {
@@ -81,7 +82,6 @@ module.exports = {
docs: {
description: "require constructor names to begin with a capital letter",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/new-cap"
},
diff --git a/tools/node_modules/eslint/lib/rules/new-parens.js b/tools/node_modules/eslint/lib/rules/new-parens.js
index 405ec1b515a..786300dba7d 100644
--- a/tools/node_modules/eslint/lib/rules/new-parens.js
+++ b/tools/node_modules/eslint/lib/rules/new-parens.js
@@ -25,7 +25,6 @@ module.exports = {
docs: {
description: "enforce or disallow parentheses when invoking a constructor with no arguments",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/new-parens"
},
diff --git a/tools/node_modules/eslint/lib/rules/newline-after-var.js b/tools/node_modules/eslint/lib/rules/newline-after-var.js
index 4809d9bfc5a..3eea1b1f732 100644
--- a/tools/node_modules/eslint/lib/rules/newline-after-var.js
+++ b/tools/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";
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "require or disallow an empty line after variable declarations",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/newline-after-var"
},
@@ -145,9 +144,9 @@ module.exports = {
/**
* Determine if a token starts more than one line after a comment ends
- * @param {token} token The token being checked
- * @param {integer} commentStartLine The line number on which the comment starts
- * @returns {boolean} True if `token` does not start immediately after a comment
+ * @param {token} token The token being checked
+ * @param {integer} commentStartLine The line number on which the comment starts
+ * @returns {boolean} True if `token` does not start immediately after a comment
*/
function hasBlankLineAfterComment(token, commentStartLine) {
return token.loc.start.line > getLastCommentLineOfBlock(commentStartLine) + 1;
diff --git a/tools/node_modules/eslint/lib/rules/newline-before-return.js b/tools/node_modules/eslint/lib/rules/newline-before-return.js
index 65ca32321cc..fd6341e67c0 100644
--- a/tools/node_modules/eslint/lib/rules/newline-before-return.js
+++ b/tools/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";
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require an empty line before `return` statements",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/newline-before-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
index 46c9d6c10f8..8de9a6a2398 100644
--- a/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
+++ b/tools/node_modules/eslint/lib/rules/newline-per-chained-call.js
@@ -18,7 +18,6 @@ module.exports = {
docs: {
description: "require a newline after each call in a method chain",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/newline-per-chained-call"
},
@@ -53,7 +52,7 @@ module.exports = {
* Get the prefix of a given MemberExpression node.
* If the MemberExpression node is a computed value it returns a
* left bracket. If not it returns a period.
- * @param {ASTNode} node A MemberExpression node to get
+ * @param {ASTNode} node A MemberExpression node to get
* @returns {string} The prefix of the node.
*/
function getPrefix(node) {
diff --git a/tools/node_modules/eslint/lib/rules/no-alert.js b/tools/node_modules/eslint/lib/rules/no-alert.js
index 702b4d2ba7c..918b98489a7 100644
--- a/tools/node_modules/eslint/lib/rules/no-alert.js
+++ b/tools/node_modules/eslint/lib/rules/no-alert.js
@@ -88,7 +88,6 @@ module.exports = {
docs: {
description: "disallow the use of `alert`, `confirm`, and `prompt`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-alert"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-array-constructor.js b/tools/node_modules/eslint/lib/rules/no-array-constructor.js
index 90c6d6bbd59..0904fa6d8f0 100644
--- a/tools/node_modules/eslint/lib/rules/no-array-constructor.js
+++ b/tools/node_modules/eslint/lib/rules/no-array-constructor.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow `Array` constructors",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-array-constructor"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-async-promise-executor.js b/tools/node_modules/eslint/lib/rules/no-async-promise-executor.js
index 553311e5804..27116f1da78 100644
--- a/tools/node_modules/eslint/lib/rules/no-async-promise-executor.js
+++ b/tools/node_modules/eslint/lib/rules/no-async-promise-executor.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow using an async function as a Promise executor",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-async-promise-executor"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-await-in-loop.js b/tools/node_modules/eslint/lib/rules/no-await-in-loop.js
index 9ca89866a6e..38af8b56c1a 100644
--- a/tools/node_modules/eslint/lib/rules/no-await-in-loop.js
+++ b/tools/node_modules/eslint/lib/rules/no-await-in-loop.js
@@ -59,7 +59,6 @@ module.exports = {
docs: {
description: "disallow `await` inside of loops",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-await-in-loop"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-bitwise.js b/tools/node_modules/eslint/lib/rules/no-bitwise.js
index a9c3360a7c5..10bf24a2997 100644
--- a/tools/node_modules/eslint/lib/rules/no-bitwise.js
+++ b/tools/node_modules/eslint/lib/rules/no-bitwise.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "disallow bitwise operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-bitwise"
},
@@ -63,7 +62,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,7 +71,7 @@ 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) {
@@ -81,7 +80,7 @@ module.exports = {
/**
* 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) {
@@ -90,7 +89,7 @@ module.exports = {
/**
* 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 +99,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/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js b/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
index 152dda0ceae..cc5906e78a3 100644
--- a/tools/node_modules/eslint/lib/rules/no-buffer-constructor.js
+++ b/tools/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";
@@ -18,7 +19,6 @@ module.exports = {
docs: {
description: "disallow use of the `Buffer()` constructor",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-buffer-constructor"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-caller.js b/tools/node_modules/eslint/lib/rules/no-caller.js
index 5fe1bd44985..dbb527906f2 100644
--- a/tools/node_modules/eslint/lib/rules/no-caller.js
+++ b/tools/node_modules/eslint/lib/rules/no-caller.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow the use of `arguments.caller` or `arguments.callee`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-caller"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-case-declarations.js b/tools/node_modules/eslint/lib/rules/no-case-declarations.js
index 1d54e221625..a132f0370fa 100644
--- a/tools/node_modules/eslint/lib/rules/no-case-declarations.js
+++ b/tools/node_modules/eslint/lib/rules/no-case-declarations.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow lexical declarations in case clauses",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-case-declarations"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-catch-shadow.js b/tools/node_modules/eslint/lib/rules/no-catch-shadow.js
index 4917af84e43..0cbeedf90b6 100644
--- a/tools/node_modules/eslint/lib/rules/no-catch-shadow.js
+++ b/tools/node_modules/eslint/lib/rules/no-catch-shadow.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-catch-shadow"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-class-assign.js b/tools/node_modules/eslint/lib/rules/no-class-assign.js
index 887058ba0f9..839ad03e292 100644
--- a/tools/node_modules/eslint/lib/rules/no-class-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-class-assign.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow reassigning class members",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/no-class-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js b/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js
index 0c6865ad59e..e8fdaa0cc69 100644
--- a/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js
+++ b/tools/node_modules/eslint/lib/rules/no-compare-neg-zero.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow comparing against -0",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-compare-neg-zero"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-cond-assign.js b/tools/node_modules/eslint/lib/rules/no-cond-assign.js
index 3843a7ac2e3..42f75af7d0c 100644
--- a/tools/node_modules/eslint/lib/rules/no-cond-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-cond-assign.js
@@ -34,7 +34,6 @@ module.exports = {
docs: {
description: "disallow assignment operators in conditional expressions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-cond-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js
index 9009b64fa15..fa87f4012e8 100644
--- a/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js
+++ b/tools/node_modules/eslint/lib/rules/no-confusing-arrow.js
@@ -31,7 +31,6 @@ module.exports = {
docs: {
description: "disallow arrow functions where they could be confused with comparisons",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-confusing-arrow"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-console.js b/tools/node_modules/eslint/lib/rules/no-console.js
index 56dbbc3a9fd..a5937cbddb2 100644
--- a/tools/node_modules/eslint/lib/rules/no-console.js
+++ b/tools/node_modules/eslint/lib/rules/no-console.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow the use of `console`",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-console"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-const-assign.js b/tools/node_modules/eslint/lib/rules/no-const-assign.js
index e4ae891705f..6ca1b6107a8 100644
--- a/tools/node_modules/eslint/lib/rules/no-const-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-const-assign.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow reassigning `const` variables",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/no-const-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-constant-condition.js b/tools/node_modules/eslint/lib/rules/no-constant-condition.js
index 3c2d68cbf6c..7a7030a9a46 100644
--- a/tools/node_modules/eslint/lib/rules/no-constant-condition.js
+++ b/tools/node_modules/eslint/lib/rules/no-constant-condition.js
@@ -19,7 +19,6 @@ module.exports = {
docs: {
description: "disallow constant expressions in conditions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-constant-condition"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-constructor-return.js b/tools/node_modules/eslint/lib/rules/no-constructor-return.js
index 4757770b7cc..b4b5baf743c 100644
--- a/tools/node_modules/eslint/lib/rules/no-constructor-return.js
+++ b/tools/node_modules/eslint/lib/rules/no-constructor-return.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow returning value from constructor",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-constructor-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-continue.js b/tools/node_modules/eslint/lib/rules/no-continue.js
index 96718d17a3d..e72e862df59 100644
--- a/tools/node_modules/eslint/lib/rules/no-continue.js
+++ b/tools/node_modules/eslint/lib/rules/no-continue.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow `continue` statements",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-continue"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-control-regex.js b/tools/node_modules/eslint/lib/rules/no-control-regex.js
index 6feeb6419d5..908d61ae449 100644
--- a/tools/node_modules/eslint/lib/rules/no-control-regex.js
+++ b/tools/node_modules/eslint/lib/rules/no-control-regex.js
@@ -52,7 +52,6 @@ module.exports = {
docs: {
description: "disallow control characters in regular expressions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-control-regex"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-debugger.js b/tools/node_modules/eslint/lib/rules/no-debugger.js
index 95a28a86215..46dd57639cf 100644
--- a/tools/node_modules/eslint/lib/rules/no-debugger.js
+++ b/tools/node_modules/eslint/lib/rules/no-debugger.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow the use of `debugger`",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-debugger"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-delete-var.js b/tools/node_modules/eslint/lib/rules/no-delete-var.js
index aeab951d75f..1438ebc33bd 100644
--- a/tools/node_modules/eslint/lib/rules/no-delete-var.js
+++ b/tools/node_modules/eslint/lib/rules/no-delete-var.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow deleting variables",
- category: "Variables",
recommended: true,
url: "https://eslint.org/docs/rules/no-delete-var"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-div-regex.js b/tools/node_modules/eslint/lib/rules/no-div-regex.js
index 0ccabdcc698..40388c366e2 100644
--- a/tools/node_modules/eslint/lib/rules/no-div-regex.js
+++ b/tools/node_modules/eslint/lib/rules/no-div-regex.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow division operators explicitly at the beginning of regular expressions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-div-regex"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-args.js b/tools/node_modules/eslint/lib/rules/no-dupe-args.js
index 817277f522e..0880b9c8124 100644
--- a/tools/node_modules/eslint/lib/rules/no-dupe-args.js
+++ b/tools/node_modules/eslint/lib/rules/no-dupe-args.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow duplicate arguments in `function` definitions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-dupe-args"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js b/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js
index b12939d57bc..f74865b82a8 100644
--- a/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js
+++ b/tools/node_modules/eslint/lib/rules/no-dupe-class-members.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow duplicate class members",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/no-dupe-class-members"
},
@@ -73,20 +72,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/tools/node_modules/eslint/lib/rules/no-dupe-else-if.js b/tools/node_modules/eslint/lib/rules/no-dupe-else-if.js
index cbeb437da1e..0d8b17cc0ab 100644
--- a/tools/node_modules/eslint/lib/rules/no-dupe-else-if.js
+++ b/tools/node_modules/eslint/lib/rules/no-dupe-else-if.js
@@ -52,7 +52,6 @@ module.exports = {
docs: {
description: "disallow duplicate conditions in if-else-if chains",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-dupe-else-if"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-dupe-keys.js b/tools/node_modules/eslint/lib/rules/no-dupe-keys.js
index 89e1f2de642..ecec022185f 100644
--- a/tools/node_modules/eslint/lib/rules/no-dupe-keys.js
+++ b/tools/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.
@@ -89,7 +88,6 @@ module.exports = {
docs: {
description: "disallow duplicate keys in object literals",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-dupe-keys"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-duplicate-case.js b/tools/node_modules/eslint/lib/rules/no-duplicate-case.js
index e2d9665e7f5..4669dcee1ba 100644
--- a/tools/node_modules/eslint/lib/rules/no-duplicate-case.js
+++ b/tools/node_modules/eslint/lib/rules/no-duplicate-case.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow duplicate case labels",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-duplicate-case"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js
index cc3da1d5a68..2663698dc96 100644
--- a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js
+++ b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js
@@ -233,7 +233,6 @@ module.exports = {
docs: {
description: "disallow duplicate module imports",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-duplicate-imports"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-else-return.js b/tools/node_modules/eslint/lib/rules/no-else-return.js
index 84409fac87c..4c981ae1592 100644
--- a/tools/node_modules/eslint/lib/rules/no-else-return.js
+++ b/tools/node_modules/eslint/lib/rules/no-else-return.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow `else` blocks after `return` statements in `if` statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-else-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-empty-character-class.js b/tools/node_modules/eslint/lib/rules/no-empty-character-class.js
index 7dc219fe1a7..85e8ef76791 100644
--- a/tools/node_modules/eslint/lib/rules/no-empty-character-class.js
+++ b/tools/node_modules/eslint/lib/rules/no-empty-character-class.js
@@ -12,16 +12,13 @@
/*
* plain-English description of the following regexp:
* 0. `^` fix the match at the beginning of the string
- * 1. `\/`: the `/` that begins the regexp
- * 2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following
- * 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes)
- * 2.1. `\\.`: an escape sequence
- * 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty
- * 3. `\/` the `/` that ends the regexp
- * 4. `[gimuy]*`: optional regexp flags
- * 5. `$`: fix the match at the end of the string
+ * 1. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following
+ * 1.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes)
+ * 1.1. `\\.`: an escape sequence
+ * 1.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty
+ * 2. `$`: fix the match at the end of the string
*/
-const regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuys]*$/u;
+const regex = /^([^\\[]|\\.|\[([^\\\]]|\\.)+\])*$/u;
//------------------------------------------------------------------------------
// Rule Definition
@@ -33,7 +30,6 @@ module.exports = {
docs: {
description: "disallow empty character classes in regular expressions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-empty-character-class"
},
@@ -46,18 +42,12 @@ module.exports = {
},
create(context) {
- const sourceCode = context.getSourceCode();
-
return {
-
- Literal(node) {
- const token = sourceCode.getFirstToken(node);
-
- if (token.type === "RegularExpression" && !regex.test(token.value)) {
+ "Literal[regex]"(node) {
+ if (!regex.test(node.regex.pattern)) {
context.report({ node, messageId: "unexpected" });
}
}
-
};
}
diff --git a/tools/node_modules/eslint/lib/rules/no-empty-function.js b/tools/node_modules/eslint/lib/rules/no-empty-function.js
index c512f8cd5f4..8b1073a59d8 100644
--- a/tools/node_modules/eslint/lib/rules/no-empty-function.js
+++ b/tools/node_modules/eslint/lib/rules/no-empty-function.js
@@ -95,7 +95,6 @@ module.exports = {
docs: {
description: "disallow empty functions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-empty-function"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-empty-pattern.js b/tools/node_modules/eslint/lib/rules/no-empty-pattern.js
index 9f34bfde92e..99ea3a7905b 100644
--- a/tools/node_modules/eslint/lib/rules/no-empty-pattern.js
+++ b/tools/node_modules/eslint/lib/rules/no-empty-pattern.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow empty destructuring patterns",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-empty-pattern"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-empty.js b/tools/node_modules/eslint/lib/rules/no-empty.js
index 45bf03c13ae..4ed3c5c5458 100644
--- a/tools/node_modules/eslint/lib/rules/no-empty.js
+++ b/tools/node_modules/eslint/lib/rules/no-empty.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow empty block statements",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-empty"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-eq-null.js b/tools/node_modules/eslint/lib/rules/no-eq-null.js
index b8dead96d25..dae922840b8 100644
--- a/tools/node_modules/eslint/lib/rules/no-eq-null.js
+++ b/tools/node_modules/eslint/lib/rules/no-eq-null.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow `null` comparisons without type-checking operators",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-eq-null"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-eval.js b/tools/node_modules/eslint/lib/rules/no-eval.js
index a020fdee014..97481528357 100644
--- a/tools/node_modules/eslint/lib/rules/no-eval.js
+++ b/tools/node_modules/eslint/lib/rules/no-eval.js
@@ -43,7 +43,6 @@ module.exports = {
docs: {
description: "disallow the use of `eval()`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-eval"
},
@@ -247,6 +246,8 @@ module.exports = {
"FunctionExpression:exit": exitVarScope,
ArrowFunctionExpression: enterVarScope,
"ArrowFunctionExpression:exit": exitVarScope,
+ "PropertyDefinition > *.value": enterVarScope,
+ "PropertyDefinition > *.value:exit": exitVarScope,
ThisExpression(node) {
if (!isMember(node.parent, "eval")) {
diff --git a/tools/node_modules/eslint/lib/rules/no-ex-assign.js b/tools/node_modules/eslint/lib/rules/no-ex-assign.js
index 1163920361d..cd56c94af75 100644
--- a/tools/node_modules/eslint/lib/rules/no-ex-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-ex-assign.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow reassigning exceptions in `catch` clauses",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-ex-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-extend-native.js b/tools/node_modules/eslint/lib/rules/no-extend-native.js
index 2a804b56398..4d5accbae63 100644
--- a/tools/node_modules/eslint/lib/rules/no-extend-native.js
+++ b/tools/node_modules/eslint/lib/rules/no-extend-native.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow extending native types",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-extend-native"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-extra-bind.js b/tools/node_modules/eslint/lib/rules/no-extra-bind.js
index 2db440dc1ea..6fd3be1d601 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-bind.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-bind.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "disallow unnecessary calls to `.bind()`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-extra-bind"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js
index 6ae3ea62ca7..cb061dac5d5 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-boolean-cast.js
@@ -24,7 +24,6 @@ module.exports = {
docs: {
description: "disallow unnecessary boolean casts",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-extra-boolean-cast"
},
@@ -150,6 +149,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) {
diff --git a/tools/node_modules/eslint/lib/rules/no-extra-label.js b/tools/node_modules/eslint/lib/rules/no-extra-label.js
index 81406e76095..bbb2413b2c7 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-label.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-label.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow unnecessary labels",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-extra-label"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-extra-parens.js b/tools/node_modules/eslint/lib/rules/no-extra-parens.js
index 307e340c958..0756d2fb2c7 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-parens.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-parens.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow unnecessary parentheses",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-extra-parens"
},
@@ -808,13 +807,6 @@ module.exports = {
CallExpression: checkCallNew,
- ClassBody(node) {
- node.body
- .filter(member => member.type === "MethodDefinition" && member.computed && member.key)
- .filter(member => hasExcessParensWithPrecedence(member.key, PRECEDENCE_OF_ASSIGNMENT_EXPR))
- .forEach(member => report(member.key));
- },
-
ConditionalExpression(node) {
if (isReturnAssignException(node)) {
return;
@@ -1063,6 +1055,12 @@ module.exports = {
}
},
+ "MethodDefinition[computed=true]"(node) {
+ if (hasExcessParensWithPrecedence(node.key, PRECEDENCE_OF_ASSIGNMENT_EXPR)) {
+ report(node.key);
+ }
+ },
+
NewExpression: checkCallNew,
ObjectExpression(node) {
@@ -1090,6 +1088,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/tools/node_modules/eslint/lib/rules/no-extra-semi.js b/tools/node_modules/eslint/lib/rules/no-extra-semi.js
index e0a8df0565a..952869c3ea7 100644
--- a/tools/node_modules/eslint/lib/rules/no-extra-semi.js
+++ b/tools/node_modules/eslint/lib/rules/no-extra-semi.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow unnecessary semicolons",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-extra-semi"
},
@@ -117,7 +116,7 @@ module.exports = {
* @param {Node} node A MethodDefinition node of the start point.
* @returns {void}
*/
- MethodDefinition(node) {
+ "MethodDefinition, PropertyDefinition"(node) {
checkForPartOfClassBody(sourceCode.getTokenAfter(node));
}
};
diff --git a/tools/node_modules/eslint/lib/rules/no-fallthrough.js b/tools/node_modules/eslint/lib/rules/no-fallthrough.js
index 3b949acd1da..bf2c82514bb 100644
--- a/tools/node_modules/eslint/lib/rules/no-fallthrough.js
+++ b/tools/node_modules/eslint/lib/rules/no-fallthrough.js
@@ -64,7 +64,6 @@ module.exports = {
docs: {
description: "disallow fallthrough of `case` statements",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-fallthrough"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-floating-decimal.js b/tools/node_modules/eslint/lib/rules/no-floating-decimal.js
index b1d883212e2..92ac2326b9f 100644
--- a/tools/node_modules/eslint/lib/rules/no-floating-decimal.js
+++ b/tools/node_modules/eslint/lib/rules/no-floating-decimal.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow leading or trailing decimal points in numeric literals",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-floating-decimal"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-func-assign.js b/tools/node_modules/eslint/lib/rules/no-func-assign.js
index 33d0ad9ecd1..aa04f337ae0 100644
--- a/tools/node_modules/eslint/lib/rules/no-func-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-func-assign.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow reassigning `function` declarations",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-func-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-global-assign.js b/tools/node_modules/eslint/lib/rules/no-global-assign.js
index ea854c4aa8c..85aac7cdc0f 100644
--- a/tools/node_modules/eslint/lib/rules/no-global-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-global-assign.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow assignments to native objects or read-only global variables",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-global-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js
index 993b8d1f1c8..1d11e10d597 100644
--- a/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js
+++ b/tools/node_modules/eslint/lib/rules/no-implicit-coercion.js
@@ -173,7 +173,6 @@ module.exports = {
docs: {
description: "disallow shorthand type conversions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-implicit-coercion"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-implicit-globals.js b/tools/node_modules/eslint/lib/rules/no-implicit-globals.js
index d4bfa3af82f..8740cd80531 100644
--- a/tools/node_modules/eslint/lib/rules/no-implicit-globals.js
+++ b/tools/node_modules/eslint/lib/rules/no-implicit-globals.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow declarations in the global scope",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-implicit-globals"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-implied-eval.js b/tools/node_modules/eslint/lib/rules/no-implied-eval.js
index b8120a64887..2432e68b612 100644
--- a/tools/node_modules/eslint/lib/rules/no-implied-eval.js
+++ b/tools/node_modules/eslint/lib/rules/no-implied-eval.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow the use of `eval()`-like methods",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-implied-eval"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-import-assign.js b/tools/node_modules/eslint/lib/rules/no-import-assign.js
index 41060d8ac9e..fbe63d0539f 100644
--- a/tools/node_modules/eslint/lib/rules/no-import-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-import-assign.js
@@ -180,7 +180,6 @@ module.exports = {
docs: {
description: "disallow assigning to imported bindings",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-import-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-inline-comments.js b/tools/node_modules/eslint/lib/rules/no-inline-comments.js
index dec278615e2..8a955a6130e 100644
--- a/tools/node_modules/eslint/lib/rules/no-inline-comments.js
+++ b/tools/node_modules/eslint/lib/rules/no-inline-comments.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow inline comments after code",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-inline-comments"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-inner-declarations.js b/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
index 0768bc61149..9bbe24d7c82 100644
--- a/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
+++ b/tools/node_modules/eslint/lib/rules/no-inner-declarations.js
@@ -24,7 +24,6 @@ module.exports = {
docs: {
description: "disallow variable or `function` declarations in nested blocks",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-inner-declarations"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js b/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js
index 94ad5ba6d5c..ee199328966 100644
--- a/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js
+++ b/tools/node_modules/eslint/lib/rules/no-invalid-regexp.js
@@ -10,7 +10,7 @@
const RegExpValidator = require("regexpp").RegExpValidator;
const validator = new RegExpValidator();
-const validFlags = /[gimuys]/gu;
+const validFlags = /[dgimsuy]/gu;
const undefined1 = void 0;
//------------------------------------------------------------------------------
@@ -23,7 +23,6 @@ module.exports = {
docs: {
description: "disallow invalid regular expression strings in `RegExp` constructors",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-invalid-regexp"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-invalid-this.js b/tools/node_modules/eslint/lib/rules/no-invalid-this.js
index a79c586d719..77558b90dcc 100644
--- a/tools/node_modules/eslint/lib/rules/no-invalid-this.js
+++ b/tools/node_modules/eslint/lib/rules/no-invalid-this.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow `this` keywords outside of classes or class-like objects",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-invalid-this"
},
@@ -129,6 +128,10 @@ module.exports = {
FunctionExpression: enterFunction,
"FunctionExpression:exit": exitFunction,
+ // Field initializers are implicit functions.
+ "PropertyDefinition > *.value": enterFunction,
+ "PropertyDefinition > *.value:exit": exitFunction,
+
// Reports if `this` of the current context is invalid.
ThisExpression(node) {
const current = stack.getCurrent();
diff --git a/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js
index 15711c6157a..c1609715394 100644
--- a/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js
+++ b/tools/node_modules/eslint/lib/rules/no-irregular-whitespace.js
@@ -31,7 +31,6 @@ module.exports = {
docs: {
description: "disallow irregular whitespace",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-irregular-whitespace"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-iterator.js b/tools/node_modules/eslint/lib/rules/no-iterator.js
index 9ba1e7aefdb..4117f6211c7 100644
--- a/tools/node_modules/eslint/lib/rules/no-iterator.js
+++ b/tools/node_modules/eslint/lib/rules/no-iterator.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow the use of the `__iterator__` property",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-iterator"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-label-var.js b/tools/node_modules/eslint/lib/rules/no-label-var.js
index 570db03285c..4532527c6e8 100644
--- a/tools/node_modules/eslint/lib/rules/no-label-var.js
+++ b/tools/node_modules/eslint/lib/rules/no-label-var.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow labels that share a name with a variable",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-label-var"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-labels.js b/tools/node_modules/eslint/lib/rules/no-labels.js
index 85760d80dbe..5dd15be092e 100644
--- a/tools/node_modules/eslint/lib/rules/no-labels.js
+++ b/tools/node_modules/eslint/lib/rules/no-labels.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow labeled statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-labels"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
index 290784b82ea..5f74cd83c8c 100644
--- a/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
+++ b/tools/node_modules/eslint/lib/rules/no-lone-blocks.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow unnecessary nested blocks",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-lone-blocks"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-lonely-if.js b/tools/node_modules/eslint/lib/rules/no-lonely-if.js
index 6552adc5752..e44f000141b 100644
--- a/tools/node_modules/eslint/lib/rules/no-lonely-if.js
+++ b/tools/node_modules/eslint/lib/rules/no-lonely-if.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow `if` statements as the only statement in `else` blocks",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-lonely-if"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-loop-func.js b/tools/node_modules/eslint/lib/rules/no-loop-func.js
index 13ebd3ee22b..d1a7868072a 100644
--- a/tools/node_modules/eslint/lib/rules/no-loop-func.js
+++ b/tools/node_modules/eslint/lib/rules/no-loop-func.js
@@ -154,7 +154,6 @@ module.exports = {
docs: {
description: "disallow function declarations that contain unsafe references inside loop statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-loop-func"
},
@@ -174,7 +173,7 @@ module.exports = {
* - has a loop node in ancestors.
* - has any references which refers to an unsafe variable.
* @param {ASTNode} node The AST node to check.
- * @returns {boolean} Whether or not the node is within a loop.
+ * @returns {void}
*/
function checkForLoops(node) {
const loopNode = getContainingLoopNode(node);
diff --git a/tools/node_modules/eslint/lib/rules/no-loss-of-precision.js b/tools/node_modules/eslint/lib/rules/no-loss-of-precision.js
index 2d0c6184220..417616dd231 100644
--- a/tools/node_modules/eslint/lib/rules/no-loss-of-precision.js
+++ b/tools/node_modules/eslint/lib/rules/no-loss-of-precision.js
@@ -15,8 +15,7 @@ module.exports = {
docs: {
description: "disallow literal numbers that lose precision",
- category: "Possible Errors",
- recommended: false,
+ recommended: true,
url: "https://eslint.org/docs/rules/no-loss-of-precision"
},
schema: [],
diff --git a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js
index 510b3f9b261..a2c678e7100 100644
--- a/tools/node_modules/eslint/lib/rules/no-magic-numbers.js
+++ b/tools/node_modules/eslint/lib/rules/no-magic-numbers.js
@@ -32,7 +32,6 @@ module.exports = {
docs: {
description: "disallow magic numbers",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-magic-numbers"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js b/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js
index 3d004615c3f..70e31e604f4 100644
--- a/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js
+++ b/tools/node_modules/eslint/lib/rules/no-misleading-character-class.js
@@ -104,7 +104,6 @@ module.exports = {
docs: {
description: "disallow characters which are made with multiple code points in character class syntax",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-misleading-character-class"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js
index 5a2e139a620..ed37a90b1c6 100644
--- a/tools/node_modules/eslint/lib/rules/no-mixed-operators.js
+++ b/tools/node_modules/eslint/lib/rules/no-mixed-operators.js
@@ -58,7 +58,7 @@ function normalizeOptions(options = {}) {
/**
* Checks whether any group which includes both given operator exists or not.
- * @param {Array.<string[]>} groups A list of groups to check.
+ * @param {Array<string[]>} groups A list of groups to check.
* @param {string} left An operator.
* @param {string} right Another operator.
* @returns {boolean} `true` if such group existed.
@@ -88,7 +88,6 @@ module.exports = {
docs: {
description: "disallow mixed binary operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-mixed-operators"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js b/tools/node_modules/eslint/lib/rules/no-mixed-requires.js
index a02de9104bd..f7c2d11ee4f 100644
--- a/tools/node_modules/eslint/lib/rules/no-mixed-requires.js
+++ b/tools/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";
@@ -19,7 +20,6 @@ module.exports = {
docs: {
description: "disallow `require` calls to be mixed with regular variable declarations",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-mixed-requires"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/tools/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js
index 287cbda03da..ac73cddda3b 100644
--- a/tools/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js
+++ b/tools/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow mixed spaces and tabs for indentation",
- category: "Stylistic Issues",
recommended: true,
url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-multi-assign.js b/tools/node_modules/eslint/lib/rules/no-multi-assign.js
index d2606a1502a..8d7bd32c7dd 100644
--- a/tools/node_modules/eslint/lib/rules/no-multi-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-multi-assign.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow use of chained assignment expressions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-multi-assign"
},
@@ -45,16 +44,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/tools/node_modules/eslint/lib/rules/no-multi-spaces.js b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js
index d43ed736337..0134dd279b5 100644
--- a/tools/node_modules/eslint/lib/rules/no-multi-spaces.js
+++ b/tools/node_modules/eslint/lib/rules/no-multi-spaces.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow multiple spaces",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-multi-spaces"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-multi-str.js b/tools/node_modules/eslint/lib/rules/no-multi-str.js
index 7cf1ae36794..848f8d405a8 100644
--- a/tools/node_modules/eslint/lib/rules/no-multi-str.js
+++ b/tools/node_modules/eslint/lib/rules/no-multi-str.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow multiline strings",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-multi-str"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/tools/node_modules/eslint/lib/rules/no-multiple-empty-lines.js
index 9cccef3088a..33ac76f6037 100644
--- a/tools/node_modules/eslint/lib/rules/no-multiple-empty-lines.js
+++ b/tools/node_modules/eslint/lib/rules/no-multiple-empty-lines.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow multiple empty lines",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-multiple-empty-lines"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-native-reassign.js b/tools/node_modules/eslint/lib/rules/no-native-reassign.js
index 833e3b7ce40..80ba0948cbc 100644
--- a/tools/node_modules/eslint/lib/rules/no-native-reassign.js
+++ b/tools/node_modules/eslint/lib/rules/no-native-reassign.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow assignments to native objects or read-only global variables",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-native-reassign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-negated-condition.js b/tools/node_modules/eslint/lib/rules/no-negated-condition.js
index 8a9eba881df..b5cbadca50f 100644
--- a/tools/node_modules/eslint/lib/rules/no-negated-condition.js
+++ b/tools/node_modules/eslint/lib/rules/no-negated-condition.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow negated conditions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-negated-condition"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/tools/node_modules/eslint/lib/rules/no-negated-in-lhs.js
index 1229cedd119..0f9c84be6c9 100644
--- a/tools/node_modules/eslint/lib/rules/no-negated-in-lhs.js
+++ b/tools/node_modules/eslint/lib/rules/no-negated-in-lhs.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow negating the left operand in `in` expressions",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-negated-in-lhs"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-nested-ternary.js b/tools/node_modules/eslint/lib/rules/no-nested-ternary.js
index 383bb238887..2d3359d38f1 100644
--- a/tools/node_modules/eslint/lib/rules/no-nested-ternary.js
+++ b/tools/node_modules/eslint/lib/rules/no-nested-ternary.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow nested ternary expressions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-nested-ternary"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-new-func.js b/tools/node_modules/eslint/lib/rules/no-new-func.js
index 9af4e31cabf..ddf61024dac 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-func.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-func.js
@@ -6,6 +6,18 @@
"use strict";
//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+const astUtils = require("./utils/ast-utils");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const callMethods = new Set(["apply", "bind", "call"]);
+
+//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -15,7 +27,6 @@ module.exports = {
docs: {
description: "disallow `new` operators with the `Function` object",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-new-func"
},
@@ -38,14 +49,30 @@ module.exports = {
variable.references.forEach(ref => {
const node = ref.identifier;
const { parent } = node;
+ let evalNode;
+
+ if (parent) {
+ if (node === parent.callee && (
+ parent.type === "NewExpression" ||
+ parent.type === "CallExpression"
+ )) {
+ evalNode = parent;
+ } else if (
+ parent.type === "MemberExpression" &&
+ node === parent.object &&
+ callMethods.has(astUtils.getStaticPropertyName(parent))
+ ) {
+ const maybeCallee = parent.parent.type === "ChainExpression" ? parent.parent : parent;
+
+ if (maybeCallee.parent.type === "CallExpression" && maybeCallee.parent.callee === maybeCallee) {
+ evalNode = maybeCallee.parent;
+ }
+ }
+ }
- if (
- parent &&
- (parent.type === "NewExpression" || parent.type === "CallExpression") &&
- node === parent.callee
- ) {
+ if (evalNode) {
context.report({
- node: parent,
+ node: evalNode,
messageId: "noFunctionConstructor"
});
}
diff --git a/tools/node_modules/eslint/lib/rules/no-new-object.js b/tools/node_modules/eslint/lib/rules/no-new-object.js
index e9f915db5ea..17dfd344476 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-object.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-object.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow `Object` constructors",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-new-object"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-new-require.js b/tools/node_modules/eslint/lib/rules/no-new-require.js
index 063f783e70c..7973f8f2a27 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-require.js
+++ b/tools/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";
@@ -19,7 +20,6 @@ module.exports = {
docs: {
description: "disallow `new` operators with calls to `require`",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-new-require"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-new-symbol.js b/tools/node_modules/eslint/lib/rules/no-new-symbol.js
index aeb509c0d9c..391527df90c 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-symbol.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-symbol.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow `new` operators with the `Symbol` object",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/no-new-symbol"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-new-wrappers.js b/tools/node_modules/eslint/lib/rules/no-new-wrappers.js
index d276c48d203..b697d8d7951 100644
--- a/tools/node_modules/eslint/lib/rules/no-new-wrappers.js
+++ b/tools/node_modules/eslint/lib/rules/no-new-wrappers.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-new-wrappers"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-new.js b/tools/node_modules/eslint/lib/rules/no-new.js
index aa8a4e26876..1b37f077d5c 100644
--- a/tools/node_modules/eslint/lib/rules/no-new.js
+++ b/tools/node_modules/eslint/lib/rules/no-new.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow `new` operators outside of assignments or comparisons",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-new"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js b/tools/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js
index a4b46d9591f..da61f61d02f 100644
--- a/tools/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js
+++ b/tools/node_modules/eslint/lib/rules/no-nonoctal-decimal-escape.js
@@ -30,12 +30,12 @@ module.exports = {
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
+ recommended: true,
+ url: "https://eslint.org/docs/rules/no-nonoctal-decimal-escape"
},
+ hasSuggestions: true,
+
schema: [],
messages: {
diff --git a/tools/node_modules/eslint/lib/rules/no-obj-calls.js b/tools/node_modules/eslint/lib/rules/no-obj-calls.js
index 6eb200c9b87..d62c1f0b4be 100644
--- a/tools/node_modules/eslint/lib/rules/no-obj-calls.js
+++ b/tools/node_modules/eslint/lib/rules/no-obj-calls.js
@@ -43,7 +43,6 @@ module.exports = {
docs: {
description: "disallow calling global object properties as functions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-obj-calls"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-octal-escape.js b/tools/node_modules/eslint/lib/rules/no-octal-escape.js
index 5b4c7b2ebb4..4513a83861d 100644
--- a/tools/node_modules/eslint/lib/rules/no-octal-escape.js
+++ b/tools/node_modules/eslint/lib/rules/no-octal-escape.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow octal escape sequences in string literals",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-octal-escape"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-octal.js b/tools/node_modules/eslint/lib/rules/no-octal.js
index e9940befafa..5ee6895f623 100644
--- a/tools/node_modules/eslint/lib/rules/no-octal.js
+++ b/tools/node_modules/eslint/lib/rules/no-octal.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow octal literals",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-octal"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-param-reassign.js b/tools/node_modules/eslint/lib/rules/no-param-reassign.js
index 6874af44f38..b758b9d97fc 100644
--- a/tools/node_modules/eslint/lib/rules/no-param-reassign.js
+++ b/tools/node_modules/eslint/lib/rules/no-param-reassign.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow reassigning `function` parameters",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-param-reassign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-path-concat.js b/tools/node_modules/eslint/lib/rules/no-path-concat.js
index fc1f894f878..184c9182b4d 100644
--- a/tools/node_modules/eslint/lib/rules/no-path-concat.js
+++ b/tools/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";
@@ -18,7 +19,6 @@ module.exports = {
docs: {
description: "disallow string concatenation with `__dirname` and `__filename`",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-path-concat"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-plusplus.js b/tools/node_modules/eslint/lib/rules/no-plusplus.js
index 84d6c3e1f91..d7b6c730562 100644
--- a/tools/node_modules/eslint/lib/rules/no-plusplus.js
+++ b/tools/node_modules/eslint/lib/rules/no-plusplus.js
@@ -51,7 +51,6 @@ module.exports = {
docs: {
description: "disallow the unary operators `++` and `--`",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-plusplus"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-process-env.js b/tools/node_modules/eslint/lib/rules/no-process-env.js
index 49d1734906e..c61b5572314 100644
--- a/tools/node_modules/eslint/lib/rules/no-process-env.js
+++ b/tools/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";
@@ -18,7 +19,6 @@ module.exports = {
docs: {
description: "disallow the use of `process.env`",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-process-env"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-process-exit.js b/tools/node_modules/eslint/lib/rules/no-process-exit.js
index 77c9cfd7cbd..73310a9e4e6 100644
--- a/tools/node_modules/eslint/lib/rules/no-process-exit.js
+++ b/tools/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";
@@ -18,7 +19,6 @@ module.exports = {
docs: {
description: "disallow the use of `process.exit()`",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-process-exit"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-promise-executor-return.js b/tools/node_modules/eslint/lib/rules/no-promise-executor-return.js
index 32ee6e15124..42652416f8f 100644
--- a/tools/node_modules/eslint/lib/rules/no-promise-executor-return.js
+++ b/tools/node_modules/eslint/lib/rules/no-promise-executor-return.js
@@ -69,7 +69,6 @@ module.exports = {
docs: {
description: "disallow returning values from Promise executor functions",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-promise-executor-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-proto.js b/tools/node_modules/eslint/lib/rules/no-proto.js
index 82ce02fa4e3..0c2490f7b42 100644
--- a/tools/node_modules/eslint/lib/rules/no-proto.js
+++ b/tools/node_modules/eslint/lib/rules/no-proto.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow the use of the `__proto__` property",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-proto"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-prototype-builtins.js b/tools/node_modules/eslint/lib/rules/no-prototype-builtins.js
index c5e4d49259b..1f837b96040 100644
--- a/tools/node_modules/eslint/lib/rules/no-prototype-builtins.js
+++ b/tools/node_modules/eslint/lib/rules/no-prototype-builtins.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow calling some `Object.prototype` methods directly on objects",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-prototype-builtins"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-redeclare.js b/tools/node_modules/eslint/lib/rules/no-redeclare.js
index 6ddb21c9e15..afbe6170cb7 100644
--- a/tools/node_modules/eslint/lib/rules/no-redeclare.js
+++ b/tools/node_modules/eslint/lib/rules/no-redeclare.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow variable redeclaration",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-redeclare"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-regex-spaces.js b/tools/node_modules/eslint/lib/rules/no-regex-spaces.js
index e6d4c9efba7..1d6b121ba80 100644
--- a/tools/node_modules/eslint/lib/rules/no-regex-spaces.js
+++ b/tools/node_modules/eslint/lib/rules/no-regex-spaces.js
@@ -39,7 +39,6 @@ module.exports = {
docs: {
description: "disallow multiple spaces in regular expressions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-regex-spaces"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-exports.js b/tools/node_modules/eslint/lib/rules/no-restricted-exports.js
index f0df0ffaedb..f568fdc6850 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-exports.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-exports.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow specified names in exports",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-exports"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-globals.js b/tools/node_modules/eslint/lib/rules/no-restricted-globals.js
index 2c932a7307c..efbcd755b1f 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-globals.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-globals.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow specified global variables",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-globals"
},
@@ -43,7 +42,7 @@ module.exports = {
messages: {
defaultMessage: "Unexpected use of '{{name}}'.",
- // eslint-disable-next-line eslint-plugin/report-message-format
+ // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
customMessage: "Unexpected use of '{{name}}'. {{customMessage}}"
}
},
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js
index 414164d29f7..eda63407ff2 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js
@@ -79,26 +79,25 @@ module.exports = {
docs: {
description: "disallow specified modules when loaded by `import`",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-imports"
},
messages: {
path: "'{{importSource}}' import is restricted from being used.",
- // eslint-disable-next-line eslint-plugin/report-message-format
+ // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
pathWithCustomMessage: "'{{importSource}}' import is restricted from being used. {{customMessage}}",
patterns: "'{{importSource}}' import is restricted from being used by a pattern.",
- // eslint-disable-next-line eslint-plugin/report-message-format
+ // 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}}",
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}}"
},
@@ -147,7 +146,7 @@ module.exports = {
? [{ matcher: ignore().add(restrictedPatterns) }]
: restrictedPatterns.map(({ group, message }) => ({ matcher: ignore().add(group), customMessage: message }));
- // 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 && restrictedPatternGroups.length === 0) {
return {};
}
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-modules.js b/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
index d0b8a78a507..66e6fe49e31 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-modules.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Restrict usage of specified node modules.
* @author Christian Schulz
+ * @deprecated in ESLint v7.0.0
*/
"use strict";
@@ -48,7 +49,6 @@ module.exports = {
docs: {
description: "disallow specified modules when loaded by `require`",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-modules"
},
@@ -73,7 +73,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,7 +97,7 @@ 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 {};
}
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-properties.js b/tools/node_modules/eslint/lib/rules/no-restricted-properties.js
index 7ab83995a3e..3671d88eb60 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-properties.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-properties.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow certain properties on certain objects",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-properties"
},
@@ -64,9 +63,9 @@ module.exports = {
},
messages: {
- // eslint-disable-next-line eslint-plugin/report-message-format
+ // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
restrictedObjectProperty: "'{{objectName}}.{{propertyName}}' is restricted from being used.{{message}}",
- // eslint-disable-next-line eslint-plugin/report-message-format
+ // eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
restrictedProperty: "'{{propertyName}}' is restricted from being used.{{message}}"
}
},
diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js b/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js
index 9572603a824..0ff6b91bc69 100644
--- a/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js
+++ b/tools/node_modules/eslint/lib/rules/no-restricted-syntax.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow specified syntax",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-restricted-syntax"
},
@@ -42,7 +41,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/tools/node_modules/eslint/lib/rules/no-return-assign.js b/tools/node_modules/eslint/lib/rules/no-return-assign.js
index 4b57d42eb99..ecb789ea269 100644
--- a/tools/node_modules/eslint/lib/rules/no-return-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-return-assign.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "disallow assignment operators in `return` statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-return-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-return-await.js b/tools/node_modules/eslint/lib/rules/no-return-await.js
index d1d89826856..7ec808f50a3 100644
--- a/tools/node_modules/eslint/lib/rules/no-return-await.js
+++ b/tools/node_modules/eslint/lib/rules/no-return-await.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow unnecessary `return await`",
- category: "Best Practices",
recommended: false,
diff --git a/tools/node_modules/eslint/lib/rules/no-script-url.js b/tools/node_modules/eslint/lib/rules/no-script-url.js
index 0c820524403..12451ad9a9e 100644
--- a/tools/node_modules/eslint/lib/rules/no-script-url.js
+++ b/tools/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";
@@ -19,7 +18,6 @@ module.exports = {
docs: {
description: "disallow `javascript:` urls",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-script-url"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-self-assign.js b/tools/node_modules/eslint/lib/rules/no-self-assign.js
index 705be324cf0..813771e700a 100644
--- a/tools/node_modules/eslint/lib/rules/no-self-assign.js
+++ b/tools/node_modules/eslint/lib/rules/no-self-assign.js
@@ -130,7 +130,6 @@ module.exports = {
docs: {
description: "disallow assignments where both sides are exactly the same",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-self-assign"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-self-compare.js b/tools/node_modules/eslint/lib/rules/no-self-compare.js
index 79b6ac7ea0f..ee77ff08b20 100644
--- a/tools/node_modules/eslint/lib/rules/no-self-compare.js
+++ b/tools/node_modules/eslint/lib/rules/no-self-compare.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow comparisons where both sides are exactly the same",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-self-compare"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-sequences.js b/tools/node_modules/eslint/lib/rules/no-sequences.js
index fe516975fbc..b8941256e6f 100644
--- a/tools/node_modules/eslint/lib/rules/no-sequences.js
+++ b/tools/node_modules/eslint/lib/rules/no-sequences.js
@@ -29,7 +29,6 @@ module.exports = {
docs: {
description: "disallow comma operators",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-sequences"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-setter-return.js b/tools/node_modules/eslint/lib/rules/no-setter-return.js
index 9c79240dda1..67114ade821 100644
--- a/tools/node_modules/eslint/lib/rules/no-setter-return.js
+++ b/tools/node_modules/eslint/lib/rules/no-setter-return.js
@@ -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
) {
@@ -141,7 +142,6 @@ module.exports = {
docs: {
description: "disallow returning values from setters",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-setter-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js
index 9647e9a1bcd..7d4174a104e 100644
--- a/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js
+++ b/tools/node_modules/eslint/lib/rules/no-shadow-restricted-names.js
@@ -27,7 +27,6 @@ module.exports = {
docs: {
description: "disallow identifiers from shadowing restricted names",
- category: "Variables",
recommended: true,
url: "https://eslint.org/docs/rules/no-shadow-restricted-names"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-shadow.js b/tools/node_modules/eslint/lib/rules/no-shadow.js
index a0b1db50c0b..4ec357620b6 100644
--- a/tools/node_modules/eslint/lib/rules/no-shadow.js
+++ b/tools/node_modules/eslint/lib/rules/no-shadow.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow variable declarations from shadowing variables declared in the outer scope",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-shadow"
},
@@ -59,7 +58,7 @@ module.exports = {
/**
* 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) {
diff --git a/tools/node_modules/eslint/lib/rules/no-spaced-func.js b/tools/node_modules/eslint/lib/rules/no-spaced-func.js
index 961bc681f7e..8f51d5446d8 100644
--- a/tools/node_modules/eslint/lib/rules/no-spaced-func.js
+++ b/tools/node_modules/eslint/lib/rules/no-spaced-func.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "disallow spacing between function identifiers and their applications (deprecated)",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-spaced-func"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-sparse-arrays.js b/tools/node_modules/eslint/lib/rules/no-sparse-arrays.js
index e8407c3faed..56ce5dcc871 100644
--- a/tools/node_modules/eslint/lib/rules/no-sparse-arrays.js
+++ b/tools/node_modules/eslint/lib/rules/no-sparse-arrays.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow sparse arrays",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-sparse-arrays"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-sync.js b/tools/node_modules/eslint/lib/rules/no-sync.js
index 06424e0b38f..ea40df12933 100644
--- a/tools/node_modules/eslint/lib/rules/no-sync.js
+++ b/tools/node_modules/eslint/lib/rules/no-sync.js
@@ -1,10 +1,9 @@
/**
* @fileoverview Rule to check for properties whose identifier ends with the string Sync
* @author Matt DuVall<http://mattduvall.com/>
+ * @deprecated in ESLint v7.0.0
*/
-/* jshint node:true */
-
"use strict";
//------------------------------------------------------------------------------
@@ -21,7 +20,6 @@ module.exports = {
docs: {
description: "disallow synchronous methods",
- category: "Node.js and CommonJS",
recommended: false,
url: "https://eslint.org/docs/rules/no-sync"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-tabs.js b/tools/node_modules/eslint/lib/rules/no-tabs.js
index ca7be261653..1f3921a9a70 100644
--- a/tools/node_modules/eslint/lib/rules/no-tabs.js
+++ b/tools/node_modules/eslint/lib/rules/no-tabs.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "disallow all tabs",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-tabs"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-template-curly-in-string.js b/tools/node_modules/eslint/lib/rules/no-template-curly-in-string.js
index 539cd5be5ff..e71480fc013 100644
--- a/tools/node_modules/eslint/lib/rules/no-template-curly-in-string.js
+++ b/tools/node_modules/eslint/lib/rules/no-template-curly-in-string.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow template literal placeholder syntax in regular strings",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-template-curly-in-string"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-ternary.js b/tools/node_modules/eslint/lib/rules/no-ternary.js
index b3ced860566..8b2e10a34a4 100644
--- a/tools/node_modules/eslint/lib/rules/no-ternary.js
+++ b/tools/node_modules/eslint/lib/rules/no-ternary.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow ternary operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-ternary"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-this-before-super.js b/tools/node_modules/eslint/lib/rules/no-this-before-super.js
index 5bfba66fc65..9cc85ebbe21 100644
--- a/tools/node_modules/eslint/lib/rules/no-this-before-super.js
+++ b/tools/node_modules/eslint/lib/rules/no-this-before-super.js
@@ -40,7 +40,6 @@ module.exports = {
docs: {
description: "disallow `this`/`super` before calling `super()` in constructors",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/no-this-before-super"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-throw-literal.js b/tools/node_modules/eslint/lib/rules/no-throw-literal.js
index 29fb3718b48..311e6d4f079 100644
--- a/tools/node_modules/eslint/lib/rules/no-throw-literal.js
+++ b/tools/node_modules/eslint/lib/rules/no-throw-literal.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow throwing literals as exceptions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-throw-literal"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js
index 98ae62c8963..1930098bea0 100644
--- a/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js
+++ b/tools/node_modules/eslint/lib/rules/no-trailing-spaces.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow trailing whitespace at the end of lines",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-trailing-spaces"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-undef-init.js b/tools/node_modules/eslint/lib/rules/no-undef-init.js
index 5c240fef742..7298d344941 100644
--- a/tools/node_modules/eslint/lib/rules/no-undef-init.js
+++ b/tools/node_modules/eslint/lib/rules/no-undef-init.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "disallow initializing variables to `undefined`",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-undef-init"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-undef.js b/tools/node_modules/eslint/lib/rules/no-undef.js
index 6b5140819bb..ee611f9c866 100644
--- a/tools/node_modules/eslint/lib/rules/no-undef.js
+++ b/tools/node_modules/eslint/lib/rules/no-undef.js
@@ -29,7 +29,6 @@ module.exports = {
docs: {
description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments",
- category: "Variables",
recommended: true,
url: "https://eslint.org/docs/rules/no-undef"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-undefined.js b/tools/node_modules/eslint/lib/rules/no-undefined.js
index a075d903e21..ad302255420 100644
--- a/tools/node_modules/eslint/lib/rules/no-undefined.js
+++ b/tools/node_modules/eslint/lib/rules/no-undefined.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow the use of `undefined` as an identifier",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-undefined"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js b/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js
index 87d2336fa4a..916b8c01baa 100644
--- a/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js
+++ b/tools/node_modules/eslint/lib/rules/no-underscore-dangle.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow dangling underscores in identifiers",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-underscore-dangle"
},
@@ -253,7 +252,9 @@ module.exports = {
node,
messageId: "unexpectedUnderscore",
data: {
- identifier
+ identifier: node.key.type === "PrivateIdentifier"
+ ? `#${identifier}`
+ : identifier
}
});
}
@@ -268,6 +269,7 @@ module.exports = {
VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
MemberExpression: checkForDanglingUnderscoreInMemberExpression,
MethodDefinition: checkForDanglingUnderscoreInMethod,
+ PropertyDefinition: checkForDanglingUnderscoreInMethod,
Property: checkForDanglingUnderscoreInMethod,
FunctionExpression: checkForDanglingUnderscoreInFunction,
ArrowFunctionExpression: checkForDanglingUnderscoreInFunction
diff --git a/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
index 7af3fe67090..4447959ed9a 100644
--- a/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
+++ b/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow confusing multiline expressions",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-unexpected-multiline"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js b/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js
index 7031a4dd8b8..ba321d2c6ed 100644
--- a/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js
+++ b/tools/node_modules/eslint/lib/rules/no-unmodified-loop-condition.js
@@ -162,7 +162,6 @@ module.exports = {
docs: {
description: "disallow unmodified loop conditions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-unmodified-loop-condition"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js
index 06c615f3824..e12240d03e0 100644
--- a/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js
+++ b/tools/node_modules/eslint/lib/rules/no-unneeded-ternary.js
@@ -29,7 +29,6 @@ module.exports = {
docs: {
description: "disallow ternary operators when simpler alternatives exist",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-unneeded-ternary"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unreachable-loop.js b/tools/node_modules/eslint/lib/rules/no-unreachable-loop.js
index 868a6ff98f8..5cbfac46d31 100644
--- a/tools/node_modules/eslint/lib/rules/no-unreachable-loop.js
+++ b/tools/node_modules/eslint/lib/rules/no-unreachable-loop.js
@@ -59,7 +59,6 @@ module.exports = {
docs: {
description: "disallow loops with a body that allows only one iteration",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/no-unreachable-loop"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unreachable.js b/tools/node_modules/eslint/lib/rules/no-unreachable.js
index 415631a6f7d..ce17a5966a7 100644
--- a/tools/node_modules/eslint/lib/rules/no-unreachable.js
+++ b/tools/node_modules/eslint/lib/rules/no-unreachable.js
@@ -9,6 +9,12 @@
//------------------------------------------------------------------------------
/**
+ * @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.
* @returns {boolean} `true` if the node has the initializer.
@@ -105,7 +111,6 @@ module.exports = {
docs: {
description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-unreachable"
},
@@ -120,6 +125,10 @@ module.exports = {
create(context) {
let currentCodePath = null;
+ /** @type {ConstructorInfo | null} */
+ let constructorInfo = null;
+
+ /** @type {ConsecutiveRange} */
const range = new ConsecutiveRange(context.getSourceCode());
/**
@@ -130,7 +139,7 @@ module.exports = {
function reportIfUnreachable(node) {
let nextNode = null;
- if (node && currentCodePath.currentSegments.every(isUnreachable)) {
+ if (node && (node.type === "PropertyDefinition" || currentCodePath.currentSegments.every(isUnreachable))) {
// Store this statement to distinguish consecutive statements.
if (range.isEmpty) {
@@ -212,6 +221,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/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js b/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js
index 11bf06e872a..4bb7f7fec4f 100644
--- a/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js
+++ b/tools/node_modules/eslint/lib/rules/no-unsafe-finally.js
@@ -24,7 +24,6 @@ module.exports = {
docs: {
description: "disallow control flow statements in `finally` blocks",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/no-unsafe-finally"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js b/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js
index a9c2ee74f2c..c681986941a 100644
--- a/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js
+++ b/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js
@@ -52,12 +52,12 @@ module.exports = {
docs: {
description: "disallow negating the left operand of relational operators",
- category: "Possible Errors",
recommended: true,
- url: "https://eslint.org/docs/rules/no-unsafe-negation",
- suggestion: true
+ url: "https://eslint.org/docs/rules/no-unsafe-negation"
},
+ hasSuggestions: true,
+
schema: [
{
type: "object",
diff --git a/tools/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js b/tools/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js
index 2eafc1ad8f1..cc15c998813 100644
--- a/tools/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js
+++ b/tools/node_modules/eslint/lib/rules/no-unsafe-optional-chaining.js
@@ -24,8 +24,7 @@ module.exports = {
docs: {
description: "disallow use of optional chaining in contexts where the `undefined` value is not allowed",
- category: "Possible Errors",
- recommended: false,
+ recommended: true,
url: "https://eslint.org/docs/rules/no-unsafe-optional-chaining"
},
schema: [{
diff --git a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js
index 58c9b334187..3bb816df778 100644
--- a/tools/node_modules/eslint/lib/rules/no-unused-expressions.js
+++ b/tools/node_modules/eslint/lib/rules/no-unused-expressions.js
@@ -30,7 +30,6 @@ module.exports = {
docs: {
description: "disallow unused expressions",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-unused-expressions"
},
@@ -72,8 +71,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 +81,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 +96,8 @@ module.exports = {
return list.slice();
}
- // eslint-disable-next-line jsdoc/require-description
/**
+ * Gets leading directives nodes in a Node body.
* @param {ASTNode} node a Program or BlockStatement node
* @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
*/
@@ -106,8 +105,8 @@ module.exports = {
return takeWhile(looksLikeDirective, node.body);
}
- // eslint-disable-next-line jsdoc/require-description
/**
+ * Detect if a Node is a directive.
* @param {ASTNode} node any node
* @param {ASTNode[]} ancestors the given node's ancestors
* @returns {boolean} whether the given node is considered a directive in its current position
diff --git a/tools/node_modules/eslint/lib/rules/no-unused-labels.js b/tools/node_modules/eslint/lib/rules/no-unused-labels.js
index b33fcb78679..f0b09614e09 100644
--- a/tools/node_modules/eslint/lib/rules/no-unused-labels.js
+++ b/tools/node_modules/eslint/lib/rules/no-unused-labels.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow unused labels",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-unused-labels"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-unused-vars.js b/tools/node_modules/eslint/lib/rules/no-unused-vars.js
index f04818f8e9d..847e21baf5f 100644
--- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js
+++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js
@@ -33,7 +33,6 @@ module.exports = {
docs: {
description: "disallow unused variables",
- category: "Variables",
recommended: true,
url: "https://eslint.org/docs/rules/no-unused-vars"
},
@@ -296,6 +295,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 +337,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 +350,7 @@ module.exports = {
}
if (parent.type === "AssignmentExpression" &&
- grandparent.type === "ExpressionStatement" &&
+ isUnusedExpression(parent) &&
id === parent.left &&
!canBeUsedLater
) {
@@ -411,31 +434,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.
* @param {ASTNode} rhsNode The RHS node of the previous assignment.
diff --git a/tools/node_modules/eslint/lib/rules/no-use-before-define.js b/tools/node_modules/eslint/lib/rules/no-use-before-define.js
index c7300567ede..fd8864e5fa5 100644
--- a/tools/node_modules/eslint/lib/rules/no-use-before-define.js
+++ b/tools/node_modules/eslint/lib/rules/no-use-before-define.js
@@ -135,7 +135,6 @@ module.exports = {
docs: {
description: "disallow the use of variables before they are defined",
- category: "Variables",
recommended: false,
url: "https://eslint.org/docs/rules/no-use-before-define"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-backreference.js b/tools/node_modules/eslint/lib/rules/no-useless-backreference.js
index 529c16439e3..ae491471282 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-backreference.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-backreference.js
@@ -64,8 +64,7 @@ module.exports = {
docs: {
description: "disallow useless backreferences in regular expressions",
- category: "Possible Errors",
- recommended: false,
+ recommended: true,
url: "https://eslint.org/docs/rules/no-useless-backreference"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-call.js b/tools/node_modules/eslint/lib/rules/no-useless-call.js
index b1382a2fa28..89350665fe3 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-call.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-call.js
@@ -55,7 +55,6 @@ module.exports = {
docs: {
description: "disallow unnecessary calls to `.call()` and `.apply()`",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-call"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-catch.js b/tools/node_modules/eslint/lib/rules/no-useless-catch.js
index f303c272948..280ba553367 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-catch.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-catch.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow unnecessary `catch` clauses",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-useless-catch"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-computed-key.js b/tools/node_modules/eslint/lib/rules/no-useless-computed-key.js
index a1cacc29612..a8769214f54 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-computed-key.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-computed-key.js
@@ -11,6 +11,77 @@
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";
+
+ /* istanbul ignore next */
+ default:
+ throw new Error(`Unexpected node type: ${node.type}`);
+ }
+
+}
+
+//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -20,7 +91,6 @@ module.exports = {
docs: {
description: "disallow unnecessary computed property keys in objects and classes",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-computed-key"
},
@@ -51,22 +121,9 @@ module.exports = {
* @returns {void}
*/
function check(node) {
- if (!node.computed) {
- return;
- }
-
- const key = node.key,
- nodeType = typeof key.value;
-
- let allowedKey;
-
- if (node.type === "MethodDefinition") {
- allowedKey = node.static ? "prototype" : "constructor";
- } else {
- allowedKey = "__proto__";
- }
+ if (hasUselessComputedKey(node)) {
+ const { key } = node;
- if (key.type === "Literal" && (nodeType === "string" || nodeType === "number") && key.value !== allowedKey) {
context.report({
node,
messageId: "unnecessarilyComputedProperty",
@@ -103,7 +160,8 @@ module.exports = {
return {
Property: check,
- MethodDefinition: enforceForClassMembers ? check : noop
+ MethodDefinition: enforceForClassMembers ? check : noop,
+ PropertyDefinition: enforceForClassMembers ? check : noop
};
}
};
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-concat.js b/tools/node_modules/eslint/lib/rules/no-useless-concat.js
index cfc60c8fb51..a0176a7e9db 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-concat.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-concat.js
@@ -70,7 +70,6 @@ module.exports = {
docs: {
description: "disallow unnecessary concatenation of literals or template literals",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-concat"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-constructor.js b/tools/node_modules/eslint/lib/rules/no-useless-constructor.js
index baabe7ec80f..13ec6755015 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-constructor.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-constructor.js
@@ -138,7 +138,6 @@ module.exports = {
docs: {
description: "disallow unnecessary constructors",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-constructor"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-escape.js b/tools/node_modules/eslint/lib/rules/no-useless-escape.js
index 512c93a8bc0..a780a7a84a6 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-escape.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-escape.js
@@ -34,16 +34,17 @@ const REGEX_NON_CHARCLASS_ESCAPES = union(REGEX_GENERAL_ESCAPES, new Set("^/.$*+
* @returns {Object[]} A list of characters, each with info on escaping and whether they're in a character class.
* @example
*
- * parseRegExp('a\\b[cd-]')
+ * parseRegExp("a\\b[cd-]");
*
- * returns:
+ * // returns:
* [
- * {text: 'a', index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false},
- * {text: 'b', index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false},
- * {text: 'c', index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false},
- * {text: 'd', index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false},
- * {text: '-', index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false}
- * ]
+ * { text: "a", index: 0, escaped: false, inCharClass: false, startsCharClass: false, endsCharClass: false },
+ * { text: "b", index: 2, escaped: true, inCharClass: false, startsCharClass: false, endsCharClass: false },
+ * { text: "c", index: 4, escaped: false, inCharClass: true, startsCharClass: true, endsCharClass: false },
+ * { text: "d", index: 5, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false },
+ * { text: "-", index: 6, escaped: false, inCharClass: true, startsCharClass: false, endsCharClass: false }
+ * ];
+ *
*/
function parseRegExp(regExpText) {
const charList = [];
@@ -83,12 +84,12 @@ module.exports = {
docs: {
description: "disallow unnecessary escape characters",
- category: "Best Practices",
recommended: true,
- url: "https://eslint.org/docs/rules/no-useless-escape",
- suggestion: true
+ url: "https://eslint.org/docs/rules/no-useless-escape"
},
+ hasSuggestions: true,
+
messages: {
unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
removeEscape: "Remove the `\\`. This maintains the current functionality.",
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-rename.js b/tools/node_modules/eslint/lib/rules/no-useless-rename.js
index a7cec025da7..c0d27e600a8 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-rename.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-rename.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "disallow renaming import, export, and destructured assignments to the same name",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-rename"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-useless-return.js b/tools/node_modules/eslint/lib/rules/no-useless-return.js
index 111cb21015f..87f05892a94 100644
--- a/tools/node_modules/eslint/lib/rules/no-useless-return.js
+++ b/tools/node_modules/eslint/lib/rules/no-useless-return.js
@@ -67,7 +67,6 @@ module.exports = {
docs: {
description: "disallow redundant return statements",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-useless-return"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-var.js b/tools/node_modules/eslint/lib/rules/no-var.js
index f2cb96b1f70..a821c38a36e 100644
--- a/tools/node_modules/eslint/lib/rules/no-var.js
+++ b/tools/node_modules/eslint/lib/rules/no-var.js
@@ -185,7 +185,6 @@ module.exports = {
docs: {
description: "require `let` or `const` instead of `var`",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/no-var"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-void.js b/tools/node_modules/eslint/lib/rules/no-void.js
index 99c83785552..dba4932385d 100644
--- a/tools/node_modules/eslint/lib/rules/no-void.js
+++ b/tools/node_modules/eslint/lib/rules/no-void.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "disallow `void` operators",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-void"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-warning-comments.js b/tools/node_modules/eslint/lib/rules/no-warning-comments.js
index e5f702bc7d7..23e3da35e14 100644
--- a/tools/node_modules/eslint/lib/rules/no-warning-comments.js
+++ b/tools/node_modules/eslint/lib/rules/no-warning-comments.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow specified warning terms in comments",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/no-warning-comments"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js b/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js
index 226f873c5f6..9a492997d76 100644
--- a/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js
+++ b/tools/node_modules/eslint/lib/rules/no-whitespace-before-property.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "disallow whitespace before properties",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/no-whitespace-before-property"
},
diff --git a/tools/node_modules/eslint/lib/rules/no-with.js b/tools/node_modules/eslint/lib/rules/no-with.js
index d3e52e02f3d..219a68094cb 100644
--- a/tools/node_modules/eslint/lib/rules/no-with.js
+++ b/tools/node_modules/eslint/lib/rules/no-with.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "disallow `with` statements",
- category: "Best Practices",
recommended: true,
url: "https://eslint.org/docs/rules/no-with"
},
diff --git a/tools/node_modules/eslint/lib/rules/nonblock-statement-body-position.js b/tools/node_modules/eslint/lib/rules/nonblock-statement-body-position.js
index 34e6eeac39d..7ed541b3802 100644
--- a/tools/node_modules/eslint/lib/rules/nonblock-statement-body-position.js
+++ b/tools/node_modules/eslint/lib/rules/nonblock-statement-body-position.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce the location of single-line statements",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/nonblock-statement-body-position"
},
diff --git a/tools/node_modules/eslint/lib/rules/object-curly-newline.js b/tools/node_modules/eslint/lib/rules/object-curly-newline.js
index 1fbea00c5d7..e1609913582 100644
--- a/tools/node_modules/eslint/lib/rules/object-curly-newline.js
+++ b/tools/node_modules/eslint/lib/rules/object-curly-newline.js
@@ -150,7 +150,6 @@ module.exports = {
docs: {
description: "enforce consistent line breaks after opening and before closing braces",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/object-curly-newline"
},
diff --git a/tools/node_modules/eslint/lib/rules/object-curly-spacing.js b/tools/node_modules/eslint/lib/rules/object-curly-spacing.js
index c0044f5033c..b18ef574045 100644
--- a/tools/node_modules/eslint/lib/rules/object-curly-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/object-curly-spacing.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing inside braces",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/object-curly-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/object-property-newline.js b/tools/node_modules/eslint/lib/rules/object-property-newline.js
index 0c7f800282e..7cca23ff31f 100644
--- a/tools/node_modules/eslint/lib/rules/object-property-newline.js
+++ b/tools/node_modules/eslint/lib/rules/object-property-newline.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce placing object properties on separate lines",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/object-property-newline"
},
diff --git a/tools/node_modules/eslint/lib/rules/object-shorthand.js b/tools/node_modules/eslint/lib/rules/object-shorthand.js
index 3999ff8b99f..10bb07bbb0c 100644
--- a/tools/node_modules/eslint/lib/rules/object-shorthand.js
+++ b/tools/node_modules/eslint/lib/rules/object-shorthand.js
@@ -28,7 +28,6 @@ module.exports = {
docs: {
description: "require or disallow method and property shorthand syntax for object literals",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/object-shorthand"
},
@@ -149,7 +148,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 +155,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 +167,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 +179,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 +195,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) {
diff --git a/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js b/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js
index db4674760a0..c0ad70004e6 100644
--- a/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js
+++ b/tools/node_modules/eslint/lib/rules/one-var-declaration-per-line.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "require or disallow newlines around variable declarations",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/one-var-declaration-per-line"
},
diff --git a/tools/node_modules/eslint/lib/rules/one-var.js b/tools/node_modules/eslint/lib/rules/one-var.js
index e3df8320f8b..9c78ef87da8 100644
--- a/tools/node_modules/eslint/lib/rules/one-var.js
+++ b/tools/node_modules/eslint/lib/rules/one-var.js
@@ -34,7 +34,6 @@ module.exports = {
docs: {
description: "enforce variables to be declared either together or separately in functions",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/one-var"
},
@@ -209,7 +208,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) {
diff --git a/tools/node_modules/eslint/lib/rules/operator-assignment.js b/tools/node_modules/eslint/lib/rules/operator-assignment.js
index a48d2725197..34bdb861f46 100644
--- a/tools/node_modules/eslint/lib/rules/operator-assignment.js
+++ b/tools/node_modules/eslint/lib/rules/operator-assignment.js
@@ -17,8 +17,8 @@ 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) {
@@ -28,8 +28,8 @@ function isCommutativeOperatorWithShorthand(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) {
@@ -63,7 +63,6 @@ module.exports = {
docs: {
description: "require or disallow assignment operator shorthand where possible",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/operator-assignment"
},
@@ -96,7 +95,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) {
@@ -149,7 +148,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/tools/node_modules/eslint/lib/rules/operator-linebreak.js b/tools/node_modules/eslint/lib/rules/operator-linebreak.js
index 18da5c55b4a..6eab0cccbb4 100644
--- a/tools/node_modules/eslint/lib/rules/operator-linebreak.js
+++ b/tools/node_modules/eslint/lib/rules/operator-linebreak.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "enforce consistent linebreak style for operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/operator-linebreak"
},
@@ -136,23 +135,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 +219,7 @@ module.exports = {
* @returns {void}
*/
function validateBinaryExpression(node) {
- validateNode(node, node.left);
+ validateNode(node, node.right, node.operator);
}
//--------------------------------------------------------------------------
@@ -235,12 +232,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/tools/node_modules/eslint/lib/rules/padded-blocks.js b/tools/node_modules/eslint/lib/rules/padded-blocks.js
index f8b5bd97777..ca83f11fc50 100644
--- a/tools/node_modules/eslint/lib/rules/padded-blocks.js
+++ b/tools/node_modules/eslint/lib/rules/padded-blocks.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "require or disallow padding within blocks",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/padded-blocks"
},
@@ -167,6 +166,7 @@ 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) {
diff --git a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js
index c97b9956b71..073940a40eb 100644
--- a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js
+++ b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js
@@ -431,7 +431,6 @@ module.exports = {
docs: {
description: "require or disallow padding lines between statements",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/padding-line-between-statements"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js
index a01c0340821..518bf4b2da3 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-arrow-callback.js
@@ -60,6 +60,7 @@ function getVariableOfArguments(scope) {
/**
* 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)`.
@@ -150,7 +151,6 @@ module.exports = {
docs: {
description: "require using arrow functions for callbacks",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-arrow-callback"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-const.js b/tools/node_modules/eslint/lib/rules/prefer-const.js
index f6e79e71c3e..b44bd7592b5 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-const.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-const.js
@@ -332,7 +332,6 @@ module.exports = {
docs: {
description: "require `const` declarations for variables that are never reassigned after declared",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-const"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js
index f82bb75c122..46986d237df 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-destructuring.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-destructuring.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "require destructuring from arrays and/or objects",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-destructuring"
},
@@ -119,8 +118,8 @@ module.exports = {
// Helpers
//--------------------------------------------------------------------------
- // eslint-disable-next-line jsdoc/require-description
/**
+ * Checks if destructuring type should be checked.
* @param {string} nodeType "AssignmentExpression" or "VariableDeclarator"
* @param {string} destructuringType "array" or "object"
* @returns {boolean} `true` if the destructuring type should be checked for the given node
@@ -221,7 +220,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/tools/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js b/tools/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js
index 6121af88971..de802ce1e11 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-exponentiation-operator.js
@@ -90,7 +90,6 @@ module.exports = {
docs: {
description: "disallow the use of `Math.pow` in favor of the `**` operator",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-exponentiation-operator"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js b/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js
index 7d0aa3f9dc0..41aa549327d 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-named-capture-group.js
@@ -33,7 +33,6 @@ module.exports = {
docs: {
description: "enforce using named capture group in regular expression",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-named-capture-group"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js b/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js
index cc82e6653c0..91bb26724eb 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-numeric-literals.js
@@ -45,7 +45,6 @@ module.exports = {
docs: {
description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-numeric-literals"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-object-spread.js b/tools/node_modules/eslint/lib/rules/prefer-object-spread.js
index ab252c73ae3..3958a51b30e 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-object-spread.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-object-spread.js
@@ -247,7 +247,6 @@ module.exports = {
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",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-object-spread"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js b/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js
index ec16e445555..bdc1fef4d7c 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-promise-reject-errors.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "require using Error objects as Promise rejection reasons",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-promise-reject-errors"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-reflect.js b/tools/node_modules/eslint/lib/rules/prefer-reflect.js
index 156d61251c4..fea88c67827 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-reflect.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-reflect.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require `Reflect` methods where applicable",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-reflect"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-regex-literals.js b/tools/node_modules/eslint/lib/rules/prefer-regex-literals.js
index 9e8ce023547..fbfeb5636d7 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-regex-literals.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-regex-literals.js
@@ -54,7 +54,6 @@ module.exports = {
docs: {
description: "disallow use of the `RegExp` constructor in favor of regular expression literals",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-regex-literals"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-rest-params.js b/tools/node_modules/eslint/lib/rules/prefer-rest-params.js
index 3ecea732af8..157f0bbd61a 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-rest-params.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-rest-params.js
@@ -65,7 +65,6 @@ module.exports = {
docs: {
description: "require rest parameters instead of `arguments`",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-rest-params"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-spread.js b/tools/node_modules/eslint/lib/rules/prefer-spread.js
index d3c3c4d2297..3944fedb126 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-spread.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-spread.js
@@ -49,7 +49,6 @@ module.exports = {
docs: {
description: "require spread operators instead of `.apply()`",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-spread"
},
diff --git a/tools/node_modules/eslint/lib/rules/prefer-template.js b/tools/node_modules/eslint/lib/rules/prefer-template.js
index cb967660a62..564dd555f8e 100644
--- a/tools/node_modules/eslint/lib/rules/prefer-template.js
+++ b/tools/node_modules/eslint/lib/rules/prefer-template.js
@@ -128,7 +128,6 @@ module.exports = {
docs: {
description: "require template literals instead of string concatenation",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/prefer-template"
},
diff --git a/tools/node_modules/eslint/lib/rules/quote-props.js b/tools/node_modules/eslint/lib/rules/quote-props.js
index fab7bdc9c15..ce277cdcc9d 100644
--- a/tools/node_modules/eslint/lib/rules/quote-props.js
+++ b/tools/node_modules/eslint/lib/rules/quote-props.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "require quotes around object literal property names",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/quote-props"
},
@@ -91,7 +90,7 @@ module.exports = {
/**
* Checks whether a certain string constitutes an ES3 token
- * @param {string} tokenStr The string to be checked.
+ * @param {string} tokenStr The string to be checked.
* @returns {boolean} `true` if it is an ES3 token.
*/
function isKeyword(tokenStr) {
@@ -100,9 +99,9 @@ module.exports = {
/**
* 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
*/
@@ -139,7 +138,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 +194,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 +212,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/tools/node_modules/eslint/lib/rules/quotes.js b/tools/node_modules/eslint/lib/rules/quotes.js
index da7e127493e..d7959c0d1f0 100644
--- a/tools/node_modules/eslint/lib/rules/quotes.js
+++ b/tools/node_modules/eslint/lib/rules/quotes.js
@@ -80,7 +80,6 @@ module.exports = {
docs: {
description: "enforce the consistent use of either backticks, double, or single quotes",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/quotes"
},
@@ -216,6 +215,7 @@ module.exports = {
// LiteralPropertyName.
case "Property":
+ case "PropertyDefinition":
case "MethodDefinition":
return parent.key === node && !parent.computed;
diff --git a/tools/node_modules/eslint/lib/rules/radix.js b/tools/node_modules/eslint/lib/rules/radix.js
index d1b67e5e280..0c6c6ffb1a6 100644
--- a/tools/node_modules/eslint/lib/rules/radix.js
+++ b/tools/node_modules/eslint/lib/rules/radix.js
@@ -80,12 +80,12 @@ module.exports = {
docs: {
description: "enforce the consistent use of the radix argument when using `parseInt()`",
- category: "Best Practices",
recommended: false,
- url: "https://eslint.org/docs/rules/radix",
- suggestion: true
+ url: "https://eslint.org/docs/rules/radix"
},
+ hasSuggestions: true,
+
schema: [
{
enum: ["always", "as-needed"]
diff --git a/tools/node_modules/eslint/lib/rules/require-atomic-updates.js b/tools/node_modules/eslint/lib/rules/require-atomic-updates.js
index b3df907420c..9eee4ca38bc 100644
--- a/tools/node_modules/eslint/lib/rules/require-atomic-updates.js
+++ b/tools/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();
@@ -168,7 +171,6 @@ module.exports = {
docs: {
description: "disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/require-atomic-updates"
},
@@ -177,7 +179,8 @@ module.exports = {
schema: [],
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}}`."
}
},
@@ -273,13 +276,25 @@ module.exports = {
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 (node.parent.left === reference.identifier) {
+ context.report({
+ node: node.parent,
+ messageId: "nonAtomicUpdate",
+ data: {
+ value: variable.name
+ }
+ });
+ } else {
+ context.report({
+ node: node.parent,
+ messageId: "nonAtomicObjectUpdate",
+ data: {
+ value: sourceCode.getText(node.parent.left),
+ object: variable.name
+ }
+ });
+ }
+
}
}
}
diff --git a/tools/node_modules/eslint/lib/rules/require-await.js b/tools/node_modules/eslint/lib/rules/require-await.js
index 9b5acc78c81..8ec6f547ae9 100644
--- a/tools/node_modules/eslint/lib/rules/require-await.js
+++ b/tools/node_modules/eslint/lib/rules/require-await.js
@@ -34,7 +34,6 @@ module.exports = {
docs: {
description: "disallow async functions which have no `await` expression",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/require-await"
},
diff --git a/tools/node_modules/eslint/lib/rules/require-jsdoc.js b/tools/node_modules/eslint/lib/rules/require-jsdoc.js
index e581b2bee46..1d76e3d222b 100644
--- a/tools/node_modules/eslint/lib/rules/require-jsdoc.js
+++ b/tools/node_modules/eslint/lib/rules/require-jsdoc.js
@@ -1,6 +1,7 @@
/**
* @fileoverview Rule to check for jsdoc presence.
* @author Gyandeep Singh
+ * @deprecated in ESLint v5.10.0
*/
"use strict";
@@ -10,7 +11,6 @@ module.exports = {
docs: {
description: "require JSDoc comments",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/require-jsdoc"
},
diff --git a/tools/node_modules/eslint/lib/rules/require-unicode-regexp.js b/tools/node_modules/eslint/lib/rules/require-unicode-regexp.js
index 880405e9a25..a332b48da66 100644
--- a/tools/node_modules/eslint/lib/rules/require-unicode-regexp.js
+++ b/tools/node_modules/eslint/lib/rules/require-unicode-regexp.js
@@ -26,7 +26,6 @@ module.exports = {
docs: {
description: "enforce the use of `u` flag on RegExp",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/require-unicode-regexp"
},
diff --git a/tools/node_modules/eslint/lib/rules/require-yield.js b/tools/node_modules/eslint/lib/rules/require-yield.js
index af2344dfa6b..f5b5d530396 100644
--- a/tools/node_modules/eslint/lib/rules/require-yield.js
+++ b/tools/node_modules/eslint/lib/rules/require-yield.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require generator functions to contain `yield`",
- category: "ECMAScript 6",
recommended: true,
url: "https://eslint.org/docs/rules/require-yield"
},
diff --git a/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js b/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js
index 8cb9814f0c9..a636defdcd9 100644
--- a/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/rest-spread-spacing.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce spacing between rest and spread operators and their expressions",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/rest-spread-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/semi-spacing.js b/tools/node_modules/eslint/lib/rules/semi-spacing.js
index 5c546f29028..e5e2ae25cc7 100644
--- a/tools/node_modules/eslint/lib/rules/semi-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/semi-spacing.js
@@ -17,7 +17,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before and after semicolons",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/semi-spacing"
},
@@ -238,7 +237,8 @@ module.exports = {
if (node.test) {
checkSemicolonSpacing(sourceCode.getTokenAfter(node.test), node);
}
- }
+ },
+ PropertyDefinition: checkNode
};
}
};
diff --git a/tools/node_modules/eslint/lib/rules/semi-style.js b/tools/node_modules/eslint/lib/rules/semi-style.js
index 0c9bec4c85e..43d8d51f969 100644
--- a/tools/node_modules/eslint/lib/rules/semi-style.js
+++ b/tools/node_modules/eslint/lib/rules/semi-style.js
@@ -15,15 +15,13 @@ 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.
@@ -35,7 +33,7 @@ const SELECTOR = `:matches(${
function getChildren(node) {
const t = node.type;
- if (t === "BlockStatement" || t === "Program") {
+ if (t === "BlockStatement" || t === "Program" || t === "ClassBody") {
return node.body;
}
if (t === "SwitchCase") {
@@ -69,7 +67,6 @@ module.exports = {
docs: {
description: "enforce location of semicolons",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/semi-style"
},
diff --git a/tools/node_modules/eslint/lib/rules/semi.js b/tools/node_modules/eslint/lib/rules/semi.js
index d2f0670427b..4124a8c508c 100644
--- a/tools/node_modules/eslint/lib/rules/semi.js
+++ b/tools/node_modules/eslint/lib/rules/semi.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "require or disallow semicolons instead of ASI",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/semi"
},
@@ -78,6 +77,8 @@ module.exports = {
create(context) {
const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-`
+ const unsafeClassFieldNames = new Set(["get", "set", "static"]);
+ const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]);
const options = context.options[1];
const never = context.options[0] === "never";
const exceptOneLine = Boolean(options && options.omitLastInOneLineBlock);
@@ -167,6 +168,55 @@ module.exports = {
}
/**
+ * Checks if a given PropertyDefinition node followed by a semicolon
+ * can safely remove that semicolon. It is not to safe to remove if
+ * the class field name is "get", "set", or "static", or if
+ * followed by a generator method.
+ * @param {ASTNode} node The node to check.
+ * @returns {boolean} `true` if the node cannot have the semicolon
+ * removed.
+ */
+ function maybeClassFieldAsiHazard(node) {
+
+ if (node.type !== "PropertyDefinition") {
+ return false;
+ }
+
+ /*
+ * Computed property names and non-identifiers are always safe
+ * as they can be distinguished from keywords easily.
+ */
+ const needsNameCheck = !node.computed && node.key.type === "Identifier";
+
+ /*
+ * Certain names are problematic unless they also have a
+ * a way to distinguish between keywords and property
+ * names.
+ */
+ if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) {
+
+ /*
+ * Special case: If the field name is `static`,
+ * it is only valid if the field is marked as static,
+ * so "static static" is okay but "static" is not.
+ */
+ const isStaticStatic = node.static && node.key.name === "static";
+
+ /*
+ * For other unsafe names, we only care if there is no
+ * initializer. No initializer = hazard.
+ */
+ if (!isStaticStatic && !node.value) {
+ return true;
+ }
+ }
+
+ const followingToken = sourceCode.getTokenAfter(node);
+
+ return unsafeClassFieldFollowers.has(followingToken.value);
+ }
+
+ /**
* Check whether a given node is on the same line with the next token.
* @param {Node} node A statement node to check.
* @returns {boolean} `true` if the node is on the same line with the next token.
@@ -233,10 +283,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))) {
@@ -276,7 +335,11 @@ 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 {
@@ -329,7 +392,8 @@ module.exports = {
if (!/(?:Class|Function)Declaration/u.test(node.declaration.type)) {
checkForSemicolon(node);
}
- }
+ },
+ PropertyDefinition: checkForSemicolon
};
}
diff --git a/tools/node_modules/eslint/lib/rules/sort-imports.js b/tools/node_modules/eslint/lib/rules/sort-imports.js
index 4c3ddec7669..dd43daddf05 100644
--- a/tools/node_modules/eslint/lib/rules/sort-imports.js
+++ b/tools/node_modules/eslint/lib/rules/sort-imports.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "enforce sorted import declarations within modules",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/sort-imports"
},
diff --git a/tools/node_modules/eslint/lib/rules/sort-keys.js b/tools/node_modules/eslint/lib/rules/sort-keys.js
index 8a95ee25d61..65a99142279 100644
--- a/tools/node_modules/eslint/lib/rules/sort-keys.js
+++ b/tools/node_modules/eslint/lib/rules/sort-keys.js
@@ -81,7 +81,6 @@ module.exports = {
docs: {
description: "require object keys to be sorted",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/sort-keys"
},
diff --git a/tools/node_modules/eslint/lib/rules/sort-vars.js b/tools/node_modules/eslint/lib/rules/sort-vars.js
index 7add2cf74b2..0616c44ac62 100644
--- a/tools/node_modules/eslint/lib/rules/sort-vars.js
+++ b/tools/node_modules/eslint/lib/rules/sort-vars.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require variables within the same declaration block to be sorted",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/sort-vars"
},
diff --git a/tools/node_modules/eslint/lib/rules/space-before-blocks.js b/tools/node_modules/eslint/lib/rules/space-before-blocks.js
index 87ef9bfd880..87d5b27aace 100644
--- a/tools/node_modules/eslint/lib/rules/space-before-blocks.js
+++ b/tools/node_modules/eslint/lib/rules/space-before-blocks.js
@@ -40,7 +40,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before blocks",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/space-before-blocks"
},
@@ -108,13 +107,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/tools/node_modules/eslint/lib/rules/space-before-function-paren.js b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
index 1021a110cfd..b60bee04097 100644
--- a/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
+++ b/tools/node_modules/eslint/lib/rules/space-before-function-paren.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before `function` definition opening parenthesis",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/space-before-function-paren"
},
diff --git a/tools/node_modules/eslint/lib/rules/space-in-parens.js b/tools/node_modules/eslint/lib/rules/space-in-parens.js
index b0a604d955d..24378b89f04 100644
--- a/tools/node_modules/eslint/lib/rules/space-in-parens.js
+++ b/tools/node_modules/eslint/lib/rules/space-in-parens.js
@@ -16,7 +16,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing inside parentheses",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/space-in-parens"
},
diff --git a/tools/node_modules/eslint/lib/rules/space-infix-ops.js b/tools/node_modules/eslint/lib/rules/space-infix-ops.js
index 3c550984fc6..8065b5240b9 100644
--- a/tools/node_modules/eslint/lib/rules/space-infix-ops.js
+++ b/tools/node_modules/eslint/lib/rules/space-infix-ops.js
@@ -4,6 +4,8 @@
*/
"use strict";
+const { isEqToken } = require("./utils/ast-utils");
+
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
@@ -14,7 +16,6 @@ module.exports = {
docs: {
description: "require spacing around infix operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/space-infix-ops"
},
@@ -164,7 +165,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/tools/node_modules/eslint/lib/rules/space-unary-ops.js b/tools/node_modules/eslint/lib/rules/space-unary-ops.js
index 57f6e784501..de9018f9b69 100644
--- a/tools/node_modules/eslint/lib/rules/space-unary-ops.js
+++ b/tools/node_modules/eslint/lib/rules/space-unary-ops.js
@@ -20,7 +20,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing before or after unary operators",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/space-unary-ops"
},
diff --git a/tools/node_modules/eslint/lib/rules/spaced-comment.js b/tools/node_modules/eslint/lib/rules/spaced-comment.js
index 226a2d44798..6f0b432b765 100644
--- a/tools/node_modules/eslint/lib/rules/spaced-comment.js
+++ b/tools/node_modules/eslint/lib/rules/spaced-comment.js
@@ -152,7 +152,6 @@ module.exports = {
docs: {
description: "enforce consistent spacing after the `//` or `/*` in a comment",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/spaced-comment"
},
diff --git a/tools/node_modules/eslint/lib/rules/strict.js b/tools/node_modules/eslint/lib/rules/strict.js
index b0d6cf9172a..24af39dabee 100644
--- a/tools/node_modules/eslint/lib/rules/strict.js
+++ b/tools/node_modules/eslint/lib/rules/strict.js
@@ -69,7 +69,6 @@ module.exports = {
docs: {
description: "require or disallow strict mode directives",
- category: "Strict Mode",
recommended: false,
url: "https://eslint.org/docs/rules/strict"
},
diff --git a/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js b/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js
index c90641573c6..a4f3ba213eb 100644
--- a/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "enforce spacing around colons of switch statements",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/switch-colon-spacing"
},
@@ -52,18 +51,6 @@ module.exports = {
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.
* @param {Token} right The right token to check.
@@ -115,7 +102,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/tools/node_modules/eslint/lib/rules/symbol-description.js b/tools/node_modules/eslint/lib/rules/symbol-description.js
index 155cea4dc0b..9f5d9358f00 100644
--- a/tools/node_modules/eslint/lib/rules/symbol-description.js
+++ b/tools/node_modules/eslint/lib/rules/symbol-description.js
@@ -22,7 +22,6 @@ module.exports = {
docs: {
description: "require symbol descriptions",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/symbol-description"
},
diff --git a/tools/node_modules/eslint/lib/rules/template-curly-spacing.js b/tools/node_modules/eslint/lib/rules/template-curly-spacing.js
index 26043bc9122..5133a54539c 100644
--- a/tools/node_modules/eslint/lib/rules/template-curly-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/template-curly-spacing.js
@@ -21,7 +21,6 @@ module.exports = {
docs: {
description: "require or disallow spacing around embedded expressions of template strings",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/template-curly-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/template-tag-spacing.js b/tools/node_modules/eslint/lib/rules/template-tag-spacing.js
index 16f586255af..45b66068a83 100644
--- a/tools/node_modules/eslint/lib/rules/template-tag-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/template-tag-spacing.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require or disallow spacing between template tags and their literals",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/template-tag-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/unicode-bom.js b/tools/node_modules/eslint/lib/rules/unicode-bom.js
index 39642f85193..e80497d19ca 100644
--- a/tools/node_modules/eslint/lib/rules/unicode-bom.js
+++ b/tools/node_modules/eslint/lib/rules/unicode-bom.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "require or disallow Unicode byte order mark (BOM)",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/unicode-bom"
},
diff --git a/tools/node_modules/eslint/lib/rules/use-isnan.js b/tools/node_modules/eslint/lib/rules/use-isnan.js
index ef95b21314a..cd8331f932e 100644
--- a/tools/node_modules/eslint/lib/rules/use-isnan.js
+++ b/tools/node_modules/eslint/lib/rules/use-isnan.js
@@ -37,7 +37,6 @@ module.exports = {
docs: {
description: "require calls to `isNaN()` when checking for `NaN`",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/use-isnan"
},
diff --git a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js
index 6b853001132..e4fd977c116 100644
--- a/tools/node_modules/eslint/lib/rules/utils/ast-utils.js
+++ b/tools/node_modules/eslint/lib/rules/utils/ast-utils.js
@@ -266,6 +266,7 @@ function getStaticPropertyName(node) {
return getStaticPropertyName(node.expression);
case "Property":
+ case "PropertyDefinition":
case "MethodDefinition":
prop = node.key;
break;
@@ -407,6 +408,7 @@ function isSameReference(left, right, disableStaticComputedKey = false) {
return true;
case "Identifier":
+ case "PrivateIdentifier":
return left.name === right.name;
case "Literal":
return equalLiteralValue(left, right);
@@ -517,6 +519,15 @@ function isParenthesised(sourceCode, node) {
}
/**
+ * 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.
* @returns {boolean} `true` if the token is an arrow token.
@@ -649,6 +660,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 +756,19 @@ 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);
+}
+
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
@@ -794,6 +828,7 @@ module.exports = {
isOpeningBracketToken,
isOpeningParenToken,
isSemicolonToken,
+ isEqToken,
/**
* Checks whether or not a given node is a string literal.
@@ -836,8 +871,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
*/
@@ -923,6 +958,16 @@ module.exports = {
* @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 && node.parent && node.parent.type === "PropertyDefinition" && node.value === node) {
+ return false;
+ }
+
if (
(capIsConstructor && isES5Constructor(node)) ||
hasJSDocThisTag(node, sourceCode)
@@ -983,8 +1028,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;
@@ -1261,7 +1308,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 +1371,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 +1388,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 +1405,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 +1416,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 +1531,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 +1546,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 +1653,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) {
@@ -1805,5 +1885,6 @@ module.exports = {
isSpecificMemberAccess,
equalLiteralValue,
isSameReference,
- isLogicalAssignmentOperator
+ isLogicalAssignmentOperator,
+ getSwitchCaseColonToken
};
diff --git a/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js b/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js
index d426d85c59a..7f116a2684f 100644
--- a/tools/node_modules/eslint/lib/rules/utils/lazy-loading-rule-map.js
+++ b/tools/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<string, () => Rule>}
*/
diff --git a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js
index 9ec6938e35a..824410b3370 100644
--- a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js
+++ b/tools/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";
@@ -20,7 +21,6 @@ module.exports = {
docs: {
description: "enforce valid JSDoc comments",
- category: "Possible Errors",
recommended: false,
url: "https://eslint.org/docs/rules/valid-jsdoc"
},
diff --git a/tools/node_modules/eslint/lib/rules/valid-typeof.js b/tools/node_modules/eslint/lib/rules/valid-typeof.js
index a0f20f74d0e..33b64f56cc3 100644
--- a/tools/node_modules/eslint/lib/rules/valid-typeof.js
+++ b/tools/node_modules/eslint/lib/rules/valid-typeof.js
@@ -14,7 +14,6 @@ module.exports = {
docs: {
description: "enforce comparing `typeof` expressions against valid strings",
- category: "Possible Errors",
recommended: true,
url: "https://eslint.org/docs/rules/valid-typeof"
},
diff --git a/tools/node_modules/eslint/lib/rules/vars-on-top.js b/tools/node_modules/eslint/lib/rules/vars-on-top.js
index 28ddae442b5..6f913dcad9d 100644
--- a/tools/node_modules/eslint/lib/rules/vars-on-top.js
+++ b/tools/node_modules/eslint/lib/rules/vars-on-top.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require `var` declarations be placed at the top of their containing scope",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/vars-on-top"
},
@@ -32,8 +31,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
*/
diff --git a/tools/node_modules/eslint/lib/rules/wrap-iife.js b/tools/node_modules/eslint/lib/rules/wrap-iife.js
index 07e5b84a4a5..498d7bd2842 100644
--- a/tools/node_modules/eslint/lib/rules/wrap-iife.js
+++ b/tools/node_modules/eslint/lib/rules/wrap-iife.js
@@ -43,7 +43,6 @@ module.exports = {
docs: {
description: "require parentheses around immediate `function` invocations",
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/wrap-iife"
},
diff --git a/tools/node_modules/eslint/lib/rules/wrap-regex.js b/tools/node_modules/eslint/lib/rules/wrap-regex.js
index 4ecbcecbbeb..945eb5ecea1 100644
--- a/tools/node_modules/eslint/lib/rules/wrap-regex.js
+++ b/tools/node_modules/eslint/lib/rules/wrap-regex.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require parenthesis around regex literals",
- category: "Stylistic Issues",
recommended: false,
url: "https://eslint.org/docs/rules/wrap-regex"
},
diff --git a/tools/node_modules/eslint/lib/rules/yield-star-spacing.js b/tools/node_modules/eslint/lib/rules/yield-star-spacing.js
index 20b8e9ea91e..8c3eefa4acd 100644
--- a/tools/node_modules/eslint/lib/rules/yield-star-spacing.js
+++ b/tools/node_modules/eslint/lib/rules/yield-star-spacing.js
@@ -15,7 +15,6 @@ module.exports = {
docs: {
description: "require or disallow spacing around the `*` in `yield*` expressions",
- category: "ECMAScript 6",
recommended: false,
url: "https://eslint.org/docs/rules/yield-star-spacing"
},
diff --git a/tools/node_modules/eslint/lib/rules/yoda.js b/tools/node_modules/eslint/lib/rules/yoda.js
index 2fca7571113..2d018dc3df1 100644
--- a/tools/node_modules/eslint/lib/rules/yoda.js
+++ b/tools/node_modules/eslint/lib/rules/yoda.js
@@ -121,7 +121,6 @@ module.exports = {
docs: {
description: 'require or disallow "Yoda" conditions',
- category: "Best Practices",
recommended: false,
url: "https://eslint.org/docs/rules/yoda"
},
diff --git a/tools/node_modules/eslint/lib/shared/ajv.js b/tools/node_modules/eslint/lib/shared/ajv.js
index 3fb0fbdd33c..f4f6a62183d 100644
--- a/tools/node_modules/eslint/lib/shared/ajv.js
+++ b/tools/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/tools/node_modules/eslint/lib/shared/config-validator.js b/tools/node_modules/eslint/lib/shared/config-validator.js
index 03b32f1c918..47353ac4814 100644
--- a/tools/node_modules/eslint/lib/shared/config-validator.js
+++ b/tools/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/tools/node_modules/eslint/lib/shared/logging.js b/tools/node_modules/eslint/lib/shared/logging.js
index 6aa1f5a1e59..7f06a74e142 100644
--- a/tools/node_modules/eslint/lib/shared/logging.js
+++ b/tools/node_modules/eslint/lib/shared/logging.js
@@ -5,7 +5,7 @@
"use strict";
-/* eslint no-console: "off" */
+/* eslint no-console: "off" -- Logging util */
/* istanbul ignore next */
module.exports = {
diff --git a/tools/node_modules/eslint/lib/shared/relative-module-resolver.js b/tools/node_modules/eslint/lib/shared/relative-module-resolver.js
index cd743f3795b..18a694983c1 100644
--- a/tools/node_modules/eslint/lib/shared/relative-module-resolver.js
+++ b/tools/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/tools/node_modules/eslint/lib/shared/runtime-info.js b/tools/node_modules/eslint/lib/shared/runtime-info.js
index aa5eff756a8..56c0898be54 100644
--- a/tools/node_modules/eslint/lib/shared/runtime-info.js
+++ b/tools/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,6 +92,7 @@ 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 } = {}) {
diff --git a/tools/node_modules/eslint/lib/shared/traverser.js b/tools/node_modules/eslint/lib/shared/traverser.js
index 32f76779507..be0ed59a4f9 100644
--- a/tools/node_modules/eslint/lib/shared/traverser.js
+++ b/tools/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 a copy of the ancestor nodes.
* @returns {ASTNode[]} The ancestor nodes.
*/
parents() {
diff --git a/tools/node_modules/eslint/lib/shared/types.js b/tools/node_modules/eslint/lib/shared/types.js
index c3b76e42d5f..bbfd2ed9a99 100644
--- a/tools/node_modules/eslint/lib/shared/types.js
+++ b/tools/node_modules/eslint/lib/shared/types.js
@@ -83,12 +83,12 @@ module.exports = {};
/**
* @typedef {Object} LintMessage
- * @property {number} column The 1-based column number.
+ * @property {number|undefined} column The 1-based column number.
* @property {number} [endColumn] The 1-based column number of the end location.
* @property {number} [endLine] The 1-based line number of the end location.
* @property {boolean} fatal If `true` then this is a fatal error.
* @property {{range:[number,number], text:string}} [fix] Information for autofix.
- * @property {number} line The 1-based line number.
+ * @property {number|undefined} line The 1-based line number.
* @property {string} message The error message.
* @property {string|null} ruleId The ID of the rule which makes this message.
* @property {0|1|2} severity The severity of this message.
diff --git a/tools/node_modules/eslint/lib/source-code/source-code.js b/tools/node_modules/eslint/lib/source-code/source-code.js
index cc4524fa74c..49b2820a846 100644
--- a/tools/node_modules/eslint/lib/source-code/source-code.js
+++ b/tools/node_modules/eslint/lib/source-code/source-code.js
@@ -143,10 +143,12 @@ function isSpaceBetween(sourceCode, first, second, checkInsideOfJSXText) {
// Public Interface
//------------------------------------------------------------------------------
+/**
+ * Represents parsed source code.
+ */
class SourceCode extends TokenStore {
/**
- * Represents parsed source code.
* @param {string|Object} textOrConfig The source code text or config object.
* @param {string} textOrConfig.text The source code text.
* @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
@@ -175,20 +177,20 @@ class SourceCode extends TokenStore {
/**
* The flag to indicate that the source code has Unicode BOM.
- * @type boolean
+ * @type {boolean}
*/
this.hasBOM = (text.charCodeAt(0) === 0xFEFF);
/**
* The original text source code.
* BOM was stripped from this text.
- * @type string
+ * @type {string}
*/
this.text = (this.hasBOM ? text.slice(1) : text);
/**
* The parsed AST for the source code.
- * @type ASTNode
+ * @type {ASTNode}
*/
this.ast = ast;
@@ -223,7 +225,7 @@ class SourceCode extends TokenStore {
/**
* The source code split into lines according to ECMA-262 specification.
* This is done to avoid each rule needing to do so separately.
- * @type string[]
+ * @type {string[]}
*/
this.lines = [];
this.lineStartIndices = [0];
@@ -506,6 +508,7 @@ class SourceCode extends TokenStore {
/**
* Converts a source text index into a (line, column) pair.
* @param {number} index The index of a character in a file
+ * @throws {TypeError} If non-numeric index or index out of range.
* @returns {Object} A {line, column} location object with a 0-indexed column
* @public
*/
@@ -545,6 +548,9 @@ class SourceCode extends TokenStore {
* @param {Object} loc A line/column location
* @param {number} loc.line The line number of the location (1-indexed)
* @param {number} loc.column The column number of the location (0-indexed)
+ * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
+ * `line` and `column`, if the `line` is less than or equal to zero or
+ * the line or column is out of the expected range.
* @returns {number} The range index of the location in the file.
* @public
*/
diff --git a/tools/node_modules/eslint/lib/source-code/token-store/cursor.js b/tools/node_modules/eslint/lib/source-code/token-store/cursor.js
index 4e1595c6dcb..494762acdfa 100644
--- a/tools/node_modules/eslint/lib/source-code/token-store/cursor.js
+++ b/tools/node_modules/eslint/lib/source-code/token-store/cursor.js
@@ -70,7 +70,7 @@ module.exports = class Cursor {
* @abstract
*/
/* istanbul ignore next */
- moveNext() { // eslint-disable-line class-methods-use-this
+ moveNext() { // eslint-disable-line class-methods-use-this -- Unused
throw new Error("Not implemented.");
}
};
diff --git a/tools/node_modules/eslint/lib/unsupported-api.js b/tools/node_modules/eslint/lib/unsupported-api.js
new file mode 100644
index 00000000000..110b35a47a4
--- /dev/null
+++ b/tools/node_modules/eslint/lib/unsupported-api.js
@@ -0,0 +1,23 @@
+/**
+ * @fileoverview APIs that are not officially supported by ESLint.
+ * These APIs may change or be removed at any time. Use at your
+ * own risk.
+ * @author Nicholas C. Zakas
+ */
+
+"use strict";
+
+//-----------------------------------------------------------------------------
+// Requirements
+//-----------------------------------------------------------------------------
+
+const { FileEnumerator } = require("./cli-engine/file-enumerator");
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+module.exports = {
+ builtinRules: require("./rules"),
+ FileEnumerator
+};
diff --git a/tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE b/tools/node_modules/eslint/node_modules/@babel/code-frame/LICENSE
deleted file mode 100644
index f31575ec773..00000000000
--- a/tools/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/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md b/tools/node_modules/eslint/node_modules/@babel/code-frame/README.md
deleted file mode 100644
index 08cacb0477f..00000000000
--- a/tools/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/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/code-frame/lib/index.js
deleted file mode 100644
index 28d86f7bc1c..00000000000
--- a/tools/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/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json b/tools/node_modules/eslint/node_modules/@babel/code-frame/package.json
deleted file mode 100644
index 07a28a6bda4..00000000000
--- a/tools/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 <sebmck@gmail.com>",
- "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/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/LICENSE b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/LICENSE
deleted file mode 100644
index f31575ec773..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/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/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md
deleted file mode 100644
index 6733576a8ce..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# @babel/helper-validator-identifier
-
-> Validate identifier/keywords name
-
-See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information.
-
-## Install
-
-Using npm:
-
-```sh
-npm install --save-dev @babel/helper-validator-identifier
-```
-
-or using yarn:
-
-```sh
-yarn add @babel/helper-validator-identifier --dev
-```
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js
deleted file mode 100644
index 71310db1f39..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/identifier.js
+++ /dev/null
@@ -1,84 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.isIdentifierStart = isIdentifierStart;
-exports.isIdentifierChar = isIdentifierChar;
-exports.isIdentifierName = isIdentifierName;
-let 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";
-let 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";
-const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
-const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
-nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
-const 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];
-const 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];
-
-function isInAstralSet(code, set) {
- let pos = 0x10000;
-
- for (let i = 0, length = set.length; i < length; i += 2) {
- pos += set[i];
- if (pos > code) return false;
- pos += set[i + 1];
- if (pos >= code) return true;
- }
-
- return false;
-}
-
-function isIdentifierStart(code) {
- if (code < 65) return code === 36;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
-
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
- }
-
- return isInAstralSet(code, astralIdentifierStartCodes);
-}
-
-function isIdentifierChar(code) {
- if (code < 48) return code === 36;
- if (code < 58) return true;
- if (code < 65) return false;
- if (code <= 90) return true;
- if (code < 97) return code === 95;
- if (code <= 122) return true;
-
- if (code <= 0xffff) {
- return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
- }
-
- return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
-}
-
-function isIdentifierName(name) {
- let isFirst = true;
-
- for (let i = 0; i < name.length; i++) {
- let cp = name.charCodeAt(i);
-
- if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
- const trail = name.charCodeAt(++i);
-
- if ((trail & 0xfc00) === 0xdc00) {
- cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
- }
- }
-
- if (isFirst) {
- isFirst = false;
-
- if (!isIdentifierStart(cp)) {
- return false;
- }
- } else if (!isIdentifierChar(cp)) {
- return false;
- }
- }
-
- return !isFirst;
-} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/index.js
deleted file mode 100644
index 7b623c90a6e..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-Object.defineProperty(exports, "isIdentifierName", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierName;
- }
-});
-Object.defineProperty(exports, "isIdentifierChar", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierChar;
- }
-});
-Object.defineProperty(exports, "isIdentifierStart", {
- enumerable: true,
- get: function () {
- return _identifier.isIdentifierStart;
- }
-});
-Object.defineProperty(exports, "isReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isReservedWord;
- }
-});
-Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictBindOnlyReservedWord;
- }
-});
-Object.defineProperty(exports, "isStrictBindReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictBindReservedWord;
- }
-});
-Object.defineProperty(exports, "isStrictReservedWord", {
- enumerable: true,
- get: function () {
- return _keyword.isStrictReservedWord;
- }
-});
-Object.defineProperty(exports, "isKeyword", {
- enumerable: true,
- get: function () {
- return _keyword.isKeyword;
- }
-});
-
-var _identifier = require("./identifier");
-
-var _keyword = require("./keyword"); \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/keyword.js b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/keyword.js
deleted file mode 100644
index 110cee40028..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/lib/keyword.js
+++ /dev/null
@@ -1,38 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.isReservedWord = isReservedWord;
-exports.isStrictReservedWord = isStrictReservedWord;
-exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
-exports.isStrictBindReservedWord = isStrictBindReservedWord;
-exports.isKeyword = isKeyword;
-const reservedWords = {
- keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
- strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
- strictBind: ["eval", "arguments"]
-};
-const keywords = new Set(reservedWords.keyword);
-const reservedWordsStrictSet = new Set(reservedWords.strict);
-const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
-
-function isReservedWord(word, inModule) {
- return inModule && word === "await" || word === "enum";
-}
-
-function isStrictReservedWord(word, inModule) {
- return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
-}
-
-function isStrictBindOnlyReservedWord(word) {
- return reservedWordsStrictBindSet.has(word);
-}
-
-function isStrictBindReservedWord(word, inModule) {
- return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
-}
-
-function isKeyword(word) {
- return keywords.has(word);
-} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json
deleted file mode 100644
index cf138d6f2c3..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/package.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "@babel/helper-validator-identifier",
- "version": "7.14.8",
- "description": "Validate identifier/keywords name",
- "repository": {
- "type": "git",
- "url": "https://github.com/babel/babel.git",
- "directory": "packages/babel-helper-validator-identifier"
- },
- "license": "MIT",
- "publishConfig": {
- "access": "public"
- },
- "main": "./lib/index.js",
- "exports": "./lib/index.js",
- "devDependencies": {
- "@babel/helper-validator-identifier-baseline": "npm:@babel/helper-validator-identifier@7.10.4",
- "@unicode/unicode-13.0.0": "^1.0.6",
- "benchmark": "^2.1.4",
- "charcodes": "^0.2.0"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "author": "The Babel Team (https://babel.dev/team)"
-} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js b/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
deleted file mode 100644
index 45276d51b2d..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js
+++ /dev/null
@@ -1,75 +0,0 @@
-"use strict";
-
-// Always use the latest available version of Unicode!
-// https://tc39.github.io/ecma262/#sec-conformance
-const version = "13.0.0";
-
-const start = require("@unicode/unicode-" +
- version +
- "/Binary_Property/ID_Start/code-points.js").filter(function (ch) {
- return ch > 0x7f;
-});
-let last = -1;
-const cont = [0x200c, 0x200d].concat(
- require("@unicode/unicode-" +
- version +
- "/Binary_Property/ID_Continue/code-points.js").filter(function (ch) {
- return ch > 0x7f && search(start, ch, last + 1) == -1;
- })
-);
-
-function search(arr, ch, starting) {
- for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
- if (arr[i] === ch) return i;
- }
- return -1;
-}
-
-function pad(str, width) {
- while (str.length < width) str = "0" + str;
- return str;
-}
-
-function esc(code) {
- const hex = code.toString(16);
- if (hex.length <= 2) return "\\x" + pad(hex, 2);
- else return "\\u" + pad(hex, 4);
-}
-
-function generate(chars) {
- const astral = [];
- let re = "";
- for (let i = 0, at = 0x10000; i < chars.length; i++) {
- const from = chars[i];
- let to = from;
- while (i < chars.length - 1 && chars[i + 1] == to + 1) {
- i++;
- to++;
- }
- if (to <= 0xffff) {
- if (from == to) re += esc(from);
- else if (from + 1 == to) re += esc(from) + esc(to);
- else re += esc(from) + "-" + esc(to);
- } else {
- astral.push(from - at, to - from);
- at = to;
- }
- }
- return { nonASCII: re, astral: astral };
-}
-
-const startData = generate(start);
-const contData = generate(cont);
-
-console.log("/* prettier-ignore */");
-console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
-console.log("/* prettier-ignore */");
-console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
-console.log("/* prettier-ignore */");
-console.log(
- "const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
-);
-console.log("/* prettier-ignore */");
-console.log(
- "const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
-);
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/LICENSE
deleted file mode 100644
index f31575ec773..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/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/tools/node_modules/eslint/node_modules/@babel/highlight/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/README.md
deleted file mode 100644
index f8887ad2ca4..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# @babel/highlight
-
-> Syntax highlight JavaScript strings for output in terminals.
-
-See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information.
-
-## Install
-
-Using npm:
-
-```sh
-npm install --save-dev @babel/highlight
-```
-
-or using yarn:
-
-```sh
-yarn add @babel/highlight --dev
-```
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js
deleted file mode 100644
index 34e308f4ef9..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/lib/index.js
+++ /dev/null
@@ -1,116 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.shouldHighlight = shouldHighlight;
-exports.getChalk = getChalk;
-exports.default = highlight;
-
-var _jsTokens = require("js-tokens");
-
-var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
-
-var _chalk = require("chalk");
-
-const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
-
-function getDefs(chalk) {
- return {
- keyword: chalk.cyan,
- capitalized: chalk.yellow,
- jsxIdentifier: chalk.yellow,
- punctuator: chalk.yellow,
- number: chalk.magenta,
- string: chalk.green,
- regex: chalk.magenta,
- comment: chalk.grey,
- invalid: chalk.white.bgRed.bold
- };
-}
-
-const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
-const BRACKET = /^[()[\]{}]$/;
-let tokenize;
-{
- const JSX_TAG = /^[a-z][\w-]*$/i;
-
- const getTokenType = function (token, offset, text) {
- if (token.type === "name") {
- if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
- return "keyword";
- }
-
- if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
- return "jsxIdentifier";
- }
-
- if (token.value[0] !== token.value[0].toLowerCase()) {
- return "capitalized";
- }
- }
-
- if (token.type === "punctuator" && BRACKET.test(token.value)) {
- return "bracket";
- }
-
- if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
- return "punctuator";
- }
-
- return token.type;
- };
-
- tokenize = function* (text) {
- let match;
-
- while (match = _jsTokens.default.exec(text)) {
- const token = _jsTokens.matchToToken(match);
-
- yield {
- type: getTokenType(token, match.index, text),
- value: token.value
- };
- }
- };
-}
-
-function highlightTokens(defs, text) {
- let highlighted = "";
-
- for (const {
- type,
- value
- } of tokenize(text)) {
- const colorize = defs[type];
-
- if (colorize) {
- highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n");
- } else {
- highlighted += value;
- }
- }
-
- return highlighted;
-}
-
-function shouldHighlight(options) {
- return !!_chalk.supportsColor || options.forceColor;
-}
-
-function getChalk(options) {
- return options.forceColor ? new _chalk.constructor({
- enabled: true,
- level: 1
- }) : _chalk;
-}
-
-function highlight(code, options = {}) {
- if (shouldHighlight(options)) {
- const chalk = getChalk(options);
- const defs = getDefs(chalk);
- return highlightTokens(defs, code);
- } else {
- return code;
- }
-} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js
deleted file mode 100644
index 90a871c4d78..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/index.js
+++ /dev/null
@@ -1,165 +0,0 @@
-'use strict';
-const colorConvert = require('color-convert');
-
-const wrapAnsi16 = (fn, offset) => function () {
- const code = fn.apply(colorConvert, arguments);
- return `\u001B[${code + offset}m`;
-};
-
-const wrapAnsi256 = (fn, offset) => function () {
- const code = fn.apply(colorConvert, arguments);
- return `\u001B[${38 + offset};5;${code}m`;
-};
-
-const wrapAnsi16m = (fn, offset) => function () {
- const rgb = fn.apply(colorConvert, arguments);
- return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
-};
-
-function assembleStyles() {
- const codes = new Map();
- const styles = {
- modifier: {
- reset: [0, 0],
- // 21 isn't widely supported and 22 does the same thing
- bold: [1, 22],
- dim: [2, 22],
- italic: [3, 23],
- underline: [4, 24],
- inverse: [7, 27],
- hidden: [8, 28],
- strikethrough: [9, 29]
- },
- color: {
- black: [30, 39],
- red: [31, 39],
- green: [32, 39],
- yellow: [33, 39],
- blue: [34, 39],
- magenta: [35, 39],
- cyan: [36, 39],
- white: [37, 39],
- gray: [90, 39],
-
- // Bright color
- redBright: [91, 39],
- greenBright: [92, 39],
- yellowBright: [93, 39],
- blueBright: [94, 39],
- magentaBright: [95, 39],
- cyanBright: [96, 39],
- whiteBright: [97, 39]
- },
- bgColor: {
- bgBlack: [40, 49],
- bgRed: [41, 49],
- bgGreen: [42, 49],
- bgYellow: [43, 49],
- bgBlue: [44, 49],
- bgMagenta: [45, 49],
- bgCyan: [46, 49],
- bgWhite: [47, 49],
-
- // Bright color
- bgBlackBright: [100, 49],
- bgRedBright: [101, 49],
- bgGreenBright: [102, 49],
- bgYellowBright: [103, 49],
- bgBlueBright: [104, 49],
- bgMagentaBright: [105, 49],
- bgCyanBright: [106, 49],
- bgWhiteBright: [107, 49]
- }
- };
-
- // Fix humans
- styles.color.grey = styles.color.gray;
-
- for (const groupName of Object.keys(styles)) {
- const group = styles[groupName];
-
- for (const styleName of Object.keys(group)) {
- const style = group[styleName];
-
- styles[styleName] = {
- open: `\u001B[${style[0]}m`,
- close: `\u001B[${style[1]}m`
- };
-
- group[styleName] = styles[styleName];
-
- codes.set(style[0], style[1]);
- }
-
- Object.defineProperty(styles, groupName, {
- value: group,
- enumerable: false
- });
-
- Object.defineProperty(styles, 'codes', {
- value: codes,
- enumerable: false
- });
- }
-
- const ansi2ansi = n => n;
- const rgb2rgb = (r, g, b) => [r, g, b];
-
- styles.color.close = '\u001B[39m';
- styles.bgColor.close = '\u001B[49m';
-
- styles.color.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 0)
- };
- styles.color.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 0)
- };
- styles.color.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 0)
- };
-
- styles.bgColor.ansi = {
- ansi: wrapAnsi16(ansi2ansi, 10)
- };
- styles.bgColor.ansi256 = {
- ansi256: wrapAnsi256(ansi2ansi, 10)
- };
- styles.bgColor.ansi16m = {
- rgb: wrapAnsi16m(rgb2rgb, 10)
- };
-
- for (let key of Object.keys(colorConvert)) {
- if (typeof colorConvert[key] !== 'object') {
- continue;
- }
-
- const suite = colorConvert[key];
-
- if (key === 'ansi16') {
- key = 'ansi';
- }
-
- if ('ansi16' in suite) {
- styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
- styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
- }
-
- if ('ansi256' in suite) {
- styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
- styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
- }
-
- if ('rgb' in suite) {
- styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
- styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
- }
- }
-
- return styles;
-}
-
-// Make the export immutable
-Object.defineProperty(module, 'exports', {
- enumerable: true,
- get: assembleStyles
-});
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json
deleted file mode 100644
index 65edb48c399..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "ansi-styles",
- "version": "3.2.1",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": "chalk/ansi-styles",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava",
- "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "ansi",
- "styles",
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "tty",
- "escape",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "color-convert": "^1.9.0"
- },
- "devDependencies": {
- "ava": "*",
- "babel-polyfill": "^6.23.0",
- "svg-term-cli": "^2.1.1",
- "xo": "*"
- },
- "ava": {
- "require": "babel-polyfill"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md
deleted file mode 100644
index 3158e2df59c..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/ansi-styles/readme.md
+++ /dev/null
@@ -1,147 +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](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
-
-You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
-
-<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
-
-
-## Install
-
-```
-$ npm install ansi-styles
-```
-
-
-## Usage
-
-```js
-const style = require('ansi-styles');
-
-console.log(`${style.green.open}Hello world!${style.green.close}`);
-
-
-// Color conversion between 16/256/truecolor
-// NOTE: If conversion goes to 16 colors or 256 colors, the original color
-// may be degraded to fit that color palette. This means terminals
-// that do not support 16 million colors will best-match the
-// original color.
-console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
-console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
-console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close);
-```
-
-## API
-
-Each style has an `open` and `close` property.
-
-
-## Styles
-
-### Modifiers
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(Not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(Not widely supported)*
-
-### Colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue`
-- `magenta`
-- `cyan`
-- `white`
-- `gray` ("bright black")
-- `redBright`
-- `greenBright`
-- `yellowBright`
-- `blueBright`
-- `magentaBright`
-- `cyanBright`
-- `whiteBright`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-- `bgBlackBright`
-- `bgRedBright`
-- `bgGreenBright`
-- `bgYellowBright`
-- `bgBlueBright`
-- `bgMagentaBright`
-- `bgCyanBright`
-- `bgWhiteBright`
-
-
-## Advanced usage
-
-By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
-
-- `style.modifier`
-- `style.color`
-- `style.bgColor`
-
-###### Example
-
-```js
-console.log(style.color.green.open);
-```
-
-Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
-
-###### Example
-
-```js
-console.log(style.codes.get(36));
-//=> 39
-```
-
-
-## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
-
-`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
-
-To use these, call the associated conversion function with the intended output, for example:
-
-```js
-style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
-style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
-
-style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
-style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
-
-style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
-style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
-```
-
-
-## Related
-
-- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
-
-
-## Maintainers
-
-- [Sindre Sorhus](https://github.com/sindresorhus)
-- [Josh Junon](https://github.com/qix-)
-
-
-## License
-
-MIT
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js
deleted file mode 100644
index 1cc5fa89a95..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js
+++ /dev/null
@@ -1,228 +0,0 @@
-'use strict';
-const escapeStringRegexp = require('escape-string-regexp');
-const ansiStyles = require('ansi-styles');
-const stdoutColor = require('supports-color').stdout;
-
-const template = require('./templates.js');
-
-const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
-
-// `supportsColor.level` ā†’ `ansiStyles.color[name]` mapping
-const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
-
-// `color-convert` models to exclude from the Chalk API due to conflicts and such
-const skipModels = new Set(['gray']);
-
-const styles = Object.create(null);
-
-function applyOptions(obj, options) {
- options = options || {};
-
- // Detect level if not set manually
- const scLevel = stdoutColor ? stdoutColor.level : 0;
- obj.level = options.level === undefined ? scLevel : options.level;
- obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
-}
-
-function Chalk(options) {
- // We check for this.template here since calling `chalk.constructor()`
- // by itself will have a `this` of a previously constructed chalk object
- if (!this || !(this instanceof Chalk) || this.template) {
- const chalk = {};
- applyOptions(chalk, options);
-
- chalk.template = function () {
- const args = [].slice.call(arguments);
- return chalkTag.apply(null, [chalk.template].concat(args));
- };
-
- Object.setPrototypeOf(chalk, Chalk.prototype);
- Object.setPrototypeOf(chalk.template, chalk);
-
- chalk.template.constructor = Chalk;
-
- return chalk.template;
- }
-
- applyOptions(this, options);
-}
-
-// Use bright blue on Windows as the normal blue color is illegible
-if (isSimpleWindowsTerm) {
- ansiStyles.blue.open = '\u001B[94m';
-}
-
-for (const key of Object.keys(ansiStyles)) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
-
- styles[key] = {
- get() {
- const codes = ansiStyles[key];
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
- }
- };
-}
-
-styles.visible = {
- get() {
- return build.call(this, this._styles || [], true, 'visible');
- }
-};
-
-ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
-for (const model of Object.keys(ansiStyles.color.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
-
- styles[model] = {
- get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.color.close,
- closeRe: ansiStyles.color.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
-}
-
-ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
-for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
-
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
- styles[bgModel] = {
- get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.bgColor.close,
- closeRe: ansiStyles.bgColor.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
-}
-
-const proto = Object.defineProperties(() => {}, styles);
-
-function build(_styles, _empty, key) {
- const builder = function () {
- return applyStyle.apply(builder, arguments);
- };
-
- builder._styles = _styles;
- builder._empty = _empty;
-
- const self = this;
-
- Object.defineProperty(builder, 'level', {
- enumerable: true,
- get() {
- return self.level;
- },
- set(level) {
- self.level = level;
- }
- });
-
- Object.defineProperty(builder, 'enabled', {
- enumerable: true,
- get() {
- return self.enabled;
- },
- set(enabled) {
- self.enabled = enabled;
- }
- });
-
- // See below for fix regarding invisible grey/dim combination on Windows
- builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
-
- // `__proto__` is used because we must return a function, but there is
- // no way to create a function with a different prototype
- builder.__proto__ = proto; // eslint-disable-line no-proto
-
- return builder;
-}
-
-function applyStyle() {
- // Support varags, but simply cast to string in case there's only one arg
- const args = arguments;
- const argsLen = args.length;
- let str = String(arguments[0]);
-
- if (argsLen === 0) {
- return '';
- }
-
- if (argsLen > 1) {
- // Don't slice `arguments`, it prevents V8 optimizations
- for (let a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
-
- if (!this.enabled || this.level <= 0 || !str) {
- return this._empty ? '' : str;
- }
-
- // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
- // see https://github.com/chalk/chalk/issues/58
- // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
- const originalDim = ansiStyles.dim.open;
- if (isSimpleWindowsTerm && this.hasGrey) {
- ansiStyles.dim.open = '';
- }
-
- for (const code of this._styles.slice().reverse()) {
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
-
- // Close the styling before a linebreak and reopen
- // after next line to fix a bleed issue on macOS
- // https://github.com/chalk/chalk/pull/92
- str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
- }
-
- // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
- ansiStyles.dim.open = originalDim;
-
- return str;
-}
-
-function chalkTag(chalk, strings) {
- if (!Array.isArray(strings)) {
- // If chalk() was called by itself or with a string,
- // return the string itself as a string.
- return [].slice.call(arguments, 1).join(' ');
- }
-
- const args = [].slice.call(arguments, 2);
- const parts = [strings.raw[0]];
-
- for (let i = 1; i < strings.length; i++) {
- parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
- parts.push(String(strings.raw[i]));
- }
-
- return template(chalk, parts.join(''));
-}
-
-Object.defineProperties(Chalk.prototype, styles);
-
-module.exports = Chalk(); // eslint-disable-line new-cap
-module.exports.supportsColor = stdoutColor;
-module.exports.default = module.exports; // For TypeScript
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js.flow b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js.flow
deleted file mode 100644
index 622caaa2e80..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/index.js.flow
+++ /dev/null
@@ -1,93 +0,0 @@
-// @flow strict
-
-type TemplateStringsArray = $ReadOnlyArray<string>;
-
-export type Level = $Values<{
- None: 0,
- Basic: 1,
- Ansi256: 2,
- TrueColor: 3
-}>;
-
-export type ChalkOptions = {|
- enabled?: boolean,
- level?: Level
-|};
-
-export type ColorSupport = {|
- level: Level,
- hasBasic: boolean,
- has256: boolean,
- has16m: boolean
-|};
-
-export interface Chalk {
- (...text: string[]): string,
- (text: TemplateStringsArray, ...placeholders: string[]): string,
- constructor(options?: ChalkOptions): Chalk,
- enabled: boolean,
- level: Level,
- rgb(r: number, g: number, b: number): Chalk,
- hsl(h: number, s: number, l: number): Chalk,
- hsv(h: number, s: number, v: number): Chalk,
- hwb(h: number, w: number, b: number): Chalk,
- bgHex(color: string): Chalk,
- bgKeyword(color: string): Chalk,
- bgRgb(r: number, g: number, b: number): Chalk,
- bgHsl(h: number, s: number, l: number): Chalk,
- bgHsv(h: number, s: number, v: number): Chalk,
- bgHwb(h: number, w: number, b: number): Chalk,
- hex(color: string): Chalk,
- keyword(color: string): Chalk,
-
- +reset: Chalk,
- +bold: Chalk,
- +dim: Chalk,
- +italic: Chalk,
- +underline: Chalk,
- +inverse: Chalk,
- +hidden: Chalk,
- +strikethrough: Chalk,
-
- +visible: Chalk,
-
- +black: Chalk,
- +red: Chalk,
- +green: Chalk,
- +yellow: Chalk,
- +blue: Chalk,
- +magenta: Chalk,
- +cyan: Chalk,
- +white: Chalk,
- +gray: Chalk,
- +grey: Chalk,
- +blackBright: Chalk,
- +redBright: Chalk,
- +greenBright: Chalk,
- +yellowBright: Chalk,
- +blueBright: Chalk,
- +magentaBright: Chalk,
- +cyanBright: Chalk,
- +whiteBright: Chalk,
-
- +bgBlack: Chalk,
- +bgRed: Chalk,
- +bgGreen: Chalk,
- +bgYellow: Chalk,
- +bgBlue: Chalk,
- +bgMagenta: Chalk,
- +bgCyan: Chalk,
- +bgWhite: Chalk,
- +bgBlackBright: Chalk,
- +bgRedBright: Chalk,
- +bgGreenBright: Chalk,
- +bgYellowBright: Chalk,
- +bgBlueBright: Chalk,
- +bgMagentaBright: Chalk,
- +bgCyanBright: Chalk,
- +bgWhiteBrigh: Chalk,
-
- supportsColor: ColorSupport
-};
-
-declare module.exports: Chalk;
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json
deleted file mode 100644
index bc324685a76..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/package.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "chalk",
- "version": "2.4.2",
- "description": "Terminal string styling done right",
- "license": "MIT",
- "repository": "chalk/chalk",
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava",
- "bench": "matcha benchmark.js",
- "coveralls": "nyc report --reporter=text-lcov | coveralls"
- },
- "files": [
- "index.js",
- "templates.js",
- "types/index.d.ts",
- "index.js.flow"
- ],
- "keywords": [
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "string",
- "str",
- "ansi",
- "style",
- "styles",
- "tty",
- "formatting",
- "rgb",
- "256",
- "shell",
- "xterm",
- "log",
- "logging",
- "command-line",
- "text"
- ],
- "dependencies": {
- "ansi-styles": "^3.2.1",
- "escape-string-regexp": "^1.0.5",
- "supports-color": "^5.3.0"
- },
- "devDependencies": {
- "ava": "*",
- "coveralls": "^3.0.0",
- "execa": "^0.9.0",
- "flow-bin": "^0.68.0",
- "import-fresh": "^2.0.0",
- "matcha": "^0.7.0",
- "nyc": "^11.0.2",
- "resolve-from": "^4.0.0",
- "typescript": "^2.5.3",
- "xo": "*"
- },
- "types": "types/index.d.ts",
- "xo": {
- "envs": [
- "node",
- "mocha"
- ],
- "ignores": [
- "test/_flow.js"
- ]
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/readme.md
deleted file mode 100644
index d298e2c48d6..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/readme.md
+++ /dev/null
@@ -1,314 +0,0 @@
-<h1 align="center">
- <br>
- <br>
- <img width="320" src="media/logo.svg" alt="Chalk">
- <br>
- <br>
- <br>
-</h1>
-
-> Terminal string styling done right
-
-[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs)
-
-### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
-
-<img src="https://cdn.rawgit.com/chalk/ansi-styles/8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" alt="" width="900">
-
-
-## Highlights
-
-- Expressive API
-- Highly performant
-- Ability to nest styles
-- [256/Truecolor color support](#256-and-truecolor-color-support)
-- Auto-detects color support
-- Doesn't extend `String.prototype`
-- Clean and focused
-- Actively maintained
-- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017
-
-
-## Install
-
-```console
-$ npm install chalk
-```
-
-<a href="https://www.patreon.com/sindresorhus">
- <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160">
-</a>
-
-
-## Usage
-
-```js
-const chalk = require('chalk');
-
-console.log(chalk.blue('Hello world!'));
-```
-
-Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
-
-```js
-const chalk = require('chalk');
-const log = console.log;
-
-// Combine styled and normal strings
-log(chalk.blue('Hello') + ' World' + chalk.red('!'));
-
-// Compose multiple styles using the chainable API
-log(chalk.blue.bgRed.bold('Hello world!'));
-
-// Pass in multiple arguments
-log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
-
-// Nest styles
-log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
-
-// Nest styles of the same type even (color, underline, background)
-log(chalk.green(
- 'I am a green line ' +
- chalk.blue.underline.bold('with a blue substring') +
- ' that becomes green again!'
-));
-
-// ES2015 template literal
-log(`
-CPU: ${chalk.red('90%')}
-RAM: ${chalk.green('40%')}
-DISK: ${chalk.yellow('70%')}
-`);
-
-// ES2015 tagged template literal
-log(chalk`
-CPU: {red ${cpu.totalPercent}%}
-RAM: {green ${ram.used / ram.total * 100}%}
-DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
-`);
-
-// Use RGB colors in terminal emulators that support it.
-log(chalk.keyword('orange')('Yay for orange colored text!'));
-log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
-log(chalk.hex('#DEADED').bold('Bold gray!'));
-```
-
-Easily define your own themes:
-
-```js
-const chalk = require('chalk');
-
-const error = chalk.bold.red;
-const warning = chalk.keyword('orange');
-
-console.log(error('Error!'));
-console.log(warning('Warning!'));
-```
-
-Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
-
-```js
-const name = 'Sindre';
-console.log(chalk.green('Hello %s'), name);
-//=> 'Hello Sindre'
-```
-
-
-## API
-
-### chalk.`<style>[.<style>...](string, [string...])`
-
-Example: `chalk.red.bold.underline('Hello', 'world');`
-
-Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
-
-Multiple arguments will be separated by space.
-
-### chalk.enabled
-
-Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
-
-Chalk is enabled by default unless explicitly disabled via the constructor or `chalk.level` is `0`.
-
-If you need to change this in a reusable module, create a new instance:
-
-```js
-const ctx = new chalk.constructor({enabled: false});
-```
-
-### chalk.level
-
-Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
-
-If you need to change this in a reusable module, create a new instance:
-
-```js
-const ctx = new chalk.constructor({level: 0});
-```
-
-Levels are as follows:
-
-0. All colors disabled
-1. Basic color support (16 colors)
-2. 256 color support
-3. Truecolor support (16 million colors)
-
-### chalk.supportsColor
-
-Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
-
-Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
-
-Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
-
-
-## Styles
-
-### Modifiers
-
-- `reset`
-- `bold`
-- `dim`
-- `italic` *(Not widely supported)*
-- `underline`
-- `inverse`
-- `hidden`
-- `strikethrough` *(Not widely supported)*
-- `visible` (Text is emitted only if enabled)
-
-### Colors
-
-- `black`
-- `red`
-- `green`
-- `yellow`
-- `blue` *(On Windows the bright version is used since normal blue is illegible)*
-- `magenta`
-- `cyan`
-- `white`
-- `gray` ("bright black")
-- `redBright`
-- `greenBright`
-- `yellowBright`
-- `blueBright`
-- `magentaBright`
-- `cyanBright`
-- `whiteBright`
-
-### Background colors
-
-- `bgBlack`
-- `bgRed`
-- `bgGreen`
-- `bgYellow`
-- `bgBlue`
-- `bgMagenta`
-- `bgCyan`
-- `bgWhite`
-- `bgBlackBright`
-- `bgRedBright`
-- `bgGreenBright`
-- `bgYellowBright`
-- `bgBlueBright`
-- `bgMagentaBright`
-- `bgCyanBright`
-- `bgWhiteBright`
-
-
-## Tagged template literal
-
-Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
-
-```js
-const chalk = require('chalk');
-
-const miles = 18;
-const calculateFeet = miles => miles * 5280;
-
-console.log(chalk`
- There are {bold 5280 feet} in a mile.
- In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
-`);
-```
-
-Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
-
-Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
-
-```js
-console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
-console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
-```
-
-Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
-
-All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
-
-
-## 256 and Truecolor color support
-
-Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
-
-Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
-
-Examples:
-
-- `chalk.hex('#DEADED').underline('Hello, world!')`
-- `chalk.keyword('orange')('Some orange text')`
-- `chalk.rgb(15, 100, 204).inverse('Hello!')`
-
-Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
-
-- `chalk.bgHex('#DEADED').underline('Hello, world!')`
-- `chalk.bgKeyword('orange')('Some orange text')`
-- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
-
-The following color models can be used:
-
-- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
-- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
-- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
-- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
-- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
-- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
-- `ansi16`
-- `ansi256`
-
-
-## Windows
-
-If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
-
-
-## Origin story
-
-[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
-
-
-## Related
-
-- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
-- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
-- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
-- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
-- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
-- [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
-- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
-- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
-- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
-- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
-- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
-- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
-- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
-
-
-## Maintainers
-
-- [Sindre Sorhus](https://github.com/sindresorhus)
-- [Josh Junon](https://github.com/qix-)
-
-
-## License
-
-MIT
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/templates.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/templates.js
deleted file mode 100644
index dbdf9b22112..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/chalk/templates.js
+++ /dev/null
@@ -1,128 +0,0 @@
-'use strict';
-const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
-const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
-const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
-const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
-
-const ESCAPES = new Map([
- ['n', '\n'],
- ['r', '\r'],
- ['t', '\t'],
- ['b', '\b'],
- ['f', '\f'],
- ['v', '\v'],
- ['0', '\0'],
- ['\\', '\\'],
- ['e', '\u001B'],
- ['a', '\u0007']
-]);
-
-function unescape(c) {
- if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
- return String.fromCharCode(parseInt(c.slice(1), 16));
- }
-
- return ESCAPES.get(c) || c;
-}
-
-function parseArguments(name, args) {
- const results = [];
- const chunks = args.trim().split(/\s*,\s*/g);
- let matches;
-
- for (const chunk of chunks) {
- if (!isNaN(chunk)) {
- results.push(Number(chunk));
- } else if ((matches = chunk.match(STRING_REGEX))) {
- results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
- } else {
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
- }
- }
-
- return results;
-}
-
-function parseStyle(style) {
- STYLE_REGEX.lastIndex = 0;
-
- const results = [];
- let matches;
-
- while ((matches = STYLE_REGEX.exec(style)) !== null) {
- const name = matches[1];
-
- if (matches[2]) {
- const args = parseArguments(name, matches[2]);
- results.push([name].concat(args));
- } else {
- results.push([name]);
- }
- }
-
- return results;
-}
-
-function buildStyle(chalk, styles) {
- const enabled = {};
-
- for (const layer of styles) {
- for (const style of layer.styles) {
- enabled[style[0]] = layer.inverse ? null : style.slice(1);
- }
- }
-
- let current = chalk;
- for (const styleName of Object.keys(enabled)) {
- if (Array.isArray(enabled[styleName])) {
- if (!(styleName in current)) {
- throw new Error(`Unknown Chalk style: ${styleName}`);
- }
-
- if (enabled[styleName].length > 0) {
- current = current[styleName].apply(current, enabled[styleName]);
- } else {
- current = current[styleName];
- }
- }
- }
-
- return current;
-}
-
-module.exports = (chalk, tmp) => {
- const styles = [];
- const chunks = [];
- let chunk = [];
-
- // eslint-disable-next-line max-params
- tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
- if (escapeChar) {
- chunk.push(unescape(escapeChar));
- } else if (style) {
- const str = chunk.join('');
- chunk = [];
- chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
- styles.push({inverse, styles: parseStyle(style)});
- } else if (close) {
- if (styles.length === 0) {
- throw new Error('Found extraneous } in Chalk template literal');
- }
-
- chunks.push(buildStyle(chalk, styles)(chunk.join('')));
- chunk = [];
- styles.pop();
- } else {
- chunk.push(chr);
- }
- });
-
- chunks.push(chunk.join(''));
-
- if (styles.length > 0) {
- const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
- throw new Error(errMsg);
- }
-
- return chunks.join('');
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE
deleted file mode 100644
index 5b4c386f926..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/README.md
deleted file mode 100644
index d4b08fc3699..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/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 &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js
deleted file mode 100644
index 32172007ec0..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/conversions.js
+++ /dev/null
@@ -1,868 +0,0 @@
-/* MIT license */
-var 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.)
-
-var reverseKeywords = {};
-for (var key in cssKeywords) {
- if (cssKeywords.hasOwnProperty(key)) {
- reverseKeywords[cssKeywords[key]] = key;
- }
-}
-
-var convert = module.exports = {
- 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']}
-};
-
-// hide .channels and .labels properties
-for (var model in convert) {
- if (convert.hasOwnProperty(model)) {
- 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);
- }
-
- var channels = convert[model].channels;
- var labels = convert[model].labels;
- 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) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var min = Math.min(r, g, b);
- var max = Math.max(r, g, b);
- var delta = max - min;
- var h;
- var s;
- var l;
-
- 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;
- }
-
- 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) {
- var rdif;
- var gdif;
- var bdif;
- var h;
- var s;
-
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var v = Math.max(r, g, b);
- var diff = v - Math.min(r, g, b);
- var diffc = function (c) {
- return (v - c) / 6 / diff + 1 / 2;
- };
-
- if (diff === 0) {
- h = 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) {
- var r = rgb[0];
- var g = rgb[1];
- var b = rgb[2];
- var h = convert.rgb.hsl(rgb)[0];
- var 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) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var c;
- var m;
- var y;
- var k;
-
- k = Math.min(1 - r, 1 - g, 1 - b);
- c = (1 - r - k) / (1 - k) || 0;
- m = (1 - g - k) / (1 - k) || 0;
- y = (1 - b - k) / (1 - k) || 0;
-
- return [c * 100, m * 100, y * 100, k * 100];
-};
-
-/**
- * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
- * */
-function comparativeDistance(x, y) {
- return (
- Math.pow(x[0] - y[0], 2) +
- Math.pow(x[1] - y[1], 2) +
- Math.pow(x[2] - y[2], 2)
- );
-}
-
-convert.rgb.keyword = function (rgb) {
- var reversed = reverseKeywords[rgb];
- if (reversed) {
- return reversed;
- }
-
- var currentClosestDistance = Infinity;
- var currentClosestKeyword;
-
- for (var keyword in cssKeywords) {
- if (cssKeywords.hasOwnProperty(keyword)) {
- var value = cssKeywords[keyword];
-
- // Compute comparative distance
- var 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) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
-
- // assume sRGB
- r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
- g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
- b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
-
- var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
- var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
- var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
-
- return [x * 100, y * 100, z * 100];
-};
-
-convert.rgb.lab = function (rgb) {
- var xyz = convert.rgb.xyz(rgb);
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
-
- x /= 95.047;
- y /= 100;
- z /= 108.883;
-
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
-
- l = (116 * y) - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
-
- return [l, a, b];
-};
-
-convert.hsl.rgb = function (hsl) {
- var h = hsl[0] / 360;
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var t1;
- var t2;
- var t3;
- var rgb;
- var 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;
- }
-
- t1 = 2 * l - t2;
-
- rgb = [0, 0, 0];
- for (var 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) {
- var h = hsl[0];
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var smin = s;
- var lmin = Math.max(l, 0.01);
- var sv;
- var v;
-
- l *= 2;
- s *= (l <= 1) ? l : 2 - l;
- smin *= lmin <= 1 ? lmin : 2 - lmin;
- v = (l + s) / 2;
- sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
-
- return [h, sv * 100, v * 100];
-};
-
-convert.hsv.rgb = function (hsv) {
- var h = hsv[0] / 60;
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var hi = Math.floor(h) % 6;
-
- var f = h - Math.floor(h);
- var p = 255 * v * (1 - s);
- var q = 255 * v * (1 - (s * f));
- var 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) {
- var h = hsv[0];
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
- var vmin = Math.max(v, 0.01);
- var lmin;
- var sl;
- var l;
-
- l = (2 - s) * v;
- 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) {
- var h = hwb[0] / 360;
- var wh = hwb[1] / 100;
- var bl = hwb[2] / 100;
- var ratio = wh + bl;
- var i;
- var v;
- var f;
- var n;
-
- // wh + bl cant be > 1
- if (ratio > 1) {
- wh /= ratio;
- bl /= ratio;
- }
-
- i = Math.floor(6 * h);
- v = 1 - bl;
- f = 6 * h - i;
-
- if ((i & 0x01) !== 0) {
- f = 1 - f;
- }
-
- n = wh + f * (v - wh); // linear interpolation
-
- var r;
- var g;
- var b;
- 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;
- }
-
- return [r * 255, g * 255, b * 255];
-};
-
-convert.cmyk.rgb = function (cmyk) {
- var c = cmyk[0] / 100;
- var m = cmyk[1] / 100;
- var y = cmyk[2] / 100;
- var k = cmyk[3] / 100;
- var r;
- var g;
- var b;
-
- r = 1 - Math.min(1, c * (1 - k) + k);
- g = 1 - Math.min(1, m * (1 - k) + k);
- b = 1 - Math.min(1, y * (1 - k) + k);
-
- return [r * 255, g * 255, b * 255];
-};
-
-convert.xyz.rgb = function (xyz) {
- var x = xyz[0] / 100;
- var y = xyz[1] / 100;
- var z = xyz[2] / 100;
- var r;
- var g;
- var 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 * Math.pow(r, 1.0 / 2.4)) - 0.055)
- : r * 12.92;
-
- g = g > 0.0031308
- ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
- : g * 12.92;
-
- b = b > 0.0031308
- ? ((1.055 * Math.pow(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) {
- var x = xyz[0];
- var y = xyz[1];
- var z = xyz[2];
- var l;
- var a;
- var b;
-
- x /= 95.047;
- y /= 100;
- z /= 108.883;
-
- x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
- y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
- z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
-
- l = (116 * y) - 16;
- a = 500 * (x - y);
- b = 200 * (y - z);
-
- return [l, a, b];
-};
-
-convert.lab.xyz = function (lab) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var x;
- var y;
- var z;
-
- y = (l + 16) / 116;
- x = a / 500 + y;
- z = y - b / 200;
-
- var y2 = Math.pow(y, 3);
- var x2 = Math.pow(x, 3);
- var z2 = Math.pow(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) {
- var l = lab[0];
- var a = lab[1];
- var b = lab[2];
- var hr;
- var h;
- var c;
-
- hr = Math.atan2(b, a);
- h = hr * 360 / 2 / Math.PI;
-
- if (h < 0) {
- h += 360;
- }
-
- c = Math.sqrt(a * a + b * b);
-
- return [l, c, h];
-};
-
-convert.lch.lab = function (lch) {
- var l = lch[0];
- var c = lch[1];
- var h = lch[2];
- var a;
- var b;
- var hr;
-
- hr = h / 360 * 2 * Math.PI;
- a = c * Math.cos(hr);
- b = c * Math.sin(hr);
-
- return [l, a, b];
-};
-
-convert.rgb.ansi16 = function (args) {
- var r = args[0];
- var g = args[1];
- var b = args[2];
- var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
-
- value = Math.round(value / 50);
-
- if (value === 0) {
- return 30;
- }
-
- var 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) {
- var r = args[0];
- var g = args[1];
- var 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;
- }
-
- var 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) {
- var 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];
- }
-
- var mult = (~~(args > 50) + 1) * 0.5;
- var r = ((color & 1) * mult) * 255;
- var g = (((color >> 1) & 1) * mult) * 255;
- var b = (((color >> 2) & 1) * mult) * 255;
-
- return [r, g, b];
-};
-
-convert.ansi256.rgb = function (args) {
- // handle greyscale
- if (args >= 232) {
- var c = (args - 232) * 10 + 8;
- return [c, c, c];
- }
-
- args -= 16;
-
- var rem;
- var r = Math.floor(args / 36) / 5 * 255;
- var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
- var b = (rem % 6) / 5 * 255;
-
- return [r, g, b];
-};
-
-convert.rgb.hex = function (args) {
- var integer = ((Math.round(args[0]) & 0xFF) << 16)
- + ((Math.round(args[1]) & 0xFF) << 8)
- + (Math.round(args[2]) & 0xFF);
-
- var string = integer.toString(16).toUpperCase();
- return '000000'.substring(string.length) + string;
-};
-
-convert.hex.rgb = function (args) {
- var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
- if (!match) {
- return [0, 0, 0];
- }
-
- var colorString = match[0];
-
- if (match[0].length === 3) {
- colorString = colorString.split('').map(function (char) {
- return char + char;
- }).join('');
- }
-
- var integer = parseInt(colorString, 16);
- var r = (integer >> 16) & 0xFF;
- var g = (integer >> 8) & 0xFF;
- var b = integer & 0xFF;
-
- return [r, g, b];
-};
-
-convert.rgb.hcg = function (rgb) {
- var r = rgb[0] / 255;
- var g = rgb[1] / 255;
- var b = rgb[2] / 255;
- var max = Math.max(Math.max(r, g), b);
- var min = Math.min(Math.min(r, g), b);
- var chroma = (max - min);
- var grayscale;
- var 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 + 4;
- }
-
- hue /= 6;
- hue %= 1;
-
- return [hue * 360, chroma * 100, grayscale * 100];
-};
-
-convert.hsl.hcg = function (hsl) {
- var s = hsl[1] / 100;
- var l = hsl[2] / 100;
- var c = 1;
- var f = 0;
-
- if (l < 0.5) {
- c = 2.0 * s * l;
- } else {
- c = 2.0 * s * (1.0 - l);
- }
-
- if (c < 1.0) {
- f = (l - 0.5 * c) / (1.0 - c);
- }
-
- return [hsl[0], c * 100, f * 100];
-};
-
-convert.hsv.hcg = function (hsv) {
- var s = hsv[1] / 100;
- var v = hsv[2] / 100;
-
- var c = s * v;
- var f = 0;
-
- if (c < 1.0) {
- f = (v - c) / (1 - c);
- }
-
- return [hsv[0], c * 100, f * 100];
-};
-
-convert.hcg.rgb = function (hcg) {
- var h = hcg[0] / 360;
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
-
- if (c === 0.0) {
- return [g * 255, g * 255, g * 255];
- }
-
- var pure = [0, 0, 0];
- var hi = (h % 1) * 6;
- var v = hi % 1;
- var w = 1 - v;
- var mg = 0;
-
- 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;
- }
-
- 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) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
-
- var v = c + g * (1.0 - c);
- var f = 0;
-
- if (v > 0.0) {
- f = c / v;
- }
-
- return [hcg[0], f * 100, v * 100];
-};
-
-convert.hcg.hsl = function (hcg) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
-
- var l = g * (1.0 - c) + 0.5 * c;
- var 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) {
- var c = hcg[1] / 100;
- var g = hcg[2] / 100;
- var v = c + g * (1.0 - c);
- return [hcg[0], (v - c) * 100, (1 - v) * 100];
-};
-
-convert.hwb.hcg = function (hwb) {
- var w = hwb[1] / 100;
- var b = hwb[2] / 100;
- var v = 1 - b;
- var c = v - w;
- var 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 = convert.gray.hsv = function (args) {
- return [0, 0, args[0]];
-};
-
-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) {
- var val = Math.round(gray[0] / 100 * 255) & 0xFF;
- var integer = (val << 16) + (val << 8) + val;
-
- var string = integer.toString(16).toUpperCase();
- return '000000'.substring(string.length) + string;
-};
-
-convert.rgb.gray = function (rgb) {
- var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
- return [val / 255 * 100];
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js
deleted file mode 100644
index e65b5d775da..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/index.js
+++ /dev/null
@@ -1,78 +0,0 @@
-var conversions = require('./conversions');
-var route = require('./route');
-
-var convert = {};
-
-var models = Object.keys(conversions);
-
-function wrapRaw(fn) {
- var wrappedFn = function (args) {
- if (args === undefined || args === null) {
- return args;
- }
-
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
-
- return fn(args);
- };
-
- // preserve .conversion property if there is one
- if ('conversion' in fn) {
- wrappedFn.conversion = fn.conversion;
- }
-
- return wrappedFn;
-}
-
-function wrapRounded(fn) {
- var wrappedFn = function (args) {
- if (args === undefined || args === null) {
- return args;
- }
-
- if (arguments.length > 1) {
- args = Array.prototype.slice.call(arguments);
- }
-
- var 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 (var 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(function (fromModel) {
- convert[fromModel] = {};
-
- Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
- Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
-
- var routes = route(fromModel);
- var routeModels = Object.keys(routes);
-
- routeModels.forEach(function (toModel) {
- var fn = routes[toModel];
-
- convert[fromModel][toModel] = wrapRounded(fn);
- convert[fromModel][toModel].raw = wrapRaw(fn);
- });
-});
-
-module.exports = convert;
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json
deleted file mode 100644
index dfbc471407f..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/package.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "name": "color-convert",
- "description": "Plain color conversion functions",
- "version": "1.9.3",
- "author": "Heather Arthur <fayearthur@gmail.com>",
- "license": "MIT",
- "repository": "Qix-/color-convert",
- "scripts": {
- "pretest": "xo",
- "test": "node test/basic.js"
- },
- "keywords": [
- "color",
- "colour",
- "convert",
- "converter",
- "conversion",
- "rgb",
- "hsl",
- "hsv",
- "hwb",
- "cmyk",
- "ansi",
- "ansi16"
- ],
- "files": [
- "index.js",
- "conversions.js",
- "css-keywords.js",
- "route.js"
- ],
- "xo": {
- "rules": {
- "default-case": 0,
- "no-inline-comments": 0,
- "operator-linebreak": 0
- }
- },
- "devDependencies": {
- "chalk": "1.1.1",
- "xo": "0.11.2"
- },
- "dependencies": {
- "color-name": "1.1.3"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js
deleted file mode 100644
index 0a1fdea689e..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-convert/route.js
+++ /dev/null
@@ -1,97 +0,0 @@
-var 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() {
- var graph = {};
- // https://jsperf.com/object-keys-vs-for-in-with-closure/3
- var models = Object.keys(conversions);
-
- for (var 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) {
- var graph = buildGraph();
- var queue = [fromModel]; // unshift -> queue -> pop
-
- graph[fromModel].distance = 0;
-
- while (queue.length) {
- var current = queue.pop();
- var adjacents = Object.keys(conversions[current]);
-
- for (var len = adjacents.length, i = 0; i < len; i++) {
- var adjacent = adjacents[i];
- var 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) {
- var path = [graph[toModel].parent, toModel];
- var fn = conversions[graph[toModel].parent][toModel];
-
- var 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) {
- var graph = deriveBFS(fromModel);
- var conversion = {};
-
- var models = Object.keys(graph);
- for (var len = models.length, i = 0; i < len; i++) {
- var toModel = models[i];
- var 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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE
deleted file mode 100644
index c6b10012540..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/LICENSE
+++ /dev/null
@@ -1,8 +0,0 @@
-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
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/README.md
deleted file mode 100644
index 932b979176f..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/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]
-```
-
-<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/index.js
deleted file mode 100644
index b7c198a6f3d..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json
deleted file mode 100644
index d061123ef02..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/color-name/package.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "color-name",
- "version": "1.1.3",
- "description": "A list of color names and its values",
- "main": "index.js",
- "scripts": {
- "test": "node test.js"
- },
- "repository": {
- "type": "git",
- "url": "git@github.com:dfcreative/color-name.git"
- },
- "keywords": [
- "color-name",
- "color",
- "color-keyword",
- "keyword"
- ],
- "author": "DY <dfcreative@gmail.com>",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/dfcreative/color-name/issues"
- },
- "homepage": "https://github.com/dfcreative/color-name"
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js
deleted file mode 100644
index 7834bf9b24c..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
-module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json
deleted file mode 100644
index f307df34a23..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "name": "escape-string-regexp",
- "version": "1.0.5",
- "description": "Escape RegExp special characters",
- "license": "MIT",
- "repository": "sindresorhus/escape-string-regexp",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "maintainers": [
- "Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)",
- "Joshua Boy Nicolai Appelman <joshua@jbna.nl> (jbna.nl)"
- ],
- "engines": {
- "node": ">=0.8.0"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "escape",
- "regex",
- "regexp",
- "re",
- "regular",
- "expression",
- "string",
- "str",
- "special",
- "characters"
- ],
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md
deleted file mode 100644
index 87ac82d5ef8..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)
-
-> Escape RegExp special characters
-
-
-## Install
-
-```
-$ npm install --save escape-string-regexp
-```
-
-
-## Usage
-
-```js
-const escapeStringRegexp = require('escape-string-regexp');
-
-const escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> 'how much \$ for a unicorn\?'
-
-new RegExp(escapedString);
-```
-
-
-## License
-
-MIT Ā© [Sindre Sorhus](http://sindresorhus.com)
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js
deleted file mode 100644
index 5139728fba6..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict';
-module.exports = (flag, argv) => {
- argv = argv || process.argv;
- const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
- const pos = argv.indexOf(prefix + flag);
- const terminatorPos = argv.indexOf('--');
- return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json
deleted file mode 100644
index e1eb17a15ed..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/package.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "name": "has-flag",
- "version": "3.0.0",
- "description": "Check if argv has a specific flag",
- "license": "MIT",
- "repository": "sindresorhus/has-flag",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "has",
- "check",
- "detect",
- "contains",
- "find",
- "flag",
- "cli",
- "command-line",
- "argv",
- "process",
- "arg",
- "args",
- "argument",
- "arguments",
- "getopt",
- "minimist",
- "optimist"
- ],
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md
deleted file mode 100644
index 677893c278a..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/has-flag/readme.md
+++ /dev/null
@@ -1,70 +0,0 @@
-# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
-
-> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
-
-Correctly stops looking after an `--` argument terminator.
-
-
-## Install
-
-```
-$ npm install has-flag
-```
-
-
-## Usage
-
-```js
-// foo.js
-const hasFlag = require('has-flag');
-
-hasFlag('unicorn');
-//=> true
-
-hasFlag('--unicorn');
-//=> true
-
-hasFlag('f');
-//=> true
-
-hasFlag('-f');
-//=> true
-
-hasFlag('foo=bar');
-//=> true
-
-hasFlag('foo');
-//=> false
-
-hasFlag('rainbow');
-//=> false
-```
-
-```
-$ node foo.js -f --unicorn --foo=bar -- --rainbow
-```
-
-
-## API
-
-### hasFlag(flag, [argv])
-
-Returns a boolean for whether the flag exists.
-
-#### flag
-
-Type: `string`
-
-CLI flag to look for. The `--` prefix is optional.
-
-#### argv
-
-Type: `string[]`<br>
-Default: `process.argv`
-
-CLI arguments.
-
-
-## License
-
-MIT Ā© [Sindre Sorhus](https://sindresorhus.com)
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js
deleted file mode 100644
index 62afa3a7425..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/browser.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-module.exports = {
- stdout: false,
- stderr: false
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js
deleted file mode 100644
index 1704131bdf6..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/index.js
+++ /dev/null
@@ -1,131 +0,0 @@
-'use strict';
-const os = require('os');
-const hasFlag = require('has-flag');
-
-const env = process.env;
-
-let forceColor;
-if (hasFlag('no-color') ||
- hasFlag('no-colors') ||
- hasFlag('color=false')) {
- forceColor = false;
-} else if (hasFlag('color') ||
- hasFlag('colors') ||
- hasFlag('color=true') ||
- hasFlag('color=always')) {
- forceColor = true;
-}
-if ('FORCE_COLOR' in env) {
- forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
-}
-
-function translateLevel(level) {
- if (level === 0) {
- return false;
- }
-
- return {
- level,
- hasBasic: true,
- has256: level >= 2,
- has16m: level >= 3
- };
-}
-
-function supportsColor(stream) {
- if (forceColor === false) {
- return 0;
- }
-
- if (hasFlag('color=16m') ||
- hasFlag('color=full') ||
- hasFlag('color=truecolor')) {
- return 3;
- }
-
- if (hasFlag('color=256')) {
- return 2;
- }
-
- if (stream && !stream.isTTY && forceColor !== true) {
- return 0;
- }
-
- const min = forceColor ? 1 : 0;
-
- if (process.platform === 'win32') {
- // Node.js 7.5.0 is the first version of Node.js to include a patch to
- // libuv that enables 256 color output on Windows. Anything earlier and it
- // won't work. However, here we target Node.js 8 at minimum as it is an LTS
- // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
- // release that supports 256 colors. Windows 10 build 14931 is the first release
- // that supports 16m/TrueColor.
- const osRelease = os.release().split('.');
- if (
- Number(process.versions.node.split('.')[0]) >= 8 &&
- Number(osRelease[0]) >= 10 &&
- Number(osRelease[2]) >= 10586
- ) {
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
- }
-
- return 1;
- }
-
- if ('CI' in env) {
- if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
- return 1;
- }
-
- return min;
- }
-
- if ('TEAMCITY_VERSION' in env) {
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
- }
-
- if (env.COLORTERM === 'truecolor') {
- return 3;
- }
-
- if ('TERM_PROGRAM' in env) {
- const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
-
- switch (env.TERM_PROGRAM) {
- case 'iTerm.app':
- return version >= 3 ? 3 : 2;
- case 'Apple_Terminal':
- return 2;
- // No default
- }
- }
-
- if (/-256(color)?$/i.test(env.TERM)) {
- return 2;
- }
-
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
- return 1;
- }
-
- if ('COLORTERM' in env) {
- return 1;
- }
-
- if (env.TERM === 'dumb') {
- return min;
- }
-
- return min;
-}
-
-function getSupportLevel(stream) {
- const level = supportsColor(stream);
- return translateLevel(level);
-}
-
-module.exports = {
- supportsColor: getSupportLevel,
- stdout: getSupportLevel(process.stdout),
- stderr: getSupportLevel(process.stderr)
-};
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json
deleted file mode 100644
index ad199f5cdb0..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/package.json
+++ /dev/null
@@ -1,53 +0,0 @@
-{
- "name": "supports-color",
- "version": "5.5.0",
- "description": "Detect whether a terminal supports color",
- "license": "MIT",
- "repository": "chalk/supports-color",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=4"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js",
- "browser.js"
- ],
- "keywords": [
- "color",
- "colour",
- "colors",
- "terminal",
- "console",
- "cli",
- "ansi",
- "styles",
- "tty",
- "rgb",
- "256",
- "shell",
- "xterm",
- "command-line",
- "support",
- "supports",
- "capability",
- "detect",
- "truecolor",
- "16m"
- ],
- "dependencies": {
- "has-flag": "^3.0.0"
- },
- "devDependencies": {
- "ava": "^0.25.0",
- "import-fresh": "^2.0.0",
- "xo": "^0.20.0"
- },
- "browser": "browser.js"
-}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md b/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md
deleted file mode 100644
index f6e40195730..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/supports-color/readme.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
-
-> Detect whether a terminal supports color
-
-
-## Install
-
-```
-$ npm install supports-color
-```
-
-
-## Usage
-
-```js
-const supportsColor = require('supports-color');
-
-if (supportsColor.stdout) {
- console.log('Terminal stdout supports color');
-}
-
-if (supportsColor.stdout.has256) {
- console.log('Terminal stdout supports 256 colors');
-}
-
-if (supportsColor.stderr.has16m) {
- console.log('Terminal stderr supports 16 million colors (truecolor)');
-}
-```
-
-
-## API
-
-Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
-
-The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
-
-- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
-- `.level = 2` and `.has256 = true`: 256 color support
-- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
-
-
-## Info
-
-It obeys the `--color` and `--no-color` CLI flags.
-
-Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
-
-Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
-
-
-## Related
-
-- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
-- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
-
-
-## Maintainers
-
-- [Sindre Sorhus](https://github.com/sindresorhus)
-- [Josh Junon](https://github.com/qix-)
-
-
-## License
-
-MIT
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json b/tools/node_modules/eslint/node_modules/@babel/highlight/package.json
deleted file mode 100644
index 210c22c5110..00000000000
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/package.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "name": "@babel/highlight",
- "version": "7.14.5",
- "description": "Syntax highlight JavaScript strings for output in terminals.",
- "author": "The Babel Team (https://babel.dev/team)",
- "homepage": "https://babel.dev/docs/en/next/babel-highlight",
- "license": "MIT",
- "publishConfig": {
- "access": "public"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/babel/babel.git",
- "directory": "packages/babel-highlight"
- },
- "main": "./lib/index.js",
- "dependencies": {
- "@babel/helper-validator-identifier": "^7.14.5",
- "chalk": "^2.0.0",
- "js-tokens": "^4.0.0"
- },
- "devDependencies": {
- "@types/chalk": "^2.0.0",
- "strip-ansi": "^4.0.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
-} \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/config-schema.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/config-schema.js
index 712fc4235ec..ada90e135ca 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/config-schema.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/environments.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/environments.js
index 757c9fe696d..b3709a25950 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/environments.js
+++ b/tools/node_modules/eslint/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<string, import("../lib/shared/types").Environment>} */
-module.exports = new Map(Object.entries({
+export default new Map(Object.entries({
// Language
builtin: {
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.cjs
index 859811c8d5e..859811c8d5e 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-all.cjs
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.cjs
index 96300919ac6..96300919ac6 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/conf/eslint-recommended.cjs
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs
new file mode 100644
index 00000000000..0ee4b6b1445
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs
@@ -0,0 +1,1068 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var util = require('util');
+var path = require('path');
+var Ajv = require('ajv');
+var globals = require('globals');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
+var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
+var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);
+var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);
+
+/**
+ * @fileoverview Config file operations. This file must be usable in the browser,
+ * so no Node-specific code can be here.
+ * @author Nicholas C. Zakas
+ */
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+const RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
+ RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {
+ map[value] = index;
+ return map;
+ }, {}),
+ VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"];
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Normalizes the severity value of a rule's configuration to a number
+ * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
+ * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
+ * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
+ * whose first element is one of the above values. Strings are matched case-insensitively.
+ * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
+ */
+function getRuleSeverity(ruleConfig) {
+ const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
+ return severityValue;
+ }
+
+ if (typeof severityValue === "string") {
+ return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
+ }
+
+ return 0;
+}
+
+/**
+ * Converts old-style severity settings (0, 1, 2) into new-style
+ * severity settings (off, warn, error) for all rules. Assumption is that severity
+ * values have already been validated as correct.
+ * @param {Object} config The config object to normalize.
+ * @returns {void}
+ */
+function normalizeToStrings(config) {
+
+ if (config.rules) {
+ Object.keys(config.rules).forEach(ruleId => {
+ const ruleConfig = config.rules[ruleId];
+
+ if (typeof ruleConfig === "number") {
+ config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
+ } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
+ ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
+ }
+ });
+ }
+}
+
+/**
+ * Determines if the severity for the given rule configuration represents an error.
+ * @param {int|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} True if the rule represents an error, false if not.
+ */
+function isErrorSeverity(ruleConfig) {
+ return getRuleSeverity(ruleConfig) === 2;
+}
+
+/**
+ * Checks whether a given config has valid severity or not.
+ * @param {number|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isValidSeverity(ruleConfig) {
+ let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (typeof severity === "string") {
+ severity = severity.toLowerCase();
+ }
+ return VALID_SEVERITIES.indexOf(severity) !== -1;
+}
+
+/**
+ * Checks whether every rule of a given config has valid severity or not.
+ * @param {Object} config The configuration for rules.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isEverySeverityValid(config) {
+ return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));
+}
+
+/**
+ * Normalizes a value for a global in a config
+ * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
+ * a global directive comment
+ * @returns {("readable"|"writeable"|"off")} The value normalized as a string
+ * @throws Error if global value is invalid
+ */
+function normalizeConfigGlobal(configuredValue) {
+ switch (configuredValue) {
+ case "off":
+ return "off";
+
+ case true:
+ case "true":
+ case "writeable":
+ case "writable":
+ return "writable";
+
+ case null:
+ case false:
+ case "false":
+ case "readable":
+ case "readonly":
+ return "readonly";
+
+ default:
+ throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
+ }
+}
+
+var ConfigOps = {
+ __proto__: null,
+ getRuleSeverity: getRuleSeverity,
+ normalizeToStrings: normalizeToStrings,
+ isErrorSeverity: isErrorSeverity,
+ isValidSeverity: isValidSeverity,
+ isEverySeverityValid: isEverySeverityValid,
+ normalizeConfigGlobal: normalizeConfigGlobal
+};
+
+/**
+ * @fileoverview Provide the function that emits deprecation warnings.
+ * @author Toru Nagashima <http://github.com/mysticatea>
+ */
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+// Defitions for deprecation warnings.
+const deprecationWarningMessages = {
+ ESLINT_LEGACY_ECMAFEATURES:
+ "The 'ecmaFeatures' config file property is deprecated and has no effect.",
+ ESLINT_PERSONAL_CONFIG_LOAD:
+ "'~/.eslintrc.*' config files have been deprecated. " +
+ "Please use a config file per project or the '--config' option.",
+ ESLINT_PERSONAL_CONFIG_SUPPRESS:
+ "'~/.eslintrc.*' config files have been deprecated. " +
+ "Please remove it or add 'root:true' to the config files in your " +
+ "projects in order to avoid loading '~/.eslintrc.*' accidentally."
+};
+
+const sourceFileErrorCache = new Set();
+
+/**
+ * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
+ * for each unique file path, but repeated invocations with the same file path have no effect.
+ * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.
+ * @param {string} source The name of the configuration source to report the warning for.
+ * @param {string} errorCode The warning message to show.
+ * @returns {void}
+ */
+function emitDeprecationWarning(source, errorCode) {
+ const cacheKey = JSON.stringify({ source, errorCode });
+
+ if (sourceFileErrorCache.has(cacheKey)) {
+ return;
+ }
+ sourceFileErrorCache.add(cacheKey);
+
+ const rel = path__default["default"].relative(process.cwd(), source);
+ const message = deprecationWarningMessages[errorCode];
+
+ process.emitWarning(
+ `${message} (found in "${rel}")`,
+ "DeprecationWarning",
+ errorCode
+ );
+}
+
+/**
+ * @fileoverview The instance of Ajv validator.
+ * @author Evgeny Poberezkin
+ */
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+/*
+ * Copied from ajv/lib/refs/json-schema-draft-04.json
+ * The MIT License (MIT)
+ * Copyright (c) 2015-2017 Evgeny Poberezkin
+ */
+const metaSchema = {
+ id: "http://json-schema.org/draft-04/schema#",
+ $schema: "http://json-schema.org/draft-04/schema#",
+ description: "Core schema meta-schema",
+ definitions: {
+ schemaArray: {
+ type: "array",
+ minItems: 1,
+ items: { $ref: "#" }
+ },
+ positiveInteger: {
+ type: "integer",
+ minimum: 0
+ },
+ positiveIntegerDefault0: {
+ allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
+ },
+ simpleTypes: {
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
+ },
+ stringArray: {
+ type: "array",
+ items: { type: "string" },
+ minItems: 1,
+ uniqueItems: true
+ }
+ },
+ type: "object",
+ properties: {
+ id: {
+ type: "string"
+ },
+ $schema: {
+ type: "string"
+ },
+ title: {
+ type: "string"
+ },
+ description: {
+ type: "string"
+ },
+ default: { },
+ multipleOf: {
+ type: "number",
+ minimum: 0,
+ exclusiveMinimum: true
+ },
+ maximum: {
+ type: "number"
+ },
+ exclusiveMaximum: {
+ type: "boolean",
+ default: false
+ },
+ minimum: {
+ type: "number"
+ },
+ exclusiveMinimum: {
+ type: "boolean",
+ default: false
+ },
+ maxLength: { $ref: "#/definitions/positiveInteger" },
+ minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
+ pattern: {
+ type: "string",
+ format: "regex"
+ },
+ additionalItems: {
+ anyOf: [
+ { type: "boolean" },
+ { $ref: "#" }
+ ],
+ default: { }
+ },
+ items: {
+ anyOf: [
+ { $ref: "#" },
+ { $ref: "#/definitions/schemaArray" }
+ ],
+ default: { }
+ },
+ maxItems: { $ref: "#/definitions/positiveInteger" },
+ minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
+ uniqueItems: {
+ type: "boolean",
+ default: false
+ },
+ maxProperties: { $ref: "#/definitions/positiveInteger" },
+ minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
+ required: { $ref: "#/definitions/stringArray" },
+ additionalProperties: {
+ anyOf: [
+ { type: "boolean" },
+ { $ref: "#" }
+ ],
+ default: { }
+ },
+ definitions: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ properties: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ patternProperties: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ dependencies: {
+ type: "object",
+ additionalProperties: {
+ anyOf: [
+ { $ref: "#" },
+ { $ref: "#/definitions/stringArray" }
+ ]
+ }
+ },
+ enum: {
+ type: "array",
+ minItems: 1,
+ uniqueItems: true
+ },
+ type: {
+ anyOf: [
+ { $ref: "#/definitions/simpleTypes" },
+ {
+ type: "array",
+ items: { $ref: "#/definitions/simpleTypes" },
+ minItems: 1,
+ uniqueItems: true
+ }
+ ]
+ },
+ format: { type: "string" },
+ allOf: { $ref: "#/definitions/schemaArray" },
+ anyOf: { $ref: "#/definitions/schemaArray" },
+ oneOf: { $ref: "#/definitions/schemaArray" },
+ not: { $ref: "#" }
+ },
+ dependencies: {
+ exclusiveMaximum: ["maximum"],
+ exclusiveMinimum: ["minimum"]
+ },
+ default: { }
+};
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+var ajvOrig = (additionalOptions = {}) => {
+ const ajv = new Ajv__default["default"]({
+ meta: false,
+ useDefaults: true,
+ validateSchema: false,
+ missingRefs: "ignore",
+ verbose: true,
+ schemaId: "auto",
+ ...additionalOptions
+ });
+
+ ajv.addMetaSchema(metaSchema);
+ // eslint-disable-next-line no-underscore-dangle
+ ajv._opts.defaultMeta = metaSchema.id;
+
+ return ajv;
+};
+
+/**
+ * @fileoverview Defines a schema for configs.
+ * @author Sylvan Mably
+ */
+
+const baseConfigProperties = {
+ $schema: { type: "string" },
+ env: { type: "object" },
+ extends: { $ref: "#/definitions/stringOrStrings" },
+ globals: { type: "object" },
+ overrides: {
+ type: "array",
+ items: { $ref: "#/definitions/overrideConfig" },
+ additionalItems: false
+ },
+ parser: { type: ["string", "null"] },
+ parserOptions: { type: "object" },
+ plugins: { type: "array" },
+ processor: { type: "string" },
+ rules: { type: "object" },
+ settings: { type: "object" },
+ noInlineConfig: { type: "boolean" },
+ reportUnusedDisableDirectives: { type: "boolean" },
+
+ ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
+};
+
+const configSchema = {
+ definitions: {
+ stringOrStrings: {
+ oneOf: [
+ { type: "string" },
+ {
+ type: "array",
+ items: { type: "string" },
+ additionalItems: false
+ }
+ ]
+ },
+ stringOrStringsRequired: {
+ oneOf: [
+ { type: "string" },
+ {
+ type: "array",
+ items: { type: "string" },
+ additionalItems: false,
+ minItems: 1
+ }
+ ]
+ },
+
+ // Config at top-level.
+ objectConfig: {
+ type: "object",
+ properties: {
+ root: { type: "boolean" },
+ ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
+ ...baseConfigProperties
+ },
+ additionalProperties: false
+ },
+
+ // Config in `overrides`.
+ overrideConfig: {
+ type: "object",
+ properties: {
+ excludedFiles: { $ref: "#/definitions/stringOrStrings" },
+ files: { $ref: "#/definitions/stringOrStringsRequired" },
+ ...baseConfigProperties
+ },
+ required: ["files"],
+ additionalProperties: false
+ }
+ },
+
+ $ref: "#/definitions/objectConfig"
+};
+
+/**
+ * @fileoverview Defines environment settings and globals.
+ * @author Elan Shanker
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Get the object that has difference.
+ * @param {Record<string,boolean>} current The newer object.
+ * @param {Record<string,boolean>} prev The older object.
+ * @returns {Record<string,boolean>} The difference object.
+ */
+function getDiff(current, prev) {
+ const retv = {};
+
+ for (const [key, value] of Object.entries(current)) {
+ if (!Object.hasOwnProperty.call(prev, key)) {
+ retv[key] = value;
+ }
+ }
+
+ return retv;
+}
+
+const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ...
+const newGlobals2017 = {
+ Atomics: false,
+ SharedArrayBuffer: false
+};
+const newGlobals2020 = {
+ BigInt: false,
+ BigInt64Array: false,
+ BigUint64Array: false,
+ globalThis: false
+};
+
+const newGlobals2021 = {
+ AggregateError: false,
+ FinalizationRegistry: false,
+ WeakRef: false
+};
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/** @type {Map<string, import("../lib/shared/types").Environment>} */
+var environments = new Map(Object.entries({
+
+ // Language
+ builtin: {
+ globals: globals__default["default"].es5
+ },
+ es6: {
+ globals: newGlobals2015,
+ parserOptions: {
+ ecmaVersion: 6
+ }
+ },
+ es2015: {
+ globals: newGlobals2015,
+ parserOptions: {
+ ecmaVersion: 6
+ }
+ },
+ es2017: {
+ globals: { ...newGlobals2015, ...newGlobals2017 },
+ parserOptions: {
+ ecmaVersion: 8
+ }
+ },
+ es2020: {
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
+ parserOptions: {
+ ecmaVersion: 11
+ }
+ },
+ es2021: {
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
+ parserOptions: {
+ ecmaVersion: 12
+ }
+ },
+
+ // Platforms
+ browser: {
+ globals: globals__default["default"].browser
+ },
+ node: {
+ globals: globals__default["default"].node,
+ parserOptions: {
+ ecmaFeatures: {
+ globalReturn: true
+ }
+ }
+ },
+ "shared-node-browser": {
+ globals: globals__default["default"]["shared-node-browser"]
+ },
+ worker: {
+ globals: globals__default["default"].worker
+ },
+ serviceworker: {
+ globals: globals__default["default"].serviceworker
+ },
+
+ // Frameworks
+ commonjs: {
+ globals: globals__default["default"].commonjs,
+ parserOptions: {
+ ecmaFeatures: {
+ globalReturn: true
+ }
+ }
+ },
+ amd: {
+ globals: globals__default["default"].amd
+ },
+ mocha: {
+ globals: globals__default["default"].mocha
+ },
+ jasmine: {
+ globals: globals__default["default"].jasmine
+ },
+ jest: {
+ globals: globals__default["default"].jest
+ },
+ phantomjs: {
+ globals: globals__default["default"].phantomjs
+ },
+ jquery: {
+ globals: globals__default["default"].jquery
+ },
+ qunit: {
+ globals: globals__default["default"].qunit
+ },
+ prototypejs: {
+ globals: globals__default["default"].prototypejs
+ },
+ shelljs: {
+ globals: globals__default["default"].shelljs
+ },
+ meteor: {
+ globals: globals__default["default"].meteor
+ },
+ mongo: {
+ globals: globals__default["default"].mongo
+ },
+ protractor: {
+ globals: globals__default["default"].protractor
+ },
+ applescript: {
+ globals: globals__default["default"].applescript
+ },
+ nashorn: {
+ globals: globals__default["default"].nashorn
+ },
+ atomtest: {
+ globals: globals__default["default"].atomtest
+ },
+ embertest: {
+ globals: globals__default["default"].embertest
+ },
+ webextensions: {
+ globals: globals__default["default"].webextensions
+ },
+ greasemonkey: {
+ globals: globals__default["default"].greasemonkey
+ }
+}));
+
+/**
+ * @fileoverview Validates configs.
+ * @author Brandon Mills
+ */
+
+const ajv = ajvOrig();
+
+const ruleValidators = new WeakMap();
+const noop = Function.prototype;
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+let validateSchema;
+const severityMap = {
+ error: 2,
+ warn: 1,
+ off: 0
+};
+
+const validated = new WeakSet();
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+class ConfigValidator {
+ constructor({ builtInRules = new Map() } = {}) {
+ this.builtInRules = builtInRules;
+ }
+
+ /**
+ * Gets a complete options schema for a rule.
+ * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object
+ * @returns {Object} JSON Schema for the rule's options.
+ */
+ getRuleOptionsSchema(rule) {
+ if (!rule) {
+ return null;
+ }
+
+ const schema = rule.schema || rule.meta && rule.meta.schema;
+
+ // Given a tuple of schemas, insert warning level at the beginning
+ if (Array.isArray(schema)) {
+ if (schema.length) {
+ return {
+ type: "array",
+ items: schema,
+ minItems: 0,
+ maxItems: schema.length
+ };
+ }
+ return {
+ type: "array",
+ minItems: 0,
+ maxItems: 0
+ };
+
+ }
+
+ // Given a full schema, leave it alone
+ return schema || null;
+ }
+
+ /**
+ * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.
+ * @param {options} options The given options for the rule.
+ * @returns {number|string} The rule's severity value
+ */
+ validateRuleSeverity(options) {
+ const severity = Array.isArray(options) ? options[0] : options;
+ const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;
+
+ if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
+ return normSeverity;
+ }
+
+ throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`);
+
+ }
+
+ /**
+ * Validates the non-severity options passed to a rule, based on its schema.
+ * @param {{create: Function}} rule The rule to validate
+ * @param {Array} localOptions The options for the rule, excluding severity
+ * @returns {void}
+ */
+ validateRuleSchema(rule, localOptions) {
+ if (!ruleValidators.has(rule)) {
+ const schema = this.getRuleOptionsSchema(rule);
+
+ if (schema) {
+ ruleValidators.set(rule, ajv.compile(schema));
+ }
+ }
+
+ const validateRule = ruleValidators.get(rule);
+
+ if (validateRule) {
+ validateRule(localOptions);
+ if (validateRule.errors) {
+ throw new Error(validateRule.errors.map(
+ error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`
+ ).join(""));
+ }
+ }
+ }
+
+ /**
+ * Validates a rule's options against its schema.
+ * @param {{create: Function}|null} rule The rule that the config is being validated for
+ * @param {string} ruleId The rule's unique name.
+ * @param {Array|number} options The given options for the rule.
+ * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,
+ * no source is prepended to the message.
+ * @returns {void}
+ */
+ validateRuleOptions(rule, ruleId, options, source = null) {
+ try {
+ const severity = this.validateRuleSeverity(options);
+
+ if (severity !== 0) {
+ this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);
+ }
+ } catch (err) {
+ const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`;
+
+ if (typeof source === "string") {
+ throw new Error(`${source}:\n\t${enhancedMessage}`);
+ } else {
+ throw new Error(enhancedMessage);
+ }
+ }
+ }
+
+ /**
+ * Validates an environment object
+ * @param {Object} environment The environment config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.
+ * @returns {void}
+ */
+ validateEnvironment(
+ environment,
+ source,
+ getAdditionalEnv = noop
+ ) {
+
+ // not having an environment is ok
+ if (!environment) {
+ return;
+ }
+
+ Object.keys(environment).forEach(id => {
+ const env = getAdditionalEnv(id) || environments.get(id) || null;
+
+ if (!env) {
+ const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`;
+
+ throw new Error(message);
+ }
+ });
+ }
+
+ /**
+ * Validates a rules config object
+ * @param {Object} rulesConfig The rules config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules
+ * @returns {void}
+ */
+ validateRules(
+ rulesConfig,
+ source,
+ getAdditionalRule = noop
+ ) {
+ if (!rulesConfig) {
+ return;
+ }
+
+ Object.keys(rulesConfig).forEach(id => {
+ const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;
+
+ this.validateRuleOptions(rule, id, rulesConfig[id], source);
+ });
+ }
+
+ /**
+ * Validates a `globals` section of a config file
+ * @param {Object} globalsConfig The `globals` section
+ * @param {string|null} source The name of the configuration source to report in the event of an error.
+ * @returns {void}
+ */
+ validateGlobals(globalsConfig, source = null) {
+ if (!globalsConfig) {
+ return;
+ }
+
+ Object.entries(globalsConfig)
+ .forEach(([configuredGlobal, configuredValue]) => {
+ try {
+ normalizeConfigGlobal(configuredValue);
+ } catch (err) {
+ throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`);
+ }
+ });
+ }
+
+ /**
+ * Validate `processor` configuration.
+ * @param {string|undefined} processorName The processor name.
+ * @param {string} source The name of config file.
+ * @param {function(id:string): Processor} getProcessor The getter of defined processors.
+ * @returns {void}
+ */
+ validateProcessor(processorName, source, getProcessor) {
+ if (processorName && !getProcessor(processorName)) {
+ throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);
+ }
+ }
+
+ /**
+ * Formats an array of schema validation errors.
+ * @param {Array} errors An array of error messages to format.
+ * @returns {string} Formatted error message
+ */
+ formatErrors(errors) {
+ return errors.map(error => {
+ if (error.keyword === "additionalProperties") {
+ const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;
+
+ return `Unexpected top-level property "${formattedPropertyPath}"`;
+ }
+ if (error.keyword === "type") {
+ const formattedField = error.dataPath.slice(1);
+ const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema;
+ const formattedValue = JSON.stringify(error.data);
+
+ return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`;
+ }
+
+ const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
+
+ return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
+ }).map(message => `\t- ${message}.\n`).join("");
+ }
+
+ /**
+ * Validates the top level properties of the config object.
+ * @param {Object} config The config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @returns {void}
+ */
+ validateConfigSchema(config, source = null) {
+ validateSchema = validateSchema || ajv.compile(configSchema);
+
+ if (!validateSchema(config)) {
+ throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`);
+ }
+
+ if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {
+ emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
+ }
+ }
+
+ /**
+ * Validates an entire config object.
+ * @param {Object} config The config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.
+ * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.
+ * @returns {void}
+ */
+ validate(config, source, getAdditionalRule, getAdditionalEnv) {
+ this.validateConfigSchema(config, source);
+ this.validateRules(config.rules, source, getAdditionalRule);
+ this.validateEnvironment(config.env, source, getAdditionalEnv);
+ this.validateGlobals(config.globals, source);
+
+ for (const override of config.overrides || []) {
+ this.validateRules(override.rules, source, getAdditionalRule);
+ this.validateEnvironment(override.env, source, getAdditionalEnv);
+ this.validateGlobals(config.globals, source);
+ }
+ }
+
+ /**
+ * Validate config array object.
+ * @param {ConfigArray} configArray The config array to validate.
+ * @returns {void}
+ */
+ validateConfigArray(configArray) {
+ const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);
+ const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);
+ const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);
+
+ // Validate.
+ for (const element of configArray) {
+ if (validated.has(element)) {
+ continue;
+ }
+ validated.add(element);
+
+ this.validateEnvironment(element.env, element.name, getPluginEnv);
+ this.validateGlobals(element.globals, element.name);
+ this.validateProcessor(element.processor, element.name, getPluginProcessor);
+ this.validateRules(element.rules, element.name, getPluginRule);
+ }
+ }
+
+}
+
+/**
+ * @fileoverview Common helpers for naming of plugins, formatters and configs
+ */
+
+const NAMESPACE_REGEX = /^@.*\//iu;
+
+/**
+ * Brings package name to correct format based on prefix
+ * @param {string} name The name of the package.
+ * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"
+ * @returns {string} Normalized name of the package
+ * @private
+ */
+function normalizePackageName(name, prefix) {
+ let normalizedName = name;
+
+ /**
+ * On Windows, name can come in with Windows slashes instead of Unix slashes.
+ * Normalize to Unix first to avoid errors later on.
+ * https://github.com/eslint/eslint/issues/5644
+ */
+ if (normalizedName.includes("\\")) {
+ normalizedName = normalizedName.replace(/\\/gu, "/");
+ }
+
+ if (normalizedName.charAt(0) === "@") {
+
+ /**
+ * it's a scoped package
+ * package name is the prefix, or just a username
+ */
+ const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"),
+ scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");
+
+ if (scopedPackageShortcutRegex.test(normalizedName)) {
+ normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);
+ } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {
+
+ /**
+ * for scoped packages, insert the prefix after the first / unless
+ * the path is already @scope/eslint or @scope/eslint-xxx-yyy
+ */
+ normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`);
+ }
+ } else if (!normalizedName.startsWith(`${prefix}-`)) {
+ normalizedName = `${prefix}-${normalizedName}`;
+ }
+
+ return normalizedName;
+}
+
+/**
+ * Removes the prefix from a fullname.
+ * @param {string} fullname The term which may have the prefix.
+ * @param {string} prefix The prefix to remove.
+ * @returns {string} The term without prefix.
+ */
+function getShorthandName(fullname, prefix) {
+ if (fullname[0] === "@") {
+ let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname);
+
+ if (matchResult) {
+ return matchResult[1];
+ }
+
+ matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname);
+ if (matchResult) {
+ return `${matchResult[1]}/${matchResult[2]}`;
+ }
+ } else if (fullname.startsWith(`${prefix}-`)) {
+ return fullname.slice(prefix.length + 1);
+ }
+
+ return fullname;
+}
+
+/**
+ * Gets the scope (namespace) of a term.
+ * @param {string} term The term which may have the namespace.
+ * @returns {string} The namespace of the term if it has one.
+ */
+function getNamespaceFromTerm(term) {
+ const match = term.match(NAMESPACE_REGEX);
+
+ return match ? match[0] : "";
+}
+
+var naming = {
+ __proto__: null,
+ normalizePackageName: normalizePackageName,
+ getShorthandName: getShorthandName,
+ getNamespaceFromTerm: getNamespaceFromTerm
+};
+
+/**
+ * @fileoverview Package exports for @eslint/eslintrc
+ * @author Nicholas C. Zakas
+ */
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+const Legacy = {
+ environments,
+
+ // shared
+ ConfigOps,
+ ConfigValidator,
+ naming
+};
+
+exports.Legacy = Legacy;
+//# sourceMappingURL=eslintrc-universal.cjs.map
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
new file mode 100644
index 00000000000..e1e5c3971fc
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
@@ -0,0 +1,4236 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var fs = require('fs');
+var path = require('path');
+var importFresh = require('import-fresh');
+var stripComments = require('strip-json-comments');
+var util = require('util');
+var Ajv = require('ajv');
+var globals = require('globals');
+var Module = require('module');
+var assert = require('assert');
+var ignore = require('ignore');
+var debugOrig = require('debug');
+var minimatch = require('minimatch');
+var os = require('os');
+var url = require('url');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
+var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
+var importFresh__default = /*#__PURE__*/_interopDefaultLegacy(importFresh);
+var stripComments__default = /*#__PURE__*/_interopDefaultLegacy(stripComments);
+var util__default = /*#__PURE__*/_interopDefaultLegacy(util);
+var Ajv__default = /*#__PURE__*/_interopDefaultLegacy(Ajv);
+var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);
+var Module__default = /*#__PURE__*/_interopDefaultLegacy(Module);
+var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
+var ignore__default = /*#__PURE__*/_interopDefaultLegacy(ignore);
+var debugOrig__default = /*#__PURE__*/_interopDefaultLegacy(debugOrig);
+var minimatch__default = /*#__PURE__*/_interopDefaultLegacy(minimatch);
+var os__default = /*#__PURE__*/_interopDefaultLegacy(os);
+
+/**
+ * @fileoverview Config file operations. This file must be usable in the browser,
+ * so no Node-specific code can be here.
+ * @author Nicholas C. Zakas
+ */
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+const RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
+ RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce((map, value, index) => {
+ map[value] = index;
+ return map;
+ }, {}),
+ VALID_SEVERITIES = [0, 1, 2, "off", "warn", "error"];
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * Normalizes the severity value of a rule's configuration to a number
+ * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
+ * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
+ * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
+ * whose first element is one of the above values. Strings are matched case-insensitively.
+ * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
+ */
+function getRuleSeverity(ruleConfig) {
+ const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
+ return severityValue;
+ }
+
+ if (typeof severityValue === "string") {
+ return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
+ }
+
+ return 0;
+}
+
+/**
+ * Converts old-style severity settings (0, 1, 2) into new-style
+ * severity settings (off, warn, error) for all rules. Assumption is that severity
+ * values have already been validated as correct.
+ * @param {Object} config The config object to normalize.
+ * @returns {void}
+ */
+function normalizeToStrings(config) {
+
+ if (config.rules) {
+ Object.keys(config.rules).forEach(ruleId => {
+ const ruleConfig = config.rules[ruleId];
+
+ if (typeof ruleConfig === "number") {
+ config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
+ } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
+ ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
+ }
+ });
+ }
+}
+
+/**
+ * Determines if the severity for the given rule configuration represents an error.
+ * @param {int|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} True if the rule represents an error, false if not.
+ */
+function isErrorSeverity(ruleConfig) {
+ return getRuleSeverity(ruleConfig) === 2;
+}
+
+/**
+ * Checks whether a given config has valid severity or not.
+ * @param {number|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isValidSeverity(ruleConfig) {
+ let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (typeof severity === "string") {
+ severity = severity.toLowerCase();
+ }
+ return VALID_SEVERITIES.indexOf(severity) !== -1;
+}
+
+/**
+ * Checks whether every rule of a given config has valid severity or not.
+ * @param {Object} config The configuration for rules.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isEverySeverityValid(config) {
+ return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));
+}
+
+/**
+ * Normalizes a value for a global in a config
+ * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
+ * a global directive comment
+ * @returns {("readable"|"writeable"|"off")} The value normalized as a string
+ * @throws Error if global value is invalid
+ */
+function normalizeConfigGlobal(configuredValue) {
+ switch (configuredValue) {
+ case "off":
+ return "off";
+
+ case true:
+ case "true":
+ case "writeable":
+ case "writable":
+ return "writable";
+
+ case null:
+ case false:
+ case "false":
+ case "readable":
+ case "readonly":
+ return "readonly";
+
+ default:
+ throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
+ }
+}
+
+var ConfigOps = {
+ __proto__: null,
+ getRuleSeverity: getRuleSeverity,
+ normalizeToStrings: normalizeToStrings,
+ isErrorSeverity: isErrorSeverity,
+ isValidSeverity: isValidSeverity,
+ isEverySeverityValid: isEverySeverityValid,
+ normalizeConfigGlobal: normalizeConfigGlobal
+};
+
+/**
+ * @fileoverview Provide the function that emits deprecation warnings.
+ * @author Toru Nagashima <http://github.com/mysticatea>
+ */
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+// Defitions for deprecation warnings.
+const deprecationWarningMessages = {
+ ESLINT_LEGACY_ECMAFEATURES:
+ "The 'ecmaFeatures' config file property is deprecated and has no effect.",
+ ESLINT_PERSONAL_CONFIG_LOAD:
+ "'~/.eslintrc.*' config files have been deprecated. " +
+ "Please use a config file per project or the '--config' option.",
+ ESLINT_PERSONAL_CONFIG_SUPPRESS:
+ "'~/.eslintrc.*' config files have been deprecated. " +
+ "Please remove it or add 'root:true' to the config files in your " +
+ "projects in order to avoid loading '~/.eslintrc.*' accidentally."
+};
+
+const sourceFileErrorCache = new Set();
+
+/**
+ * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted
+ * for each unique file path, but repeated invocations with the same file path have no effect.
+ * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active.
+ * @param {string} source The name of the configuration source to report the warning for.
+ * @param {string} errorCode The warning message to show.
+ * @returns {void}
+ */
+function emitDeprecationWarning(source, errorCode) {
+ const cacheKey = JSON.stringify({ source, errorCode });
+
+ if (sourceFileErrorCache.has(cacheKey)) {
+ return;
+ }
+ sourceFileErrorCache.add(cacheKey);
+
+ const rel = path__default["default"].relative(process.cwd(), source);
+ const message = deprecationWarningMessages[errorCode];
+
+ process.emitWarning(
+ `${message} (found in "${rel}")`,
+ "DeprecationWarning",
+ errorCode
+ );
+}
+
+/**
+ * @fileoverview The instance of Ajv validator.
+ * @author Evgeny Poberezkin
+ */
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+/*
+ * Copied from ajv/lib/refs/json-schema-draft-04.json
+ * The MIT License (MIT)
+ * Copyright (c) 2015-2017 Evgeny Poberezkin
+ */
+const metaSchema = {
+ id: "http://json-schema.org/draft-04/schema#",
+ $schema: "http://json-schema.org/draft-04/schema#",
+ description: "Core schema meta-schema",
+ definitions: {
+ schemaArray: {
+ type: "array",
+ minItems: 1,
+ items: { $ref: "#" }
+ },
+ positiveInteger: {
+ type: "integer",
+ minimum: 0
+ },
+ positiveIntegerDefault0: {
+ allOf: [{ $ref: "#/definitions/positiveInteger" }, { default: 0 }]
+ },
+ simpleTypes: {
+ enum: ["array", "boolean", "integer", "null", "number", "object", "string"]
+ },
+ stringArray: {
+ type: "array",
+ items: { type: "string" },
+ minItems: 1,
+ uniqueItems: true
+ }
+ },
+ type: "object",
+ properties: {
+ id: {
+ type: "string"
+ },
+ $schema: {
+ type: "string"
+ },
+ title: {
+ type: "string"
+ },
+ description: {
+ type: "string"
+ },
+ default: { },
+ multipleOf: {
+ type: "number",
+ minimum: 0,
+ exclusiveMinimum: true
+ },
+ maximum: {
+ type: "number"
+ },
+ exclusiveMaximum: {
+ type: "boolean",
+ default: false
+ },
+ minimum: {
+ type: "number"
+ },
+ exclusiveMinimum: {
+ type: "boolean",
+ default: false
+ },
+ maxLength: { $ref: "#/definitions/positiveInteger" },
+ minLength: { $ref: "#/definitions/positiveIntegerDefault0" },
+ pattern: {
+ type: "string",
+ format: "regex"
+ },
+ additionalItems: {
+ anyOf: [
+ { type: "boolean" },
+ { $ref: "#" }
+ ],
+ default: { }
+ },
+ items: {
+ anyOf: [
+ { $ref: "#" },
+ { $ref: "#/definitions/schemaArray" }
+ ],
+ default: { }
+ },
+ maxItems: { $ref: "#/definitions/positiveInteger" },
+ minItems: { $ref: "#/definitions/positiveIntegerDefault0" },
+ uniqueItems: {
+ type: "boolean",
+ default: false
+ },
+ maxProperties: { $ref: "#/definitions/positiveInteger" },
+ minProperties: { $ref: "#/definitions/positiveIntegerDefault0" },
+ required: { $ref: "#/definitions/stringArray" },
+ additionalProperties: {
+ anyOf: [
+ { type: "boolean" },
+ { $ref: "#" }
+ ],
+ default: { }
+ },
+ definitions: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ properties: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ patternProperties: {
+ type: "object",
+ additionalProperties: { $ref: "#" },
+ default: { }
+ },
+ dependencies: {
+ type: "object",
+ additionalProperties: {
+ anyOf: [
+ { $ref: "#" },
+ { $ref: "#/definitions/stringArray" }
+ ]
+ }
+ },
+ enum: {
+ type: "array",
+ minItems: 1,
+ uniqueItems: true
+ },
+ type: {
+ anyOf: [
+ { $ref: "#/definitions/simpleTypes" },
+ {
+ type: "array",
+ items: { $ref: "#/definitions/simpleTypes" },
+ minItems: 1,
+ uniqueItems: true
+ }
+ ]
+ },
+ format: { type: "string" },
+ allOf: { $ref: "#/definitions/schemaArray" },
+ anyOf: { $ref: "#/definitions/schemaArray" },
+ oneOf: { $ref: "#/definitions/schemaArray" },
+ not: { $ref: "#" }
+ },
+ dependencies: {
+ exclusiveMaximum: ["maximum"],
+ exclusiveMinimum: ["minimum"]
+ },
+ default: { }
+};
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+var ajvOrig = (additionalOptions = {}) => {
+ const ajv = new Ajv__default["default"]({
+ meta: false,
+ useDefaults: true,
+ validateSchema: false,
+ missingRefs: "ignore",
+ verbose: true,
+ schemaId: "auto",
+ ...additionalOptions
+ });
+
+ ajv.addMetaSchema(metaSchema);
+ // eslint-disable-next-line no-underscore-dangle
+ ajv._opts.defaultMeta = metaSchema.id;
+
+ return ajv;
+};
+
+/**
+ * @fileoverview Defines a schema for configs.
+ * @author Sylvan Mably
+ */
+
+const baseConfigProperties = {
+ $schema: { type: "string" },
+ env: { type: "object" },
+ extends: { $ref: "#/definitions/stringOrStrings" },
+ globals: { type: "object" },
+ overrides: {
+ type: "array",
+ items: { $ref: "#/definitions/overrideConfig" },
+ additionalItems: false
+ },
+ parser: { type: ["string", "null"] },
+ parserOptions: { type: "object" },
+ plugins: { type: "array" },
+ processor: { type: "string" },
+ rules: { type: "object" },
+ settings: { type: "object" },
+ noInlineConfig: { type: "boolean" },
+ reportUnusedDisableDirectives: { type: "boolean" },
+
+ ecmaFeatures: { type: "object" } // deprecated; logs a warning when used
+};
+
+const configSchema = {
+ definitions: {
+ stringOrStrings: {
+ oneOf: [
+ { type: "string" },
+ {
+ type: "array",
+ items: { type: "string" },
+ additionalItems: false
+ }
+ ]
+ },
+ stringOrStringsRequired: {
+ oneOf: [
+ { type: "string" },
+ {
+ type: "array",
+ items: { type: "string" },
+ additionalItems: false,
+ minItems: 1
+ }
+ ]
+ },
+
+ // Config at top-level.
+ objectConfig: {
+ type: "object",
+ properties: {
+ root: { type: "boolean" },
+ ignorePatterns: { $ref: "#/definitions/stringOrStrings" },
+ ...baseConfigProperties
+ },
+ additionalProperties: false
+ },
+
+ // Config in `overrides`.
+ overrideConfig: {
+ type: "object",
+ properties: {
+ excludedFiles: { $ref: "#/definitions/stringOrStrings" },
+ files: { $ref: "#/definitions/stringOrStringsRequired" },
+ ...baseConfigProperties
+ },
+ required: ["files"],
+ additionalProperties: false
+ }
+ },
+
+ $ref: "#/definitions/objectConfig"
+};
+
+/**
+ * @fileoverview Defines environment settings and globals.
+ * @author Elan Shanker
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Get the object that has difference.
+ * @param {Record<string,boolean>} current The newer object.
+ * @param {Record<string,boolean>} prev The older object.
+ * @returns {Record<string,boolean>} The difference object.
+ */
+function getDiff(current, prev) {
+ const retv = {};
+
+ for (const [key, value] of Object.entries(current)) {
+ if (!Object.hasOwnProperty.call(prev, key)) {
+ retv[key] = value;
+ }
+ }
+
+ return retv;
+}
+
+const newGlobals2015 = getDiff(globals__default["default"].es2015, globals__default["default"].es5); // 19 variables such as Promise, Map, ...
+const newGlobals2017 = {
+ Atomics: false,
+ SharedArrayBuffer: false
+};
+const newGlobals2020 = {
+ BigInt: false,
+ BigInt64Array: false,
+ BigUint64Array: false,
+ globalThis: false
+};
+
+const newGlobals2021 = {
+ AggregateError: false,
+ FinalizationRegistry: false,
+ WeakRef: false
+};
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/** @type {Map<string, import("../lib/shared/types").Environment>} */
+var environments = new Map(Object.entries({
+
+ // Language
+ builtin: {
+ globals: globals__default["default"].es5
+ },
+ es6: {
+ globals: newGlobals2015,
+ parserOptions: {
+ ecmaVersion: 6
+ }
+ },
+ es2015: {
+ globals: newGlobals2015,
+ parserOptions: {
+ ecmaVersion: 6
+ }
+ },
+ es2017: {
+ globals: { ...newGlobals2015, ...newGlobals2017 },
+ parserOptions: {
+ ecmaVersion: 8
+ }
+ },
+ es2020: {
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020 },
+ parserOptions: {
+ ecmaVersion: 11
+ }
+ },
+ es2021: {
+ globals: { ...newGlobals2015, ...newGlobals2017, ...newGlobals2020, ...newGlobals2021 },
+ parserOptions: {
+ ecmaVersion: 12
+ }
+ },
+
+ // Platforms
+ browser: {
+ globals: globals__default["default"].browser
+ },
+ node: {
+ globals: globals__default["default"].node,
+ parserOptions: {
+ ecmaFeatures: {
+ globalReturn: true
+ }
+ }
+ },
+ "shared-node-browser": {
+ globals: globals__default["default"]["shared-node-browser"]
+ },
+ worker: {
+ globals: globals__default["default"].worker
+ },
+ serviceworker: {
+ globals: globals__default["default"].serviceworker
+ },
+
+ // Frameworks
+ commonjs: {
+ globals: globals__default["default"].commonjs,
+ parserOptions: {
+ ecmaFeatures: {
+ globalReturn: true
+ }
+ }
+ },
+ amd: {
+ globals: globals__default["default"].amd
+ },
+ mocha: {
+ globals: globals__default["default"].mocha
+ },
+ jasmine: {
+ globals: globals__default["default"].jasmine
+ },
+ jest: {
+ globals: globals__default["default"].jest
+ },
+ phantomjs: {
+ globals: globals__default["default"].phantomjs
+ },
+ jquery: {
+ globals: globals__default["default"].jquery
+ },
+ qunit: {
+ globals: globals__default["default"].qunit
+ },
+ prototypejs: {
+ globals: globals__default["default"].prototypejs
+ },
+ shelljs: {
+ globals: globals__default["default"].shelljs
+ },
+ meteor: {
+ globals: globals__default["default"].meteor
+ },
+ mongo: {
+ globals: globals__default["default"].mongo
+ },
+ protractor: {
+ globals: globals__default["default"].protractor
+ },
+ applescript: {
+ globals: globals__default["default"].applescript
+ },
+ nashorn: {
+ globals: globals__default["default"].nashorn
+ },
+ atomtest: {
+ globals: globals__default["default"].atomtest
+ },
+ embertest: {
+ globals: globals__default["default"].embertest
+ },
+ webextensions: {
+ globals: globals__default["default"].webextensions
+ },
+ greasemonkey: {
+ globals: globals__default["default"].greasemonkey
+ }
+}));
+
+/**
+ * @fileoverview Validates configs.
+ * @author Brandon Mills
+ */
+
+const ajv = ajvOrig();
+
+const ruleValidators = new WeakMap();
+const noop = Function.prototype;
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+let validateSchema;
+const severityMap = {
+ error: 2,
+ warn: 1,
+ off: 0
+};
+
+const validated = new WeakSet();
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+class ConfigValidator {
+ constructor({ builtInRules = new Map() } = {}) {
+ this.builtInRules = builtInRules;
+ }
+
+ /**
+ * Gets a complete options schema for a rule.
+ * @param {{create: Function, schema: (Array|null)}} rule A new-style rule object
+ * @returns {Object} JSON Schema for the rule's options.
+ */
+ getRuleOptionsSchema(rule) {
+ if (!rule) {
+ return null;
+ }
+
+ const schema = rule.schema || rule.meta && rule.meta.schema;
+
+ // Given a tuple of schemas, insert warning level at the beginning
+ if (Array.isArray(schema)) {
+ if (schema.length) {
+ return {
+ type: "array",
+ items: schema,
+ minItems: 0,
+ maxItems: schema.length
+ };
+ }
+ return {
+ type: "array",
+ minItems: 0,
+ maxItems: 0
+ };
+
+ }
+
+ // Given a full schema, leave it alone
+ return schema || null;
+ }
+
+ /**
+ * Validates a rule's severity and returns the severity value. Throws an error if the severity is invalid.
+ * @param {options} options The given options for the rule.
+ * @returns {number|string} The rule's severity value
+ */
+ validateRuleSeverity(options) {
+ const severity = Array.isArray(options) ? options[0] : options;
+ const normSeverity = typeof severity === "string" ? severityMap[severity.toLowerCase()] : severity;
+
+ if (normSeverity === 0 || normSeverity === 1 || normSeverity === 2) {
+ return normSeverity;
+ }
+
+ throw new Error(`\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '${util__default["default"].inspect(severity).replace(/'/gu, "\"").replace(/\n/gu, "")}').\n`);
+
+ }
+
+ /**
+ * Validates the non-severity options passed to a rule, based on its schema.
+ * @param {{create: Function}} rule The rule to validate
+ * @param {Array} localOptions The options for the rule, excluding severity
+ * @returns {void}
+ */
+ validateRuleSchema(rule, localOptions) {
+ if (!ruleValidators.has(rule)) {
+ const schema = this.getRuleOptionsSchema(rule);
+
+ if (schema) {
+ ruleValidators.set(rule, ajv.compile(schema));
+ }
+ }
+
+ const validateRule = ruleValidators.get(rule);
+
+ if (validateRule) {
+ validateRule(localOptions);
+ if (validateRule.errors) {
+ throw new Error(validateRule.errors.map(
+ error => `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`
+ ).join(""));
+ }
+ }
+ }
+
+ /**
+ * Validates a rule's options against its schema.
+ * @param {{create: Function}|null} rule The rule that the config is being validated for
+ * @param {string} ruleId The rule's unique name.
+ * @param {Array|number} options The given options for the rule.
+ * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined,
+ * no source is prepended to the message.
+ * @returns {void}
+ */
+ validateRuleOptions(rule, ruleId, options, source = null) {
+ try {
+ const severity = this.validateRuleSeverity(options);
+
+ if (severity !== 0) {
+ this.validateRuleSchema(rule, Array.isArray(options) ? options.slice(1) : []);
+ }
+ } catch (err) {
+ const enhancedMessage = `Configuration for rule "${ruleId}" is invalid:\n${err.message}`;
+
+ if (typeof source === "string") {
+ throw new Error(`${source}:\n\t${enhancedMessage}`);
+ } else {
+ throw new Error(enhancedMessage);
+ }
+ }
+ }
+
+ /**
+ * Validates an environment object
+ * @param {Object} environment The environment config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded environments.
+ * @returns {void}
+ */
+ validateEnvironment(
+ environment,
+ source,
+ getAdditionalEnv = noop
+ ) {
+
+ // not having an environment is ok
+ if (!environment) {
+ return;
+ }
+
+ Object.keys(environment).forEach(id => {
+ const env = getAdditionalEnv(id) || environments.get(id) || null;
+
+ if (!env) {
+ const message = `${source}:\n\tEnvironment key "${id}" is unknown\n`;
+
+ throw new Error(message);
+ }
+ });
+ }
+
+ /**
+ * Validates a rules config object
+ * @param {Object} rulesConfig The rules config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(ruleId:string): Object} getAdditionalRule A map from strings to loaded rules
+ * @returns {void}
+ */
+ validateRules(
+ rulesConfig,
+ source,
+ getAdditionalRule = noop
+ ) {
+ if (!rulesConfig) {
+ return;
+ }
+
+ Object.keys(rulesConfig).forEach(id => {
+ const rule = getAdditionalRule(id) || this.builtInRules.get(id) || null;
+
+ this.validateRuleOptions(rule, id, rulesConfig[id], source);
+ });
+ }
+
+ /**
+ * Validates a `globals` section of a config file
+ * @param {Object} globalsConfig The `globals` section
+ * @param {string|null} source The name of the configuration source to report in the event of an error.
+ * @returns {void}
+ */
+ validateGlobals(globalsConfig, source = null) {
+ if (!globalsConfig) {
+ return;
+ }
+
+ Object.entries(globalsConfig)
+ .forEach(([configuredGlobal, configuredValue]) => {
+ try {
+ normalizeConfigGlobal(configuredValue);
+ } catch (err) {
+ throw new Error(`ESLint configuration of global '${configuredGlobal}' in ${source} is invalid:\n${err.message}`);
+ }
+ });
+ }
+
+ /**
+ * Validate `processor` configuration.
+ * @param {string|undefined} processorName The processor name.
+ * @param {string} source The name of config file.
+ * @param {function(id:string): Processor} getProcessor The getter of defined processors.
+ * @returns {void}
+ */
+ validateProcessor(processorName, source, getProcessor) {
+ if (processorName && !getProcessor(processorName)) {
+ throw new Error(`ESLint configuration of processor in '${source}' is invalid: '${processorName}' was not found.`);
+ }
+ }
+
+ /**
+ * Formats an array of schema validation errors.
+ * @param {Array} errors An array of error messages to format.
+ * @returns {string} Formatted error message
+ */
+ formatErrors(errors) {
+ return errors.map(error => {
+ if (error.keyword === "additionalProperties") {
+ const formattedPropertyPath = error.dataPath.length ? `${error.dataPath.slice(1)}.${error.params.additionalProperty}` : error.params.additionalProperty;
+
+ return `Unexpected top-level property "${formattedPropertyPath}"`;
+ }
+ if (error.keyword === "type") {
+ const formattedField = error.dataPath.slice(1);
+ const formattedExpectedType = Array.isArray(error.schema) ? error.schema.join("/") : error.schema;
+ const formattedValue = JSON.stringify(error.data);
+
+ return `Property "${formattedField}" is the wrong type (expected ${formattedExpectedType} but got \`${formattedValue}\`)`;
+ }
+
+ const field = error.dataPath[0] === "." ? error.dataPath.slice(1) : error.dataPath;
+
+ return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
+ }).map(message => `\t- ${message}.\n`).join("");
+ }
+
+ /**
+ * Validates the top level properties of the config object.
+ * @param {Object} config The config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @returns {void}
+ */
+ validateConfigSchema(config, source = null) {
+ validateSchema = validateSchema || ajv.compile(configSchema);
+
+ if (!validateSchema(config)) {
+ throw new Error(`ESLint configuration in ${source} is invalid:\n${this.formatErrors(validateSchema.errors)}`);
+ }
+
+ if (Object.hasOwnProperty.call(config, "ecmaFeatures")) {
+ emitDeprecationWarning(source, "ESLINT_LEGACY_ECMAFEATURES");
+ }
+ }
+
+ /**
+ * Validates an entire config object.
+ * @param {Object} config The config object to validate.
+ * @param {string} source The name of the configuration source to report in any errors.
+ * @param {function(ruleId:string): Object} [getAdditionalRule] A map from strings to loaded rules.
+ * @param {function(envId:string): Object} [getAdditionalEnv] A map from strings to loaded envs.
+ * @returns {void}
+ */
+ validate(config, source, getAdditionalRule, getAdditionalEnv) {
+ this.validateConfigSchema(config, source);
+ this.validateRules(config.rules, source, getAdditionalRule);
+ this.validateEnvironment(config.env, source, getAdditionalEnv);
+ this.validateGlobals(config.globals, source);
+
+ for (const override of config.overrides || []) {
+ this.validateRules(override.rules, source, getAdditionalRule);
+ this.validateEnvironment(override.env, source, getAdditionalEnv);
+ this.validateGlobals(config.globals, source);
+ }
+ }
+
+ /**
+ * Validate config array object.
+ * @param {ConfigArray} configArray The config array to validate.
+ * @returns {void}
+ */
+ validateConfigArray(configArray) {
+ const getPluginEnv = Map.prototype.get.bind(configArray.pluginEnvironments);
+ const getPluginProcessor = Map.prototype.get.bind(configArray.pluginProcessors);
+ const getPluginRule = Map.prototype.get.bind(configArray.pluginRules);
+
+ // Validate.
+ for (const element of configArray) {
+ if (validated.has(element)) {
+ continue;
+ }
+ validated.add(element);
+
+ this.validateEnvironment(element.env, element.name, getPluginEnv);
+ this.validateGlobals(element.globals, element.name);
+ this.validateProcessor(element.processor, element.name, getPluginProcessor);
+ this.validateRules(element.rules, element.name, getPluginRule);
+ }
+ }
+
+}
+
+/**
+ * @fileoverview Common helpers for naming of plugins, formatters and configs
+ */
+
+const NAMESPACE_REGEX = /^@.*\//iu;
+
+/**
+ * Brings package name to correct format based on prefix
+ * @param {string} name The name of the package.
+ * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"
+ * @returns {string} Normalized name of the package
+ * @private
+ */
+function normalizePackageName(name, prefix) {
+ let normalizedName = name;
+
+ /**
+ * On Windows, name can come in with Windows slashes instead of Unix slashes.
+ * Normalize to Unix first to avoid errors later on.
+ * https://github.com/eslint/eslint/issues/5644
+ */
+ if (normalizedName.includes("\\")) {
+ normalizedName = normalizedName.replace(/\\/gu, "/");
+ }
+
+ if (normalizedName.charAt(0) === "@") {
+
+ /**
+ * it's a scoped package
+ * package name is the prefix, or just a username
+ */
+ const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, "u"),
+ scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");
+
+ if (scopedPackageShortcutRegex.test(normalizedName)) {
+ normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);
+ } else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {
+
+ /**
+ * for scoped packages, insert the prefix after the first / unless
+ * the path is already @scope/eslint or @scope/eslint-xxx-yyy
+ */
+ normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`);
+ }
+ } else if (!normalizedName.startsWith(`${prefix}-`)) {
+ normalizedName = `${prefix}-${normalizedName}`;
+ }
+
+ return normalizedName;
+}
+
+/**
+ * Removes the prefix from a fullname.
+ * @param {string} fullname The term which may have the prefix.
+ * @param {string} prefix The prefix to remove.
+ * @returns {string} The term without prefix.
+ */
+function getShorthandName(fullname, prefix) {
+ if (fullname[0] === "@") {
+ let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(fullname);
+
+ if (matchResult) {
+ return matchResult[1];
+ }
+
+ matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(fullname);
+ if (matchResult) {
+ return `${matchResult[1]}/${matchResult[2]}`;
+ }
+ } else if (fullname.startsWith(`${prefix}-`)) {
+ return fullname.slice(prefix.length + 1);
+ }
+
+ return fullname;
+}
+
+/**
+ * Gets the scope (namespace) of a term.
+ * @param {string} term The term which may have the namespace.
+ * @returns {string} The namespace of the term if it has one.
+ */
+function getNamespaceFromTerm(term) {
+ const match = term.match(NAMESPACE_REGEX);
+
+ return match ? match[0] : "";
+}
+
+var naming = {
+ __proto__: null,
+ normalizePackageName: normalizePackageName,
+ getShorthandName: getShorthandName,
+ getNamespaceFromTerm: getNamespaceFromTerm
+};
+
+/**
+ * Utility for resolving a module relative to another module
+ * @author Teddy Katz
+ */
+
+/*
+ * `Module.createRequire` is added in v12.2.0. It supports URL as well.
+ * We only support the case where the argument is a filepath, not a URL.
+ */
+const createRequire = Module__default["default"].createRequire;
+
+/**
+ * Resolves a Node module relative to another module
+ * @param {string} moduleName The name of a Node module, or a path to a Node module.
+ * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be
+ * a file rather than a directory, but the file need not actually exist.
+ * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`
+ */
+function resolve(moduleName, relativeToPath) {
+ try {
+ return createRequire(relativeToPath).resolve(moduleName);
+ } catch (error) {
+
+ // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.
+ if (
+ typeof error === "object" &&
+ error !== null &&
+ error.code === "MODULE_NOT_FOUND" &&
+ !error.requireStack &&
+ error.message.includes(moduleName)
+ ) {
+ error.message += `\nRequire stack:\n- ${relativeToPath}`;
+ }
+ throw error;
+ }
+}
+
+var ModuleResolver = {
+ __proto__: null,
+ resolve: resolve
+};
+
+/**
+ * @fileoverview `IgnorePattern` class.
+ *
+ * `IgnorePattern` class has the set of glob patterns and the base path.
+ *
+ * It provides two static methods.
+ *
+ * - `IgnorePattern.createDefaultIgnore(cwd)`
+ * Create the default predicate function.
+ * - `IgnorePattern.createIgnore(ignorePatterns)`
+ * Create the predicate function from multiple `IgnorePattern` objects.
+ *
+ * It provides two properties and a method.
+ *
+ * - `patterns`
+ * The glob patterns that ignore to lint.
+ * - `basePath`
+ * The base path of the glob patterns. If absolute paths existed in the
+ * glob patterns, those are handled as relative paths to the base path.
+ * - `getPatternsRelativeTo(basePath)`
+ * Get `patterns` as modified for a given base path. It modifies the
+ * absolute paths in the patterns as prepending the difference of two base
+ * paths.
+ *
+ * `ConfigArrayFactory` creates `IgnorePattern` objects when it processes
+ * `ignorePatterns` properties.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+const debug$3 = debugOrig__default["default"]("eslintrc:ignore-pattern");
+
+/** @typedef {ReturnType<import("ignore").default>} Ignore */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+/**
+ * Get the path to the common ancestor directory of given paths.
+ * @param {string[]} sourcePaths The paths to calculate the common ancestor.
+ * @returns {string} The path to the common ancestor directory.
+ */
+function getCommonAncestorPath(sourcePaths) {
+ let result = sourcePaths[0];
+
+ for (let i = 1; i < sourcePaths.length; ++i) {
+ const a = result;
+ const b = sourcePaths[i];
+
+ // Set the shorter one (it's the common ancestor if one includes the other).
+ result = a.length < b.length ? a : b;
+
+ // Set the common ancestor.
+ for (let j = 0, lastSepPos = 0; j < a.length && j < b.length; ++j) {
+ if (a[j] !== b[j]) {
+ result = a.slice(0, lastSepPos);
+ break;
+ }
+ if (a[j] === path__default["default"].sep) {
+ lastSepPos = j;
+ }
+ }
+ }
+
+ let resolvedResult = result || path__default["default"].sep;
+
+ // if Windows common ancestor is root of drive must have trailing slash to be absolute.
+ if (resolvedResult && resolvedResult.endsWith(":") && process.platform === "win32") {
+ resolvedResult += path__default["default"].sep;
+ }
+ return resolvedResult;
+}
+
+/**
+ * Make relative path.
+ * @param {string} from The source path to get relative path.
+ * @param {string} to The destination path to get relative path.
+ * @returns {string} The relative path.
+ */
+function relative(from, to) {
+ const relPath = path__default["default"].relative(from, to);
+
+ if (path__default["default"].sep === "/") {
+ return relPath;
+ }
+ return relPath.split(path__default["default"].sep).join("/");
+}
+
+/**
+ * Get the trailing slash if existed.
+ * @param {string} filePath The path to check.
+ * @returns {string} The trailing slash if existed.
+ */
+function dirSuffix(filePath) {
+ const isDir = (
+ filePath.endsWith(path__default["default"].sep) ||
+ (process.platform === "win32" && filePath.endsWith("/"))
+ );
+
+ return isDir ? "/" : "";
+}
+
+const DefaultPatterns = Object.freeze(["/**/node_modules/*"]);
+const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]);
+
+//------------------------------------------------------------------------------
+// Public
+//------------------------------------------------------------------------------
+
+class IgnorePattern {
+
+ /**
+ * The default patterns.
+ * @type {string[]}
+ */
+ static get DefaultPatterns() {
+ return DefaultPatterns;
+ }
+
+ /**
+ * Create the default predicate function.
+ * @param {string} cwd The current working directory.
+ * @returns {((filePath:string, dot:boolean) => boolean) & {basePath:string; patterns:string[]}}
+ * The preficate function.
+ * The first argument is an absolute path that is checked.
+ * The second argument is the flag to not ignore dotfiles.
+ * If the predicate function returned `true`, it means the path should be ignored.
+ */
+ static createDefaultIgnore(cwd) {
+ return this.createIgnore([new IgnorePattern(DefaultPatterns, cwd)]);
+ }
+
+ /**
+ * Create the predicate function from multiple `IgnorePattern` objects.
+ * @param {IgnorePattern[]} ignorePatterns The list of ignore patterns.
+ * @returns {((filePath:string, dot?:boolean) => boolean) & {basePath:string; patterns:string[]}}
+ * The preficate function.
+ * The first argument is an absolute path that is checked.
+ * The second argument is the flag to not ignore dotfiles.
+ * If the predicate function returned `true`, it means the path should be ignored.
+ */
+ static createIgnore(ignorePatterns) {
+ debug$3("Create with: %o", ignorePatterns);
+
+ const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));
+ const patterns = [].concat(
+ ...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))
+ );
+ const ig = ignore__default["default"]().add([...DotPatterns, ...patterns]);
+ const dotIg = ignore__default["default"]().add(patterns);
+
+ debug$3(" processed: %o", { basePath, patterns });
+
+ return Object.assign(
+ (filePath, dot = false) => {
+ assert__default["default"](path__default["default"].isAbsolute(filePath), "'filePath' should be an absolute path.");
+ const relPathRaw = relative(basePath, filePath);
+ const relPath = relPathRaw && (relPathRaw + dirSuffix(filePath));
+ const adoptedIg = dot ? dotIg : ig;
+ const result = relPath !== "" && adoptedIg.ignores(relPath);
+
+ debug$3("Check", { filePath, dot, relativePath: relPath, result });
+ return result;
+ },
+ { basePath, patterns }
+ );
+ }
+
+ /**
+ * Initialize a new `IgnorePattern` instance.
+ * @param {string[]} patterns The glob patterns that ignore to lint.
+ * @param {string} basePath The base path of `patterns`.
+ */
+ constructor(patterns, basePath) {
+ assert__default["default"](path__default["default"].isAbsolute(basePath), "'basePath' should be an absolute path.");
+
+ /**
+ * The glob patterns that ignore to lint.
+ * @type {string[]}
+ */
+ this.patterns = patterns;
+
+ /**
+ * The base path of `patterns`.
+ * @type {string}
+ */
+ this.basePath = basePath;
+
+ /**
+ * If `true` then patterns which don't start with `/` will match the paths to the outside of `basePath`. Defaults to `false`.
+ *
+ * It's set `true` for `.eslintignore`, `package.json`, and `--ignore-path` for backward compatibility.
+ * It's `false` as-is for `ignorePatterns` property in config files.
+ * @type {boolean}
+ */
+ this.loose = false;
+ }
+
+ /**
+ * Get `patterns` as modified for a given base path. It modifies the
+ * absolute paths in the patterns as prepending the difference of two base
+ * paths.
+ * @param {string} newBasePath The base path.
+ * @returns {string[]} Modifired patterns.
+ */
+ getPatternsRelativeTo(newBasePath) {
+ assert__default["default"](path__default["default"].isAbsolute(newBasePath), "'newBasePath' should be an absolute path.");
+ const { basePath, loose, patterns } = this;
+
+ if (newBasePath === basePath) {
+ return patterns;
+ }
+ const prefix = `/${relative(newBasePath, basePath)}`;
+
+ return patterns.map(pattern => {
+ const negative = pattern.startsWith("!");
+ const head = negative ? "!" : "";
+ const body = negative ? pattern.slice(1) : pattern;
+
+ if (body.startsWith("/") || body.startsWith("../")) {
+ return `${head}${prefix}${body}`;
+ }
+ return loose ? pattern : `${head}${prefix}/**/${body}`;
+ });
+ }
+}
+
+/**
+ * @fileoverview `ExtractedConfig` class.
+ *
+ * `ExtractedConfig` class expresses a final configuration for a specific file.
+ *
+ * It provides one method.
+ *
+ * - `toCompatibleObjectAsConfigFileContent()`
+ * Convert this configuration to the compatible object as the content of
+ * config files. It converts the loaded parser and plugins to strings.
+ * `CLIEngine#getConfigForFile(filePath)` method uses this method.
+ *
+ * `ConfigArray#extractConfig(filePath)` creates a `ExtractedConfig` instance.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+// For VSCode intellisense
+/** @typedef {import("../../shared/types").ConfigData} ConfigData */
+/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */
+/** @typedef {import("../../shared/types").SeverityConf} SeverityConf */
+/** @typedef {import("./config-dependency").DependentParser} DependentParser */
+/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */
+
+/**
+ * Check if `xs` starts with `ys`.
+ * @template T
+ * @param {T[]} xs The array to check.
+ * @param {T[]} ys The array that may be the first part of `xs`.
+ * @returns {boolean} `true` if `xs` starts with `ys`.
+ */
+function startsWith(xs, ys) {
+ return xs.length >= ys.length && ys.every((y, i) => y === xs[i]);
+}
+
+/**
+ * The class for extracted config data.
+ */
+class ExtractedConfig {
+ constructor() {
+
+ /**
+ * The config name what `noInlineConfig` setting came from.
+ * @type {string}
+ */
+ this.configNameOfNoInlineConfig = "";
+
+ /**
+ * Environments.
+ * @type {Record<string, boolean>}
+ */
+ this.env = {};
+
+ /**
+ * Global variables.
+ * @type {Record<string, GlobalConf>}
+ */
+ this.globals = {};
+
+ /**
+ * The glob patterns that ignore to lint.
+ * @type {(((filePath:string, dot?:boolean) => boolean) & { basePath:string; patterns:string[] }) | undefined}
+ */
+ this.ignores = void 0;
+
+ /**
+ * The flag that disables directive comments.
+ * @type {boolean|undefined}
+ */
+ this.noInlineConfig = void 0;
+
+ /**
+ * Parser definition.
+ * @type {DependentParser|null}
+ */
+ this.parser = null;
+
+ /**
+ * Options for the parser.
+ * @type {Object}
+ */
+ this.parserOptions = {};
+
+ /**
+ * Plugin definitions.
+ * @type {Record<string, DependentPlugin>}
+ */
+ this.plugins = {};
+
+ /**
+ * Processor ID.
+ * @type {string|null}
+ */
+ this.processor = null;
+
+ /**
+ * The flag that reports unused `eslint-disable` directive comments.
+ * @type {boolean|undefined}
+ */
+ this.reportUnusedDisableDirectives = void 0;
+
+ /**
+ * Rule settings.
+ * @type {Record<string, [SeverityConf, ...any[]]>}
+ */
+ this.rules = {};
+
+ /**
+ * Shared settings.
+ * @type {Object}
+ */
+ this.settings = {};
+ }
+
+ /**
+ * Convert this config to the compatible object as a config file content.
+ * @returns {ConfigData} The converted object.
+ */
+ toCompatibleObjectAsConfigFileContent() {
+ const {
+ /* eslint-disable no-unused-vars */
+ configNameOfNoInlineConfig: _ignore1,
+ processor: _ignore2,
+ /* eslint-enable no-unused-vars */
+ ignores,
+ ...config
+ } = this;
+
+ config.parser = config.parser && config.parser.filePath;
+ config.plugins = Object.keys(config.plugins).filter(Boolean).reverse();
+ config.ignorePatterns = ignores ? ignores.patterns : [];
+
+ // Strip the default patterns from `ignorePatterns`.
+ if (startsWith(config.ignorePatterns, IgnorePattern.DefaultPatterns)) {
+ config.ignorePatterns =
+ config.ignorePatterns.slice(IgnorePattern.DefaultPatterns.length);
+ }
+
+ return config;
+ }
+}
+
+/**
+ * @fileoverview `ConfigArray` class.
+ *
+ * `ConfigArray` class expresses the full of a configuration. It has the entry
+ * config file, base config files that were extended, loaded parsers, and loaded
+ * plugins.
+ *
+ * `ConfigArray` class provides three properties and two methods.
+ *
+ * - `pluginEnvironments`
+ * - `pluginProcessors`
+ * - `pluginRules`
+ * The `Map` objects that contain the members of all plugins that this
+ * config array contains. Those map objects don't have mutation methods.
+ * Those keys are the member ID such as `pluginId/memberName`.
+ * - `isRoot()`
+ * If `true` then this configuration has `root:true` property.
+ * - `extractConfig(filePath)`
+ * Extract the final configuration for a given file. This means merging
+ * every config array element which that `criteria` property matched. The
+ * `filePath` argument must be an absolute path.
+ *
+ * `ConfigArrayFactory` provides the loading logic of config files.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+// Define types for VSCode IntelliSense.
+/** @typedef {import("../../shared/types").Environment} Environment */
+/** @typedef {import("../../shared/types").GlobalConf} GlobalConf */
+/** @typedef {import("../../shared/types").RuleConf} RuleConf */
+/** @typedef {import("../../shared/types").Rule} Rule */
+/** @typedef {import("../../shared/types").Plugin} Plugin */
+/** @typedef {import("../../shared/types").Processor} Processor */
+/** @typedef {import("./config-dependency").DependentParser} DependentParser */
+/** @typedef {import("./config-dependency").DependentPlugin} DependentPlugin */
+/** @typedef {import("./override-tester")["OverrideTester"]} OverrideTester */
+
+/**
+ * @typedef {Object} ConfigArrayElement
+ * @property {string} name The name of this config element.
+ * @property {string} filePath The path to the source file of this config element.
+ * @property {InstanceType<OverrideTester>|null} criteria The tester for the `files` and `excludedFiles` of this config element.
+ * @property {Record<string, boolean>|undefined} env The environment settings.
+ * @property {Record<string, GlobalConf>|undefined} globals The global variable settings.
+ * @property {IgnorePattern|undefined} ignorePattern The ignore patterns.
+ * @property {boolean|undefined} noInlineConfig The flag that disables directive comments.
+ * @property {DependentParser|undefined} parser The parser loader.
+ * @property {Object|undefined} parserOptions The parser options.
+ * @property {Record<string, DependentPlugin>|undefined} plugins The plugin loaders.
+ * @property {string|undefined} processor The processor name to refer plugin's processor.
+ * @property {boolean|undefined} reportUnusedDisableDirectives The flag to report unused `eslint-disable` comments.
+ * @property {boolean|undefined} root The flag to express root.
+ * @property {Record<string, RuleConf>|undefined} rules The rule settings
+ * @property {Object|undefined} settings The shared settings.
+ * @property {"config" | "ignore" | "implicit-processor"} type The element type.
+ */
+
+/**
+ * @typedef {Object} ConfigArrayInternalSlots
+ * @property {Map<string, ExtractedConfig>} cache The cache to extract configs.
+ * @property {ReadonlyMap<string, Environment>|null} envMap The map from environment ID to environment definition.
+ * @property {ReadonlyMap<string, Processor>|null} processorMap The map from processor ID to environment definition.
+ * @property {ReadonlyMap<string, Rule>|null} ruleMap The map from rule ID to rule definition.
+ */
+
+/** @type {WeakMap<ConfigArray, ConfigArrayInternalSlots>} */
+const internalSlotsMap$2 = new class extends WeakMap {
+ get(key) {
+ let value = super.get(key);
+
+ if (!value) {
+ value = {
+ cache: new Map(),
+ envMap: null,
+ processorMap: null,
+ ruleMap: null
+ };
+ super.set(key, value);
+ }
+
+ return value;
+ }
+}();
+
+/**
+ * Get the indices which are matched to a given file.
+ * @param {ConfigArrayElement[]} elements The elements.
+ * @param {string} filePath The path to a target file.
+ * @returns {number[]} The indices.
+ */
+function getMatchedIndices(elements, filePath) {
+ const indices = [];
+
+ for (let i = elements.length - 1; i >= 0; --i) {
+ const element = elements[i];
+
+ if (!element.criteria || (filePath && element.criteria.test(filePath))) {
+ indices.push(i);
+ }
+ }
+
+ return indices;
+}
+
+/**
+ * Check if a value is a non-null object.
+ * @param {any} x The value to check.
+ * @returns {boolean} `true` if the value is a non-null object.
+ */
+function isNonNullObject(x) {
+ return typeof x === "object" && x !== null;
+}
+
+/**
+ * Merge two objects.
+ *
+ * Assign every property values of `y` to `x` if `x` doesn't have the property.
+ * If `x`'s property value is an object, it does recursive.
+ * @param {Object} target The destination to merge
+ * @param {Object|undefined} source The source to merge.
+ * @returns {void}
+ */
+function mergeWithoutOverwrite(target, source) {
+ if (!isNonNullObject(source)) {
+ return;
+ }
+
+ for (const key of Object.keys(source)) {
+ if (key === "__proto__") {
+ continue;
+ }
+
+ if (isNonNullObject(target[key])) {
+ mergeWithoutOverwrite(target[key], source[key]);
+ } else if (target[key] === void 0) {
+ if (isNonNullObject(source[key])) {
+ target[key] = Array.isArray(source[key]) ? [] : {};
+ mergeWithoutOverwrite(target[key], source[key]);
+ } else if (source[key] !== void 0) {
+ target[key] = source[key];
+ }
+ }
+ }
+}
+
+/**
+ * The error for plugin conflicts.
+ */
+class PluginConflictError extends Error {
+
+ /**
+ * Initialize this error object.
+ * @param {string} pluginId The plugin ID.
+ * @param {{filePath:string, importerName:string}[]} plugins The resolved plugins.
+ */
+ constructor(pluginId, plugins) {
+ super(`Plugin "${pluginId}" was conflicted between ${plugins.map(p => `"${p.importerName}"`).join(" and ")}.`);
+ this.messageTemplate = "plugin-conflict";
+ this.messageData = { pluginId, plugins };
+ }
+}
+
+/**
+ * Merge plugins.
+ * `target`'s definition is prior to `source`'s.
+ * @param {Record<string, DependentPlugin>} target The destination to merge
+ * @param {Record<string, DependentPlugin>|undefined} source The source to merge.
+ * @returns {void}
+ */
+function mergePlugins(target, source) {
+ if (!isNonNullObject(source)) {
+ return;
+ }
+
+ for (const key of Object.keys(source)) {
+ if (key === "__proto__") {
+ continue;
+ }
+ const targetValue = target[key];
+ const sourceValue = source[key];
+
+ // Adopt the plugin which was found at first.
+ if (targetValue === void 0) {
+ if (sourceValue.error) {
+ throw sourceValue.error;
+ }
+ target[key] = sourceValue;
+ } else if (sourceValue.filePath !== targetValue.filePath) {
+ throw new PluginConflictError(key, [
+ {
+ filePath: targetValue.filePath,
+ importerName: targetValue.importerName
+ },
+ {
+ filePath: sourceValue.filePath,
+ importerName: sourceValue.importerName
+ }
+ ]);
+ }
+ }
+}
+
+/**
+ * Merge rule configs.
+ * `target`'s definition is prior to `source`'s.
+ * @param {Record<string, Array>} target The destination to merge
+ * @param {Record<string, RuleConf>|undefined} source The source to merge.
+ * @returns {void}
+ */
+function mergeRuleConfigs(target, source) {
+ if (!isNonNullObject(source)) {
+ return;
+ }
+
+ for (const key of Object.keys(source)) {
+ if (key === "__proto__") {
+ continue;
+ }
+ const targetDef = target[key];
+ const sourceDef = source[key];
+
+ // Adopt the rule config which was found at first.
+ if (targetDef === void 0) {
+ if (Array.isArray(sourceDef)) {
+ target[key] = [...sourceDef];
+ } else {
+ target[key] = [sourceDef];
+ }
+
+ /*
+ * If the first found rule config is severity only and the current rule
+ * config has options, merge the severity and the options.
+ */
+ } else if (
+ targetDef.length === 1 &&
+ Array.isArray(sourceDef) &&
+ sourceDef.length >= 2
+ ) {
+ targetDef.push(...sourceDef.slice(1));
+ }
+ }
+}
+
+/**
+ * Create the extracted config.
+ * @param {ConfigArray} instance The config elements.
+ * @param {number[]} indices The indices to use.
+ * @returns {ExtractedConfig} The extracted config.
+ */
+function createConfig(instance, indices) {
+ const config = new ExtractedConfig();
+ const ignorePatterns = [];
+
+ // Merge elements.
+ for (const index of indices) {
+ const element = instance[index];
+
+ // Adopt the parser which was found at first.
+ if (!config.parser && element.parser) {
+ if (element.parser.error) {
+ throw element.parser.error;
+ }
+ config.parser = element.parser;
+ }
+
+ // Adopt the processor which was found at first.
+ if (!config.processor && element.processor) {
+ config.processor = element.processor;
+ }
+
+ // Adopt the noInlineConfig which was found at first.
+ if (config.noInlineConfig === void 0 && element.noInlineConfig !== void 0) {
+ config.noInlineConfig = element.noInlineConfig;
+ config.configNameOfNoInlineConfig = element.name;
+ }
+
+ // Adopt the reportUnusedDisableDirectives which was found at first.
+ if (config.reportUnusedDisableDirectives === void 0 && element.reportUnusedDisableDirectives !== void 0) {
+ config.reportUnusedDisableDirectives = element.reportUnusedDisableDirectives;
+ }
+
+ // Collect ignorePatterns
+ if (element.ignorePattern) {
+ ignorePatterns.push(element.ignorePattern);
+ }
+
+ // Merge others.
+ mergeWithoutOverwrite(config.env, element.env);
+ mergeWithoutOverwrite(config.globals, element.globals);
+ mergeWithoutOverwrite(config.parserOptions, element.parserOptions);
+ mergeWithoutOverwrite(config.settings, element.settings);
+ mergePlugins(config.plugins, element.plugins);
+ mergeRuleConfigs(config.rules, element.rules);
+ }
+
+ // Create the predicate function for ignore patterns.
+ if (ignorePatterns.length > 0) {
+ config.ignores = IgnorePattern.createIgnore(ignorePatterns.reverse());
+ }
+
+ return config;
+}
+
+/**
+ * Collect definitions.
+ * @template T, U
+ * @param {string} pluginId The plugin ID for prefix.
+ * @param {Record<string,T>} defs The definitions to collect.
+ * @param {Map<string, U>} map The map to output.
+ * @param {function(T): U} [normalize] The normalize function for each value.
+ * @returns {void}
+ */
+function collect(pluginId, defs, map, normalize) {
+ if (defs) {
+ const prefix = pluginId && `${pluginId}/`;
+
+ for (const [key, value] of Object.entries(defs)) {
+ map.set(
+ `${prefix}${key}`,
+ normalize ? normalize(value) : value
+ );
+ }
+ }
+}
+
+/**
+ * Normalize a rule definition.
+ * @param {Function|Rule} rule The rule definition to normalize.
+ * @returns {Rule} The normalized rule definition.
+ */
+function normalizePluginRule(rule) {
+ return typeof rule === "function" ? { create: rule } : rule;
+}
+
+/**
+ * Delete the mutation methods from a given map.
+ * @param {Map<any, any>} map The map object to delete.
+ * @returns {void}
+ */
+function deleteMutationMethods(map) {
+ Object.defineProperties(map, {
+ clear: { configurable: true, value: void 0 },
+ delete: { configurable: true, value: void 0 },
+ set: { configurable: true, value: void 0 }
+ });
+}
+
+/**
+ * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.
+ * @param {ConfigArrayElement[]} elements The config elements.
+ * @param {ConfigArrayInternalSlots} slots The internal slots.
+ * @returns {void}
+ */
+function initPluginMemberMaps(elements, slots) {
+ const processed = new Set();
+
+ slots.envMap = new Map();
+ slots.processorMap = new Map();
+ slots.ruleMap = new Map();
+
+ for (const element of elements) {
+ if (!element.plugins) {
+ continue;
+ }
+
+ for (const [pluginId, value] of Object.entries(element.plugins)) {
+ const plugin = value.definition;
+
+ if (!plugin || processed.has(pluginId)) {
+ continue;
+ }
+ processed.add(pluginId);
+
+ collect(pluginId, plugin.environments, slots.envMap);
+ collect(pluginId, plugin.processors, slots.processorMap);
+ collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);
+ }
+ }
+
+ deleteMutationMethods(slots.envMap);
+ deleteMutationMethods(slots.processorMap);
+ deleteMutationMethods(slots.ruleMap);
+}
+
+/**
+ * Create `envMap`, `processorMap`, `ruleMap` with the plugins in the config array.
+ * @param {ConfigArray} instance The config elements.
+ * @returns {ConfigArrayInternalSlots} The extracted config.
+ */
+function ensurePluginMemberMaps(instance) {
+ const slots = internalSlotsMap$2.get(instance);
+
+ if (!slots.ruleMap) {
+ initPluginMemberMaps(instance, slots);
+ }
+
+ return slots;
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * The Config Array.
+ *
+ * `ConfigArray` instance contains all settings, parsers, and plugins.
+ * You need to call `ConfigArray#extractConfig(filePath)` method in order to
+ * extract, merge and get only the config data which is related to an arbitrary
+ * file.
+ * @extends {Array<ConfigArrayElement>}
+ */
+class ConfigArray extends Array {
+
+ /**
+ * Get the plugin environments.
+ * The returned map cannot be mutated.
+ * @type {ReadonlyMap<string, Environment>} The plugin environments.
+ */
+ get pluginEnvironments() {
+ return ensurePluginMemberMaps(this).envMap;
+ }
+
+ /**
+ * Get the plugin processors.
+ * The returned map cannot be mutated.
+ * @type {ReadonlyMap<string, Processor>} The plugin processors.
+ */
+ get pluginProcessors() {
+ return ensurePluginMemberMaps(this).processorMap;
+ }
+
+ /**
+ * Get the plugin rules.
+ * The returned map cannot be mutated.
+ * @returns {ReadonlyMap<string, Rule>} The plugin rules.
+ */
+ get pluginRules() {
+ return ensurePluginMemberMaps(this).ruleMap;
+ }
+
+ /**
+ * Check if this config has `root` flag.
+ * @returns {boolean} `true` if this config array is root.
+ */
+ isRoot() {
+ for (let i = this.length - 1; i >= 0; --i) {
+ const root = this[i].root;
+
+ if (typeof root === "boolean") {
+ return root;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Extract the config data which is related to a given file.
+ * @param {string} filePath The absolute path to the target file.
+ * @returns {ExtractedConfig} The extracted config data.
+ */
+ extractConfig(filePath) {
+ const { cache } = internalSlotsMap$2.get(this);
+ const indices = getMatchedIndices(this, filePath);
+ const cacheKey = indices.join(",");
+
+ if (!cache.has(cacheKey)) {
+ cache.set(cacheKey, createConfig(this, indices));
+ }
+
+ return cache.get(cacheKey);
+ }
+
+ /**
+ * Check if a given path is an additional lint target.
+ * @param {string} filePath The absolute path to the target file.
+ * @returns {boolean} `true` if the file is an additional lint target.
+ */
+ isAdditionalTargetPath(filePath) {
+ for (const { criteria, type } of this) {
+ if (
+ type === "config" &&
+ criteria &&
+ !criteria.endsWithWildcard &&
+ criteria.test(filePath)
+ ) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+/**
+ * Get the used extracted configs.
+ * CLIEngine will use this method to collect used deprecated rules.
+ * @param {ConfigArray} instance The config array object to get.
+ * @returns {ExtractedConfig[]} The used extracted configs.
+ * @private
+ */
+function getUsedExtractedConfigs(instance) {
+ const { cache } = internalSlotsMap$2.get(instance);
+
+ return Array.from(cache.values());
+}
+
+/**
+ * @fileoverview `ConfigDependency` class.
+ *
+ * `ConfigDependency` class expresses a loaded parser or plugin.
+ *
+ * If the parser or plugin was loaded successfully, it has `definition` property
+ * and `filePath` property. Otherwise, it has `error` property.
+ *
+ * When `JSON.stringify()` converted a `ConfigDependency` object to a JSON, it
+ * omits `definition` property.
+ *
+ * `ConfigArrayFactory` creates `ConfigDependency` objects when it loads parsers
+ * or plugins.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+/**
+ * The class is to store parsers or plugins.
+ * This class hides the loaded object from `JSON.stringify()` and `console.log`.
+ * @template T
+ */
+class ConfigDependency {
+
+ /**
+ * Initialize this instance.
+ * @param {Object} data The dependency data.
+ * @param {T} [data.definition] The dependency if the loading succeeded.
+ * @param {Error} [data.error] The error object if the loading failed.
+ * @param {string} [data.filePath] The actual path to the dependency if the loading succeeded.
+ * @param {string} data.id The ID of this dependency.
+ * @param {string} data.importerName The name of the config file which loads this dependency.
+ * @param {string} data.importerPath The path to the config file which loads this dependency.
+ */
+ constructor({
+ definition = null,
+ error = null,
+ filePath = null,
+ id,
+ importerName,
+ importerPath
+ }) {
+
+ /**
+ * The loaded dependency if the loading succeeded.
+ * @type {T|null}
+ */
+ this.definition = definition;
+
+ /**
+ * The error object if the loading failed.
+ * @type {Error|null}
+ */
+ this.error = error;
+
+ /**
+ * The loaded dependency if the loading succeeded.
+ * @type {string|null}
+ */
+ this.filePath = filePath;
+
+ /**
+ * The ID of this dependency.
+ * @type {string}
+ */
+ this.id = id;
+
+ /**
+ * The name of the config file which loads this dependency.
+ * @type {string}
+ */
+ this.importerName = importerName;
+
+ /**
+ * The path to the config file which loads this dependency.
+ * @type {string}
+ */
+ this.importerPath = importerPath;
+ }
+
+ // eslint-disable-next-line jsdoc/require-description
+ /**
+ * @returns {Object} a JSON compatible object.
+ */
+ toJSON() {
+ const obj = this[util__default["default"].inspect.custom]();
+
+ // Display `error.message` (`Error#message` is unenumerable).
+ if (obj.error instanceof Error) {
+ obj.error = { ...obj.error, message: obj.error.message };
+ }
+
+ return obj;
+ }
+
+ // eslint-disable-next-line jsdoc/require-description
+ /**
+ * @returns {Object} an object to display by `console.log()`.
+ */
+ [util__default["default"].inspect.custom]() {
+ const {
+ definition: _ignore, // eslint-disable-line no-unused-vars
+ ...obj
+ } = this;
+
+ return obj;
+ }
+}
+
+/**
+ * @fileoverview `OverrideTester` class.
+ *
+ * `OverrideTester` class handles `files` property and `excludedFiles` property
+ * of `overrides` config.
+ *
+ * It provides one method.
+ *
+ * - `test(filePath)`
+ * Test if a file path matches the pair of `files` property and
+ * `excludedFiles` property. The `filePath` argument must be an absolute
+ * path.
+ *
+ * `ConfigArrayFactory` creates `OverrideTester` objects when it processes
+ * `overrides` properties.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+const { Minimatch } = minimatch__default["default"];
+
+const minimatchOpts = { dot: true, matchBase: true };
+
+/**
+ * @typedef {Object} Pattern
+ * @property {InstanceType<Minimatch>[] | null} includes The positive matchers.
+ * @property {InstanceType<Minimatch>[] | null} excludes The negative matchers.
+ */
+
+/**
+ * Normalize a given pattern to an array.
+ * @param {string|string[]|undefined} patterns A glob pattern or an array of glob patterns.
+ * @returns {string[]|null} Normalized patterns.
+ * @private
+ */
+function normalizePatterns(patterns) {
+ if (Array.isArray(patterns)) {
+ return patterns.filter(Boolean);
+ }
+ if (typeof patterns === "string" && patterns) {
+ return [patterns];
+ }
+ return [];
+}
+
+/**
+ * Create the matchers of given patterns.
+ * @param {string[]} patterns The patterns.
+ * @returns {InstanceType<Minimatch>[] | null} The matchers.
+ */
+function toMatcher(patterns) {
+ if (patterns.length === 0) {
+ return null;
+ }
+ return patterns.map(pattern => {
+ if (/^\.[/\\]/u.test(pattern)) {
+ return new Minimatch(
+ pattern.slice(2),
+
+ // `./*.js` should not match with `subdir/foo.js`
+ { ...minimatchOpts, matchBase: false }
+ );
+ }
+ return new Minimatch(pattern, minimatchOpts);
+ });
+}
+
+/**
+ * Convert a given matcher to string.
+ * @param {Pattern} matchers The matchers.
+ * @returns {string} The string expression of the matcher.
+ */
+function patternToJson({ includes, excludes }) {
+ return {
+ includes: includes && includes.map(m => m.pattern),
+ excludes: excludes && excludes.map(m => m.pattern)
+ };
+}
+
+/**
+ * The class to test given paths are matched by the patterns.
+ */
+class OverrideTester {
+
+ /**
+ * Create a tester with given criteria.
+ * If there are no criteria, returns `null`.
+ * @param {string|string[]} files The glob patterns for included files.
+ * @param {string|string[]} excludedFiles The glob patterns for excluded files.
+ * @param {string} basePath The path to the base directory to test paths.
+ * @returns {OverrideTester|null} The created instance or `null`.
+ */
+ static create(files, excludedFiles, basePath) {
+ const includePatterns = normalizePatterns(files);
+ const excludePatterns = normalizePatterns(excludedFiles);
+ let endsWithWildcard = false;
+
+ if (includePatterns.length === 0) {
+ return null;
+ }
+
+ // Rejects absolute paths or relative paths to parents.
+ for (const pattern of includePatterns) {
+ if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) {
+ throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);
+ }
+ if (pattern.endsWith("*")) {
+ endsWithWildcard = true;
+ }
+ }
+ for (const pattern of excludePatterns) {
+ if (path__default["default"].isAbsolute(pattern) || pattern.includes("..")) {
+ throw new Error(`Invalid override pattern (expected relative path not containing '..'): ${pattern}`);
+ }
+ }
+
+ const includes = toMatcher(includePatterns);
+ const excludes = toMatcher(excludePatterns);
+
+ return new OverrideTester(
+ [{ includes, excludes }],
+ basePath,
+ endsWithWildcard
+ );
+ }
+
+ /**
+ * Combine two testers by logical and.
+ * If either of the testers was `null`, returns the other tester.
+ * The `basePath` property of the two must be the same value.
+ * @param {OverrideTester|null} a A tester.
+ * @param {OverrideTester|null} b Another tester.
+ * @returns {OverrideTester|null} Combined tester.
+ */
+ static and(a, b) {
+ if (!b) {
+ return a && new OverrideTester(
+ a.patterns,
+ a.basePath,
+ a.endsWithWildcard
+ );
+ }
+ if (!a) {
+ return new OverrideTester(
+ b.patterns,
+ b.basePath,
+ b.endsWithWildcard
+ );
+ }
+
+ assert__default["default"].strictEqual(a.basePath, b.basePath);
+ return new OverrideTester(
+ a.patterns.concat(b.patterns),
+ a.basePath,
+ a.endsWithWildcard || b.endsWithWildcard
+ );
+ }
+
+ /**
+ * Initialize this instance.
+ * @param {Pattern[]} patterns The matchers.
+ * @param {string} basePath The base path.
+ * @param {boolean} endsWithWildcard If `true` then a pattern ends with `*`.
+ */
+ constructor(patterns, basePath, endsWithWildcard = false) {
+
+ /** @type {Pattern[]} */
+ this.patterns = patterns;
+
+ /** @type {string} */
+ this.basePath = basePath;
+
+ /** @type {boolean} */
+ this.endsWithWildcard = endsWithWildcard;
+ }
+
+ /**
+ * Test if a given path is matched or not.
+ * @param {string} filePath The absolute path to the target file.
+ * @returns {boolean} `true` if the path was matched.
+ */
+ test(filePath) {
+ if (typeof filePath !== "string" || !path__default["default"].isAbsolute(filePath)) {
+ throw new Error(`'filePath' should be an absolute path, but got ${filePath}.`);
+ }
+ const relativePath = path__default["default"].relative(this.basePath, filePath);
+
+ return this.patterns.every(({ includes, excludes }) => (
+ (!includes || includes.some(m => m.match(relativePath))) &&
+ (!excludes || !excludes.some(m => m.match(relativePath)))
+ ));
+ }
+
+ // eslint-disable-next-line jsdoc/require-description
+ /**
+ * @returns {Object} a JSON compatible object.
+ */
+ toJSON() {
+ if (this.patterns.length === 1) {
+ return {
+ ...patternToJson(this.patterns[0]),
+ basePath: this.basePath
+ };
+ }
+ return {
+ AND: this.patterns.map(patternToJson),
+ basePath: this.basePath
+ };
+ }
+
+ // eslint-disable-next-line jsdoc/require-description
+ /**
+ * @returns {Object} an object to display by `console.log()`.
+ */
+ [util__default["default"].inspect.custom]() {
+ return this.toJSON();
+ }
+}
+
+/**
+ * @fileoverview `ConfigArray` class.
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+/**
+ * @fileoverview The factory of `ConfigArray` objects.
+ *
+ * This class provides methods to create `ConfigArray` instance.
+ *
+ * - `create(configData, options)`
+ * Create a `ConfigArray` instance from a config data. This is to handle CLI
+ * options except `--config`.
+ * - `loadFile(filePath, options)`
+ * Create a `ConfigArray` instance from a config file. This is to handle
+ * `--config` option. If the file was not found, throws the following error:
+ * - If the filename was `*.js`, a `MODULE_NOT_FOUND` error.
+ * - If the filename was `package.json`, an IO error or an
+ * `ESLINT_CONFIG_FIELD_NOT_FOUND` error.
+ * - Otherwise, an IO error such as `ENOENT`.
+ * - `loadInDirectory(directoryPath, options)`
+ * Create a `ConfigArray` instance from a config file which is on a given
+ * directory. This tries to load `.eslintrc.*` or `package.json`. If not
+ * found, returns an empty `ConfigArray`.
+ * - `loadESLintIgnore(filePath)`
+ * Create a `ConfigArray` instance from a config file that is `.eslintignore`
+ * format. This is to handle `--ignore-path` option.
+ * - `loadDefaultESLintIgnore()`
+ * Create a `ConfigArray` instance from `.eslintignore` or `package.json` in
+ * the current working directory.
+ *
+ * `ConfigArrayFactory` class has the responsibility that loads configuration
+ * files, including loading `extends`, `parser`, and `plugins`. The created
+ * `ConfigArray` instance has the loaded `extends`, `parser`, and `plugins`.
+ *
+ * But this class doesn't handle cascading. `CascadingConfigArrayFactory` class
+ * handles cascading and hierarchy.
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+const require$1 = Module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('eslintrc.cjs', document.baseURI).href)));
+
+const debug$2 = debugOrig__default["default"]("eslintrc:config-array-factory");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const configFilenames = [
+ ".eslintrc.js",
+ ".eslintrc.cjs",
+ ".eslintrc.yaml",
+ ".eslintrc.yml",
+ ".eslintrc.json",
+ ".eslintrc",
+ "package.json"
+];
+
+// Define types for VSCode IntelliSense.
+/** @typedef {import("./shared/types").ConfigData} ConfigData */
+/** @typedef {import("./shared/types").OverrideConfigData} OverrideConfigData */
+/** @typedef {import("./shared/types").Parser} Parser */
+/** @typedef {import("./shared/types").Plugin} Plugin */
+/** @typedef {import("./shared/types").Rule} Rule */
+/** @typedef {import("./config-array/config-dependency").DependentParser} DependentParser */
+/** @typedef {import("./config-array/config-dependency").DependentPlugin} DependentPlugin */
+/** @typedef {ConfigArray[0]} ConfigArrayElement */
+
+/**
+ * @typedef {Object} ConfigArrayFactoryOptions
+ * @property {Map<string,Plugin>} [additionalPluginPool] The map for additional plugins.
+ * @property {string} [cwd] The path to the current working directory.
+ * @property {string} [resolvePluginsRelativeTo] A path to the directory that plugins should be resolved from. Defaults to `cwd`.
+ * @property {Map<string,Rule>} 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 {string} eslintRecommendedPath The path to the definitions for eslint:recommended.
+ */
+
+/**
+ * @typedef {Object} ConfigArrayFactoryInternalSlots
+ * @property {Map<string,Plugin>} additionalPluginPool The map for additional plugins.
+ * @property {string} cwd The path to the current working directory.
+ * @property {string | undefined} resolvePluginsRelativeTo An absolute path the the directory that plugins should be resolved from.
+ * @property {Map<string,Rule>} 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 {string} eslintRecommendedPath The path to the definitions for eslint:recommended.
+ */
+
+/**
+ * @typedef {Object} ConfigArrayFactoryLoadingContext
+ * @property {string} filePath The path to the current configuration.
+ * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
+ * @property {string} name The name of the current configuration.
+ * @property {string} pluginBasePath The base path to resolve plugins.
+ * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors.
+ */
+
+/**
+ * @typedef {Object} ConfigArrayFactoryLoadingContext
+ * @property {string} filePath The path to the current configuration.
+ * @property {string} matchBasePath The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
+ * @property {string} name The name of the current configuration.
+ * @property {"config" | "ignore" | "implicit-processor"} type The type of the current configuration. This is `"config"` in normal. This is `"ignore"` if it came from `.eslintignore`. This is `"implicit-processor"` if it came from legacy file-extension processors.
+ */
+
+/** @type {WeakMap<ConfigArrayFactory, ConfigArrayFactoryInternalSlots>} */
+const internalSlotsMap$1 = new WeakMap();
+
+/**
+ * Check if a given string is a file path.
+ * @param {string} nameOrPath A module name or file path.
+ * @returns {boolean} `true` if the `nameOrPath` is a file path.
+ */
+function isFilePath(nameOrPath) {
+ return (
+ /^\.{1,2}[/\\]/u.test(nameOrPath) ||
+ path__default["default"].isAbsolute(nameOrPath)
+ );
+}
+
+/**
+ * Convenience wrapper for synchronously reading file contents.
+ * @param {string} filePath The filename to read.
+ * @returns {string} The file contents, with the BOM removed.
+ * @private
+ */
+function readFile(filePath) {
+ return fs__default["default"].readFileSync(filePath, "utf8").replace(/^\ufeff/u, "");
+}
+
+/**
+ * Loads a YAML configuration from a file.
+ * @param {string} filePath The filename to load.
+ * @returns {ConfigData} The configuration object from the file.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+function loadYAMLConfigFile(filePath) {
+ debug$2(`Loading YAML config file: ${filePath}`);
+
+ // lazy load YAML to improve performance when not used
+ const yaml = require$1("js-yaml");
+
+ try {
+
+ // empty YAML file can be null, so always use
+ return yaml.safeLoad(readFile(filePath)) || {};
+ } catch (e) {
+ debug$2(`Error reading YAML file: ${filePath}`);
+ e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
+ throw e;
+ }
+}
+
+/**
+ * Loads a JSON configuration from a file.
+ * @param {string} filePath The filename to load.
+ * @returns {ConfigData} The configuration object from the file.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+function loadJSONConfigFile(filePath) {
+ debug$2(`Loading JSON config file: ${filePath}`);
+
+ try {
+ return JSON.parse(stripComments__default["default"](readFile(filePath)));
+ } catch (e) {
+ debug$2(`Error reading JSON file: ${filePath}`);
+ e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
+ e.messageTemplate = "failed-to-read-json";
+ e.messageData = {
+ path: filePath,
+ message: e.message
+ };
+ throw e;
+ }
+}
+
+/**
+ * Loads a legacy (.eslintrc) configuration from a file.
+ * @param {string} filePath The filename to load.
+ * @returns {ConfigData} The configuration object from the file.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+function loadLegacyConfigFile(filePath) {
+ debug$2(`Loading legacy config file: ${filePath}`);
+
+ // lazy load YAML to improve performance when not used
+ const yaml = require$1("js-yaml");
+
+ try {
+ return yaml.safeLoad(stripComments__default["default"](readFile(filePath))) || /* istanbul ignore next */ {};
+ } catch (e) {
+ debug$2("Error reading YAML file: %s\n%o", filePath, e);
+ e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
+ throw e;
+ }
+}
+
+/**
+ * Loads a JavaScript configuration from a file.
+ * @param {string} filePath The filename to load.
+ * @returns {ConfigData} The configuration object from the file.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+function loadJSConfigFile(filePath) {
+ debug$2(`Loading JS config file: ${filePath}`);
+ try {
+ return importFresh__default["default"](filePath);
+ } catch (e) {
+ debug$2(`Error reading JavaScript file: ${filePath}`);
+ e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
+ throw e;
+ }
+}
+
+/**
+ * Loads a configuration from a package.json file.
+ * @param {string} filePath The filename to load.
+ * @returns {ConfigData} The configuration object from the file.
+ * @throws {Error} If the file cannot be read.
+ * @private
+ */
+function loadPackageJSONConfigFile(filePath) {
+ debug$2(`Loading package.json config file: ${filePath}`);
+ try {
+ const packageData = loadJSONConfigFile(filePath);
+
+ if (!Object.hasOwnProperty.call(packageData, "eslintConfig")) {
+ throw Object.assign(
+ new Error("package.json file doesn't have 'eslintConfig' field."),
+ { code: "ESLINT_CONFIG_FIELD_NOT_FOUND" }
+ );
+ }
+
+ return packageData.eslintConfig;
+ } catch (e) {
+ debug$2(`Error reading package.json file: ${filePath}`);
+ e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
+ throw e;
+ }
+}
+
+/**
+ * Loads a `.eslintignore` from a file.
+ * @param {string} filePath The filename to load.
+ * @returns {string[]} The ignore patterns from the file.
+ * @private
+ */
+function loadESLintIgnoreFile(filePath) {
+ debug$2(`Loading .eslintignore file: ${filePath}`);
+
+ try {
+ return readFile(filePath)
+ .split(/\r?\n/gu)
+ .filter(line => line.trim() !== "" && !line.startsWith("#"));
+ } catch (e) {
+ debug$2(`Error reading .eslintignore file: ${filePath}`);
+ e.message = `Cannot read .eslintignore file: ${filePath}\nError: ${e.message}`;
+ throw e;
+ }
+}
+
+/**
+ * Creates an error to notify about a missing config to extend from.
+ * @param {string} configName The name of the missing config.
+ * @param {string} importerName The name of the config that imported the missing config
+ * @param {string} messageTemplate The text template to source error strings from.
+ * @returns {Error} The error object to throw
+ * @private
+ */
+function configInvalidError(configName, importerName, messageTemplate) {
+ return Object.assign(
+ new Error(`Failed to load config "${configName}" to extend from.`),
+ {
+ messageTemplate,
+ messageData: { configName, importerName }
+ }
+ );
+}
+
+/**
+ * Loads a configuration file regardless of the source. Inspects the file path
+ * to determine the correctly way to load the config file.
+ * @param {string} filePath The path to the configuration.
+ * @returns {ConfigData|null} The configuration information.
+ * @private
+ */
+function loadConfigFile(filePath) {
+ switch (path__default["default"].extname(filePath)) {
+ case ".js":
+ case ".cjs":
+ return loadJSConfigFile(filePath);
+
+ case ".json":
+ if (path__default["default"].basename(filePath) === "package.json") {
+ return loadPackageJSONConfigFile(filePath);
+ }
+ return loadJSONConfigFile(filePath);
+
+ case ".yaml":
+ case ".yml":
+ return loadYAMLConfigFile(filePath);
+
+ default:
+ return loadLegacyConfigFile(filePath);
+ }
+}
+
+/**
+ * Write debug log.
+ * @param {string} request The requested module name.
+ * @param {string} relativeTo The file path to resolve the request relative to.
+ * @param {string} filePath The resolved file path.
+ * @returns {void}
+ */
+function writeDebugLogForLoading(request, relativeTo, filePath) {
+ /* istanbul ignore next */
+ if (debug$2.enabled) {
+ let nameAndVersion = null;
+
+ try {
+ const packageJsonPath = resolve(
+ `${request}/package.json`,
+ relativeTo
+ );
+ const { version = "unknown" } = require$1(packageJsonPath);
+
+ nameAndVersion = `${request}@${version}`;
+ } catch (error) {
+ debug$2("package.json was not found:", error.message);
+ nameAndVersion = request;
+ }
+
+ debug$2("Loaded: %s (%s)", nameAndVersion, filePath);
+ }
+}
+
+/**
+ * Create a new context with default values.
+ * @param {ConfigArrayFactoryInternalSlots} slots The internal slots.
+ * @param {"config" | "ignore" | "implicit-processor" | undefined} providedType The type of the current configuration. Default is `"config"`.
+ * @param {string | undefined} providedName The name of the current configuration. Default is the relative path from `cwd` to `filePath`.
+ * @param {string | undefined} providedFilePath The path to the current configuration. Default is empty string.
+ * @param {string | undefined} providedMatchBasePath The type of the current configuration. Default is the directory of `filePath` or `cwd`.
+ * @returns {ConfigArrayFactoryLoadingContext} The created context.
+ */
+function createContext(
+ { cwd, resolvePluginsRelativeTo },
+ providedType,
+ providedName,
+ providedFilePath,
+ providedMatchBasePath
+) {
+ const filePath = providedFilePath
+ ? path__default["default"].resolve(cwd, providedFilePath)
+ : "";
+ const matchBasePath =
+ (providedMatchBasePath && path__default["default"].resolve(cwd, providedMatchBasePath)) ||
+ (filePath && path__default["default"].dirname(filePath)) ||
+ cwd;
+ const name =
+ providedName ||
+ (filePath && path__default["default"].relative(cwd, filePath)) ||
+ "";
+ const pluginBasePath =
+ resolvePluginsRelativeTo ||
+ (filePath && path__default["default"].dirname(filePath)) ||
+ cwd;
+ const type = providedType || "config";
+
+ return { filePath, matchBasePath, name, pluginBasePath, type };
+}
+
+/**
+ * Normalize a given plugin.
+ * - Ensure the object to have four properties: configs, environments, processors, and rules.
+ * - Ensure the object to not have other properties.
+ * @param {Plugin} plugin The plugin to normalize.
+ * @returns {Plugin} The normalized plugin.
+ */
+function normalizePlugin(plugin) {
+ return {
+ configs: plugin.configs || {},
+ environments: plugin.environments || {},
+ processors: plugin.processors || {},
+ rules: plugin.rules || {}
+ };
+}
+
+//------------------------------------------------------------------------------
+// Public Interface
+//------------------------------------------------------------------------------
+
+/**
+ * The factory of `ConfigArray` objects.
+ */
+class ConfigArrayFactory {
+
+ /**
+ * Initialize this instance.
+ * @param {ConfigArrayFactoryOptions} [options] The map for additional plugins.
+ */
+ constructor({
+ additionalPluginPool = new Map(),
+ cwd = process.cwd(),
+ resolvePluginsRelativeTo,
+ builtInRules,
+ resolver = ModuleResolver,
+ eslintAllPath,
+ eslintRecommendedPath
+ } = {}) {
+ internalSlotsMap$1.set(this, {
+ additionalPluginPool,
+ cwd,
+ resolvePluginsRelativeTo:
+ resolvePluginsRelativeTo &&
+ path__default["default"].resolve(cwd, resolvePluginsRelativeTo),
+ builtInRules,
+ resolver,
+ eslintAllPath,
+ eslintRecommendedPath
+ });
+ }
+
+ /**
+ * Create `ConfigArray` instance from a config data.
+ * @param {ConfigData|null} configData The config data to create.
+ * @param {Object} [options] The options.
+ * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
+ * @param {string} [options.filePath] The path to this config data.
+ * @param {string} [options.name] The config name.
+ * @returns {ConfigArray} Loaded config.
+ */
+ create(configData, { basePath, filePath, name } = {}) {
+ if (!configData) {
+ return new ConfigArray();
+ }
+
+ const slots = internalSlotsMap$1.get(this);
+ const ctx = createContext(slots, "config", name, filePath, basePath);
+ const elements = this._normalizeConfigData(configData, ctx);
+
+ return new ConfigArray(...elements);
+ }
+
+ /**
+ * Load a config file.
+ * @param {string} filePath The path to a config file.
+ * @param {Object} [options] The options.
+ * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
+ * @param {string} [options.name] The config name.
+ * @returns {ConfigArray} Loaded config.
+ */
+ loadFile(filePath, { basePath, name } = {}) {
+ const slots = internalSlotsMap$1.get(this);
+ const ctx = createContext(slots, "config", name, filePath, basePath);
+
+ return new ConfigArray(...this._loadConfigData(ctx));
+ }
+
+ /**
+ * Load the config file on a given directory if exists.
+ * @param {string} directoryPath The path to a directory.
+ * @param {Object} [options] The options.
+ * @param {string} [options.basePath] The base path to resolve relative paths in `overrides[].files`, `overrides[].excludedFiles`, and `ignorePatterns`.
+ * @param {string} [options.name] The config name.
+ * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
+ */
+ loadInDirectory(directoryPath, { basePath, name } = {}) {
+ const slots = internalSlotsMap$1.get(this);
+
+ for (const filename of configFilenames) {
+ const ctx = createContext(
+ slots,
+ "config",
+ name,
+ path__default["default"].join(directoryPath, filename),
+ basePath
+ );
+
+ if (fs__default["default"].existsSync(ctx.filePath) && fs__default["default"].statSync(ctx.filePath).isFile()) {
+ let configData;
+
+ try {
+ configData = loadConfigFile(ctx.filePath);
+ } catch (error) {
+ if (!error || error.code !== "ESLINT_CONFIG_FIELD_NOT_FOUND") {
+ throw error;
+ }
+ }
+
+ if (configData) {
+ debug$2(`Config file found: ${ctx.filePath}`);
+ return new ConfigArray(
+ ...this._normalizeConfigData(configData, ctx)
+ );
+ }
+ }
+ }
+
+ debug$2(`Config file not found on ${directoryPath}`);
+ return new ConfigArray();
+ }
+
+ /**
+ * Check if a config file on a given directory exists or not.
+ * @param {string} directoryPath The path to a directory.
+ * @returns {string | null} The path to the found config file. If not found then null.
+ */
+ static getPathToConfigFileInDirectory(directoryPath) {
+ for (const filename of configFilenames) {
+ const filePath = path__default["default"].join(directoryPath, filename);
+
+ if (fs__default["default"].existsSync(filePath)) {
+ if (filename === "package.json") {
+ try {
+ loadPackageJSONConfigFile(filePath);
+ return filePath;
+ } catch { /* ignore */ }
+ } else {
+ return filePath;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Load `.eslintignore` file.
+ * @param {string} filePath The path to a `.eslintignore` file to load.
+ * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
+ */
+ loadESLintIgnore(filePath) {
+ const slots = internalSlotsMap$1.get(this);
+ const ctx = createContext(
+ slots,
+ "ignore",
+ void 0,
+ filePath,
+ slots.cwd
+ );
+ const ignorePatterns = loadESLintIgnoreFile(ctx.filePath);
+
+ return new ConfigArray(
+ ...this._normalizeESLintIgnoreData(ignorePatterns, ctx)
+ );
+ }
+
+ /**
+ * Load `.eslintignore` file in the current working directory.
+ * @returns {ConfigArray} Loaded config. An empty `ConfigArray` if any config doesn't exist.
+ */
+ loadDefaultESLintIgnore() {
+ const slots = internalSlotsMap$1.get(this);
+ const eslintIgnorePath = path__default["default"].resolve(slots.cwd, ".eslintignore");
+ const packageJsonPath = path__default["default"].resolve(slots.cwd, "package.json");
+
+ if (fs__default["default"].existsSync(eslintIgnorePath)) {
+ return this.loadESLintIgnore(eslintIgnorePath);
+ }
+ if (fs__default["default"].existsSync(packageJsonPath)) {
+ const data = loadJSONConfigFile(packageJsonPath);
+
+ if (Object.hasOwnProperty.call(data, "eslintIgnore")) {
+ if (!Array.isArray(data.eslintIgnore)) {
+ throw new Error("Package.json eslintIgnore property requires an array of paths");
+ }
+ const ctx = createContext(
+ slots,
+ "ignore",
+ "eslintIgnore in package.json",
+ packageJsonPath,
+ slots.cwd
+ );
+
+ return new ConfigArray(
+ ...this._normalizeESLintIgnoreData(data.eslintIgnore, ctx)
+ );
+ }
+ }
+
+ return new ConfigArray();
+ }
+
+ /**
+ * Load a given config file.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} Loaded config.
+ * @private
+ */
+ _loadConfigData(ctx) {
+ return this._normalizeConfigData(loadConfigFile(ctx.filePath), ctx);
+ }
+
+ /**
+ * Normalize a given `.eslintignore` data to config array elements.
+ * @param {string[]} ignorePatterns The patterns to ignore files.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ *_normalizeESLintIgnoreData(ignorePatterns, ctx) {
+ const elements = this._normalizeObjectConfigData(
+ { ignorePatterns },
+ ctx
+ );
+
+ // Set `ignorePattern.loose` flag for backward compatibility.
+ for (const element of elements) {
+ if (element.ignorePattern) {
+ element.ignorePattern.loose = true;
+ }
+ yield element;
+ }
+ }
+
+ /**
+ * Normalize a given config to an array.
+ * @param {ConfigData} configData The config data to normalize.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ _normalizeConfigData(configData, ctx) {
+ const validator = new ConfigValidator();
+
+ validator.validateConfigSchema(configData, ctx.name || ctx.filePath);
+ return this._normalizeObjectConfigData(configData, ctx);
+ }
+
+ /**
+ * Normalize a given config to an array.
+ * @param {ConfigData|OverrideConfigData} configData The config data to normalize.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ *_normalizeObjectConfigData(configData, ctx) {
+ const { files, excludedFiles, ...configBody } = configData;
+ const criteria = OverrideTester.create(
+ files,
+ excludedFiles,
+ ctx.matchBasePath
+ );
+ const elements = this._normalizeObjectConfigDataBody(configBody, ctx);
+
+ // Apply the criteria to every element.
+ for (const element of elements) {
+
+ /*
+ * Merge the criteria.
+ * This is for the `overrides` entries that came from the
+ * configurations of `overrides[].extends`.
+ */
+ element.criteria = OverrideTester.and(criteria, element.criteria);
+
+ /*
+ * Remove `root` property to ignore `root` settings which came from
+ * `extends` in `overrides`.
+ */
+ if (element.criteria) {
+ element.root = void 0;
+ }
+
+ yield element;
+ }
+ }
+
+ /**
+ * Normalize a given config to an array.
+ * @param {ConfigData} configData The config data to normalize.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ *_normalizeObjectConfigDataBody(
+ {
+ env,
+ extends: extend,
+ globals,
+ ignorePatterns,
+ noInlineConfig,
+ parser: parserName,
+ parserOptions,
+ plugins: pluginList,
+ processor,
+ reportUnusedDisableDirectives,
+ root,
+ rules,
+ settings,
+ overrides: overrideList = []
+ },
+ ctx
+ ) {
+ const extendList = Array.isArray(extend) ? extend : [extend];
+ const ignorePattern = ignorePatterns && new IgnorePattern(
+ Array.isArray(ignorePatterns) ? ignorePatterns : [ignorePatterns],
+ ctx.matchBasePath
+ );
+
+ // Flatten `extends`.
+ for (const extendName of extendList.filter(Boolean)) {
+ yield* this._loadExtends(extendName, ctx);
+ }
+
+ // Load parser & plugins.
+ const parser = parserName && this._loadParser(parserName, ctx);
+ const plugins = pluginList && this._loadPlugins(pluginList, ctx);
+
+ // Yield pseudo config data for file extension processors.
+ if (plugins) {
+ yield* this._takeFileExtensionProcessors(plugins, ctx);
+ }
+
+ // Yield the config data except `extends` and `overrides`.
+ yield {
+
+ // Debug information.
+ type: ctx.type,
+ name: ctx.name,
+ filePath: ctx.filePath,
+
+ // Config data.
+ criteria: null,
+ env,
+ globals,
+ ignorePattern,
+ noInlineConfig,
+ parser,
+ parserOptions,
+ plugins,
+ processor,
+ reportUnusedDisableDirectives,
+ root,
+ rules,
+ settings
+ };
+
+ // Flatten `overries`.
+ for (let i = 0; i < overrideList.length; ++i) {
+ yield* this._normalizeObjectConfigData(
+ overrideList[i],
+ { ...ctx, name: `${ctx.name}#overrides[${i}]` }
+ );
+ }
+ }
+
+ /**
+ * Load configs of an element in `extends`.
+ * @param {string} extendName The name of a base config.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ _loadExtends(extendName, ctx) {
+ debug$2("Loading {extends:%j} relative to %s", extendName, ctx.filePath);
+ try {
+ if (extendName.startsWith("eslint:")) {
+ return this._loadExtendedBuiltInConfig(extendName, ctx);
+ }
+ if (extendName.startsWith("plugin:")) {
+ return this._loadExtendedPluginConfig(extendName, ctx);
+ }
+ return this._loadExtendedShareableConfig(extendName, ctx);
+ } catch (error) {
+ error.message += `\nReferenced from: ${ctx.filePath || ctx.name}`;
+ throw error;
+ }
+ }
+
+ /**
+ * Load configs of an element in `extends`.
+ * @param {string} extendName The name of a base config.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ _loadExtendedBuiltInConfig(extendName, ctx) {
+ const { eslintAllPath, eslintRecommendedPath } = internalSlotsMap$1.get(this);
+
+ if (extendName === "eslint:recommended") {
+ return this._loadConfigData({
+ ...ctx,
+ filePath: eslintRecommendedPath,
+ name: `${ctx.name} Ā» ${extendName}`
+ });
+ }
+ if (extendName === "eslint:all") {
+ return this._loadConfigData({
+ ...ctx,
+ filePath: eslintAllPath,
+ name: `${ctx.name} Ā» ${extendName}`
+ });
+ }
+
+ throw configInvalidError(extendName, ctx.name, "extend-config-missing");
+ }
+
+ /**
+ * Load configs of an element in `extends`.
+ * @param {string} extendName The name of a base config.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ _loadExtendedPluginConfig(extendName, ctx) {
+ const slashIndex = extendName.lastIndexOf("/");
+
+ if (slashIndex === -1) {
+ throw configInvalidError(extendName, ctx.filePath, "plugin-invalid");
+ }
+
+ const pluginName = extendName.slice("plugin:".length, slashIndex);
+ const configName = extendName.slice(slashIndex + 1);
+
+ if (isFilePath(pluginName)) {
+ throw new Error("'extends' cannot use a file path for plugins.");
+ }
+
+ const plugin = this._loadPlugin(pluginName, ctx);
+ const configData =
+ plugin.definition &&
+ plugin.definition.configs[configName];
+
+ if (configData) {
+ return this._normalizeConfigData(configData, {
+ ...ctx,
+ filePath: plugin.filePath || ctx.filePath,
+ name: `${ctx.name} Ā» plugin:${plugin.id}/${configName}`
+ });
+ }
+
+ throw plugin.error || configInvalidError(extendName, ctx.filePath, "extend-config-missing");
+ }
+
+ /**
+ * Load configs of an element in `extends`.
+ * @param {string} extendName The name of a base config.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The normalized config.
+ * @private
+ */
+ _loadExtendedShareableConfig(extendName, ctx) {
+ const { cwd, resolver } = internalSlotsMap$1.get(this);
+ const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js");
+ let request;
+
+ if (isFilePath(extendName)) {
+ request = extendName;
+ } else if (extendName.startsWith(".")) {
+ request = `./${extendName}`; // For backward compatibility. A ton of tests depended on this behavior.
+ } else {
+ request = normalizePackageName(
+ extendName,
+ "eslint-config"
+ );
+ }
+
+ let filePath;
+
+ try {
+ filePath = resolver.resolve(request, relativeTo);
+ } catch (error) {
+ /* istanbul ignore else */
+ if (error && error.code === "MODULE_NOT_FOUND") {
+ throw configInvalidError(extendName, ctx.filePath, "extend-config-missing");
+ }
+ throw error;
+ }
+
+ writeDebugLogForLoading(request, relativeTo, filePath);
+ return this._loadConfigData({
+ ...ctx,
+ filePath,
+ name: `${ctx.name} Ā» ${request}`
+ });
+ }
+
+ /**
+ * Load given plugins.
+ * @param {string[]} names The plugin names to load.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {Record<string,DependentPlugin>} The loaded parser.
+ * @private
+ */
+ _loadPlugins(names, ctx) {
+ return names.reduce((map, name) => {
+ if (isFilePath(name)) {
+ throw new Error("Plugins array cannot includes file paths.");
+ }
+ const plugin = this._loadPlugin(name, ctx);
+
+ map[plugin.id] = plugin;
+
+ return map;
+ }, {});
+ }
+
+ /**
+ * Load a given parser.
+ * @param {string} nameOrPath The package name or the path to a parser file.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {DependentParser} The loaded parser.
+ */
+ _loadParser(nameOrPath, ctx) {
+ debug$2("Loading parser %j from %s", nameOrPath, ctx.filePath);
+
+ const { cwd, resolver } = internalSlotsMap$1.get(this);
+ const relativeTo = ctx.filePath || path__default["default"].join(cwd, "__placeholder__.js");
+
+ try {
+ const filePath = resolver.resolve(nameOrPath, relativeTo);
+
+ writeDebugLogForLoading(nameOrPath, relativeTo, filePath);
+
+ return new ConfigDependency({
+ definition: require$1(filePath),
+ filePath,
+ id: nameOrPath,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ } catch (error) {
+
+ // If the parser name is "espree", load the espree of ESLint.
+ if (nameOrPath === "espree") {
+ debug$2("Fallback espree.");
+ return new ConfigDependency({
+ definition: require$1("espree"),
+ filePath: require$1.resolve("espree"),
+ id: nameOrPath,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ }
+
+ debug$2("Failed to load parser '%s' declared in '%s'.", nameOrPath, ctx.name);
+ error.message = `Failed to load parser '${nameOrPath}' declared in '${ctx.name}': ${error.message}`;
+
+ return new ConfigDependency({
+ error,
+ id: nameOrPath,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ }
+ }
+
+ /**
+ * Load a given plugin.
+ * @param {string} name The plugin name to load.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {DependentPlugin} The loaded plugin.
+ * @private
+ */
+ _loadPlugin(name, ctx) {
+ debug$2("Loading plugin %j from %s", name, ctx.filePath);
+
+ const { additionalPluginPool, resolver } = internalSlotsMap$1.get(this);
+ const request = normalizePackageName(name, "eslint-plugin");
+ const id = getShorthandName(request, "eslint-plugin");
+ const relativeTo = path__default["default"].join(ctx.pluginBasePath, "__placeholder__.js");
+
+ if (name.match(/\s+/u)) {
+ const error = Object.assign(
+ new Error(`Whitespace found in plugin name '${name}'`),
+ {
+ messageTemplate: "whitespace-found",
+ messageData: { pluginName: request }
+ }
+ );
+
+ return new ConfigDependency({
+ error,
+ id,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ }
+
+ // Check for additional pool.
+ const plugin =
+ additionalPluginPool.get(request) ||
+ additionalPluginPool.get(id);
+
+ if (plugin) {
+ return new ConfigDependency({
+ definition: normalizePlugin(plugin),
+ filePath: "", // It's unknown where the plugin came from.
+ id,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ }
+
+ let filePath;
+ let error;
+
+ try {
+ filePath = resolver.resolve(request, relativeTo);
+ } catch (resolveError) {
+ error = resolveError;
+ /* istanbul ignore else */
+ if (error && error.code === "MODULE_NOT_FOUND") {
+ error.messageTemplate = "plugin-missing";
+ error.messageData = {
+ pluginName: request,
+ resolvePluginsRelativeTo: ctx.pluginBasePath,
+ importerName: ctx.name
+ };
+ }
+ }
+
+ if (filePath) {
+ try {
+ writeDebugLogForLoading(request, relativeTo, filePath);
+
+ const startTime = Date.now();
+ const pluginDefinition = require$1(filePath);
+
+ debug$2(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);
+
+ return new ConfigDependency({
+ definition: normalizePlugin(pluginDefinition),
+ filePath,
+ id,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ } catch (loadError) {
+ error = loadError;
+ }
+ }
+
+ debug$2("Failed to load plugin '%s' declared in '%s'.", name, ctx.name);
+ error.message = `Failed to load plugin '${name}' declared in '${ctx.name}': ${error.message}`;
+ return new ConfigDependency({
+ error,
+ id,
+ importerName: ctx.name,
+ importerPath: ctx.filePath
+ });
+ }
+
+ /**
+ * Take file expression processors as config array elements.
+ * @param {Record<string,DependentPlugin>} plugins The plugin definitions.
+ * @param {ConfigArrayFactoryLoadingContext} ctx The loading context.
+ * @returns {IterableIterator<ConfigArrayElement>} The config array elements of file expression processors.
+ * @private
+ */
+ *_takeFileExtensionProcessors(plugins, ctx) {
+ for (const pluginId of Object.keys(plugins)) {
+ const processors =
+ plugins[pluginId] &&
+ plugins[pluginId].definition &&
+ plugins[pluginId].definition.processors;
+
+ if (!processors) {
+ continue;
+ }
+
+ for (const processorId of Object.keys(processors)) {
+ if (processorId.startsWith(".")) {
+ yield* this._normalizeObjectConfigData(
+ {
+ files: [`*${processorId}`],
+ processor: `${pluginId}/${processorId}`
+ },
+ {
+ ...ctx,
+ type: "implicit-processor",
+ name: `${ctx.name}#processors["${pluginId}/${processorId}"]`
+ }
+ );
+ }
+ }
+ }
+ }
+}
+
+/**
+ * @fileoverview `CascadingConfigArrayFactory` class.
+ *
+ * `CascadingConfigArrayFactory` class has a responsibility:
+ *
+ * 1. Handles cascading of config files.
+ *
+ * It provides two methods:
+ *
+ * - `getConfigArrayForFile(filePath)`
+ * Get the corresponded configuration of a given file. This method doesn't
+ * throw even if the given file didn't exist.
+ * - `clearCache()`
+ * Clear the internal cache. You have to call this method when
+ * `additionalPluginPool` was updated if `baseConfig` or `cliConfig` depends
+ * on the additional plugins. (`CLIEngine#addPlugin()` method calls this.)
+ *
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ */
+
+const debug$1 = debugOrig__default["default"]("eslintrc:cascading-config-array-factory");
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+// Define types for VSCode IntelliSense.
+/** @typedef {import("./shared/types").ConfigData} ConfigData */
+/** @typedef {import("./shared/types").Parser} Parser */
+/** @typedef {import("./shared/types").Plugin} Plugin */
+/** @typedef {import("./shared/types").Rule} Rule */
+/** @typedef {ReturnType<ConfigArrayFactory["create"]>} ConfigArray */
+
+/**
+ * @typedef {Object} CascadingConfigArrayFactoryOptions
+ * @property {Map<string,Plugin>} [additionalPluginPool] The map for additional plugins.
+ * @property {ConfigData} [baseConfig] The config by `baseConfig` option.
+ * @property {ConfigData} [cliConfig] The config by CLI options (`--env`, `--global`, `--ignore-pattern`, `--parser`, `--parser-options`, `--plugin`, and `--rule`). CLI options overwrite the setting in config files.
+ * @property {string} [cwd] The base directory to start lookup.
+ * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.
+ * @property {string[]} [rulePaths] The value of `--rulesdir` option.
+ * @property {string} [specificConfigPath] The value of `--config` option.
+ * @property {boolean} [useEslintrc] if `false` then it doesn't load config files.
+ * @property {Function} loadRules The function to use to load rules.
+ * @property {Map<string,Rule>} 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 {string} eslintRecommendedPath The path to the definitions for eslint:recommended.
+ */
+
+/**
+ * @typedef {Object} CascadingConfigArrayFactoryInternalSlots
+ * @property {ConfigArray} baseConfigArray The config array of `baseConfig` option.
+ * @property {ConfigData} baseConfigData The config data of `baseConfig` option. This is used to reset `baseConfigArray`.
+ * @property {ConfigArray} cliConfigArray The config array of CLI options.
+ * @property {ConfigData} cliConfigData The config data of CLI options. This is used to reset `cliConfigArray`.
+ * @property {ConfigArrayFactory} configArrayFactory The factory for config arrays.
+ * @property {Map<string, ConfigArray>} configCache The cache from directory paths to config arrays.
+ * @property {string} cwd The base directory to start lookup.
+ * @property {WeakMap<ConfigArray, ConfigArray>} finalizeCache The cache from config arrays to finalized config arrays.
+ * @property {string} [ignorePath] The path to the alternative file of `.eslintignore`.
+ * @property {string[]|null} rulePaths The value of `--rulesdir` option. This is used to reset `baseConfigArray`.
+ * @property {string|null} specificConfigPath The value of `--config` option. This is used to reset `cliConfigArray`.
+ * @property {boolean} useEslintrc if `false` then it doesn't load config files.
+ * @property {Function} loadRules The function to use to load rules.
+ * @property {Map<string,Rule>} 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 {string} eslintRecommendedPath The path to the definitions for eslint:recommended.
+ */
+
+/** @type {WeakMap<CascadingConfigArrayFactory, CascadingConfigArrayFactoryInternalSlots>} */
+const internalSlotsMap = new WeakMap();
+
+/**
+ * Create the config array from `baseConfig` and `rulePaths`.
+ * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.
+ * @returns {ConfigArray} The config array of the base configs.
+ */
+function createBaseConfigArray({
+ configArrayFactory,
+ baseConfigData,
+ rulePaths,
+ cwd,
+ loadRules
+}) {
+ const baseConfigArray = configArrayFactory.create(
+ baseConfigData,
+ { name: "BaseConfig" }
+ );
+
+ /*
+ * Create the config array element for the default ignore patterns.
+ * This element has `ignorePattern` property that ignores the default
+ * patterns in the current working directory.
+ */
+ baseConfigArray.unshift(configArrayFactory.create(
+ { ignorePatterns: IgnorePattern.DefaultPatterns },
+ { name: "DefaultIgnorePattern" }
+ )[0]);
+
+ /*
+ * Load rules `--rulesdir` option as a pseudo plugin.
+ * Use a pseudo plugin to define rules of `--rulesdir`, so we can validate
+ * the rule's options with only information in the config array.
+ */
+ if (rulePaths && rulePaths.length > 0) {
+ baseConfigArray.push({
+ type: "config",
+ name: "--rulesdir",
+ filePath: "",
+ plugins: {
+ "": new ConfigDependency({
+ definition: {
+ rules: rulePaths.reduce(
+ (map, rulesPath) => Object.assign(
+ map,
+ loadRules(rulesPath, cwd)
+ ),
+ {}
+ )
+ },
+ filePath: "",
+ id: "",
+ importerName: "--rulesdir",
+ importerPath: ""
+ })
+ }
+ });
+ }
+
+ return baseConfigArray;
+}
+
+/**
+ * Create the config array from CLI options.
+ * @param {CascadingConfigArrayFactoryInternalSlots} slots The slots.
+ * @returns {ConfigArray} The config array of the base configs.
+ */
+function createCLIConfigArray({
+ cliConfigData,
+ configArrayFactory,
+ cwd,
+ ignorePath,
+ specificConfigPath
+}) {
+ const cliConfigArray = configArrayFactory.create(
+ cliConfigData,
+ { name: "CLIOptions" }
+ );
+
+ cliConfigArray.unshift(
+ ...(ignorePath
+ ? configArrayFactory.loadESLintIgnore(ignorePath)
+ : configArrayFactory.loadDefaultESLintIgnore())
+ );
+
+ if (specificConfigPath) {
+ cliConfigArray.unshift(
+ ...configArrayFactory.loadFile(
+ specificConfigPath,
+ { name: "--config", basePath: cwd }
+ )
+ );
+ }
+
+ return cliConfigArray;
+}
+
+/**
+ * The error type when there are files matched by a glob, but all of them have been ignored.
+ */
+class ConfigurationNotFoundError extends Error {
+
+ // eslint-disable-next-line jsdoc/require-description
+ /**
+ * @param {string} directoryPath The directory path.
+ */
+ constructor(directoryPath) {
+ super(`No ESLint configuration found in ${directoryPath}.`);
+ this.messageTemplate = "no-config-found";
+ this.messageData = { directoryPath };
+ }
+}
+
+/**
+ * This class provides the functionality that enumerates every file which is
+ * matched by given glob patterns and that configuration.
+ */
+class CascadingConfigArrayFactory {
+
+ /**
+ * Initialize this enumerator.
+ * @param {CascadingConfigArrayFactoryOptions} options The options.
+ */
+ constructor({
+ additionalPluginPool = new Map(),
+ baseConfig: baseConfigData = null,
+ cliConfig: cliConfigData = null,
+ cwd = process.cwd(),
+ ignorePath,
+ resolvePluginsRelativeTo,
+ rulePaths = [],
+ specificConfigPath = null,
+ useEslintrc = true,
+ builtInRules = new Map(),
+ loadRules,
+ resolver,
+ eslintRecommendedPath,
+ eslintAllPath
+ } = {}) {
+ const configArrayFactory = new ConfigArrayFactory({
+ additionalPluginPool,
+ cwd,
+ resolvePluginsRelativeTo,
+ builtInRules,
+ resolver,
+ eslintRecommendedPath,
+ eslintAllPath
+ });
+
+ internalSlotsMap.set(this, {
+ baseConfigArray: createBaseConfigArray({
+ baseConfigData,
+ configArrayFactory,
+ cwd,
+ rulePaths,
+ loadRules,
+ resolver
+ }),
+ baseConfigData,
+ cliConfigArray: createCLIConfigArray({
+ cliConfigData,
+ configArrayFactory,
+ cwd,
+ ignorePath,
+ specificConfigPath
+ }),
+ cliConfigData,
+ configArrayFactory,
+ configCache: new Map(),
+ cwd,
+ finalizeCache: new WeakMap(),
+ ignorePath,
+ rulePaths,
+ specificConfigPath,
+ useEslintrc,
+ builtInRules,
+ loadRules
+ });
+ }
+
+ /**
+ * The path to the current working directory.
+ * This is used by tests.
+ * @type {string}
+ */
+ get cwd() {
+ const { cwd } = internalSlotsMap.get(this);
+
+ return cwd;
+ }
+
+ /**
+ * Get the config array of a given file.
+ * If `filePath` was not given, it returns the config which contains only
+ * `baseConfigData` and `cliConfigData`.
+ * @param {string} [filePath] The file path to a file.
+ * @param {Object} [options] The options.
+ * @param {boolean} [options.ignoreNotFoundError] If `true` then it doesn't throw `ConfigurationNotFoundError`.
+ * @returns {ConfigArray} The config array of the file.
+ */
+ getConfigArrayForFile(filePath, { ignoreNotFoundError = false } = {}) {
+ const {
+ baseConfigArray,
+ cliConfigArray,
+ cwd
+ } = internalSlotsMap.get(this);
+
+ if (!filePath) {
+ return new ConfigArray(...baseConfigArray, ...cliConfigArray);
+ }
+
+ const directoryPath = path__default["default"].dirname(path__default["default"].resolve(cwd, filePath));
+
+ debug$1(`Load config files for ${directoryPath}.`);
+
+ return this._finalizeConfigArray(
+ this._loadConfigInAncestors(directoryPath),
+ directoryPath,
+ ignoreNotFoundError
+ );
+ }
+
+ /**
+ * Set the config data to override all configs.
+ * Require to call `clearCache()` method after this method is called.
+ * @param {ConfigData} configData The config data to override all configs.
+ * @returns {void}
+ */
+ setOverrideConfig(configData) {
+ const slots = internalSlotsMap.get(this);
+
+ slots.cliConfigData = configData;
+ }
+
+ /**
+ * Clear config cache.
+ * @returns {void}
+ */
+ clearCache() {
+ const slots = internalSlotsMap.get(this);
+
+ slots.baseConfigArray = createBaseConfigArray(slots);
+ slots.cliConfigArray = createCLIConfigArray(slots);
+ slots.configCache.clear();
+ }
+
+ /**
+ * Load and normalize config files from the ancestor directories.
+ * @param {string} directoryPath The path to a leaf directory.
+ * @param {boolean} configsExistInSubdirs `true` if configurations exist in subdirectories.
+ * @returns {ConfigArray} The loaded config.
+ * @private
+ */
+ _loadConfigInAncestors(directoryPath, configsExistInSubdirs = false) {
+ const {
+ baseConfigArray,
+ configArrayFactory,
+ configCache,
+ cwd,
+ useEslintrc
+ } = internalSlotsMap.get(this);
+
+ if (!useEslintrc) {
+ return baseConfigArray;
+ }
+
+ let configArray = configCache.get(directoryPath);
+
+ // Hit cache.
+ if (configArray) {
+ debug$1(`Cache hit: ${directoryPath}.`);
+ return configArray;
+ }
+ debug$1(`No cache found: ${directoryPath}.`);
+
+ const homePath = os__default["default"].homedir();
+
+ // Consider this is root.
+ if (directoryPath === homePath && cwd !== homePath) {
+ debug$1("Stop traversing because of considered root.");
+ if (configsExistInSubdirs) {
+ const filePath = ConfigArrayFactory.getPathToConfigFileInDirectory(directoryPath);
+
+ if (filePath) {
+ emitDeprecationWarning(
+ filePath,
+ "ESLINT_PERSONAL_CONFIG_SUPPRESS"
+ );
+ }
+ }
+ return this._cacheConfig(directoryPath, baseConfigArray);
+ }
+
+ // Load the config on this directory.
+ try {
+ configArray = configArrayFactory.loadInDirectory(directoryPath);
+ } catch (error) {
+ /* istanbul ignore next */
+ if (error.code === "EACCES") {
+ debug$1("Stop traversing because of 'EACCES' error.");
+ return this._cacheConfig(directoryPath, baseConfigArray);
+ }
+ throw error;
+ }
+
+ if (configArray.length > 0 && configArray.isRoot()) {
+ debug$1("Stop traversing because of 'root:true'.");
+ configArray.unshift(...baseConfigArray);
+ return this._cacheConfig(directoryPath, configArray);
+ }
+
+ // Load from the ancestors and merge it.
+ const parentPath = path__default["default"].dirname(directoryPath);
+ const parentConfigArray = parentPath && parentPath !== directoryPath
+ ? this._loadConfigInAncestors(
+ parentPath,
+ configsExistInSubdirs || configArray.length > 0
+ )
+ : baseConfigArray;
+
+ if (configArray.length > 0) {
+ configArray.unshift(...parentConfigArray);
+ } else {
+ configArray = parentConfigArray;
+ }
+
+ // Cache and return.
+ return this._cacheConfig(directoryPath, configArray);
+ }
+
+ /**
+ * Freeze and cache a given config.
+ * @param {string} directoryPath The path to a directory as a cache key.
+ * @param {ConfigArray} configArray The config array as a cache value.
+ * @returns {ConfigArray} The `configArray` (frozen).
+ */
+ _cacheConfig(directoryPath, configArray) {
+ const { configCache } = internalSlotsMap.get(this);
+
+ Object.freeze(configArray);
+ configCache.set(directoryPath, configArray);
+
+ return configArray;
+ }
+
+ /**
+ * Finalize a given config array.
+ * Concatenate `--config` and other CLI options.
+ * @param {ConfigArray} configArray The parent config array.
+ * @param {string} directoryPath The path to the leaf directory to find config files.
+ * @param {boolean} ignoreNotFoundError If `true` then it doesn't throw `ConfigurationNotFoundError`.
+ * @returns {ConfigArray} The loaded config.
+ * @private
+ */
+ _finalizeConfigArray(configArray, directoryPath, ignoreNotFoundError) {
+ const {
+ cliConfigArray,
+ configArrayFactory,
+ finalizeCache,
+ useEslintrc,
+ builtInRules
+ } = internalSlotsMap.get(this);
+
+ let finalConfigArray = finalizeCache.get(configArray);
+
+ if (!finalConfigArray) {
+ finalConfigArray = configArray;
+
+ // Load the personal config if there are no regular config files.
+ if (
+ useEslintrc &&
+ configArray.every(c => !c.filePath) &&
+ cliConfigArray.every(c => !c.filePath) // `--config` option can be a file.
+ ) {
+ const homePath = os__default["default"].homedir();
+
+ debug$1("Loading the config file of the home directory:", homePath);
+
+ const personalConfigArray = configArrayFactory.loadInDirectory(
+ homePath,
+ { name: "PersonalConfig" }
+ );
+
+ if (
+ personalConfigArray.length > 0 &&
+ !directoryPath.startsWith(homePath)
+ ) {
+ const lastElement =
+ personalConfigArray[personalConfigArray.length - 1];
+
+ emitDeprecationWarning(
+ lastElement.filePath,
+ "ESLINT_PERSONAL_CONFIG_LOAD"
+ );
+ }
+
+ finalConfigArray = finalConfigArray.concat(personalConfigArray);
+ }
+
+ // Apply CLI options.
+ if (cliConfigArray.length > 0) {
+ finalConfigArray = finalConfigArray.concat(cliConfigArray);
+ }
+
+ // Validate rule settings and environments.
+ const validator = new ConfigValidator({
+ builtInRules
+ });
+
+ validator.validateConfigArray(finalConfigArray);
+
+ // Cache it.
+ Object.freeze(finalConfigArray);
+ finalizeCache.set(configArray, finalConfigArray);
+
+ debug$1(
+ "Configuration was determined: %o on %s",
+ finalConfigArray,
+ directoryPath
+ );
+ }
+
+ // At least one element (the default ignore patterns) exists.
+ if (!ignoreNotFoundError && useEslintrc && finalConfigArray.length <= 1) {
+ throw new ConfigurationNotFoundError(directoryPath);
+ }
+
+ return finalConfigArray;
+ }
+}
+
+/**
+ * @fileoverview Compatibility class for flat config.
+ * @author Nicholas C. Zakas
+ */
+
+const dirname = path__default["default"].dirname(url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('eslintrc.cjs', document.baseURI).href))));
+
+//-----------------------------------------------------------------------------
+// Helpers
+//-----------------------------------------------------------------------------
+
+/** @typedef {import("../../shared/types").Environment} Environment */
+/** @typedef {import("../../shared/types").Processor} Processor */
+
+const debug = debugOrig__default["default"]("eslintrc:flat-compat");
+const cafactory = Symbol("cafactory");
+
+/**
+ * Translates an ESLintRC-style config object into a flag-config-style config
+ * object.
+ * @param {Object} eslintrcConfig An ESLintRC-style config object.
+ * @param {Object} options Options to help translate the config.
+ * @param {string} options.resolveConfigRelativeTo To the directory to resolve
+ * configs from.
+ * @param {string} options.resolvePluginsRelativeTo The directory to resolve
+ * plugins from.
+ * @param {ReadOnlyMap<string,Environment>} options.pluginEnvironments A map of plugin environment
+ * names to objects.
+ * @param {ReadOnlyMap<string,Processor>} options.pluginProcessors A map of plugin processor
+ * names to objects.
+ * @returns {Object} A flag-config-style config object.
+ */
+function translateESLintRC(eslintrcConfig, {
+ resolveConfigRelativeTo,
+ resolvePluginsRelativeTo,
+ pluginEnvironments,
+ pluginProcessors
+}) {
+
+ const flatConfig = {};
+ const configs = [];
+ const languageOptions = {};
+ const linterOptions = {};
+ const keysToCopy = ["settings", "rules", "processor"];
+ const languageOptionsKeysToCopy = ["globals", "parser", "parserOptions"];
+ const linterOptionsKeysToCopy = ["noInlineConfig", "reportUnusedDisableDirectives"];
+
+ // 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") {
+ flatConfig[key] = eslintrcConfig[key];
+ }
+ }
+
+ // copy over languageOptions
+ for (const key of languageOptionsKeysToCopy) {
+ if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
+
+ // create the languageOptions key in the flat config
+ flatConfig.languageOptions = languageOptions;
+
+ if (key === "parser") {
+ debug(`Resolving parser '${languageOptions[key]}' relative to ${resolveConfigRelativeTo}`);
+
+ if (eslintrcConfig[key].error) {
+ throw eslintrcConfig[key].error;
+ }
+
+ languageOptions[key] = eslintrcConfig[key].definition;
+ continue;
+ }
+
+ // clone any object values that are in the eslintrc config
+ if (eslintrcConfig[key] && typeof eslintrcConfig[key] === "object") {
+ languageOptions[key] = {
+ ...eslintrcConfig[key]
+ };
+ } else {
+ languageOptions[key] = eslintrcConfig[key];
+ }
+ }
+ }
+
+ // copy over linterOptions
+ for (const key of linterOptionsKeysToCopy) {
+ if (key in eslintrcConfig && typeof eslintrcConfig[key] !== "undefined") {
+ flatConfig.linterOptions = linterOptions;
+ linterOptions[key] = eslintrcConfig[key];
+ }
+ }
+
+ // move ecmaVersion a level up
+ if (languageOptions.parserOptions) {
+
+ if ("ecmaVersion" in languageOptions.parserOptions) {
+ languageOptions.ecmaVersion = languageOptions.parserOptions.ecmaVersion;
+ delete languageOptions.parserOptions.ecmaVersion;
+ }
+
+ if ("sourceType" in languageOptions.parserOptions) {
+ languageOptions.sourceType = languageOptions.parserOptions.sourceType;
+ delete languageOptions.parserOptions.sourceType;
+ }
+
+ // check to see if we even need parserOptions anymore and remove it if not
+ if (Object.keys(languageOptions.parserOptions).length === 0) {
+ delete languageOptions.parserOptions;
+ }
+ }
+
+ // overrides
+ if (eslintrcConfig.criteria) {
+ flatConfig.files = [absoluteFilePath => eslintrcConfig.criteria.test(absoluteFilePath)];
+ }
+
+ // translate plugins
+ if (eslintrcConfig.plugins && typeof eslintrcConfig.plugins === "object") {
+ debug(`Translating plugins: ${eslintrcConfig.plugins}`);
+
+ flatConfig.plugins = {};
+
+ for (const pluginName of Object.keys(eslintrcConfig.plugins)) {
+
+ debug(`Translating plugin: ${pluginName}`);
+ debug(`Resolving plugin '${pluginName} relative to ${resolvePluginsRelativeTo}`);
+
+ const { definition: plugin, error } = eslintrcConfig.plugins[pluginName];
+
+ if (error) {
+ throw error;
+ }
+
+ flatConfig.plugins[pluginName] = plugin;
+
+ // create a config for any processors
+ if (plugin.processors) {
+ for (const processorName of Object.keys(plugin.processors)) {
+ if (processorName.startsWith(".")) {
+ debug(`Assigning processor: ${pluginName}/${processorName}`);
+
+ configs.unshift({
+ files: [`**/*${processorName}`],
+ processor: pluginProcessors.get(`${pluginName}/${processorName}`)
+ });
+ }
+
+ }
+ }
+ }
+ }
+
+ // translate env - must come after plugins
+ if (eslintrcConfig.env && typeof eslintrcConfig.env === "object") {
+ for (const envName of Object.keys(eslintrcConfig.env)) {
+
+ // only add environments that are true
+ if (eslintrcConfig.env[envName]) {
+ debug(`Translating environment: ${envName}`);
+
+ if (environments.has(envName)) {
+
+ // built-in environments should be defined first
+ configs.unshift(...translateESLintRC(environments.get(envName), {
+ resolveConfigRelativeTo,
+ resolvePluginsRelativeTo
+ }));
+ } else if (pluginEnvironments.has(envName)) {
+
+ // if the environment comes from a plugin, it should come after the plugin config
+ configs.push(...translateESLintRC(pluginEnvironments.get(envName), {
+ resolveConfigRelativeTo,
+ resolvePluginsRelativeTo
+ }));
+ }
+ }
+ }
+ }
+
+ // only add if there are actually keys in the config
+ if (Object.keys(flatConfig).length > 0) {
+ configs.push(flatConfig);
+ }
+
+ return configs;
+}
+
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+/**
+ * A compatibility class for working with configs.
+ */
+class FlatCompat {
+
+ constructor({
+ baseDirectory = process.cwd(),
+ resolvePluginsRelativeTo = baseDirectory
+ } = {}) {
+ this.baseDirectory = baseDirectory;
+ this.resolvePluginsRelativeTo = resolvePluginsRelativeTo;
+ this[cafactory] = new ConfigArrayFactory({
+ cwd: baseDirectory,
+ resolvePluginsRelativeTo,
+ eslintAllPath: path__default["default"].resolve(dirname, "../conf/eslint-all.cjs"),
+ eslintRecommendedPath: path__default["default"].resolve(dirname, "../conf/eslint-recommended.cjs")
+ });
+ }
+
+ /**
+ * Translates an ESLintRC-style config into a flag-config-style config.
+ * @param {Object} eslintrcConfig The ESLintRC-style config object.
+ * @returns {Object} A flag-config-style config object.
+ */
+ config(eslintrcConfig) {
+ const eslintrcArray = this[cafactory].create(eslintrcConfig, {
+ basePath: this.baseDirectory
+ });
+
+ const flatArray = [];
+ let hasIgnorePatterns = false;
+
+ eslintrcArray.forEach(configData => {
+ if (configData.type === "config") {
+ hasIgnorePatterns = hasIgnorePatterns || configData.ignorePattern;
+ flatArray.push(...translateESLintRC(configData, {
+ resolveConfigRelativeTo: path__default["default"].join(this.baseDirectory, "__placeholder.js"),
+ resolvePluginsRelativeTo: path__default["default"].join(this.resolvePluginsRelativeTo, "__placeholder.js"),
+ pluginEnvironments: eslintrcArray.pluginEnvironments,
+ pluginProcessors: eslintrcArray.pluginProcessors
+ }));
+ }
+ });
+
+ // combine ignorePatterns to emulate ESLintRC behavior better
+ if (hasIgnorePatterns) {
+ flatArray.unshift({
+ ignores: [filePath => {
+
+ // Compute the final config for this file.
+ // This filters config array elements by `files`/`excludedFiles` then merges the elements.
+ const finalConfig = eslintrcArray.extractConfig(filePath);
+
+ // Test the `ignorePattern` properties of the final config.
+ return Boolean(finalConfig.ignores) && finalConfig.ignores(filePath);
+ }]
+ });
+ }
+
+ return flatArray;
+ }
+
+ /**
+ * Translates the `env` section of an ESLintRC-style config.
+ * @param {Object} envConfig The `env` section of an ESLintRC config.
+ * @returns {Object} A flag-config object representing the environments.
+ */
+ env(envConfig) {
+ return this.config({
+ env: envConfig
+ });
+ }
+
+ /**
+ * Translates the `extends` section of an ESLintRC-style config.
+ * @param {...string} configsToExtend The names of the configs to load.
+ * @returns {Object} A flag-config object representing the config.
+ */
+ extends(...configsToExtend) {
+ return this.config({
+ extends: configsToExtend
+ });
+ }
+
+ /**
+ * Translates the `plugins` section of an ESLintRC-style config.
+ * @param {...string} plugins The names of the plugins to load.
+ * @returns {Object} A flag-config object representing the plugins.
+ */
+ plugins(...plugins) {
+ return this.config({
+ plugins
+ });
+ }
+}
+
+/**
+ * @fileoverview Package exports for @eslint/eslintrc
+ * @author Nicholas C. Zakas
+ */
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+const Legacy = {
+ ConfigArray,
+ createConfigArrayFactoryContext: createContext,
+ CascadingConfigArrayFactory,
+ ConfigArrayFactory,
+ ConfigDependency,
+ ExtractedConfig,
+ IgnorePattern,
+ OverrideTester,
+ getUsedExtractedConfigs,
+ environments,
+
+ // shared
+ ConfigOps,
+ ConfigValidator,
+ ModuleResolver,
+ naming
+};
+
+exports.FlatCompat = FlatCompat;
+exports.Legacy = Legacy;
+//# sourceMappingURL=eslintrc.cjs.map
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js
index c991c24b607..553ca0a9fc5 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js
@@ -17,19 +17,20 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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 os from "os";
+import path from "path";
+import ConfigValidator from "./shared/config-validator.js";
+import { emitDeprecationWarning } from "./shared/deprecation-warnings.js";
+import { ConfigArrayFactory } from "./config-array-factory.js";
+import { ConfigArray, ConfigDependency, IgnorePattern } from "./config-array/index.js";
+import debugOrig from "debug";
+
+const debug = debugOrig("eslintrc:cascading-config-array-factory");
//------------------------------------------------------------------------------
// Helpers
@@ -516,4 +517,4 @@ class CascadingConfigArrayFactory {
// Public Interface
//------------------------------------------------------------------------------
-module.exports = { CascadingConfigArrayFactory };
+export { CascadingConfigArrayFactory };
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js
index 406601c2471..82abffa90cd 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array-factory.js
@@ -33,26 +33,30 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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 fs from "fs";
+import path from "path";
+import importFresh from "import-fresh";
+import stripComments from "strip-json-comments";
+import ConfigValidator from "./shared/config-validator.js";
+import * as naming from "./shared/naming.js";
+import * as ModuleResolver from "./shared/relative-module-resolver.js";
+import {
ConfigArray,
ConfigDependency,
IgnorePattern,
OverrideTester
-} = require("./config-array");
-const debug = require("debug")("eslintrc:config-array-factory");
+} from "./config-array/index.js";
+import debugOrig from "debug";
+
+import { createRequire } from "module";
+const require = createRequire(import.meta.url);
+
+const debug = debugOrig("eslintrc:config-array-factory");
//------------------------------------------------------------------------------
// Helpers
@@ -922,11 +926,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 +977,7 @@ class ConfigArrayFactory {
_loadPlugin(name, ctx) {
debug("Loading plugin %j from %s", name, ctx.filePath);
- const { additionalPluginPool } = internalSlotsMap.get(this);
+ const { additionalPluginPool, resolver } = internalSlotsMap.get(this);
const request = naming.normalizePackageName(name, "eslint-plugin");
const id = naming.getShorthandName(request, "eslint-plugin");
const relativeTo = path.join(ctx.pluginBasePath, "__placeholder__.js");
@@ -1014,7 +1018,7 @@ class ConfigArrayFactory {
let error;
try {
- filePath = ModuleResolver.resolve(request, relativeTo);
+ filePath = resolver.resolve(request, relativeTo);
} catch (resolveError) {
error = resolveError;
/* istanbul ignore else */
@@ -1096,4 +1100,4 @@ class ConfigArrayFactory {
}
}
-module.exports = { ConfigArrayFactory, createContext };
+export { ConfigArrayFactory, createContext };
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js
index 42a7362737f..133f5a242e8 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-array.js
@@ -24,14 +24,13 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
-const { ExtractedConfig } = require("./extracted-config");
-const { IgnorePattern } = require("./ignore-pattern");
+import { ExtractedConfig } from "./extracted-config.js";
+import { IgnorePattern } from "./ignore-pattern.js";
//------------------------------------------------------------------------------
// Helpers
@@ -504,21 +503,21 @@ class ConfigArray extends Array {
}
}
-const exportObject = {
- ConfigArray,
+/**
+ * Get the used extracted configs.
+ * CLIEngine will use this method to collect used deprecated rules.
+ * @param {ConfigArray} instance The config array object to get.
+ * @returns {ExtractedConfig[]} The used extracted configs.
+ * @private
+ */
+function getUsedExtractedConfigs(instance) {
+ const { cache } = internalSlotsMap.get(instance);
- /**
- * Get the used extracted configs.
- * CLIEngine will use this method to collect used deprecated rules.
- * @param {ConfigArray} instance The config array object to get.
- * @returns {ExtractedConfig[]} The used extracted configs.
- * @private
- */
- getUsedExtractedConfigs(instance) {
- const { cache } = internalSlotsMap.get(instance);
+ return Array.from(cache.values());
+}
- return Array.from(cache.values());
- }
-};
-module.exports = exportObject;
+export {
+ ConfigArray,
+ getUsedExtractedConfigs
+};
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js
index 0d5f6f71395..2883c3a2a70 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js
@@ -14,9 +14,8 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"use strict";
-const util = require("util");
+import util from "util";
/**
* The class is to store parsers or plugins.
@@ -113,4 +112,4 @@ class ConfigDependency {
/** @typedef {ConfigDependency<import("../../shared/types").Parser>} DependentParser */
/** @typedef {ConfigDependency<import("../../shared/types").Plugin>} DependentPlugin */
-module.exports = { ConfigDependency };
+export { ConfigDependency };
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js
index b27d6ffb188..e93b0b67b65 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js
@@ -14,9 +14,8 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js
index 4c16278ee80..c0a86359a77 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js
@@ -27,16 +27,17 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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<import("ignore").default>} Ignore */
@@ -234,4 +235,4 @@ class IgnorePattern {
}
}
-module.exports = { IgnorePattern };
+export { IgnorePattern };
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js
index 928d76c83ab..647f02b7469 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/index.js
@@ -2,15 +2,14 @@
* @fileoverview `ConfigArray` class.
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js
index e7ba1202f1c..460aafcf80c 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js
@@ -16,12 +16,14 @@
*
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js
index c0d0ea2284d..7fa111d3d40 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/flat-compat.js
@@ -3,16 +3,18 @@
* @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 path from "path";
+import { fileURLToPath } from "url";
+import createDebug from "debug";
+
+import { ConfigArrayFactory } from "./config-array-factory.js";
+import environments from "../conf/environments.js";
+
+const dirname = path.dirname(fileURLToPath(import.meta.url));
//-----------------------------------------------------------------------------
// Helpers
@@ -223,8 +225,8 @@ class FlatCompat {
this[cafactory] = new ConfigArrayFactory({
cwd: baseDirectory,
resolvePluginsRelativeTo,
- eslintAllPath: path.resolve(__dirname, "../conf/eslint-all.js"),
- eslintRecommendedPath: path.resolve(__dirname, "../conf/eslint-recommended.js")
+ eslintAllPath: path.resolve(dirname, "../conf/eslint-all.cjs"),
+ eslintRecommendedPath: path.resolve(dirname, "../conf/eslint-recommended.cjs")
});
}
@@ -305,4 +307,4 @@ class FlatCompat {
}
}
-exports.FlatCompat = FlatCompat;
+export { FlatCompat };
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index-universal.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index-universal.js
new file mode 100644
index 00000000000..6f6b30265f2
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index-universal.js
@@ -0,0 +1,29 @@
+/**
+ * @fileoverview Package exports for @eslint/eslintrc
+ * @author Nicholas C. Zakas
+ */
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+import * as ConfigOps from "./shared/config-ops.js";
+import ConfigValidator from "./shared/config-validator.js";
+import * as naming from "./shared/naming.js";
+import environments from "../conf/environments.js";
+
+//-----------------------------------------------------------------------------
+// Exports
+//-----------------------------------------------------------------------------
+
+const Legacy = {
+ environments,
+
+ // shared
+ ConfigOps,
+ ConfigValidator,
+ naming
+};
+
+export {
+ Legacy
+};
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index.js
index de2a95d986a..9e3d13f5fd0 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/index.js
@@ -2,52 +2,54 @@
* @fileoverview Package exports for @eslint/eslintrc
* @author Nicholas C. Zakas
*/
-"use strict";
-
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
-const {
+import {
ConfigArrayFactory,
- createContext: createConfigArrayFactoryContext
-} = require("./config-array-factory");
-
-const { CascadingConfigArrayFactory } = require("./cascading-config-array-factory");
-const ModuleResolver = require("./shared/relative-module-resolver");
-const { ConfigArray, getUsedExtractedConfigs } = require("./config-array");
-const { ConfigDependency } = require("./config-array/config-dependency");
-const { ExtractedConfig } = require("./config-array/extracted-config");
-const { IgnorePattern } = require("./config-array/ignore-pattern");
-const { OverrideTester } = require("./config-array/override-tester");
-const ConfigOps = require("./shared/config-ops");
-const ConfigValidator = require("./shared/config-validator");
-const naming = require("./shared/naming");
-const { FlatCompat } = require("./flat-compat");
+ createContext as createConfigArrayFactoryContext
+} from "./config-array-factory.js";
+
+import { CascadingConfigArrayFactory } from "./cascading-config-array-factory.js";
+import * as ModuleResolver from "./shared/relative-module-resolver.js";
+import { ConfigArray, getUsedExtractedConfigs } from "./config-array/index.js";
+import { ConfigDependency } from "./config-array/config-dependency.js";
+import { ExtractedConfig } from "./config-array/extracted-config.js";
+import { IgnorePattern } from "./config-array/ignore-pattern.js";
+import { OverrideTester } from "./config-array/override-tester.js";
+import * as ConfigOps from "./shared/config-ops.js";
+import ConfigValidator from "./shared/config-validator.js";
+import * as naming from "./shared/naming.js";
+import { FlatCompat } from "./flat-compat.js";
+import environments from "../conf/environments.js";
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
-module.exports = {
-
- Legacy: {
- ConfigArray,
- createConfigArrayFactoryContext,
- CascadingConfigArrayFactory,
- ConfigArrayFactory,
- ConfigDependency,
- ExtractedConfig,
- IgnorePattern,
- OverrideTester,
- getUsedExtractedConfigs,
-
- // shared
- ConfigOps,
- ConfigValidator,
- ModuleResolver,
- naming
- },
+const Legacy = {
+ ConfigArray,
+ createConfigArrayFactoryContext,
+ CascadingConfigArrayFactory,
+ ConfigArrayFactory,
+ ConfigDependency,
+ ExtractedConfig,
+ IgnorePattern,
+ OverrideTester,
+ getUsedExtractedConfigs,
+ environments,
+
+ // shared
+ ConfigOps,
+ ConfigValidator,
+ ModuleResolver,
+ naming
+};
+
+export {
+
+ Legacy,
FlatCompat
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js
index 3fb0fbdd33c..b79ad36c3c3 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/ajv.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js
index 3b4d5699d86..d203be0e0ef 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-ops.js
@@ -3,7 +3,6 @@
* so no Node-specific code can be here.
* @author Nicholas C. Zakas
*/
-"use strict";
//------------------------------------------------------------------------------
// Private
@@ -20,111 +19,117 @@ const RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
// Public Interface
//------------------------------------------------------------------------------
-module.exports = {
-
- /**
- * Normalizes the severity value of a rule's configuration to a number
- * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
- * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
- * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
- * whose first element is one of the above values. Strings are matched case-insensitively.
- * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
- */
- getRuleSeverity(ruleConfig) {
- const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
-
- if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
- return severityValue;
- }
-
- if (typeof severityValue === "string") {
- return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
- }
-
- return 0;
- },
-
- /**
- * Converts old-style severity settings (0, 1, 2) into new-style
- * severity settings (off, warn, error) for all rules. Assumption is that severity
- * values have already been validated as correct.
- * @param {Object} config The config object to normalize.
- * @returns {void}
- */
- normalizeToStrings(config) {
-
- if (config.rules) {
- Object.keys(config.rules).forEach(ruleId => {
- const ruleConfig = config.rules[ruleId];
-
- if (typeof ruleConfig === "number") {
- config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
- } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
- ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
- }
- });
- }
- },
-
- /**
- * Determines if the severity for the given rule configuration represents an error.
- * @param {int|string|Array} ruleConfig The configuration for an individual rule.
- * @returns {boolean} True if the rule represents an error, false if not.
- */
- isErrorSeverity(ruleConfig) {
- return module.exports.getRuleSeverity(ruleConfig) === 2;
- },
-
- /**
- * Checks whether a given config has valid severity or not.
- * @param {number|string|Array} ruleConfig The configuration for an individual rule.
- * @returns {boolean} `true` if the configuration has valid severity.
- */
- isValidSeverity(ruleConfig) {
- let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
-
- if (typeof severity === "string") {
- severity = severity.toLowerCase();
- }
- return VALID_SEVERITIES.indexOf(severity) !== -1;
- },
-
- /**
- * Checks whether every rule of a given config has valid severity or not.
- * @param {Object} config The configuration for rules.
- * @returns {boolean} `true` if the configuration has valid severity.
- */
- isEverySeverityValid(config) {
- return Object.keys(config).every(ruleId => this.isValidSeverity(config[ruleId]));
- },
-
- /**
- * Normalizes a value for a global in a config
- * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
- * a global directive comment
- * @returns {("readable"|"writeable"|"off")} The value normalized as a string
- * @throws Error if global value is invalid
- */
- normalizeConfigGlobal(configuredValue) {
- switch (configuredValue) {
- case "off":
- return "off";
-
- case true:
- case "true":
- case "writeable":
- case "writable":
- return "writable";
-
- case null:
- case false:
- case "false":
- case "readable":
- case "readonly":
- return "readonly";
-
- default:
- throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
- }
+/**
+ * Normalizes the severity value of a rule's configuration to a number
+ * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
+ * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
+ * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
+ * whose first element is one of the above values. Strings are matched case-insensitively.
+ * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
+ */
+function getRuleSeverity(ruleConfig) {
+ const severityValue = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (severityValue === 0 || severityValue === 1 || severityValue === 2) {
+ return severityValue;
+ }
+
+ if (typeof severityValue === "string") {
+ return RULE_SEVERITY[severityValue.toLowerCase()] || 0;
+ }
+
+ return 0;
+}
+
+/**
+ * Converts old-style severity settings (0, 1, 2) into new-style
+ * severity settings (off, warn, error) for all rules. Assumption is that severity
+ * values have already been validated as correct.
+ * @param {Object} config The config object to normalize.
+ * @returns {void}
+ */
+function normalizeToStrings(config) {
+
+ if (config.rules) {
+ Object.keys(config.rules).forEach(ruleId => {
+ const ruleConfig = config.rules[ruleId];
+
+ if (typeof ruleConfig === "number") {
+ config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
+ } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
+ ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
+ }
+ });
+ }
+}
+
+/**
+ * Determines if the severity for the given rule configuration represents an error.
+ * @param {int|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} True if the rule represents an error, false if not.
+ */
+function isErrorSeverity(ruleConfig) {
+ return getRuleSeverity(ruleConfig) === 2;
+}
+
+/**
+ * Checks whether a given config has valid severity or not.
+ * @param {number|string|Array} ruleConfig The configuration for an individual rule.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isValidSeverity(ruleConfig) {
+ let severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
+
+ if (typeof severity === "string") {
+ severity = severity.toLowerCase();
+ }
+ return VALID_SEVERITIES.indexOf(severity) !== -1;
+}
+
+/**
+ * Checks whether every rule of a given config has valid severity or not.
+ * @param {Object} config The configuration for rules.
+ * @returns {boolean} `true` if the configuration has valid severity.
+ */
+function isEverySeverityValid(config) {
+ return Object.keys(config).every(ruleId => isValidSeverity(config[ruleId]));
+}
+
+/**
+ * Normalizes a value for a global in a config
+ * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
+ * a global directive comment
+ * @returns {("readable"|"writeable"|"off")} The value normalized as a string
+ * @throws Error if global value is invalid
+ */
+function normalizeConfigGlobal(configuredValue) {
+ switch (configuredValue) {
+ case "off":
+ return "off";
+
+ case true:
+ case "true":
+ case "writeable":
+ case "writable":
+ return "writable";
+
+ case null:
+ case false:
+ case "false":
+ case "readable":
+ case "readonly":
+ return "readonly";
+
+ default:
+ throw new Error(`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`);
}
+}
+
+export {
+ getRuleSeverity,
+ normalizeToStrings,
+ isErrorSeverity,
+ isValidSeverity,
+ isEverySeverityValid,
+ normalizeConfigGlobal
};
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js
index 90869739ca4..32174a56b39 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/config-validator.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js
index 136fc255ff9..91907b1370f 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js
@@ -2,13 +2,12 @@
* @fileoverview Provide the function that emits deprecation warnings.
* @author Toru Nagashima <http://github.com/mysticatea>
*/
-"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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js
index 32cff94538a..93df5fc438b 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/naming.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js
index 80335c5cfca..1df0ca8071d 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js
@@ -3,42 +3,40 @@
* @author Teddy Katz
*/
-"use strict";
-
-const Module = require("module");
+import Module from "module";
/*
* `Module.createRequire` is added in v12.2.0. It supports URL as well.
* We only support the case where the argument is a filepath, not a URL.
*/
-// eslint-disable-next-line node/no-unsupported-features/node-builtins, node/no-deprecated-api
-const createRequire = Module.createRequire || Module.createRequireFromPath;
-
-module.exports = {
+const createRequire = Module.createRequire;
- /**
- * Resolves a Node module relative to another module
- * @param {string} moduleName The name of a Node module, or a path to a Node module.
- * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be
- * a file rather than a directory, but the file need not actually exist.
- * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`
- */
- resolve(moduleName, relativeToPath) {
- try {
- return createRequire(relativeToPath).resolve(moduleName);
- } catch (error) {
+/**
+ * Resolves a Node module relative to another module
+ * @param {string} moduleName The name of a Node module, or a path to a Node module.
+ * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be
+ * a file rather than a directory, but the file need not actually exist.
+ * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`
+ */
+function resolve(moduleName, relativeToPath) {
+ try {
+ return createRequire(relativeToPath).resolve(moduleName);
+ } catch (error) {
- // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.
- if (
- typeof error === "object" &&
- error !== null &&
- error.code === "MODULE_NOT_FOUND" &&
- !error.requireStack &&
- error.message.includes(moduleName)
- ) {
- error.message += `\nRequire stack:\n- ${relativeToPath}`;
- }
- throw error;
+ // This `if` block is for older Node.js than 12.0.0. We can remove this block in the future.
+ if (
+ typeof error === "object" &&
+ error !== null &&
+ error.code === "MODULE_NOT_FOUND" &&
+ !error.requireStack &&
+ error.message.includes(moduleName)
+ ) {
+ error.message += `\nRequire stack:\n- ${relativeToPath}`;
}
+ throw error;
}
+}
+
+export {
+ resolve
};
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/types.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/types.js
index d4ac14e26df..a32c35e3913 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/types.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/lib/shared/types.js
@@ -2,10 +2,9 @@
* @fileoverview Define common types for input completion.
* @author Toru Nagashima <https://github.com/mysticatea>
*/
-"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/tools/node_modules/eslint/node_modules/js-tokens/LICENSE b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE
index 54aef52f3a4..1afdae55840 100644
--- a/tools/node_modules/eslint/node_modules/js-tokens/LICENSE
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/LICENSE
@@ -1,6 +1,6 @@
-The MIT License (MIT)
+(The MIT License)
-Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
+Copyright (C) 2012 by Vitaly Puzrin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/README.md b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/README.md
new file mode 100644
index 00000000000..7fa6c40503e
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/README.md
@@ -0,0 +1,257 @@
+argparse
+========
+
+[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
+[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
+
+CLI arguments parser for node.js. Javascript port of python's
+[argparse](http://docs.python.org/dev/library/argparse.html) module
+(original version 3.2). That's a full port, except some very rare options,
+recorded in issue tracker.
+
+**NB. Difference with original.**
+
+- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
+- Use `defaultValue` instead of `default`.
+- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and
+ similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE`
+ (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and
+ `SUPPRESS`.
+
+
+Example
+=======
+
+test.js file:
+
+```javascript
+#!/usr/bin/env node
+'use strict';
+
+var ArgumentParser = require('../lib/argparse').ArgumentParser;
+var parser = new ArgumentParser({
+ version: '0.0.1',
+ addHelp:true,
+ description: 'Argparse example'
+});
+parser.addArgument(
+ [ '-f', '--foo' ],
+ {
+ help: 'foo bar'
+ }
+);
+parser.addArgument(
+ [ '-b', '--bar' ],
+ {
+ help: 'bar foo'
+ }
+);
+parser.addArgument(
+ '--baz',
+ {
+ help: 'baz bar'
+ }
+);
+var args = parser.parseArgs();
+console.dir(args);
+```
+
+Display help:
+
+```
+$ ./test.js -h
+usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
+
+Argparse example
+
+Optional arguments:
+ -h, --help Show this help message and exit.
+ -v, --version Show program's version number and exit.
+ -f FOO, --foo FOO foo bar
+ -b BAR, --bar BAR bar foo
+ --baz BAZ baz bar
+```
+
+Parse arguments:
+
+```
+$ ./test.js -f=3 --bar=4 --baz 5
+{ foo: '3', bar: '4', baz: '5' }
+```
+
+More [examples](https://github.com/nodeca/argparse/tree/master/examples).
+
+
+ArgumentParser objects
+======================
+
+```
+new ArgumentParser({parameters hash});
+```
+
+Creates a new ArgumentParser object.
+
+**Supported params:**
+
+- ```description``` - Text to display before the argument help.
+- ```epilog``` - Text to display after the argument help.
+- ```addHelp``` - Add a -h/ā€“help option to the parser. (default: true)
+- ```argumentDefault``` - Set the global default value for arguments. (default: null)
+- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.
+- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ā€˜-ā€˜)
+- ```formatterClass``` - A class for customizing the help output.
+- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`)
+- ```usage``` - The string describing the program usage (default: generated)
+- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.
+
+**Not supported yet**
+
+- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.
+
+
+Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)
+
+
+addArgument() method
+====================
+
+```
+ArgumentParser.addArgument(name or flag or [name] or [flags...], {options})
+```
+
+Defines how a single command-line argument should be parsed.
+
+- ```name or flag or [name] or [flags...]``` - Either a positional name
+ (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array
+ of a single positional name (e.g., `['foo']`), or an array of options
+ (e.g., `['-f', '--foo']`).
+
+Options:
+
+- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.
+- ```nargs```- The number of command-line arguments that should be consumed.
+- ```constant``` - A constant value required by some action and nargs selections.
+- ```defaultValue``` - The value produced if the argument is absent from the command line.
+- ```type``` - The type to which the command-line argument should be converted.
+- ```choices``` - A container of the allowable values for the argument.
+- ```required``` - Whether or not the command-line option may be omitted (optionals only).
+- ```help``` - A brief description of what the argument does.
+- ```metavar``` - A name for the argument in usage messages.
+- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().
+
+Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)
+
+
+Action (some details)
+================
+
+ArgumentParser objects associate command-line arguments with actions.
+These actions can do just about anything with the command-line arguments associated
+with them, though most actions simply add an attribute to the object returned by
+parseArgs(). The action keyword argument specifies how the command-line arguments
+should be handled. The supported actions are:
+
+- ```store``` - Just stores the argumentā€™s value. This is the default action.
+- ```storeConst``` - Stores value, specified by the const keyword argument.
+ (Note that the const keyword argument defaults to the rather unhelpful None.)
+ The 'storeConst' action is most commonly used with optional arguments, that
+ specify some sort of flag.
+- ```storeTrue``` and ```storeFalse``` - Stores values True and False
+ respectively. These are special cases of 'storeConst'.
+- ```append``` - Stores a list, and appends each argument value to the list.
+ This is useful to allow an option to be specified multiple times.
+- ```appendConst``` - Stores a list, and appends value, specified by the
+ const keyword argument to the list. (Note, that the const keyword argument defaults
+ is None.) The 'appendConst' action is typically used when multiple arguments need
+ to store constants to the same list.
+- ```count``` - Counts the number of times a keyword argument occurs. For example,
+ used for increasing verbosity levels.
+- ```help``` - Prints a complete help message for all the options in the current
+ parser and then exits. By default a help action is automatically added to the parser.
+ See ArgumentParser for details of how the output is created.
+- ```version``` - Prints version information and exit. Expects a `version=`
+ keyword argument in the addArgument() call.
+
+Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action)
+
+
+Sub-commands
+============
+
+ArgumentParser.addSubparsers()
+
+Many programs split their functionality into a number of sub-commands, for
+example, the svn program can invoke sub-commands like `svn checkout`, `svn update`,
+and `svn commit`. Splitting up functionality this way can be a particularly good
+idea when a program performs several different functions which require different
+kinds of command-line arguments. `ArgumentParser` supports creation of such
+sub-commands with `addSubparsers()` method. The `addSubparsers()` method is
+normally called with no arguments and returns an special action object.
+This object has a single method `addParser()`, which takes a command name and
+any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object
+that can be modified as usual.
+
+Example:
+
+sub_commands.js
+```javascript
+#!/usr/bin/env node
+'use strict';
+
+var ArgumentParser = require('../lib/argparse').ArgumentParser;
+var parser = new ArgumentParser({
+ version: '0.0.1',
+ addHelp:true,
+ description: 'Argparse examples: sub-commands',
+});
+
+var subparsers = parser.addSubparsers({
+ title:'subcommands',
+ dest:"subcommand_name"
+});
+
+var bar = subparsers.addParser('c1', {addHelp:true});
+bar.addArgument(
+ [ '-f', '--foo' ],
+ {
+ action: 'store',
+ help: 'foo3 bar3'
+ }
+);
+var bar = subparsers.addParser(
+ 'c2',
+ {aliases:['co'], addHelp:true}
+);
+bar.addArgument(
+ [ '-b', '--bar' ],
+ {
+ action: 'store',
+ type: 'int',
+ help: 'foo3 bar3'
+ }
+);
+
+var args = parser.parseArgs();
+console.dir(args);
+
+```
+
+Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)
+
+
+Contributors
+============
+
+- [Eugene Shkuropat](https://github.com/shkuropat)
+- [Paul Jacobson](https://github.com/hpaulj)
+
+[others](https://github.com/nodeca/argparse/graphs/contributors)
+
+License
+=======
+
+Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
+Released under the MIT license. See
+[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
+
+
diff --git a/tools/node_modules/eslint/node_modules/argparse/index.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/index.js
index 3bbc1432004..3bbc1432004 100644
--- a/tools/node_modules/eslint/node_modules/argparse/index.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/index.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action.js
index 1483c79ffa5..1483c79ffa5 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/append.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append.js
index b5da0de2327..b5da0de2327 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/append.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/append/constant.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append/constant.js
index 313f5d2efcb..313f5d2efcb 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/append/constant.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/append/constant.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/count.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/count.js
index d6a5899d07e..d6a5899d07e 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/count.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/count.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/help.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/help.js
index b40e05a6f0b..b40e05a6f0b 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/help.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/help.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/store.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store.js
index 283b8609217..283b8609217 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/store.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/constant.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/constant.js
index 23caa897b37..23caa897b37 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/constant.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/constant.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/false.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/false.js
index 9924f461dad..9924f461dad 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/false.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/false.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/true.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/true.js
index 9e22f7d4419..9e22f7d4419 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/store/true.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/store/true.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/subparsers.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/subparsers.js
index 99dfedd0f1a..99dfedd0f1a 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/subparsers.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/subparsers.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action/version.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/version.js
index 8053328cdef..8053328cdef 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action/version.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action/version.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/action_container.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action_container.js
index 6f1237bea23..6f1237bea23 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/action_container.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/action_container.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/argparse.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argparse.js
index f2a2c51d9a8..f2a2c51d9a8 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/argparse.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argparse.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/argument/error.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/error.js
index c8a02a08b8f..c8a02a08b8f 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/argument/error.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/error.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/argument/exclusive.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/exclusive.js
index 8287e00d046..8287e00d046 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/argument/exclusive.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/exclusive.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/argument/group.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/group.js
index 58b271f2fec..58b271f2fec 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/argument/group.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument/group.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/argument_parser.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument_parser.js
index bd9a59a453c..bd9a59a453c 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/argument_parser.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/argument_parser.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/const.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/const.js
index b1fd4ced4e8..b1fd4ced4e8 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/const.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/const.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/help/added_formatters.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/added_formatters.js
index f8e42998e9b..f8e42998e9b 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/help/added_formatters.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/added_formatters.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/help/formatter.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/formatter.js
index 29036c14b2e..29036c14b2e 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/help/formatter.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/help/formatter.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/namespace.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/namespace.js
index a860de9ecc4..a860de9ecc4 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/namespace.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/namespace.js
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/utils.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/utils.js
index 4a9cf3edb61..4a9cf3edb61 100644
--- a/tools/node_modules/eslint/node_modules/argparse/lib/utils.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/lib/utils.js
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/package.json
new file mode 100644
index 00000000000..62fba0a9fcf
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/argparse/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "argparse",
+ "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
+ "version": "1.0.10",
+ "keywords": [
+ "cli",
+ "parser",
+ "argparse",
+ "option",
+ "args"
+ ],
+ "contributors": [
+ "Eugene Shkuropat",
+ "Paul Jacobson"
+ ],
+ "files": [
+ "index.js",
+ "lib/"
+ ],
+ "license": "MIT",
+ "repository": "nodeca/argparse",
+ "scripts": {
+ "test": "make test"
+ },
+ "dependencies": {
+ "sprintf-js": "~1.0.2"
+ },
+ "devDependencies": {
+ "eslint": "^2.13.1",
+ "istanbul": "^0.4.5",
+ "mocha": "^3.1.0",
+ "ndoc": "^5.0.1"
+ }
+}
diff --git a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/license b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE
index 654d0bfe943..09d3a29e93d 100644
--- a/tools/node_modules/eslint/node_modules/@babel/highlight/node_modules/escape-string-regexp/license
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/LICENSE
@@ -1,6 +1,6 @@
-The MIT License (MIT)
+(The MIT License)
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+Copyright (C) 2011-2015 by Vitaly Puzrin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md
new file mode 100644
index 00000000000..246e5635514
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/README.md
@@ -0,0 +1,299 @@
+JS-YAML - YAML 1.2 parser / writer for JavaScript
+=================================================
+
+[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml)
+[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
+
+__[Online Demo](http://nodeca.github.com/js-yaml/)__
+
+
+This is an implementation of [YAML](http://yaml.org/), a human-friendly data
+serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
+completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
+
+
+Installation
+------------
+
+### YAML module for node.js
+
+```
+npm install js-yaml
+```
+
+
+### CLI executable
+
+If you want to inspect your YAML files from CLI, install js-yaml globally:
+
+```
+npm install -g js-yaml
+```
+
+#### Usage
+
+```
+usage: js-yaml [-h] [-v] [-c] [-t] file
+
+Positional arguments:
+ file File with YAML document(s)
+
+Optional arguments:
+ -h, --help Show this help message and exit.
+ -v, --version Show program's version number and exit.
+ -c, --compact Display errors in compact mode
+ -t, --trace Show stack trace on error
+```
+
+
+### Bundled YAML library for browsers
+
+``` html
+<!-- esprima required only for !!js/function -->
+<script src="esprima.js"></script>
+<script src="js-yaml.min.js"></script>
+<script type="text/javascript">
+var doc = jsyaml.load('greeting: hello\nname: world');
+</script>
+```
+
+Browser support was done mostly for the online demo. If you find any errors - feel
+free to send pull requests with fixes. Also note, that IE and other old browsers
+needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.
+
+Notes:
+
+1. We have no resources to support browserified version. Don't expect it to be
+ well tested. Don't expect fast fixes if something goes wrong there.
+2. `!!js/function` in browser bundle will not work by default. If you really need
+ it - load `esprima` parser first (via amd or directly).
+3. `!!bin` in browser will return `Array`, because browsers do not support
+ node.js `Buffer` and adding Buffer shims is completely useless on practice.
+
+
+API
+---
+
+Here we cover the most 'useful' methods. If you need advanced details (creating
+your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
+[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more
+info.
+
+``` javascript
+const yaml = require('js-yaml');
+const fs = require('fs');
+
+// Get document, or throw exception on error
+try {
+ const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
+ console.log(doc);
+} catch (e) {
+ console.log(e);
+}
+```
+
+
+### safeLoad (string [ , options ])
+
+**Recommended loading way.** Parses `string` as single YAML document. Returns either a
+plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does
+not support regexps, functions and undefined. This method is safe for untrusted data.
+
+options:
+
+- `filename` _(default: null)_ - string to be used as a file path in
+ error/warning messages.
+- `onWarning` _(default: null)_ - function to call on warning messages.
+ Loader will call this function with an instance of `YAMLException` for each warning.
+- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.
+ - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
+ http://www.yaml.org/spec/1.2/spec.html#id2802346
+ - `JSON_SCHEMA` - all JSON-supported types:
+ http://www.yaml.org/spec/1.2/spec.html#id2803231
+ - `CORE_SCHEMA` - same as `JSON_SCHEMA`:
+ http://www.yaml.org/spec/1.2/spec.html#id2804923
+ - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones
+ (`!!js/undefined`, `!!js/regexp` and `!!js/function`):
+ http://yaml.org/type/
+ - `DEFAULT_FULL_SCHEMA` - all supported YAML types.
+- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
+
+NOTE: This function **does not** understand multi-document sources, it throws
+exception on those.
+
+NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
+So, the JSON schema is not as strictly defined in the YAML specification.
+It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
+The core schema also has no such restrictions. It allows binary notation for integers.
+
+
+### load (string [ , options ])
+
+**Use with care with untrusted sources**. The same as `safeLoad()` but uses
+`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
+`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you
+must additionally validate object structure to avoid injections:
+
+``` javascript
+const untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
+
+// I'm just converting that string, what could possibly go wrong?
+require('js-yaml').load(untrusted_code) + ''
+```
+
+
+### safeLoadAll (string [, iterator] [, options ])
+
+Same as `safeLoad()`, but understands multi-document sources. Applies
+`iterator` to each document if specified, or returns array of documents.
+
+``` javascript
+const yaml = require('js-yaml');
+
+yaml.safeLoadAll(data, function (doc) {
+ console.log(doc);
+});
+```
+
+
+### loadAll (string [, iterator] [ , options ])
+
+Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
+
+
+### safeDump (object [ , options ])
+
+Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
+throw an exception if you try to dump regexps or functions. However, you can
+disable exceptions by setting the `skipInvalid` option to `true`.
+
+options:
+
+- `indent` _(default: 2)_ - indentation width to use (in spaces).
+- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
+- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
+ in the safe schema) and skip pairs and single values with such types.
+- `flowLevel` (default: -1) - specifies level of nesting, when to switch from
+ block to flow style for collections. -1 means block style everwhere
+- `styles` - "tag" => "style" map. Each tag may have own set of styles.
+- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.
+- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
+ function, use the function to sort the keys.
+- `lineWidth` _(default: `80`)_ - set max line width.
+- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
+- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
+ yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
+- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
+
+The following table show availlable styles (e.g. "canonical",
+"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
+output is shown on the right side after `=>` (default setting) or `->`:
+
+``` none
+!!null
+ "canonical" -> "~"
+ "lowercase" => "null"
+ "uppercase" -> "NULL"
+ "camelcase" -> "Null"
+
+!!int
+ "binary" -> "0b1", "0b101010", "0b1110001111010"
+ "octal" -> "01", "052", "016172"
+ "decimal" => "1", "42", "7290"
+ "hexadecimal" -> "0x1", "0x2A", "0x1C7A"
+
+!!bool
+ "lowercase" => "true", "false"
+ "uppercase" -> "TRUE", "FALSE"
+ "camelcase" -> "True", "False"
+
+!!float
+ "lowercase" => ".nan", '.inf'
+ "uppercase" -> ".NAN", '.INF'
+ "camelcase" -> ".NaN", '.Inf'
+```
+
+Example:
+
+``` javascript
+safeDump (object, {
+ 'styles': {
+ '!!null': 'canonical' // dump null as ~
+ },
+ 'sortKeys': true // sort object keys
+});
+```
+
+### dump (object [ , options ])
+
+Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default).
+
+
+Supported YAML types
+--------------------
+
+The list of standard YAML tags and corresponding JavaScipt types. See also
+[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and
+[YAML types repository](http://yaml.org/type/).
+
+```
+!!null '' # null
+!!bool 'yes' # bool
+!!int '3...' # number
+!!float '3.14...' # number
+!!binary '...base64...' # buffer
+!!timestamp 'YYYY-...' # date
+!!omap [ ... ] # array of key-value pairs
+!!pairs [ ... ] # array or array pairs
+!!set { ... } # array of objects with given keys and null values
+!!str '...' # string
+!!seq [ ... ] # array
+!!map { ... } # object
+```
+
+**JavaScript-specific tags**
+
+```
+!!js/regexp /pattern/gim # RegExp
+!!js/undefined '' # Undefined
+!!js/function 'function () {...}' # Function
+```
+
+Caveats
+-------
+
+Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
+or arrays as keys, and stringifies (by calling `toString()` method) them at the
+moment of adding them.
+
+``` yaml
+---
+? [ foo, bar ]
+: - baz
+? { foo: bar }
+: - baz
+ - baz
+```
+
+``` javascript
+{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
+```
+
+Also, reading of properties on implicit block mapping keys is not supported yet.
+So, the following YAML document cannot be loaded.
+
+``` yaml
+&anchor foo:
+ foo: bar
+ *anchor: duplicate key
+ baz: bat
+ *anchor: duplicate key
+```
+
+
+js-yaml for enterprise
+----------------------
+
+Available as part of the Tidelift Subscription
+
+The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js
new file mode 100755
index 00000000000..e79186be6f5
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/bin/js-yaml.js
@@ -0,0 +1,132 @@
+#!/usr/bin/env node
+
+
+'use strict';
+
+/*eslint-disable no-console*/
+
+
+// stdlib
+var fs = require('fs');
+
+
+// 3rd-party
+var argparse = require('argparse');
+
+
+// internal
+var yaml = require('..');
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+var cli = new argparse.ArgumentParser({
+ prog: 'js-yaml',
+ version: require('../package.json').version,
+ addHelp: true
+});
+
+
+cli.addArgument([ '-c', '--compact' ], {
+ help: 'Display errors in compact mode',
+ action: 'storeTrue'
+});
+
+
+// deprecated (not needed after we removed output colors)
+// option suppressed, but not completely removed for compatibility
+cli.addArgument([ '-j', '--to-json' ], {
+ help: argparse.Const.SUPPRESS,
+ dest: 'json',
+ action: 'storeTrue'
+});
+
+
+cli.addArgument([ '-t', '--trace' ], {
+ help: 'Show stack trace on error',
+ action: 'storeTrue'
+});
+
+cli.addArgument([ 'file' ], {
+ help: 'File to read, utf-8 encoded without BOM',
+ nargs: '?',
+ defaultValue: '-'
+});
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+
+var options = cli.parseArgs();
+
+
+////////////////////////////////////////////////////////////////////////////////
+
+function readFile(filename, encoding, callback) {
+ if (options.file === '-') {
+ // read from stdin
+
+ var chunks = [];
+
+ process.stdin.on('data', function (chunk) {
+ chunks.push(chunk);
+ });
+
+ process.stdin.on('end', function () {
+ return callback(null, Buffer.concat(chunks).toString(encoding));
+ });
+ } else {
+ fs.readFile(filename, encoding, callback);
+ }
+}
+
+readFile(options.file, 'utf8', function (error, input) {
+ var output, isYaml;
+
+ if (error) {
+ if (error.code === 'ENOENT') {
+ console.error('File not found: ' + options.file);
+ process.exit(2);
+ }
+
+ console.error(
+ options.trace && error.stack ||
+ error.message ||
+ String(error));
+
+ process.exit(1);
+ }
+
+ try {
+ output = JSON.parse(input);
+ isYaml = false;
+ } catch (err) {
+ if (err instanceof SyntaxError) {
+ try {
+ output = [];
+ yaml.loadAll(input, function (doc) { output.push(doc); }, {});
+ isYaml = true;
+
+ if (output.length === 0) output = null;
+ else if (output.length === 1) output = output[0];
+
+ } catch (e) {
+ if (options.trace && err.stack) console.error(e.stack);
+ else console.error(e.toString(options.compact));
+
+ process.exit(1);
+ }
+ } else {
+ console.error(
+ options.trace && err.stack ||
+ err.message ||
+ String(err));
+
+ process.exit(1);
+ }
+ }
+
+ if (isYaml) console.log(JSON.stringify(output, null, ' '));
+ else console.log(yaml.dump(output));
+});
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js
new file mode 100644
index 00000000000..7878320743c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.js
@@ -0,0 +1,3989 @@
+/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
+'use strict';
+
+
+var loader = require('./js-yaml/loader');
+var dumper = require('./js-yaml/dumper');
+
+
+function deprecated(name) {
+ return function () {
+ throw new Error('Function ' + name + ' is deprecated and cannot be used.');
+ };
+}
+
+
+module.exports.Type = require('./js-yaml/type');
+module.exports.Schema = require('./js-yaml/schema');
+module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
+module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
+module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.safeLoad = loader.safeLoad;
+module.exports.safeLoadAll = loader.safeLoadAll;
+module.exports.dump = dumper.dump;
+module.exports.safeDump = dumper.safeDump;
+module.exports.YAMLException = require('./js-yaml/exception');
+
+// Deprecated schema names from JS-YAML 2.0.x
+module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
+module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
+module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
+
+// Deprecated functions from JS-YAML 1.x.x
+module.exports.scan = deprecated('scan');
+module.exports.parse = deprecated('parse');
+module.exports.compose = deprecated('compose');
+module.exports.addConstructor = deprecated('addConstructor');
+
+},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (subject === null);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (subject !== null);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
+
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
+
+},{}],3:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_EQUALS = 0x3D; /* = */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.noArrayIndent = options['noArrayIndent'] || false;
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+ this.noRefs = options['noRefs'] || false;
+ this.noCompatMode = options['noCompatMode'] || false;
+ this.condenseFlow = options['condenseFlow'] || false;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+// Indents every line in a string. Empty lines (\n only) are not indented.
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+
+ if (line.length && line !== '\n') result += ind;
+
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// [33] s-white ::= s-space | s-tab
+function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+}
+
+// Returns true if the character can be printed without escaping.
+// From YAML 1.2: "any allowed characters known to be non-printable
+// should also be escaped. [However,] This isnā€™t mandatory"
+// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
+ || (0x10000 <= c && c <= 0x10FFFF);
+}
+
+// [34] ns-char ::= nb-char - s-white
+// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+// [26] b-char ::= b-line-feed | b-carriage-return
+// [24] b-line-feed ::= #xA /* LF */
+// [25] b-carriage-return ::= #xD /* CR */
+// [3] c-byte-order-mark ::= #xFEFF
+function isNsChar(c) {
+ return isPrintable(c) && !isWhitespace(c)
+ // byte-order-mark
+ && c !== 0xFEFF
+ // b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+}
+
+// Simplified test for values allowed after the first character in plain style.
+function isPlainSafe(c, prev) {
+ // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
+ // where nb-char ::= c-printable - b-char - c-byte-order-mark.
+ return isPrintable(c) && c !== 0xFEFF
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // - ":" - "#"
+ // /* An ns-char preceding */ "#"
+ && c !== CHAR_COLON
+ && ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
+}
+
+// Simplified test for values allowed as the first character in plain style.
+function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ return isPrintable(c) && c !== 0xFEFF
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // ā€œ-ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ,ā€ | ā€œ[ā€ | ā€œ]ā€ | ā€œ{ā€ | ā€œ}ā€
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | ā€œ#ā€ | ā€œ&ā€ | ā€œ*ā€ | ā€œ!ā€ | ā€œ|ā€ | ā€œ=ā€ | ā€œ>ā€ | ā€œ'ā€ | ā€œ"ā€
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | ā€œ%ā€ | ā€œ@ā€ | ā€œ`ā€)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+}
+
+// Determines whether block indentation indicator is required.
+function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+}
+
+var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+// Determines which scalar styles are possible and returns the preferred style.
+// lineWidth = -1 => no limit.
+// Pre-conditions: str.length > 0.
+// Post-conditions:
+// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
+ var i;
+ var char, prev_char;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(string.charCodeAt(0))
+ && !isWhitespace(string.charCodeAt(string.length - 1));
+
+ if (singleLineOnly) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; i++) {
+ char = string.charCodeAt(i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
+ plain = plain && isPlainSafe(char, prev_char);
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; i++) {
+ char = string.charCodeAt(i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
+ plain = plain && isPlainSafe(char, prev_char);
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ return plain && !testAmbiguousType(string)
+ ? STYLE_PLAIN : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+}
+
+// Note: line breaking/folding is implemented for only the folded style.
+// NB. We drop the last trailing newline (if any) of a returned block scalar
+// since the dumper adds its own newline. This always works:
+// ā€¢ No ending newline => unaffected; already using strip "-" chomping.
+// ā€¢ Ending newline => removed then restored.
+// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+function writeScalar(state, string, level, iskey) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return "''";
+ }
+ if (!state.noCompatMode &&
+ DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
+ return "'" + string + "'";
+ }
+
+ var indent = state.indent * Math.max(1, level); // no 0-indent scalars
+ // As indentation gets deeper, let the width decrease monotonically
+ // to the lower bound min(state.lineWidth, 40).
+ // Note that this implies
+ // state.lineWidth ā‰¤ 40 + state.indent: width is fixed at the lower bound.
+ // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
+ // This behaves better than a constant minimum width which disallows narrower options,
+ // or an indent threshold which causes the width to suddenly increase.
+ var lineWidth = state.lineWidth === -1
+ ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
+
+ // Without knowing if keys are implicit/explicit, assume implicit for safety.
+ var singleLineOnly = iskey
+ // No block styles in flow mode.
+ || (state.flowLevel > -1 && level >= state.flowLevel);
+ function testAmbiguity(string) {
+ return testImplicitResolving(state, string);
+ }
+
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string, lineWidth) + '"';
+ default:
+ throw new YAMLException('impossible error: invalid scalar style');
+ }
+ }());
+}
+
+// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+}
+
+// (See the note for writeScalar.)
+function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+}
+
+// Note: a long line without a suitable break point will exceed the width limit.
+// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlinesā€”
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+}
+
+// Greedy line breaking.
+// Picks the longest line under the limit each time,
+// otherwise settles for the shortest line over the limit.
+// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
+
+ // By the invariants, start <= length-1, so there is something left over.
+ // It is either the whole string or a part starting from non-whitespace.
+ result += '\n';
+ // Insert a break if the remainder is too long and there is a break available.
+ if (line.length - start > width && curr > start) {
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
+ } else {
+ result += line.slice(start);
+ }
+
+ return result.slice(1); // drop extra \n joiner
+}
+
+// Escapes a double-quoted string.
+function escapeString(string) {
+ var result = '';
+ var char, nextChar;
+ var escapeSeq;
+
+ for (var i = 0; i < string.length; i++) {
+ char = string.charCodeAt(i);
+ // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
+ if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
+ nextChar = string.charCodeAt(i + 1);
+ if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
+ // Combine the surrogate pair and store it escaped.
+ result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
+ // Advance index one extra since we already used that char here.
+ i++; continue;
+ }
+ }
+ escapeSeq = ESCAPE_SEQUENCES[char];
+ result += !escapeSeq && isPrintable(char)
+ ? string[i]
+ : escapeSeq || encodeHex(char);
+ }
+
+ return result;
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level, object[index], false, false)) {
+ if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ // Write only valid elements.
+ if (writeNode(state, level + 1, object[index], true, true)) {
+ if (!compact || index !== 0) {
+ _result += generateNextLine(state, level);
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
+
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+
+ pairBuffer = '';
+ if (index !== 0) pairBuffer += ', ';
+
+ if (state.condenseFlow) pairBuffer += '"';
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) pairBuffer += '? ';
+
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || index !== 0) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ state.tag = explicit ? type.tag : '?';
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if (_toString.call(type.represent) === '[object Function]') {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
+
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type === '[object Object]') {
+ if (block && (Object.keys(state.dump).length !== 0)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object Array]') {
+ var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
+ if (block && (state.dump.length !== 0)) {
+ writeBlockSequence(state, arrayLevel, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, arrayLevel, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object String]') {
+ if (state.tag !== '?') {
+ writeScalar(state, state.dump, level, iskey);
+ }
+ } else {
+ if (state.skipInvalid) return false;
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (state.tag !== null && state.tag !== '?') {
+ state.dump = '!<' + state.tag + '> ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (object !== null && typeof object === 'object') {
+ index = objects.indexOf(object);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ if (!state.noRefs) getDuplicateReferences(input, state);
+
+ if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
+
+ return '';
+}
+
+function safeDump(input, options) {
+ return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+module.exports.dump = dump;
+module.exports.safeDump = safeDump;
+
+},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){
+// YAML error class. http://stackoverflow.com/questions/8458984
+//
+'use strict';
+
+function YAMLException(reason, mark) {
+ // Super constructor
+ Error.call(this);
+
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
+
+ // Include stack trace in error object
+ if (Error.captureStackTrace) {
+ // Chrome and NodeJS
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ // FF, IE 10+ and Safari 6+. Fallback for others
+ this.stack = (new Error()).stack || '';
+ }
+}
+
+
+// Inherit from Error
+YAMLException.prototype = Object.create(Error.prototype);
+YAMLException.prototype.constructor = YAMLException;
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ var result = this.name + ': ';
+
+ result += this.reason || '(unknown reason)';
+
+ if (!compact && this.mark) {
+ result += ' ' + this.mark.toString();
+ }
+
+ return result;
+};
+
+
+module.exports = YAMLException;
+
+},{}],5:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Mark = require('./mark');
+var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function _class(obj) { return Object.prototype.toString.call(obj); }
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ /* eslint-disable indent */
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(
+ ((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00
+ );
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ this.legacy = options['legacy'] || false;
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ return new YAMLException(
+ message,
+ new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 0x09 ||
+ (0x20 <= _character && _character <= 0x10FFFF))) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+}
+
+function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
+ var index, quantity;
+
+ // The output is a plain object here, so keys can only be strings.
+ // We need to convert keyNode to a string, but doing so can hang the process
+ // (deeply nested arrays that explode exponentially using aliases).
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state, 'nested arrays are not supported inside keys');
+ }
+
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
+
+ // Avoid code execution in load() via toString property
+ // (still use its own toString for arrays, timestamps,
+ // and whatever user schema extensions happen to have @@toStringTag)
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
+ keyNode = '[object Object]';
+ }
+
+
+ keyNode = String(keyNode);
+
+ if (_result === null) {
+ _result = {};
+ }
+
+ if (keyTag === 'tag:yaml.org,2002:merge') {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state.json &&
+ !_hasOwnProperty.call(overridableKeys, keyNode) &&
+ _hasOwnProperty.call(_result, keyNode)) {
+ state.line = startLine || state.line;
+ state.position = startPos || state.position;
+ throwError(state, 'duplicated mapping key');
+ }
+ _result[keyNode] = valueNode;
+ delete overridableKeys[keyNode];
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x0A/* LF */) {
+ state.position++;
+ } else if (ch === 0x0D/* CR */) {
+ state.position++;
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
+ ch === state.input.charCodeAt(_position + 1) &&
+ ch === state.input.charCodeAt(_position + 2)) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ ch === 0x23/* # */ ||
+ ch === 0x26/* & */ ||
+ ch === 0x2A/* * */ ||
+ ch === 0x21/* ! */ ||
+ ch === 0x7C/* | */ ||
+ ch === 0x3E/* > */ ||
+ ch === 0x27/* ' */ ||
+ ch === 0x22/* " */ ||
+ ch === 0x25/* % */ ||
+ ch === 0x40/* @ */ ||
+ ch === 0x60/* ` */) {
+ return false;
+ }
+
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (ch !== 0) {
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (ch === 0x23/* # */) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x22/* " */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = {},
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (ch === 0x3F/* ? */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (ch !== 0));
+ }
+ }
+
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ // except for the first content line (cf. Example 8.1)
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (emptyLines === 0) {
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else {
+ // Keep all line breaks except the header line break.
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ }
+
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (ch !== 0)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _pos,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ overridableKeys = {},
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+ _pos = state.position;
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
+
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x3A/* : */) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else {
+ break; // Reading is done. Go to the epilogue.
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if (state.lineIndent > nodeIndent && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x21/* ! */) return false;
+
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x3C/* < */) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (ch === 0x21/* ! */) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
+
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x26/* & */) return false;
+
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x2A/* * */) return false;
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ type,
+ flowIndent,
+ blockIndent;
+
+ if (state.listener !== null) {
+ state.listener('open', state);
+ }
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (indentStatus === 1) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (indentStatus === 1) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (indentStatus === 0) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (state.tag !== null && state.tag !== '!') {
+ if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!<?> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+ }
+
+ if (state.listener !== null) {
+ state.listener('close', state);
+ }
+ return state.tag !== null || state.anchor !== null || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = {};
+ state.anchorMap = {};
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) break;
+
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (ch !== 0) readLineBreak(state);
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (state.lineIndent === 0 &&
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ var nullpos = input.indexOf('\0');
+
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ var documents = loadDocuments(input, options);
+
+ if (typeof iterator !== 'function') {
+ return documents;
+ }
+
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (documents.length === 0) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+function safeLoadAll(input, iterator, options) {
+ if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+function safeLoad(input, options) {
+ return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
+module.exports.safeLoadAll = safeLoadAll;
+module.exports.safeLoad = safeLoad;
+
+},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
+'use strict';
+
+
+var common = require('./common');
+
+
+function Mark(name, buffer, position, line, column) {
+ this.name = name;
+ this.buffer = buffer;
+ this.position = position;
+ this.line = line;
+ this.column = column;
+}
+
+
+Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
+ var head, start, tail, end, snippet;
+
+ if (!this.buffer) return null;
+
+ indent = indent || 4;
+ maxLength = maxLength || 75;
+
+ head = '';
+ start = this.position;
+
+ while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
+ start -= 1;
+ if (this.position - start > (maxLength / 2 - 1)) {
+ head = ' ... ';
+ start += 5;
+ break;
+ }
+ }
+
+ tail = '';
+ end = this.position;
+
+ while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
+ end += 1;
+ if (end - this.position > (maxLength / 2 - 1)) {
+ tail = ' ... ';
+ end -= 5;
+ break;
+ }
+ }
+
+ snippet = this.buffer.slice(start, end);
+
+ return common.repeat(' ', indent) + head + snippet + tail + '\n' +
+ common.repeat(' ', indent + this.position - start + head.length) + '^';
+};
+
+
+Mark.prototype.toString = function toString(compact) {
+ var snippet, where = '';
+
+ if (this.name) {
+ where += 'in "' + this.name + '" ';
+ }
+
+ where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+
+ if (!compact) {
+ snippet = this.getSnippet();
+
+ if (snippet) {
+ where += ':\n' + snippet;
+ }
+ }
+
+ return where;
+};
+
+
+module.exports = Mark;
+
+},{"./common":2}],7:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable max-len*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name, result) {
+ var exclude = [];
+
+ schema.include.forEach(function (includedSchema) {
+ result = compileList(includedSchema, name, result);
+ });
+
+ schema[name].forEach(function (currentType) {
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
+ exclude.push(previousIndex);
+ }
+ });
+
+ result.push(currentType);
+ });
+
+ return result.filter(function (type, index) {
+ return exclude.indexOf(index) === -1;
+ });
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {}
+ }, index, length;
+
+ function collectType(type) {
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+}
+
+
+function Schema(definition) {
+ this.include = definition.include || [];
+ this.implicit = definition.implicit || [];
+ this.explicit = definition.explicit || [];
+
+ this.implicit.forEach(function (type) {
+ if (type.loadKind && type.loadKind !== 'scalar') {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+ });
+
+ this.compiledImplicit = compileList(this, 'implicit', []);
+ this.compiledExplicit = compileList(this, 'explicit', []);
+ this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
+}
+
+
+Schema.DEFAULT = null;
+
+
+Schema.create = function createSchema() {
+ var schemas, types;
+
+ switch (arguments.length) {
+ case 1:
+ schemas = Schema.DEFAULT;
+ types = arguments[0];
+ break;
+
+ case 2:
+ schemas = arguments[0];
+ types = arguments[1];
+ break;
+
+ default:
+ throw new YAMLException('Wrong number of arguments for Schema.create function');
+ }
+
+ schemas = common.toArray(schemas);
+ types = common.toArray(types);
+
+ if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
+ throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
+ }
+
+ if (!types.every(function (type) { return type instanceof Type; })) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ return new Schema({
+ include: schemas,
+ explicit: types
+ });
+};
+
+
+module.exports = Schema;
+
+},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./json')
+ ]
+});
+
+},{"../schema":7,"./json":12}],9:[function(require,module,exports){
+// JS-YAML's default schema for `load` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on JS-YAML's default safe schema and includes
+// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
+//
+// Also this schema is used as default base schema at `Schema.create` function.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = Schema.DEFAULT = new Schema({
+ include: [
+ require('./default_safe')
+ ],
+ explicit: [
+ require('../type/js/undefined'),
+ require('../type/js/regexp'),
+ require('../type/js/function')
+ ]
+});
+
+},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./core')
+ ],
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
+
+},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
+
+},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ include: [
+ require('./failsafe')
+ ],
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
+
+},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (map !== null) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
+
+},{"./exception":4}],14:[function(require,module,exports){
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+var NodeBuffer;
+
+try {
+ // A trick for browserified version, to not include `Buffer` shim
+ var _require = require;
+ NodeBuffer = _require('buffer').Buffer;
+} catch (__) {}
+
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (data === null) return false;
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) continue;
+
+ // Fail on illegal characters
+ if (code < 0) return false;
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ // Wrap into Buffer for NodeJS and leave Array for browser
+ if (NodeBuffer) {
+ // Support node 6.+ Buffer API when available
+ return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
+ }
+
+ return result;
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(object) {
+ return NodeBuffer && NodeBuffer.isBuffer(object);
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+},{"../type":13}],15:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (data === null) return false;
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":13}],16:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
+ // .2e4, .2
+ // special case, seems not from spec
+ '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
+ // 20:59
+ '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
+ // .inf
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ // .nan
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (data === null) return false;
+
+ if (!YAML_FLOAT_PATTERN.test(data) ||
+ // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data[data.length - 1] === '_') {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign, base, digits;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
+ digits = [];
+
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
+
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if (value === '.nan') {
+ return NaN;
+
+ } else if (value.indexOf(':') >= 0) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseFloat(v, 10));
+ });
+
+ value = 0.0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += d * base;
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase': return '.nan';
+ case 'uppercase': return '.NAN';
+ case 'camelcase': return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '.inf';
+ case 'uppercase': return '.INF';
+ case 'camelcase': return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '-.inf';
+ case 'uppercase': return '-.INF';
+ case 'camelcase': return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+},{"../common":2,"../type":13}],17:[function(require,module,exports){
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (data === null) return false;
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) return false;
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+ // base 8
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+ // base 10 (except 0) or base 60
+
+ // value should not start with `_`;
+ if (ch === '_') return false;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch === ':') break;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
+
+ // if !base60 - done;
+ if (ch !== ':') return true;
+
+ // base60 almost not used, no needs to optimize
+ return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch, base, digits = [];
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if (value === '0') return 0;
+
+ if (ch === '0') {
+ if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
+ if (value[1] === 'x') return sign * parseInt(value, 16);
+ return sign * parseInt(value, 8);
+ }
+
+ if (value.indexOf(':') !== -1) {
+ value.split(':').forEach(function (v) {
+ digits.unshift(parseInt(v, 10));
+ });
+
+ value = 0;
+ base = 1;
+
+ digits.forEach(function (d) {
+ value += (d * base);
+ base *= 60;
+ });
+
+ return sign * value;
+
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
+ octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
+ decimal: function (obj) { return obj.toString(10); },
+ /* eslint-disable max-len */
+ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+},{"../common":2,"../type":13}],18:[function(require,module,exports){
+'use strict';
+
+var esprima;
+
+// Browserified version does not have esprima
+//
+// 1. For node.js just require module as deps
+// 2. For browser try to require mudule via external AMD system.
+// If not found - try to fallback to window.esprima. If not
+// found too - then fail to parse.
+//
+try {
+ // workaround to exclude package from browserify list.
+ var _require = require;
+ esprima = _require('esprima');
+} catch (_) {
+ /* eslint-disable no-redeclare */
+ /* global window */
+ if (typeof window !== 'undefined') esprima = window.esprima;
+}
+
+var Type = require('../../type');
+
+function resolveJavascriptFunction(data) {
+ if (data === null) return false;
+
+ try {
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true });
+
+ if (ast.type !== 'Program' ||
+ ast.body.length !== 1 ||
+ ast.body[0].type !== 'ExpressionStatement' ||
+ (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
+ ast.body[0].expression.type !== 'FunctionExpression')) {
+ return false;
+ }
+
+ return true;
+ } catch (err) {
+ return false;
+ }
+}
+
+function constructJavascriptFunction(data) {
+ /*jslint evil:true*/
+
+ var source = '(' + data + ')',
+ ast = esprima.parse(source, { range: true }),
+ params = [],
+ body;
+
+ if (ast.type !== 'Program' ||
+ ast.body.length !== 1 ||
+ ast.body[0].type !== 'ExpressionStatement' ||
+ (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
+ ast.body[0].expression.type !== 'FunctionExpression')) {
+ throw new Error('Failed to resolve function');
+ }
+
+ ast.body[0].expression.params.forEach(function (param) {
+ params.push(param.name);
+ });
+
+ body = ast.body[0].expression.body.range;
+
+ // Esprima's ranges include the first '{' and the last '}' characters on
+ // function expressions. So cut them out.
+ if (ast.body[0].expression.body.type === 'BlockStatement') {
+ /*eslint-disable no-new-func*/
+ return new Function(params, source.slice(body[0] + 1, body[1] - 1));
+ }
+ // ES6 arrow functions can omit the BlockStatement. In that case, just return
+ // the body.
+ /*eslint-disable no-new-func*/
+ return new Function(params, 'return ' + source.slice(body[0], body[1]));
+}
+
+function representJavascriptFunction(object /*, style*/) {
+ return object.toString();
+}
+
+function isFunction(object) {
+ return Object.prototype.toString.call(object) === '[object Function]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/function', {
+ kind: 'scalar',
+ resolve: resolveJavascriptFunction,
+ construct: constructJavascriptFunction,
+ predicate: isFunction,
+ represent: representJavascriptFunction
+});
+
+},{"../../type":13}],19:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptRegExp(data) {
+ if (data === null) return false;
+ if (data.length === 0) return false;
+
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // if regexp starts with '/' it can have modifiers and must be properly closed
+ // `/foo/gim` - modifiers tail can be maximum 3 chars
+ if (regexp[0] === '/') {
+ if (tail) modifiers = tail[1];
+
+ if (modifiers.length > 3) return false;
+ // if expression starts with /, is should be properly terminated
+ if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
+ }
+
+ return true;
+}
+
+function constructJavascriptRegExp(data) {
+ var regexp = data,
+ tail = /\/([gim]*)$/.exec(data),
+ modifiers = '';
+
+ // `/foo/gim` - tail can be maximum 4 chars
+ if (regexp[0] === '/') {
+ if (tail) modifiers = tail[1];
+ regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
+ }
+
+ return new RegExp(regexp, modifiers);
+}
+
+function representJavascriptRegExp(object /*, style*/) {
+ var result = '/' + object.source + '/';
+
+ if (object.global) result += 'g';
+ if (object.multiline) result += 'm';
+ if (object.ignoreCase) result += 'i';
+
+ return result;
+}
+
+function isRegExp(object) {
+ return Object.prototype.toString.call(object) === '[object RegExp]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/regexp', {
+ kind: 'scalar',
+ resolve: resolveJavascriptRegExp,
+ construct: constructJavascriptRegExp,
+ predicate: isRegExp,
+ represent: representJavascriptRegExp
+});
+
+},{"../../type":13}],20:[function(require,module,exports){
+'use strict';
+
+var Type = require('../../type');
+
+function resolveJavascriptUndefined() {
+ return true;
+}
+
+function constructJavascriptUndefined() {
+ /*eslint-disable no-undefined*/
+ return undefined;
+}
+
+function representJavascriptUndefined() {
+ return '';
+}
+
+function isUndefined(object) {
+ return typeof object === 'undefined';
+}
+
+module.exports = new Type('tag:yaml.org,2002:js/undefined', {
+ kind: 'scalar',
+ resolve: resolveJavascriptUndefined,
+ construct: constructJavascriptUndefined,
+ predicate: isUndefined,
+ represent: representJavascriptUndefined
+});
+
+},{"../../type":13}],21:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return data !== null ? data : {}; }
+});
+
+},{"../type":13}],22:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+},{"../type":13}],23:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (data === null) return true;
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return object === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+},{"../type":13}],24:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (data === null) return true;
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
+ }
+
+ if (!pairHasKey) return false;
+
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return data !== null ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+},{"../type":13}],25:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (data === null) return true;
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ keys = Object.keys(pair);
+
+ if (keys.length !== 1) return false;
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (data === null) return [];
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+},{"../type":13}],26:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return data !== null ? data : []; }
+});
+
+},{"../type":13}],27:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (data === null) return true;
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return data !== null ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+},{"../type":13}],28:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return data !== null ? data : ''; }
+});
+
+},{"../type":13}],29:[function(require,module,exports){
+'use strict';
+
+var Type = require('../type');
+
+var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (match === null) throw new Error('Date resolve error');
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if (match[9] === '-') delta = -delta;
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) date.setTime(date.getTime() - delta);
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+},{"../type":13}],"/":[function(require,module,exports){
+'use strict';
+
+
+var yaml = require('./lib/js-yaml.js');
+
+
+module.exports = yaml;
+
+},{"./lib/js-yaml.js":1}]},{},[])("/")
+});
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js
new file mode 100644
index 00000000000..1b6ecc16b2a
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/dist/js-yaml.min.js
@@ -0,0 +1 @@
+/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function i(r,o,a){function s(t,e){if(!o[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,n){"use strict";var i=e("./js-yaml/loader"),r=e("./js-yaml/dumper");function o(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(e,t,n){"use strict";function i(e){return null==e}t.exports.isNothing=i,t.exports.isObject=function(e){return"object"==typeof e&&null!==e},t.exports.toArray=function(e){return Array.isArray(e)?e:i(e)?[]:[e]},t.exports.repeat=function(e,t){for(var n="",i=0;i<t;i+=1)n+=e;return n},t.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},t.exports.extend=function(e,t){var n,i,r,o;if(t)for(n=0,i=(o=Object.keys(t)).length;n<i;n+=1)e[r=o[n]]=t[r];return e}},{}],3:[function(e,t,n){"use strict";var c=e("./common"),f=e("./exception"),i=e("./schema/default_full"),r=e("./schema/default_safe"),l=Object.prototype.toString,u=Object.prototype.hasOwnProperty,o=9,h=10,a=13,s=32,m=33,g=34,y=35,x=37,A=38,b=39,v=42,w=44,C=45,k=58,j=61,S=62,I=63,O=64,E=91,F=93,_=96,N=123,M=124,T=125,p={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},d=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function L(e){var t,n,i=e.toString(16).toUpperCase();if(e<=255)t="x",n=2;else if(e<=65535)t="u",n=4;else{if(!(e<=4294967295))throw new f("code point within a string may not be greater than 0xFFFFFFFF");t="U",n=8}return"\\"+t+c.repeat("0",n-i.length)+i}function D(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=c.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,a,s,c;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r<o;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function U(e,t){for(var n,i,r=c.repeat(" ",t),o=0,a="",s=e.length;o<s;)o=-1===(n=e.indexOf("\n",o))?(i=e.slice(o),s):(i=e.slice(o,n+1),n+1),i.length&&"\n"!==i&&(a+=r),a+=i;return a}function q(e,t){return"\n"+c.repeat(" ",e.indent*t)}function Y(e){return e===s||e===o}function R(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function B(e,t){return R(e)&&65279!==e&&e!==w&&e!==E&&e!==F&&e!==N&&e!==T&&e!==k&&(e!==y||t&&(R(t=t)&&!Y(t)&&65279!==t&&t!==a&&t!==h))}function W(e){return/^\n* /.test(e)}var K=1,P=2,$=3,H=4,G=5;function V(e,t,n,i,r){var o,a,s,c,u=!1,l=!1,p=-1!==i,f=-1,d=R(c=e.charCodeAt(0))&&65279!==c&&!Y(c)&&c!==C&&c!==I&&c!==k&&c!==w&&c!==E&&c!==F&&c!==N&&c!==T&&c!==y&&c!==A&&c!==v&&c!==m&&c!==M&&c!==j&&c!==S&&c!==b&&c!==g&&c!==x&&c!==O&&c!==_&&!Y(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(!R(a=e.charCodeAt(o)))return G;s=0<o?e.charCodeAt(o-1):null,d=d&&B(a,s)}else{for(o=0;o<e.length;o++){if((a=e.charCodeAt(o))===h)u=!0,p&&(l=l||i<o-f-1&&" "!==e[f+1],f=o);else if(!R(a))return G;s=0<o?e.charCodeAt(o-1):null,d=d&&B(a,s)}l=l||p&&i<o-f-1&&" "!==e[f+1]}return u||l?9<n&&W(e)?G:l?H:$:d&&!r(e)?K:P}function Z(i,r,o,a){i.dump=function(){if(0===r.length)return"''";if(!i.noCompatMode&&-1!==d.indexOf(r))return"'"+r+"'";var e=i.indent*Math.max(1,o),t=-1===i.lineWidth?-1:Math.max(Math.min(i.lineWidth,40),i.lineWidth-e),n=a||-1<i.flowLevel&&o>=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(i,e)})){case K:return r;case P:return"'"+r.replace(/'/g,"''")+"'";case $:return"|"+z(r,i.indent)+J(U(r,e));case H:return">"+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;o<e.length;o++)55296<=(t=e.charCodeAt(o))&&t<=56319&&56320<=(n=e.charCodeAt(o+1))&&n<=57343?(r+=L(1024*(t-55296)+n-56320+65536),o++):(i=p[t],r+=!i&&R(t)?e[o]:i||L(t));return r}(r)+'"';default:throw new f("impossible error: invalid scalar style")}}()}function z(e,t){var n=W(e)?String(t):"",t="\n"===e[e.length-1];return n+(t&&("\n"===e[e.length-2]||"\n"===e)?"+":t?"":"-")+"\n"}function J(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Q(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,s="";n=r.exec(e);)t<(i=n.index)-o&&(n=o<a?a:i,s+="\n"+e.slice(o,n),o=n+1),a=i;return s+="\n",e.length-o>t&&o<a?s+=e.slice(o,a)+"\n"+e.slice(a+1):s+=e.slice(o),s.slice(1)}function X(e,t,n){for(var i,r,o,a=n?e.explicitTypes:e.implicitTypes,s=0,c=a.length;s<c;s+=1)if(((r=a[s]).instanceOf||r.predicate)&&(!r.instanceOf||"object"==typeof t&&t instanceof r.instanceOf)&&(!r.predicate||r.predicate(t))){if(e.tag=n?r.tag:"?",r.represent){if(o=e.styleMap[r.tag]||r.defaultStyle,"[object Function]"===l.call(r.represent))i=r.represent(t,o);else{if(!u.call(r.represent,o))throw new f("!<"+r.tag+'> 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<t)&&(r=!1),c&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(u&&c&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)i&&0!==Object.keys(e.dump).length?(function(e,t,n,i){var r,o,a,s,c,u="",l=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new f("sortKeys must be a boolean or a function");for(r=0,o=p.length;r<o;r+=1)c="",i&&0===r||(c+=q(e,t)),a=n[s=p[r]],ee(e,t+1,s,!0,!0,!0)&&((s=null!==e.tag&&"?"!==e.tag||e.dump&&1024<e.dump.length)&&(e.dump&&h===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,s&&(c+=q(e,t)),ee(e,t+1,a,!0,s)&&(e.dump&&h===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=l,e.dump=u||"{}"}(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(function(e,t,n){for(var i,r,o,a="",s=e.tag,c=Object.keys(n),u=0,l=c.length;u<l;u+=1)o="",0!==u&&(o+=", "),e.condenseFlow&&(o+='"'),r=n[i=c[u]],ee(e,t,i,!1,!1)&&(1024<e.dump.length&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ee(e,t,r,!1,!1)&&(a+=o+=e.dump));e.tag=s,e.dump="{"+a+"}"}(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a){u=e.noArrayIndent&&0<t?t-1:t;i&&0!==e.dump.length?(function(e,t,n,i){for(var r="",o=e.tag,a=0,s=n.length;a<s;a+=1)ee(e,t+1,n[a],!0,!0)&&(i&&0===a||(r+=q(e,t)),e.dump&&h===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}(e,u,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(function(e,t,n){for(var i="",r=e.tag,o=0,a=n.length;o<a;o+=1)ee(e,t,n[o],!1,!1)&&(0!==o&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}(e,u,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump))}else{if("[object String]"!==a){if(e.skipInvalid)return;throw new f("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&Z(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+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<a;o+=1)e(t[o],n,i);else for(r=Object.keys(t),o=0,a=r.length;o<a;o+=1)e(t[r[o]],n,i)}(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function ne(e,t){t=new D(t=t||{});return t.noRefs||te(e,t),ee(t,0,e,!0,!0)?t.dump+"\n":""}t.exports.dump=ne,t.exports.safeDump=function(e,t){return ne(e,c.extend({schema:r},t))}},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t,n){"use strict";function i(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}((i.prototype=Object.create(Error.prototype)).constructor=i).prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=i},{}],5:[function(e,t,n){"use strict";var h=e("./common"),i=e("./exception"),r=e("./mark"),o=e("./schema/default_safe"),a=e("./schema/default_full"),m=Object.prototype.hasOwnProperty,g=1,y=2,x=3,A=4,b=1,v=2,w=3,c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s=/[\x85\u2028\u2029]/,C=/[,\[\]\{\}]/,k=/^(?:!|!!|![a-z\-]+!)$/i,j=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function l(e){return Object.prototype.toString.call(e)}function S(e){return 10===e||13===e}function I(e){return 9===e||32===e}function O(e){return 9===e||32===e||10===e||13===e}function E(e){return 44===e||91===e||93===e||123===e||125===e}function u(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"Ā…":95===e?"Ā ":76===e?"\u2028":80===e?"\u2029":""}for(var p=new Array(256),f=new Array(256),d=0;d<256;d++)p[d]=u(d)?1:0,f[d]=u(d);function F(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,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.documents=[]}function _(e,t){return new i(t,new r(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function N(e,t){throw _(e,t)}function M(e,t){e.onWarning&&e.onWarning.call(null,_(e,t))}var T={YAML:function(e,t,n){var i,r;null!==e.version&&N(e,"duplication of %YAML directive"),1!==n.length&&N(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&N(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),r=parseInt(r[2],10),1!==i&&N(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=r<2,1!==r&&2!==r&&M(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i;2!==n.length&&N(e,"TAG directive accepts exactly two arguments"),i=n[0],n=n[1],k.test(i)||N(e,"ill-formed tag handle (first argument) of the TAG directive"),m.call(e.tagMap,i)&&N(e,'there is a previously declared suffix for "'+i+'" tag handle'),j.test(n)||N(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=n}};function L(e,t,n,i){var r,o,a,s;if(t<n){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;r<o;r+=1)9===(a=s.charCodeAt(r))||32<=a&&a<=1114111||N(e,"expected valid JSON character");else c.test(s)&&N(e,"the stream contains non-printable characters");e.result+=s}}function D(e,t,n,i){var r,o,a,s;for(h.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(r=Object.keys(n)).length;a<s;a+=1)o=r[a],m.call(t,o)||(t[o]=n[o],i[o]=!0)}function U(e,t,n,i,r,o,a,s){var c,u;if(Array.isArray(r))for(c=0,u=(r=Array.prototype.slice.call(r)).length;c<u;c+=1)Array.isArray(r[c])&&N(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===l(r[c])&&(r[c]="[object Object]");if("object"==typeof r&&"[object Object]"===l(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)D(e,t,o[c],n);else D(e,t,o,n);else e.json||m.call(n,r)||!m.call(t,r)||(e.line=a||e.line,e.position=s||e.position,N(e,"duplicated mapping key")),t[r]=o,delete n[r];return t}function q(e){var t=e.input.charCodeAt(e.position);10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function Y(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;I(r);)r=e.input.charCodeAt(++e.position);if(t&&35===r)for(;r=e.input.charCodeAt(++e.position),10!==r&&13!==r&&0!==r;);if(!S(r))break;for(q(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&M(e,"deficient indentation"),i}function R(e){var t=e.position,n=e.input.charCodeAt(t);return 45!==n&&46!==n||n!==e.input.charCodeAt(t+1)||n!==e.input.charCodeAt(t+2)||(t+=3,0!==(n=e.input.charCodeAt(t))&&!O(n))?void 0:1}function B(e,t){1===t?e.result+=" ":1<t&&(e.result+=h.repeat("\n",t-1))}function W(e,t){var n,i,r,o,a,s,c,u=e.input.charCodeAt(e.position);if(34===u){for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(u=e.input.charCodeAt(e.position));){if(34===u)return L(e,n,e.position,!0),e.position++,1;if(92===u){if(L(e,n,e.position,!0),S(u=e.input.charCodeAt(++e.position)))Y(e,!1,t);else if(u<256&&p[u])e.result+=f[u],e.position++;else if(0<(a=120===(c=u)?2:117===c?4:85===c?8:0)){for(r=a,o=0;0<r;r--)u=e.input.charCodeAt(++e.position),0<=(a=48<=(s=u)&&s<=57?s-48:97<=(s=32|s)&&s<=102?s-97+10:-1)?o=(o<<4)+a:N(e,"expected hexadecimal character");e.result+=(c=o)<=65535?String.fromCharCode(c):String.fromCharCode(55296+(c-65536>>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.lineIndent<t)break;return!!s&&(e.tag=r,e.anchor=o,e.kind="sequence",e.result=a,!0)}function P(e,t,n,i,r){var o,a,s,c,u,l,p=1,f=!1,d=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=A===n||x===n,i&&Y(e,!0,-1)&&(f=!0,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)),1===p)for(;function(e){var t,n,i,r=!1,o=!1,a=e.input.charCodeAt(e.position);if(33===a){if(null!==e.tag&&N(e,"duplication of a tag property"),60===(a=e.input.charCodeAt(++e.position))?(r=!0,a=e.input.charCodeAt(++e.position)):33===a?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){for(;a=e.input.charCodeAt(++e.position),0!==a&&62!==a;);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==a&&!O(a);)33===a&&(o?N(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),k.test(n)||N(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),C.test(i)&&N(e,"tag suffix cannot contain flow indicator characters")}return i&&!j.test(i)&&N(e,"tag name cannot contain such characters: "+i),r?e.tag=i:m.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:N(e,'undeclared tag handle "'+n+'"'),1}}(e)||function(e){var t,n=e.input.charCodeAt(e.position);if(38===n){for(null!==e.anchor&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!O(n)&&!E(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),1}}(e);)Y(e,!0,-1)?(f=!0,s=o,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)):s=!1;if(s=s&&(f||r),1!==p&&A!==n||(i=g===n||y===n?t:t+1,r=e.position-e.lineStart,1===p?s&&(K(e,r)||function(e,t,n){var i,r,o,a,s,c=e.tag,u=e.anchor,l={},p={},f=null,d=null,h=null,m=!1,g=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);0!==s;){if(i=e.input.charCodeAt(e.position+1),o=e.line,a=e.position,63!==s&&58!==s||!O(i)){if(!P(e,n,y,!1,!0))break;if(e.line===o){for(s=e.input.charCodeAt(e.position);I(s);)s=e.input.charCodeAt(++e.position);if(58===s)O(s=e.input.charCodeAt(++e.position))||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(U(e,l,p,f,d,null),f=d=h=null),r=m=!(g=!0),f=e.tag,d=e.result;else{if(!g)return e.tag=c,e.anchor=u,1;N(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return e.tag=c,e.anchor=u,1;N(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(m&&(U(e,l,p,f,d,null),f=d=h=null),r=m=g=!0):m?r=!(m=!1):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=i;if((e.line===o||e.lineIndent>t)&&(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.lineIndent<t)break}return m&&U(e,l,p,f,d,null),g&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=l),g}(e,r,i))||function(e,t){var n,i,r,o,a,s,c,u,l,p=!0,f=e.tag,d=e.anchor,h={},m=e.input.charCodeAt(e.position);if(91===m)s=!(r=93),i=[];else{if(123!==m)return;r=125,s=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),m=e.input.charCodeAt(++e.position);0!==m;){if(Y(e,!0,t),(m=e.input.charCodeAt(e.position))===r)return e.position++,e.tag=f,e.anchor=d,e.kind=s?"mapping":"sequence",e.result=i,1;p||N(e,"missed comma between flow collection entries"),l=null,o=a=!1,63===m&&O(e.input.charCodeAt(e.position+1))&&(o=a=!0,e.position++,Y(e,!0,t)),n=e.line,P(e,t,g,!1,!0),u=e.tag,c=e.result,Y(e,!0,t),m=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==m||(o=!0,m=e.input.charCodeAt(++e.position),Y(e,!0,t),P(e,t,g,!1,!0),l=e.result),s?U(e,i,h,u,c,l):o?i.push(U(e,null,h,u,c,l)):i.push(c),Y(e,!0,t),44===(m=e.input.charCodeAt(e.position))?(p=!0,m=e.input.charCodeAt(++e.position)):p=!1}N(e,"unexpected end of the stream within a flow collection")}(e,i)?d=!0:(a&&function(e,t){var n,i,r,o=b,a=!1,s=!1,c=t,u=0,l=!1,p=e.input.charCodeAt(e.position);if(124===p)i=!1;else{if(62!==p)return;i=!0}for(e.kind="scalar",e.result="";0!==p;)if(43===(p=e.input.charCodeAt(++e.position))||45===p)b===o?o=43===p?w:v:N(e,"repeat of a chomping mode identifier");else{if(!(0<=(r=48<=(r=p)&&r<=57?r-48:-1)))break;0==r?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?N(e,"repeat of an indentation width identifier"):(c=t+r-1,s=!0)}if(I(p)){for(;p=e.input.charCodeAt(++e.position),I(p););if(35===p)for(;p=e.input.charCodeAt(++e.position),!S(p)&&0!==p;);}for(;0!==p;){for(q(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<c)&&32===p;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>c&&(c=e.lineIndent),S(p))u++;else{if(e.lineIndent<c){o===w?e.result+=h.repeat("\n",a?1+u:u):o===b&&a&&(e.result+="\n");break}for(i?I(p)?(l=!0,e.result+=h.repeat("\n",a?1+u:u)):l?(l=!1,e.result+=h.repeat("\n",u+1)):0===u?a&&(e.result+=" "):e.result+=h.repeat("\n",u):e.result+=h.repeat("\n",a?1+u:u),s=a=!0,u=0,n=e.position;!S(p)&&0!==p;)p=e.input.charCodeAt(++e.position);L(e,n,e.position,!1)}}return 1}(e,i)||function(e,t){var n,i,r=e.input.charCodeAt(e.position);if(39===r){for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(L(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return 1;n=e.position,e.position++,i=e.position}else S(r)?(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 single quoted scalar"):(e.position++,i=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}}(e,i)||W(e,i)?d=!0:!function(e){var t,n=e.input.charCodeAt(e.position);if(42===n){for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!O(n)&&!E(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),t=e.input.slice(t,e.position),m.call(e.anchorMap,t)||N(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],Y(e,!0,-1),1}}(e)?function(e,t,n){var i,r,o,a,s,c,u,l=e.kind,p=e.result,f=e.input.charCodeAt(e.position);if(!O(f)&&!E(f)&&35!==f&&38!==f&&42!==f&&33!==f&&124!==f&&62!==f&&39!==f&&34!==f&&37!==f&&64!==f&&96!==f&&(63!==f&&45!==f||!(O(i=e.input.charCodeAt(e.position+1))||n&&E(i)))){for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==f;){if(58===f){if(O(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===f){if(O(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&R(e)||n&&E(f))break;if(S(f)){if(s=e.line,c=e.lineStart,u=e.lineIndent,Y(e,!1,-1),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<u;c+=1)if((l=e.implicitTypes[c]).resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else m.call(e.typeMap[e.kind||"fallback"],e.tag)?(l=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&l.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> 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.position<n.length-1;)!function(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(Y(e,!0,-1),r=e.input.charCodeAt(e.position),!(0<e.lineIndent||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!O(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&N(e,"directive name must not be less than one character in length");0!==r;){for(;I(r);)r=e.input.charCodeAt(++e.position);if(35===r){for(;r=e.input.charCodeAt(++e.position),0!==r&&!S(r););break}if(S(r))break;for(t=e.position;0!==r&&!O(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&q(e),m.call(T,n)?T[n](e,n,i):M(e,'unknown document directive "'+n+'"')}Y(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,Y(e,!0,-1)):a&&N(e,"directives end mark is expected"),P(e,e.lineIndent-1,A,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&s.test(e.input.slice(o,e.position))&&M(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&R(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Y(e,!0,-1)):e.position<e.length-1&&N(e,"end of the stream or a document separator is expected")}(n);return n.documents}function H(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=$(e,n);if("function"!=typeof t)return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function G(e,t){t=$(e,t);if(0!==t.length){if(1===t.length)return t[0];throw new i("expected a single document in the stream, but found more")}}t.exports.loadAll=H,t.exports.load=G,t.exports.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),H(e,t,h.extend({schema:o},n))},t.exports.safeLoad=function(e,t){return G(e,h.extend({schema:o},t))}},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t,n){"use strict";var s=e("./common");function i(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}i.prototype.getSnippet=function(e,t){var n,i,r,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;0<i&&-1==="\0\r\nĀ…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(--i,this.position-i>t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;o<this.buffer.length&&-1==="\0\r\nĀ…\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/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<t;e+=1)arguments[e].forEach(i);return n}(this.compiledImplicit,this.compiledExplicit)}c.DEFAULT=null,c.create=function(e,t){var n,i;switch(arguments.length){case 1:n=c.DEFAULT,i=e;break;case 2:n=e,i=t;break;default:throw new o("Wrong number of arguments for Schema.create function")}if(n=r.toArray(n),i=r.toArray(i),!n.every(function(e){return e instanceof c}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!i.every(function(e){return e instanceof a}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new c({include:n,explicit:i})},t.exports=c},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t,n){"use strict";var i=e("../schema");t.exports=i.DEFAULT=new i({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../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(e,t,n){"use strict";var i=e("../schema");t.exports=new i({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t,n){"use strict";var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=function(t,e){var n,i;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===o.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(e){return e},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,i={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){i[String(e)]=t})}),i),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},{"./exception":4}],14:[function(e,t,n){"use strict";try{var s=e("buffer").Buffer}catch(e){}var i=e("../type"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;for(var t,n=0,i=e.length,r=c,o=0;o<i;o++)if(!(64<(t=r.indexOf(e.charAt(o))))){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){for(var t=e.replace(/[\r\n=]/g,""),n=t.length,i=c,r=0,o=[],a=0;a<n;a++)a%4==0&&a&&(o.push(r>>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<r;a++)a%3==0&&a&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return e=e.toString(10),o.test(e)?e.replace("e",".e"):e},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a<o;a++)if("_"!==(t=e[a])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(a++;a<o;a++)if("_"!==(t=e[a])){if(!(48<=(i=e.charCodeAt(a))&&i<=57||65<=i&&i<=70||97<=i&&i<=102))return!1;s=!0}return s&&"_"!==t}for(;a<o;a++)if("_"!==(t=e[a])){if(!(48<=(n=e.charCodeAt(a))&&n<=55))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;a<o;a++)if("_"!==(t=e[a])){if(":"===t)break;if(!(48<=(r=e.charCodeAt(a))&&r<=57))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(a)))},construct:function(e){var t,n=e,i=1,r=[];return-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(e=n[0])&&"+"!==e||("-"===e&&(i=-1),e=(n=n.slice(1))[0]),"0"===n?0:"0"===e?"b"===n[1]?i*parseInt(n.slice(2),2):"x"===n[1]?i*parseInt(n,16):i*parseInt(n,8):-1!==n.indexOf(":")?(n.split(":").forEach(function(e){r.unshift(parseInt(e,10))}),n=0,t=1,r.forEach(function(e){n+=e*t,t*=60}),i*n):i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!i.isNegativeZero(e)},represent:{binary:function(e){return 0<=e?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return 0<=e?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return 0<=e?"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"]}})},{"../common":2,"../type":13}],18:[function(e,t,n){"use strict";try{var r=e("esprima")}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var i=e("../../type");t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",t=r.parse(t,{range:!0});return"Program"!==t.type||1!==t.body.length||"ExpressionStatement"!==t.body[0].type||"ArrowFunctionExpression"!==t.body[0].expression.type&&"FunctionExpression"!==t.body[0].expression.type?!1:!0}catch(e){return!1}},construct:function(e){var t="("+e+")",n=r.parse(t,{range:!0}),i=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(e){i.push(e.name)}),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(i,t.slice(e[0]+1,e[1]-1)):new Function(i,"return "+t.slice(e[0],e[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},{"../../type":13}],19:[function(e,t,n){"use strict";e=e("../../type");t.exports=new e("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),e="";if("/"===t[0]){if(n&&(e=n[1]),3<e.length)return!1;if("/"!==t[t.length-e.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),e="";return"/"===t[0]&&(n&&(e=n[1]),t=t.slice(1,t.length-e.length-1)),new RegExp(t,e)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},{"../../type":13}],20:[function(e,t,n){"use strict";e=e("../../type");t.exports=new e("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},{"../../type":13}],21:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},{"../type":13}],23:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t,n){"use strict";var e=e("../type"),c=Object.prototype.hasOwnProperty,u=Object.prototype.toString;t.exports=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var t,n,i,r=[],o=e,a=0,s=o.length;a<s;a+=1){if(t=o[a],i=!1,"[object Object]"!==u.call(t))return!1;for(n in t)if(c.call(t,n)){if(i)return!1;i=!0}if(!i)return!1;if(-1!==r.indexOf(n))return!1;r.push(n)}return!0},construct:function(e){return null!==e?e:[]}})},{"../type":13}],25:[function(e,t,n){"use strict";var e=e("../type"),s=Object.prototype.toString;t.exports=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var t,n,i=e,r=new Array(i.length),o=0,a=i.length;o<a;o+=1){if(t=i[o],"[object Object]"!==s.call(t))return!1;if(1!==(n=Object.keys(t)).length)return!1;r[o]=[n[0],t[n[0]]]}return!0},construct:function(e){if(null===e)return[];for(var t,n,i=e,r=new Array(i.length),o=0,a=i.length;o<a;o+=1)t=i[o],n=Object.keys(t),r[o]=[n[0],t[n[0]]];return r}})},{"../type":13}],26:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t,n){"use strict";var e=e("../type"),i=Object.prototype.hasOwnProperty;t.exports=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},{"../type":13}],28:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t,n){"use strict";var e=e("../type"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),l=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]))?))?$");t.exports=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==u.exec(e)||null!==l.exec(e))},construct:function(e){var t,n,i,r,o,a=0,s=null,c=u.exec(e);if(null===c&&(c=l.exec(e)),null===c)throw new Error("Date resolve error");if(t=+c[1],n=+c[2]-1,i=+c[3],!c[4])return new Date(Date.UTC(t,n,i));if(r=+c[4],o=+c[5],e=+c[6],c[7]){for(a=c[7].slice(0,3);a.length<3;)a+="0";a=+a}return c[9]&&(s=6e4*(60*+c[10]+ +(c[11]||0)),"-"===c[9]&&(s=-s)),e=new Date(Date.UTC(t,n,i,r,o,e,a)),s&&e.setTime(e.getTime()-s),e},instanceOf:Date,represent:function(e){return e.toISOString()}})},{"../type":13}],"/":[function(e,t,n){"use strict";e=e("./lib/js-yaml.js");t.exports=e},{"./lib/js-yaml.js":1}]},{},[])("/")});
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js
new file mode 100644
index 00000000000..13744352448
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/index.js
@@ -0,0 +1,7 @@
+'use strict';
+
+
+var yaml = require('./lib/js-yaml.js');
+
+
+module.exports = yaml;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml.js
index f0e92818e90..f0e92818e90 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/common.js
index 25ef7d8e4a3..25ef7d8e4a3 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/common.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/dumper.js
index f3d4fd93604..f3d4fd93604 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/dumper.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/exception.js
index b744a1ee4ef..b744a1ee4ef 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/exception.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/loader.js
index d7484a59191..d7484a59191 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/loader.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/mark.js
index 47b265c20ce..47b265c20ce 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/mark.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema.js
index ca7cf47e705..ca7cf47e705 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/core.js
index 206daab56c0..206daab56c0 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/core.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
index a55ef42accd..a55ef42accd 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_full.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
index 11d89bbfbba..11d89bbfbba 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
index b7a33eb7a1c..b7a33eb7a1c 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/json.js
index 5be3dbf805b..5be3dbf805b 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/schema/json.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type.js
index 90b702ac06f..90b702ac06f 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/binary.js
index 10b1875595b..10b1875595b 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/binary.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/bool.js
index cb7745930a6..cb7745930a6 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/bool.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/float.js
index 127671b2139..127671b2139 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/float.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/int.js
index ba61c5f958e..ba61c5f958e 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/int.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/function.js
index 8fab8c43089..8fab8c43089 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/function.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
index 43fa4701761..43fa4701761 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
index 95b5569fdfa..95b5569fdfa 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/map.js
index f327beebd53..f327beebd53 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/map.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/merge.js
index ae08a86444c..ae08a86444c 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/merge.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/null.js
index 6874daa6471..6874daa6471 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/null.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/omap.js
index b2b5323bd1c..b2b5323bd1c 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/omap.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/pairs.js
index 74b52403fc1..74b52403fc1 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/pairs.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/seq.js
index be8f77f2844..be8f77f2844 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/seq.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/set.js
index f885a329c2c..f885a329c2c 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/set.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/str.js
index 27acc106caa..27acc106caa 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/str.js
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
index 8fa9c586569..8fa9c586569 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/lib/js-yaml/type/timestamp.js
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json
new file mode 100644
index 00000000000..0d2366762c5
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/node_modules/js-yaml/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "js-yaml",
+ "version": "3.14.1",
+ "description": "YAML 1.2 parser and serializer",
+ "keywords": [
+ "yaml",
+ "parser",
+ "serializer",
+ "pyyaml"
+ ],
+ "homepage": "https://github.com/nodeca/js-yaml",
+ "author": "Vladimir Zapparov <dervus.grim@gmail.com>",
+ "contributors": [
+ "Aleksey V Zapparov <ixti@member.fsf.org> (http://www.ixti.net/)",
+ "Vitaly Puzrin <vitaly@rcdesign.ru> (https://github.com/puzrin)",
+ "Martin Grenfell <martin.grenfell@gmail.com> (http://got-ravings.blogspot.com)"
+ ],
+ "license": "MIT",
+ "repository": "nodeca/js-yaml",
+ "files": [
+ "index.js",
+ "lib/",
+ "bin/",
+ "dist/"
+ ],
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ },
+ "unpkg": "dist/js-yaml.min.js",
+ "jsdelivr": "dist/js-yaml.min.js",
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "devDependencies": {
+ "ansi": "^0.3.1",
+ "benchmark": "^2.1.4",
+ "browserify": "^16.2.2",
+ "codemirror": "^5.13.4",
+ "eslint": "^7.0.0",
+ "fast-check": "^1.24.2",
+ "istanbul": "^0.4.5",
+ "mocha": "^7.1.2",
+ "uglify-js": "^3.0.1"
+ },
+ "scripts": {
+ "test": "make test"
+ }
+}
diff --git a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json
index 35f51297073..593e8aeb1db 100644
--- a/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json
+++ b/tools/node_modules/eslint/node_modules/@eslint/eslintrc/package.json
@@ -1,20 +1,35 @@
{
"name": "@eslint/eslintrc",
- "version": "0.4.3",
+ "version": "1.0.2",
"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"
],
"publishConfig": {
"access": "public"
},
"scripts": {
+ "prepare": "npm run build",
+ "build": "rollup -c",
"lint": "eslint . --report-unused-disable-directives",
"fix": "npm run lint -- --fix",
- "test": "mocha -R progress -c 'tests/lib/**/*.js'",
+ "test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'",
"generate-release": "eslint-generate-release",
"generate-alpharelease": "eslint-generate-prerelease alpha",
"generate-betarelease": "eslint-generate-prerelease beta",
@@ -34,22 +49,24 @@
},
"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",
+ "fs-teardown": "^0.1.3",
+ "mocha": "^9.0.3",
+ "rollup": "^2.54.0",
"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",
+ "debug": "^4.3.2",
+ "espree": "^9.0.0",
"globals": "^13.9.0",
"ignore": "^4.0.6",
"import-fresh": "^3.2.1",
@@ -58,6 +75,6 @@
"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/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md
index 9cfe637bb3d..53dce470e75 100644
--- a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md
+++ b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/README.md
@@ -210,7 +210,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 +226,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
diff --git a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/api.js b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/api.js
index a9aacf46b5c..60d44cf96d3 100644
--- a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/api.js
+++ b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/api.js
@@ -124,17 +124,62 @@ function isString(value) {
* @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.
+ * @returns {Promise<Array>} A flattened array containing only config objects.
* @throws {TypeError} When a config function returns a function.
*/
async function normalize(items, context) {
- // TODO: Allow async config functions
+ async function *flatTraverse(array) {
+ for (let item of array) {
+ if (typeof item === 'function') {
+ item = item(context);
+ if (item.then) {
+ item = await item;
+ }
+ }
+
+ if (Array.isArray(item)) {
+ 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.
+ * @returns {Array} A flattened array containing only config objects.
+ * @throws {TypeError} When a config function returns a function.
+ */
+function normalizeSync(items, context) {
function *flatTraverse(array) {
for (let item of array) {
if (typeof item === 'function') {
item = item(context);
+ if (item.then) {
+ throw new TypeError('Async config functions are not supported.');
+ }
}
if (Array.isArray(item)) {
@@ -371,7 +416,7 @@ 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<ConfigArray>} The current ConfigArray instance.
*/
async normalize(context = {}) {
@@ -389,6 +434,27 @@ 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} The current ConfigArray instance.
+ */
+ normalizeSync(context = {}) {
+
+ if (!this.isNormalized()) {
+ const normalizedConfigs = normalizeSync(this, context);
+ this.length = 0;
+ this.push(...normalizedConfigs.map(this[ConfigArraySymbol.preprocessConfig]));
+ this[ConfigArraySymbol.isNormalized] = true;
+
+ // prevent further changes
+ Object.freeze(this);
+ }
+
+ return this;
+ }
+
+ /**
* Finalizes the state of a config before being cached and returned by
* `getConfig()`. Does nothing by default but is provided to be
* overridden by subclasses as necessary.
diff --git a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/package.json b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/package.json
index 4dc3a4e5d48..fc21c104828 100644
--- a/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/package.json
+++ b/tools/node_modules/eslint/node_modules/@humanwhocodes/config-array/package.json
@@ -1,6 +1,6 @@
{
"name": "@humanwhocodes/config-array",
- "version": "0.5.0",
+ "version": "0.6.0",
"description": "Glob-based configuration matching.",
"author": "Nicholas C. Zakas",
"main": "api.js",
@@ -58,4 +58,4 @@
"rollup": "^1.12.3",
"yorkie": "^2.0.0"
}
-} \ No newline at end of file
+}
diff --git a/tools/node_modules/eslint/node_modules/acorn/LICENSE b/tools/node_modules/eslint/node_modules/acorn/LICENSE
index cc5272c966d..d6be6db2cff 100644
--- a/tools/node_modules/eslint/node_modules/acorn/LICENSE
+++ b/tools/node_modules/eslint/node_modules/acorn/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (C) 2012-2018 by various contributors (see AUTHORS)
+Copyright (C) 2012-2020 by various contributors (see AUTHORS)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/tools/node_modules/eslint/node_modules/acorn/README.md b/tools/node_modules/eslint/node_modules/acorn/README.md
index 52d2e9b71c5..601e86c8fdd 100644
--- a/tools/node_modules/eslint/node_modules/acorn/README.md
+++ b/tools/node_modules/eslint/node_modules/acorn/README.md
@@ -32,14 +32,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 +48,20 @@ 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.
+ either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019),
+ 11 (2020), 12 (2021), 13 (2022, partial support)
+ or `"latest"` (the latest the library supports). This influences
+ support for strict mode, the set of reserved words, and support
+ for new syntax features.
**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,13 +91,19 @@ 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
+ 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"`).
+
+- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
+ only appear inside `async` functions. Defaults to `true` for
+ `ecmaVersion` 2022 and later, `false` for lower versions. Setting this option to
`true` allows to have top-level `await` expressions. They are
still not allowed in non-`async` functions, though.
+- **allowSuperOutsideMethod**: By default, `super` outside a method
+ raises an error. Set this to `true` to accept such code.
+
- **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.
@@ -224,7 +232,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(<bar/>)");
+JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020});
```
The `extend` method takes any number of plugin values, and returns a
@@ -249,6 +257,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.
diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
index 0523f0e3485..96e3b82d834 100644
--- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
+++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
@@ -152,6 +152,7 @@
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 +252,8 @@
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
}
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
@@ -314,16 +315,17 @@
}
}
- // 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), 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.
@@ -346,11 +348,16 @@
// 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,
+ 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.
allowHashBang: false,
@@ -404,14 +411,25 @@
// 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]; }
- 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; }
@@ -446,19 +464,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
@@ -473,8 +492,7 @@
this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
var reserved = "";
if (options.allowReserved !== true) {
- for (var v = options.ecmaVersion;; v--)
- { if (reserved = reservedWords[v]) { break } }
+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
if (options.sourceType === "module") { reserved += " await"; }
}
this.reservedWords = wordsRegexp(reserved);
@@ -527,13 +545,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 +564,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 +580,33 @@
};
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;
@@ -749,7 +792,7 @@
// to its body instead of creating a new node.
pp$1.parseTopLevel = function(node) {
- var exports = {};
+ var exports = Object.create(null);
if (!node.body) { node.body = []; }
while (this.type !== types.eof) {
var stmt = this.parseStatement(null, true, exports);
@@ -779,13 +822,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 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral
if (context) { return false }
if (nextCh === 123) { return true } // '{'
if (isIdentifierStart(nextCh, true)) {
var pos = next + 1;
- while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
+ 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 }
}
@@ -801,10 +845,11 @@
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.
@@ -944,7 +989,7 @@
pp$1.parseForStatement = function(node) {
this.next();
- var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
+ 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);
@@ -969,16 +1014,18 @@
if (awaitAt > -1) { this.unexpected(awaitAt); }
return this.parseFor(node, init$1)
}
+ var startsWithLet = this.isContextual("let"), isForOf = false;
var refDestructuringErrors = new DestructuringErrors;
- var init = this.parseExpression(true, refDestructuringErrors);
- if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
+ var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors);
+ if (this.type === types._in || (isForOf = 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; }
}
+ 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);
@@ -1079,7 +1126,7 @@
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.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
this.expect(types.parenR);
} else {
if (this.options.ecmaVersion < 10) { this.unexpected(); }
@@ -1215,8 +1262,6 @@
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();
@@ -1252,7 +1297,7 @@
pp$1.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,7 +1306,7 @@
// `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$1.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))
@@ -1278,7 +1323,7 @@
// 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;
@@ -1291,7 +1336,7 @@
{ node.id = this.type === types.name ? this.parseIdent() : null; }
this.parseFunctionParams(node);
- this.parseFunctionBody(node, allowExpressionBody, false);
+ this.parseFunctionBody(node, allowExpressionBody, false, forInit);
this.yieldPos = oldYieldPos;
this.awaitPos = oldAwaitPos;
@@ -1318,6 +1363,7 @@
this.parseClassId(node, isStatement);
this.parseClassSuper(node);
+ var privateNameMap = this.enterClassBody();
var classBody = this.startNode();
var hadConstructor = false;
classBody.body = [];
@@ -1329,82 +1375,181 @@
if (element.type === "MethodDefinition" && element.kind === "constructor") {
if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
hadConstructor = true;
+ } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
+ this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
}
}
}
this.strict = oldStrict;
this.next();
node.body = this.finishNode(classBody, "ClassBody");
+ this.exitClassBody();
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
};
pp$1.parseClassElement = function(constructorAllowsSuper) {
- var this$1 = this;
-
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)) {
+ var kind = "method";
+ var isStatic = false;
+
+ if (this.eatContextual("static")) {
+ // Parse static init block
+ if (ecmaVersion >= 13 && this.eat(types.braceL)) {
+ this.parseClassStaticBlock(node);
+ return node
+ }
+ if (this.isClassElementNameStart() || this.type === types.star) {
+ isStatic = true;
+ } else {
+ keyName = "static";
+ }
+ }
+ node.static = isStatic;
+ if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
+ if ((this.isClassElementNameStart() || this.type === types.star) && !this.canInsertSemicolon()) {
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";
+ } else {
+ keyName = "async";
}
}
- if (!method.key) { this.parsePropertyName(method); }
+ if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types.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.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.isClassElementNameStart = function() {
+ return (
+ this.type === types.name ||
+ this.type === types.privateId ||
+ this.type === types.num ||
+ this.type === types.string ||
+ this.type === types.bracketL ||
+ this.type.keyword
+ )
+ };
+
+ pp$1.parseClassElementName = function(element) {
+ if (this.type === types.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$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
+ // Check key and flags
var key = method.key;
- var allowsDirectSuper = false;
- if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
- key.type === "Literal" && key.value === "constructor")) {
- if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
+ if (method.kind === "constructor") {
if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
- method.kind = "constructor";
- allowsDirectSuper = constructorAllowsSuper;
- } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
+ } else if (method.static && checkKeyName(method, "prototype")) {
this.raise(key.start, "Classes may not have a static property named prototype");
}
- this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
- if (method.kind === "get" && method.value.params.length !== 0)
- { this.raiseRecoverable(method.value.start, "getter should have no params"); }
- if (method.kind === "set" && method.value.params.length !== 1)
- { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
- if (method.kind === "set" && method.value.params[0].type === "RestElement")
- { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
- return method
- };
- pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
- method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+ // Parse value
+ var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+
+ // Check value
+ if (method.kind === "get" && value.params.length !== 0)
+ { this.raiseRecoverable(value.start, "getter should have no params"); }
+ if (method.kind === "set" && value.params.length !== 1)
+ { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
+ if (method.kind === "set" && value.params[0].type === "RestElement")
+ { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }
+
return this.finishNode(method, "MethodDefinition")
};
+ pp$1.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.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$1.parseClassStaticBlock = function(node) {
+ node.body = [];
+
+ var oldLabels = this.labels;
+ this.labels = [];
+ this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
+ while (this.type !== types.braceR) {
+ var stmt = this.parseStatement(null);
+ node.body.push(stmt);
+ }
+ this.next();
+ this.exitScope();
+ this.labels = oldLabels;
+
+ return this.finishNode(node, "StaticBlock")
+ };
+
pp$1.parseClassId = function(node, isStatement) {
if (this.type === types.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(); }
@@ -1413,9 +1558,68 @@
};
pp$1.parseClassSuper = function(node) {
- node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
+ node.superClass = this.eat(types._extends) ? this.parseExprSubscripts(false) : null;
+ };
+
+ pp$1.enterClassBody = function() {
+ var element = {declared: Object.create(null), used: []};
+ this.privateNameStack.push(element);
+ return element.declared
+ };
+
+ pp$1.exitClassBody = function() {
+ var ref = this.privateNameStack.pop();
+ var declared = ref.declared;
+ var used = ref.used;
+ var len = this.privateNameStack.length;
+ var parent = len === 0 ? null : this.privateNameStack[len - 1];
+ for (var i = 0; i < used.length; ++i) {
+ var id = used[i];
+ if (!has(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) {
@@ -1584,7 +1788,7 @@
// import defaultObj, { x, y as z } from '...'
var node = this.startNode();
node.local = this.parseIdent();
- this.checkLVal(node.local, BIND_LEXICAL);
+ this.checkLValSimple(node.local, BIND_LEXICAL);
nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
if (!this.eat(types.comma)) { return nodes }
}
@@ -1593,7 +1797,7 @@
this.next();
this.expectContextual("as");
node$1.local = this.parseIdent();
- this.checkLVal(node$1.local, BIND_LEXICAL);
+ this.checkLValSimple(node$1.local, BIND_LEXICAL);
nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
return nodes
}
@@ -1612,7 +1816,7 @@
this.checkUnreserved(node$2.imported);
node$2.local = node$2.imported;
}
- this.checkLVal(node$2.local, BIND_LEXICAL);
+ this.checkLValSimple(node$2.local, BIND_LEXICAL);
nodes.push(this.finishNode(node$2, "ImportSpecifier"));
}
return nodes
@@ -1649,6 +1853,7 @@
case "ObjectPattern":
case "ArrayPattern":
+ case "AssignmentPattern":
case "RestElement":
break
@@ -1697,9 +1902,6 @@
node.type = "AssignmentPattern";
delete node.operator;
this.toAssignable(node.left, isBinding);
- // falls through to AssignmentPattern
-
- case "AssignmentPattern":
break
case "ParenthesizedExpression":
@@ -1816,28 +2018,89 @@
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$2.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 (has(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 +2108,229 @@
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$2.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);
+ default:
+ this.checkLValSimple(expr, bindingType, checkClashes);
+ }
+ };
+
+ pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
break
- case "RestElement":
- this.checkLVal(expr.argument, bindingType, checkClashes);
+ case "AssignmentPattern":
+ this.checkLValPattern(expr.left, bindingType, checkClashes);
break
- case "ParenthesizedExpression":
- this.checkLVal(expr.expression, bindingType, checkClashes);
+ case "RestElement":
+ this.checkLValPattern(expr.argument, bindingType, checkClashes);
break
default:
- this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue");
+ this.checkLValPattern(expr, bindingType, checkClashes);
}
};
- // A recursive descent parser operates by defining functions for all
+ // The algorithm used to determine whether a regexp can appear at a
+
+ var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ this.generator = !!generator;
+ };
+
+ var types$1 = {
+ b_stat: new TokContext("{", false),
+ b_expr: new TokContext("{", true),
+ b_tmpl: new TokContext("${", false),
+ p_stat: new TokContext("(", false),
+ p_expr: new TokContext("(", true),
+ q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
+ f_stat: new TokContext("function", false),
+ f_expr: new TokContext("function", true),
+ f_expr_gen: new TokContext("function", true, false, null, true),
+ f_gen: new TokContext("function", false, false, null, true)
+ };
var pp$3 = Parser.prototype;
+ pp$3.initialContext = function() {
+ return [types$1.b_stat]
+ };
+
+ pp$3.curContext = function() {
+ return this.context[this.context.length - 1]
+ };
+
+ pp$3.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$3.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$3.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; }
+ };
+
+ // Used to handle egde case when token context could not be inferred correctly in tokenize phase
+ pp$3.overrideContext = function(tokenCtx) {
+ if (this.curContext() !== tokenCtx) {
+ this.context[this.context.length - 1] = tokenCtx;
+ }
+ };
+
+ // Token-specific context update code
+
+ types.parenR.updateContext = types.braceR.updateContext = function() {
+ if (this.context.length === 1) {
+ this.exprAllowed = true;
+ return
+ }
+ var out = this.context.pop();
+ if (out === types$1.b_stat && this.curContext().token === "function") {
+ out = this.context.pop();
+ }
+ this.exprAllowed = !out.isExpr;
+ };
+
+ types.braceL.updateContext = function(prevType) {
+ this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
+ this.exprAllowed = true;
+ };
+
+ types.dollarBraceL.updateContext = function() {
+ this.context.push(types$1.b_tmpl);
+ this.exprAllowed = true;
+ };
+
+ types.parenL.updateContext = function(prevType) {
+ var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
+ this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
+ this.exprAllowed = true;
+ };
+
+ types.incDec.updateContext = function() {
+ // tokExprAllowed stays unchanged
+ };
+
+ types._function.updateContext = types._class.updateContext = function(prevType) {
+ if (prevType.beforeExpr && prevType !== types._else &&
+ !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
+ !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
+ !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
+ { this.context.push(types$1.f_expr); }
+ else
+ { this.context.push(types$1.f_stat); }
+ this.exprAllowed = false;
+ };
+
+ types.backQuote.updateContext = function() {
+ if (this.curContext() === types$1.q_tmpl)
+ { this.context.pop(); }
+ else
+ { this.context.push(types$1.q_tmpl); }
+ this.exprAllowed = false;
+ };
+
+ types.star.updateContext = function(prevType) {
+ if (prevType === types._function) {
+ var index = this.context.length - 1;
+ if (this.context[index] === types$1.f_expr)
+ { this.context[index] = types$1.f_expr_gen; }
+ else
+ { this.context[index] = types$1.f_gen; }
+ }
+ this.exprAllowed = true;
+ };
+
+ types.name.updateContext = function(prevType) {
+ var allowed = false;
+ if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
+ if (this.value === "of" && !this.exprAllowed ||
+ this.value === "yield" && this.inGeneratorContext())
+ { allowed = true; }
+ }
+ this.exprAllowed = allowed;
+ };
+
+ // A recursive descent parser operates by defining functions for all
+
+ var pp$4 = 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$4.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))
@@ -1958,13 +2392,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$4.parseExpression = function(forInit, refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
+ var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
if (this.type === types.comma) {
var node = this.startNodeAt(startPos, startLoc);
node.expressions = [expr];
- while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
+ while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
return this.finishNode(node, "SequenceExpression")
}
return expr
@@ -1973,9 +2407,9 @@
// Parse an assignment expression. This includes applications of
// operators like `+=`.
- pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
+ pp$4.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; }
@@ -1992,22 +2426,29 @@
}
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.parenL || this.type === types.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.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.eq)
+ { this.checkLValPattern(left); }
+ else
+ { this.checkLValSimple(left); }
+ node.left = left;
this.next();
- node.right = this.parseMaybeAssign(noIn);
+ node.right = this.parseMaybeAssign(forInit);
return this.finishNode(node, "AssignmentExpression")
} else {
if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
@@ -2019,16 +2460,16 @@
// Parse a ternary conditional (`?:`) operator.
- pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
+ pp$4.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)) {
var node = this.startNodeAt(startPos, startLoc);
node.test = expr;
node.consequent = this.parseMaybeAssign();
this.expect(types.colon);
- node.alternate = this.parseMaybeAssign(noIn);
+ node.alternate = this.parseMaybeAssign(forInit);
return this.finishNode(node, "ConditionalExpression")
}
return expr
@@ -2036,11 +2477,11 @@
// Start the precedence parser.
- pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
+ pp$4.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,9 +2490,9 @@
// 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$4.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._in)) {
if (prec > minPrec) {
var logical = this.type === types.logicalOR || this.type === types.logicalAND;
var coalesce = this.type === types.coalesce;
@@ -2063,18 +2504,18 @@
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))) {
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$4.buildBinary = function(startPos, startLoc, left, right, op, logical) {
var node = this.startNodeAt(startPos, startLoc);
node.left = left;
node.operator = op;
@@ -2084,67 +2525,81 @@
// Parse unary operators, both prefix and postfix.
- pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
+ pp$4.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;
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); }
+ if (update) { this.checkLValSimple(node.argument); }
else if (this.strict && node.operator === "delete" &&
node.argument.type === "Identifier")
{ this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
+ else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
+ { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
else { sawUnary = true; }
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
} else {
- 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.starstar)) {
+ if (sawUnary)
+ { this.unexpected(this.lastTokStart); }
+ else
+ { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
+ } else {
+ return expr
+ }
};
+ function isPrivateFieldAccess(node) {
+ return (
+ node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
+ node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
+ )
+ }
+
// Parse call, dot, and `[]`-subscript expressions.
- pp$3.parseExprSubscripts = function(refDestructuringErrors) {
+ pp$4.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$4.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,7 +2615,7 @@
}
};
- pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
+ pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
var optionalSupported = this.options.ecmaVersion >= 11;
var optional = optionalSupported && this.eat(types.questionDot);
if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
@@ -2169,9 +2624,15 @@
if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
var node = this.startNodeAt(startPos, startLoc);
node.object = base;
- node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
+ if (computed) {
+ node.property = this.parseExpression();
+ this.expect(types.bracketR);
+ } else if (this.type === types.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;
}
@@ -2190,7 +2651,7 @@
this.yieldPos = oldYieldPos;
this.awaitPos = oldAwaitPos;
this.awaitIdentPos = oldAwaitIdentPos;
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
}
this.checkExpressionErrors(refDestructuringErrors, true);
this.yieldPos = oldYieldPos || this.yieldPos;
@@ -2220,7 +2681,7 @@
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
// or `{}`.
- pp$3.parseExprAtom = function(refDestructuringErrors) {
+ pp$4.parseExprAtom = function(refDestructuringErrors, forInit) {
// If a division operator appears in an expression position, the
// tokenizer got confused, and we force it to read a regexp instead.
if (this.type === types.slash) { this.readRegexp(); }
@@ -2252,16 +2713,19 @@
case types.name:
var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
var id = this.parseIdent(false);
- if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
- { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) {
+ this.overrideContext(types$1.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) {
+ { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc &&
+ (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
id = this.parseIdent(false);
if (this.canInsertSemicolon() || !this.eat(types.arrow))
{ this.unexpected(); }
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
}
}
return id
@@ -2283,7 +2747,7 @@
return this.finishNode(node, "Literal")
case types.parenL:
- var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
if (refDestructuringErrors) {
if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
{ refDestructuringErrors.parenthesizedAssign = start; }
@@ -2299,6 +2763,7 @@
return this.finishNode(node, "ArrayExpression")
case types.braceL:
+ this.overrideContext(types$1.b_expr);
return this.parseObj(false, refDestructuringErrors)
case types._function:
@@ -2327,7 +2792,7 @@
}
};
- pp$3.parseExprImport = function() {
+ pp$4.parseExprImport = function() {
var node = this.startNode();
// Consume `import` as an identifier for `import.meta`.
@@ -2346,7 +2811,7 @@
}
};
- pp$3.parseDynamicImport = function(node) {
+ pp$4.parseDynamicImport = function(node) {
this.next(); // skip `(`
// Parse node.source.
@@ -2365,7 +2830,7 @@
return this.finishNode(node, "ImportExpression")
};
- pp$3.parseImportMeta = function(node) {
+ pp$4.parseImportMeta = function(node) {
this.next(); // skip `.`
var containsEsc = this.containsEsc;
@@ -2375,13 +2840,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$4.parseLiteral = function(value) {
var node = this.startNode();
node.value = value;
node.raw = this.input.slice(this.start, this.end);
@@ -2390,14 +2855,14 @@
return this.finishNode(node, "Literal")
};
- pp$3.parseParenExpression = function() {
+ pp$4.parseParenExpression = function() {
this.expect(types.parenL);
var val = this.parseExpression();
this.expect(types.parenR);
return val
};
- pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
+ pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
if (this.options.ecmaVersion >= 6) {
this.next();
@@ -2422,7 +2887,7 @@
exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
}
}
- var innerEndPos = this.start, innerEndLoc = this.startLoc;
+ var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
this.expect(types.parenR);
if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
@@ -2430,7 +2895,7 @@
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 +2924,12 @@
}
};
- pp$3.parseParenItem = function(item) {
+ pp$4.parseParenItem = function(item) {
return item
};
- pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
+ pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, forInit)
};
// New's precedence is slightly tricky. It must allow its argument to
@@ -2475,7 +2940,7 @@
var empty$1 = [];
- pp$3.parseNew = function() {
+ pp$4.parseNew = function() {
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
var node = this.startNode();
var meta = this.parseIdent(true);
@@ -2487,12 +2952,12 @@
{ 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);
+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);
if (isImport && node.callee.type === "ImportExpression") {
this.raise(startPos, "Cannot use new with import()");
}
@@ -2503,7 +2968,7 @@
// Parse template expression.
- pp$3.parseTemplateElement = function(ref) {
+ pp$4.parseTemplateElement = function(ref) {
var isTagged = ref.isTagged;
var elem = this.startNode();
@@ -2526,7 +2991,7 @@
return this.finishNode(elem, "TemplateElement")
};
- pp$3.parseTemplate = function(ref) {
+ pp$4.parseTemplate = function(ref) {
if ( ref === void 0 ) ref = {};
var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
@@ -2546,7 +3011,7 @@
return this.finishNode(node, "TemplateLiteral")
};
- pp$3.isAsyncProp = function(prop) {
+ pp$4.isAsyncProp = function(prop) {
return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
(this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
!lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
@@ -2554,7 +3019,7 @@
// Parse an object literal or binding pattern.
- pp$3.parseObj = function(isPattern, refDestructuringErrors) {
+ pp$4.parseObj = function(isPattern, refDestructuringErrors) {
var node = this.startNode(), first = true, propHash = {};
node.properties = [];
this.next();
@@ -2571,7 +3036,7 @@
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
};
- pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
+ pp$4.parseProperty = function(isPattern, refDestructuringErrors) {
var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
if (isPattern) {
@@ -2622,7 +3087,7 @@
return this.finishNode(prop, "Property")
};
- pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
+ pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
if ((isGenerator || isAsync) && this.type === types.colon)
{ this.unexpected(); }
@@ -2660,19 +3125,19 @@
{ this.awaitIdentPos = startPos; }
prop.kind = "init";
if (isPattern) {
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
} else if (this.type === types.eq && refDestructuringErrors) {
if (refDestructuringErrors.shorthandAssign < 0)
{ refDestructuringErrors.shorthandAssign = this.start; }
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
+ 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$4.parsePropertyName = function(prop) {
if (this.options.ecmaVersion >= 6) {
if (this.eat(types.bracketL)) {
prop.computed = true;
@@ -2688,7 +3153,7 @@
// Initialize empty function node.
- pp$3.initFunction = function(node) {
+ pp$4.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 +3161,7 @@
// Parse object or class method.
- pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
+ pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
this.initFunction(node);
@@ -2713,7 +3178,7 @@
this.expect(types.parenL);
node.params = this.parseBindingList(types.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 +3188,7 @@
// Parse arrow function expression with given parameters.
- pp$3.parseArrowExpression = function(node, params, isAsync) {
+ pp$4.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 +3200,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 +3210,12 @@
// Parse function body and check parameters.
- pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
+ pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
var isExpression = isArrowFunction && this.type !== types.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 +3238,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 +3247,7 @@
this.exitScope();
};
- pp$3.isSimpleParamList = function(params) {
+ pp$4.isSimpleParamList = function(params) {
for (var i = 0, list = params; i < list.length; i += 1)
{
var param = list[i];
@@ -2795,13 +3260,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$4.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,7 +3276,7 @@
// nothing in between them to be parsed as `null` (which is needed
// for array literals).
- pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
+ pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
var elts = [], first = true;
while (!this.eat(close)) {
if (!first) {
@@ -2834,7 +3299,7 @@
return elts
};
- pp$3.checkUnreserved = function(ref) {
+ pp$4.checkUnreserved = function(ref) {
var start = ref.start;
var end = ref.end;
var name = ref.name;
@@ -2843,6 +3308,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,7 +3328,7 @@
// when parsing properties), it will also convert keywords into
// identifiers.
- pp$3.parseIdent = function(liberal, isBinding) {
+ pp$4.parseIdent = function(liberal, isBinding) {
var node = this.startNode();
if (this.type === types.name) {
node.name = this.value;
@@ -2887,9 +3356,29 @@
return node
};
+ pp$4.parsePrivateIdent = function() {
+ var node = this.startNode();
+ if (this.type === types.privateId) {
+ node.name = this.value;
+ } else {
+ this.unexpected();
+ }
+ this.next();
+ this.finishNode(node, "PrivateIdentifier");
+
+ // For validating existence
+ if (this.privateNameStack.length === 0) {
+ this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
+ } else {
+ this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
+ }
+
+ return node
+ };
+
// Parses yield expression inside generator.
- pp$3.parseYield = function(noIn) {
+ pp$4.parseYield = function(forInit) {
if (!this.yieldPos) { this.yieldPos = this.start; }
var node = this.startNode();
@@ -2899,21 +3388,21 @@
node.argument = null;
} else {
node.delegate = this.eat(types.star);
- node.argument = this.parseMaybeAssign(noIn);
+ node.argument = this.parseMaybeAssign(forInit);
}
return this.finishNode(node, "YieldExpression")
};
- pp$3.parseAwait = function() {
+ pp$4.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")
};
- var pp$4 = Parser.prototype;
+ var pp$5 = Parser.prototype;
// This function is used to raise exceptions on parse errors. It
// takes an offset integer (into the current `input`) to indicate
@@ -2921,7 +3410,7 @@
// of the error message, and then raises a `SyntaxError` with that
// message.
- pp$4.raise = function(pos, message) {
+ pp$5.raise = function(pos, message) {
var loc = getLineInfo(this.input, pos);
message += " (" + loc.line + ":" + loc.column + ")";
var err = new SyntaxError(message);
@@ -2929,15 +3418,15 @@
throw err
};
- pp$4.raiseRecoverable = pp$4.raise;
+ pp$5.raiseRecoverable = pp$5.raise;
- pp$4.curPosition = function() {
+ pp$5.curPosition = function() {
if (this.options.locations) {
return new Position(this.curLine, this.pos - this.lineStart)
}
};
- var pp$5 = Parser.prototype;
+ var pp$6 = Parser.prototype;
var Scope = function Scope(flags) {
this.flags = flags;
@@ -2947,26 +3436,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$6.enterScope = function(flags) {
this.scopeStack.push(new Scope(flags));
};
- pp$5.exitScope = function() {
+ pp$6.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$6.treatFunctionsAsVarInScope = function(scope) {
return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
};
- pp$5.declareName = function(name, bindingType, pos) {
+ pp$6.declareName = function(name, bindingType, pos) {
var redeclared = false;
if (bindingType === BIND_LEXICAL) {
var scope = this.currentScope();
@@ -3001,7 +3492,7 @@
if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
};
- pp$5.checkLocalExport = function(id) {
+ pp$6.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 +3500,11 @@
}
};
- pp$5.currentScope = function() {
+ pp$6.currentScope = function() {
return this.scopeStack[this.scopeStack.length - 1]
};
- pp$5.currentVarScope = function() {
+ pp$6.currentVarScope = function() {
for (var i = this.scopeStack.length - 1;; i--) {
var scope = this.scopeStack[i];
if (scope.flags & SCOPE_VAR) { return scope }
@@ -3021,7 +3512,7 @@
};
// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
- pp$5.currentThisScope = function() {
+ pp$6.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 +3533,13 @@
// Start an AST node, attaching a start offset.
- var pp$6 = Parser.prototype;
+ var pp$7 = Parser.prototype;
- pp$6.startNode = function() {
+ pp$7.startNode = function() {
return new Node(this, this.start, this.startLoc)
};
- pp$6.startNodeAt = function(pos, loc) {
+ pp$7.startNodeAt = function(pos, loc) {
return new Node(this, pos, loc)
};
@@ -3064,156 +3555,20 @@
return node
}
- pp$6.finishNode = function(node, type) {
+ pp$7.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$7.finishNodeAt = function(node, type, pos, loc) {
return finishNodeAt.call(this, node, type, pos, loc)
};
- // The algorithm used to determine whether a regexp can appear at a
-
- var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
- this.token = token;
- this.isExpr = !!isExpr;
- this.preserveSpace = !!preserveSpace;
- this.override = override;
- this.generator = !!generator;
- };
-
- var types$1 = {
- b_stat: new TokContext("{", false),
- b_expr: new TokContext("{", true),
- b_tmpl: new TokContext("${", false),
- p_stat: new TokContext("(", false),
- p_expr: new TokContext("(", true),
- q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
- f_stat: new TokContext("function", false),
- f_expr: new TokContext("function", true),
- f_expr_gen: new TokContext("function", true, false, null, true),
- f_gen: new TokContext("function", false, false, null, true)
- };
-
- var pp$7 = Parser.prototype;
-
- pp$7.initialContext = function() {
- return [types$1.b_stat]
- };
-
- pp$7.braceIsBlock = function(prevType) {
- var parent = this.curContext();
- if (parent === types$1.f_expr || parent === types$1.f_stat)
- { return true }
- if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
- { return !parent.isExpr }
-
- // The check for `tt.name && exprAllowed` detects whether we are
- // after a `yield` or `of` construct. See the `updateContext` for
- // `tt.name`.
- if (prevType === types._return || prevType === types.name && this.exprAllowed)
- { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
- if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
- { return true }
- if (prevType === types.braceL)
- { return parent === types$1.b_stat }
- if (prevType === types._var || prevType === types._const || prevType === types.name)
- { return false }
- return !this.exprAllowed
- };
-
- pp$7.inGeneratorContext = function() {
- for (var i = this.context.length - 1; i >= 1; i--) {
- var context = this.context[i];
- if (context.token === "function")
- { return context.generator }
- }
- return false
- };
-
- pp$7.updateContext = function(prevType) {
- var update, type = this.type;
- if (type.keyword && prevType === types.dot)
- { this.exprAllowed = false; }
- else if (update = type.updateContext)
- { update.call(this, prevType); }
- else
- { this.exprAllowed = type.beforeExpr; }
- };
-
- // Token-specific context update code
-
- types.parenR.updateContext = types.braceR.updateContext = function() {
- if (this.context.length === 1) {
- this.exprAllowed = true;
- return
- }
- var out = this.context.pop();
- if (out === types$1.b_stat && this.curContext().token === "function") {
- out = this.context.pop();
- }
- this.exprAllowed = !out.isExpr;
- };
-
- types.braceL.updateContext = function(prevType) {
- this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
- this.exprAllowed = true;
- };
-
- types.dollarBraceL.updateContext = function() {
- this.context.push(types$1.b_tmpl);
- this.exprAllowed = true;
- };
-
- types.parenL.updateContext = function(prevType) {
- var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
- this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
- this.exprAllowed = true;
- };
-
- types.incDec.updateContext = function() {
- // tokExprAllowed stays unchanged
- };
-
- types._function.updateContext = types._class.updateContext = function(prevType) {
- if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else &&
- !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
- !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
- { this.context.push(types$1.f_expr); }
- else
- { this.context.push(types$1.f_stat); }
- this.exprAllowed = false;
- };
-
- types.backQuote.updateContext = function() {
- if (this.curContext() === types$1.q_tmpl)
- { this.context.pop(); }
- else
- { this.context.push(types$1.q_tmpl); }
- this.exprAllowed = false;
- };
-
- types.star.updateContext = function(prevType) {
- if (prevType === types._function) {
- var index = this.context.length - 1;
- if (this.context[index] === types$1.f_expr)
- { this.context[index] = types$1.f_expr_gen; }
- else
- { this.context[index] = types$1.f_gen; }
- }
- this.exprAllowed = true;
- };
-
- types.name.updateContext = function(prevType) {
- var allowed = false;
- if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
- if (this.value === "of" && !this.exprAllowed ||
- this.value === "yield" && this.inGeneratorContext())
- { allowed = true; }
- }
- this.exprAllowed = allowed;
+ pp$7.copyNode = function(node) {
+ var newNode = new Node(this, node.start, this.startLoc);
+ for (var prop in node) { newNode[prop] = node[prop]; }
+ return newNode
};
// This file contains Unicode properties extracted from the ECMAScript
@@ -3224,10 +3579,12 @@
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 unicodeBinaryProperties = {
9: ecma9BinaryProperties,
10: ecma10BinaryProperties,
- 11: ecma11BinaryProperties
+ 11: ecma11BinaryProperties,
+ 12: ecma12BinaryProperties
};
// #table-unicode-general-category-values
@@ -3237,10 +3594,12 @@
var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
+ var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
var unicodeScriptValues = {
9: ecma9ScriptValues,
10: ecma10ScriptValues,
- 11: ecma11ScriptValues
+ 11: ecma11ScriptValues,
+ 12: ecma12ScriptValues
};
var data = {};
@@ -3261,13 +3620,14 @@
buildUnicodeData(9);
buildUnicodeData(10);
buildUnicodeData(11);
+ buildUnicodeData(12);
var pp$8 = Parser.prototype;
var RegExpValidationState = function RegExpValidationState(parser) {
this.parser = parser;
- this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
- this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion];
+ this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
+ this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
this.source = "";
this.flags = "";
this.start = 0;
@@ -4381,10 +4741,6 @@
// 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.
@@ -4411,9 +4767,9 @@
pp$9.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() {
@@ -4632,6 +4988,20 @@
return this.finishOp(types.question, 1)
};
+ pp$9.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.privateId, this.readWord1())
+ }
+ }
+
+ this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
+ };
+
pp$9.getTokenFromCode = function(code) {
switch (code) {
// The interpretation of a dot depends on whether it is followed
@@ -4703,6 +5073,9 @@
case 126: // '~'
return this.finishOp(types.prefix, 1)
+
+ case 35: // '#'
+ return this.readToken_numberSign()
}
this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
@@ -4887,8 +5260,15 @@
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;
}
}
@@ -5012,6 +5392,12 @@
return ""
case 56:
case 57:
+ if (this.strict) {
+ this.invalidStringToken(
+ this.pos - 1,
+ "Invalid escape sequence"
+ );
+ }
if (inTemplate) {
var codePos = this.pos - 1;
@@ -5108,7 +5494,7 @@
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
- var version = "7.4.1";
+ var version = "8.5.0";
Parser.acorn = {
Parser: Parser,
diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs
index 2b31a70a2b6..96a8294589b 100644
--- a/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs
+++ b/tools/node_modules/eslint/node_modules/acorn/dist/acorn.mjs
@@ -146,6 +146,7 @@ var types = {
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.
@@ -245,8 +246,8 @@ var types = {
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
}
var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
@@ -308,16 +309,17 @@ function getLineInfo(input, offset) {
}
}
-// 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), 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.
@@ -340,11 +342,16 @@ var defaultOptions = {
// 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,
+ 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.
allowHashBang: false,
@@ -398,14 +405,25 @@ var defaultOptions = {
// 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]; }
- 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; }
@@ -440,19 +458,20 @@ function pushComment(options, array) {
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
@@ -467,8 +486,7 @@ var Parser = function Parser(options, input, startPos) {
this.keywords = wordsRegexp(keywords[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
var reserved = "";
if (options.allowReserved !== true) {
- for (var v = options.ecmaVersion;; v--)
- { if (reserved = reservedWords[v]) { break } }
+ reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
if (options.sourceType === "module") { reserved += " await"; }
}
this.reservedWords = wordsRegexp(reserved);
@@ -521,13 +539,14 @@ var Parser = function Parser(options, input, startPos) {
// 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) === "#!")
@@ -539,9 +558,14 @@ var Parser = function Parser(options, input, startPos) {
// 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();
@@ -550,14 +574,33 @@ Parser.prototype.parse = function parse () {
};
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;
@@ -743,7 +786,7 @@ var pp$1 = Parser.prototype;
// to its body instead of creating a new node.
pp$1.parseTopLevel = function(node) {
- var exports = {};
+ var exports = Object.create(null);
if (!node.body) { node.body = []; }
while (this.type !== types.eof) {
var stmt = this.parseStatement(null, true, exports);
@@ -773,13 +816,14 @@ pp$1.isLet = function(context) {
// 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 || nextCh > 0xd7ff && nextCh < 0xdc00) { return true } // '[', '/', astral
if (context) { return false }
if (nextCh === 123) { return true } // '{'
if (isIdentifierStart(nextCh, true)) {
var pos = next + 1;
- while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; }
+ 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,10 +839,11 @@ pp$1.isAsyncFunction = function() {
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.
@@ -938,7 +983,7 @@ pp$1.parseDoStatement = function(node) {
pp$1.parseForStatement = function(node) {
this.next();
- var awaitAt = (this.options.ecmaVersion >= 9 && (this.inAsync || (!this.inFunction && this.options.allowAwaitOutsideFunction)) && this.eatContextual("await")) ? this.lastTokStart : -1;
+ 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);
@@ -963,16 +1008,18 @@ pp$1.parseForStatement = function(node) {
if (awaitAt > -1) { this.unexpected(awaitAt); }
return this.parseFor(node, init$1)
}
+ var startsWithLet = this.isContextual("let"), isForOf = false;
var refDestructuringErrors = new DestructuringErrors;
- var init = this.parseExpression(true, refDestructuringErrors);
- if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
+ var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors);
+ if (this.type === types._in || (isForOf = 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; }
}
+ 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);
@@ -1073,7 +1120,7 @@ pp$1.parseTryStatement = function(node) {
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.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
this.expect(types.parenR);
} else {
if (this.options.ecmaVersion < 10) { this.unexpected(); }
@@ -1209,8 +1256,6 @@ pp$1.parseForIn = function(node, init) {
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();
@@ -1246,7 +1291,7 @@ pp$1.parseVar = function(node, isFor, kind) {
pp$1.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;
@@ -1255,7 +1300,7 @@ var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;
// `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$1.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))
@@ -1272,7 +1317,7 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
// 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;
@@ -1285,7 +1330,7 @@ pp$1.parseFunction = function(node, statement, allowExpressionBody, isAsync) {
{ node.id = this.type === types.name ? this.parseIdent() : null; }
this.parseFunctionParams(node);
- this.parseFunctionBody(node, allowExpressionBody, false);
+ this.parseFunctionBody(node, allowExpressionBody, false, forInit);
this.yieldPos = oldYieldPos;
this.awaitPos = oldAwaitPos;
@@ -1312,6 +1357,7 @@ pp$1.parseClass = function(node, isStatement) {
this.parseClassId(node, isStatement);
this.parseClassSuper(node);
+ var privateNameMap = this.enterClassBody();
var classBody = this.startNode();
var hadConstructor = false;
classBody.body = [];
@@ -1323,82 +1369,181 @@ pp$1.parseClass = function(node, isStatement) {
if (element.type === "MethodDefinition" && element.kind === "constructor") {
if (hadConstructor) { this.raise(element.start, "Duplicate constructor in the same class"); }
hadConstructor = true;
+ } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
+ this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
}
}
}
this.strict = oldStrict;
this.next();
node.body = this.finishNode(classBody, "ClassBody");
+ this.exitClassBody();
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
};
pp$1.parseClassElement = function(constructorAllowsSuper) {
- var this$1 = this;
-
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)) {
+ var kind = "method";
+ var isStatic = false;
+
+ if (this.eatContextual("static")) {
+ // Parse static init block
+ if (ecmaVersion >= 13 && this.eat(types.braceL)) {
+ this.parseClassStaticBlock(node);
+ return node
+ }
+ if (this.isClassElementNameStart() || this.type === types.star) {
+ isStatic = true;
+ } else {
+ keyName = "static";
+ }
+ }
+ node.static = isStatic;
+ if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
+ if ((this.isClassElementNameStart() || this.type === types.star) && !this.canInsertSemicolon()) {
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";
+ } else {
+ keyName = "async";
}
}
- if (!method.key) { this.parsePropertyName(method); }
+ if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types.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.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.isClassElementNameStart = function() {
+ return (
+ this.type === types.name ||
+ this.type === types.privateId ||
+ this.type === types.num ||
+ this.type === types.string ||
+ this.type === types.bracketL ||
+ this.type.keyword
+ )
+};
+
+pp$1.parseClassElementName = function(element) {
+ if (this.type === types.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$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
+ // Check key and flags
var key = method.key;
- var allowsDirectSuper = false;
- if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" ||
- key.type === "Literal" && key.value === "constructor")) {
- if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); }
+ if (method.kind === "constructor") {
if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
- method.kind = "constructor";
- allowsDirectSuper = constructorAllowsSuper;
- } else if (method.static && key.type === "Identifier" && key.name === "prototype") {
+ } else if (method.static && checkKeyName(method, "prototype")) {
this.raise(key.start, "Classes may not have a static property named prototype");
}
- this.parseClassMethod(method, isGenerator, isAsync, allowsDirectSuper);
- if (method.kind === "get" && method.value.params.length !== 0)
- { this.raiseRecoverable(method.value.start, "getter should have no params"); }
- if (method.kind === "set" && method.value.params.length !== 1)
- { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); }
- if (method.kind === "set" && method.value.params[0].type === "RestElement")
- { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); }
- return method
-};
-pp$1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
- method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+ // Parse value
+ var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);
+
+ // Check value
+ if (method.kind === "get" && value.params.length !== 0)
+ { this.raiseRecoverable(value.start, "getter should have no params"); }
+ if (method.kind === "set" && value.params.length !== 1)
+ { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
+ if (method.kind === "set" && value.params[0].type === "RestElement")
+ { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }
+
return this.finishNode(method, "MethodDefinition")
};
+pp$1.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.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$1.parseClassStaticBlock = function(node) {
+ node.body = [];
+
+ var oldLabels = this.labels;
+ this.labels = [];
+ this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
+ while (this.type !== types.braceR) {
+ var stmt = this.parseStatement(null);
+ node.body.push(stmt);
+ }
+ this.next();
+ this.exitScope();
+ this.labels = oldLabels;
+
+ return this.finishNode(node, "StaticBlock")
+};
+
pp$1.parseClassId = function(node, isStatement) {
if (this.type === types.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(); }
@@ -1407,9 +1552,68 @@ pp$1.parseClassId = function(node, isStatement) {
};
pp$1.parseClassSuper = function(node) {
- node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
+ node.superClass = this.eat(types._extends) ? this.parseExprSubscripts(false) : null;
+};
+
+pp$1.enterClassBody = function() {
+ var element = {declared: Object.create(null), used: []};
+ this.privateNameStack.push(element);
+ return element.declared
+};
+
+pp$1.exitClassBody = function() {
+ var ref = this.privateNameStack.pop();
+ var declared = ref.declared;
+ var used = ref.used;
+ var len = this.privateNameStack.length;
+ var parent = len === 0 ? null : this.privateNameStack[len - 1];
+ for (var i = 0; i < used.length; ++i) {
+ var id = used[i];
+ if (!has(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) {
@@ -1578,7 +1782,7 @@ pp$1.parseImportSpecifiers = function() {
// import defaultObj, { x, y as z } from '...'
var node = this.startNode();
node.local = this.parseIdent();
- this.checkLVal(node.local, BIND_LEXICAL);
+ this.checkLValSimple(node.local, BIND_LEXICAL);
nodes.push(this.finishNode(node, "ImportDefaultSpecifier"));
if (!this.eat(types.comma)) { return nodes }
}
@@ -1587,7 +1791,7 @@ pp$1.parseImportSpecifiers = function() {
this.next();
this.expectContextual("as");
node$1.local = this.parseIdent();
- this.checkLVal(node$1.local, BIND_LEXICAL);
+ this.checkLValSimple(node$1.local, BIND_LEXICAL);
nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier"));
return nodes
}
@@ -1606,7 +1810,7 @@ pp$1.parseImportSpecifiers = function() {
this.checkUnreserved(node$2.imported);
node$2.local = node$2.imported;
}
- this.checkLVal(node$2.local, BIND_LEXICAL);
+ this.checkLValSimple(node$2.local, BIND_LEXICAL);
nodes.push(this.finishNode(node$2, "ImportSpecifier"));
}
return nodes
@@ -1643,6 +1847,7 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
case "ObjectPattern":
case "ArrayPattern":
+ case "AssignmentPattern":
case "RestElement":
break
@@ -1691,9 +1896,6 @@ pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) {
node.type = "AssignmentPattern";
delete node.operator;
this.toAssignable(node.left, isBinding);
- // falls through to AssignmentPattern
-
- case "AssignmentPattern":
break
case "ParenthesizedExpression":
@@ -1810,28 +2012,89 @@ pp$2.parseMaybeDefault = function(startPos, startLoc, left) {
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$2.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 (has(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":
@@ -1839,58 +2102,229 @@ pp$2.checkLVal = function(expr, bindingType, checkClashes) {
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$2.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);
+ default:
+ this.checkLValSimple(expr, bindingType, checkClashes);
+ }
+};
+
+pp$2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
+ if ( bindingType === void 0 ) bindingType = BIND_NONE;
+
+ switch (expr.type) {
+ case "Property":
+ // AssignmentProperty has type === "Property"
+ this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
break
- case "RestElement":
- this.checkLVal(expr.argument, bindingType, checkClashes);
+ case "AssignmentPattern":
+ this.checkLValPattern(expr.left, bindingType, checkClashes);
break
- case "ParenthesizedExpression":
- this.checkLVal(expr.expression, bindingType, checkClashes);
+ case "RestElement":
+ this.checkLValPattern(expr.argument, bindingType, checkClashes);
break
default:
- this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue");
+ this.checkLValPattern(expr, bindingType, checkClashes);
}
};
-// A recursive descent parser operates by defining functions for all
+// The algorithm used to determine whether a regexp can appear at a
+
+var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ this.generator = !!generator;
+};
+
+var types$1 = {
+ b_stat: new TokContext("{", false),
+ b_expr: new TokContext("{", true),
+ b_tmpl: new TokContext("${", false),
+ p_stat: new TokContext("(", false),
+ p_expr: new TokContext("(", true),
+ q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
+ f_stat: new TokContext("function", false),
+ f_expr: new TokContext("function", true),
+ f_expr_gen: new TokContext("function", true, false, null, true),
+ f_gen: new TokContext("function", false, false, null, true)
+};
var pp$3 = Parser.prototype;
+pp$3.initialContext = function() {
+ return [types$1.b_stat]
+};
+
+pp$3.curContext = function() {
+ return this.context[this.context.length - 1]
+};
+
+pp$3.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$3.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$3.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; }
+};
+
+// Used to handle egde case when token context could not be inferred correctly in tokenize phase
+pp$3.overrideContext = function(tokenCtx) {
+ if (this.curContext() !== tokenCtx) {
+ this.context[this.context.length - 1] = tokenCtx;
+ }
+};
+
+// Token-specific context update code
+
+types.parenR.updateContext = types.braceR.updateContext = function() {
+ if (this.context.length === 1) {
+ this.exprAllowed = true;
+ return
+ }
+ var out = this.context.pop();
+ if (out === types$1.b_stat && this.curContext().token === "function") {
+ out = this.context.pop();
+ }
+ this.exprAllowed = !out.isExpr;
+};
+
+types.braceL.updateContext = function(prevType) {
+ this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
+ this.exprAllowed = true;
+};
+
+types.dollarBraceL.updateContext = function() {
+ this.context.push(types$1.b_tmpl);
+ this.exprAllowed = true;
+};
+
+types.parenL.updateContext = function(prevType) {
+ var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
+ this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
+ this.exprAllowed = true;
+};
+
+types.incDec.updateContext = function() {
+ // tokExprAllowed stays unchanged
+};
+
+types._function.updateContext = types._class.updateContext = function(prevType) {
+ if (prevType.beforeExpr && prevType !== types._else &&
+ !(prevType === types.semi && this.curContext() !== types$1.p_stat) &&
+ !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
+ !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
+ { this.context.push(types$1.f_expr); }
+ else
+ { this.context.push(types$1.f_stat); }
+ this.exprAllowed = false;
+};
+
+types.backQuote.updateContext = function() {
+ if (this.curContext() === types$1.q_tmpl)
+ { this.context.pop(); }
+ else
+ { this.context.push(types$1.q_tmpl); }
+ this.exprAllowed = false;
+};
+
+types.star.updateContext = function(prevType) {
+ if (prevType === types._function) {
+ var index = this.context.length - 1;
+ if (this.context[index] === types$1.f_expr)
+ { this.context[index] = types$1.f_expr_gen; }
+ else
+ { this.context[index] = types$1.f_gen; }
+ }
+ this.exprAllowed = true;
+};
+
+types.name.updateContext = function(prevType) {
+ var allowed = false;
+ if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
+ if (this.value === "of" && !this.exprAllowed ||
+ this.value === "yield" && this.inGeneratorContext())
+ { allowed = true; }
+ }
+ this.exprAllowed = allowed;
+};
+
+// A recursive descent parser operates by defining functions for all
+
+var pp$4 = 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$4.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))
@@ -1952,13 +2386,13 @@ pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) {
// and object pattern might appear (so it's possible to raise
// delayed syntax error at correct position).
-pp$3.parseExpression = function(noIn, refDestructuringErrors) {
+pp$4.parseExpression = function(forInit, refDestructuringErrors) {
var startPos = this.start, startLoc = this.startLoc;
- var expr = this.parseMaybeAssign(noIn, refDestructuringErrors);
+ var expr = this.parseMaybeAssign(forInit, refDestructuringErrors);
if (this.type === types.comma) {
var node = this.startNodeAt(startPos, startLoc);
node.expressions = [expr];
- while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); }
+ while (this.eat(types.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }
return this.finishNode(node, "SequenceExpression")
}
return expr
@@ -1967,9 +2401,9 @@ pp$3.parseExpression = function(noIn, refDestructuringErrors) {
// Parse an assignment expression. This includes applications of
// operators like `+=`.
-pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
+pp$4.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; }
@@ -1986,22 +2420,29 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
}
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.parenL || this.type === types.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.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.eq)
+ { this.checkLValPattern(left); }
+ else
+ { this.checkLValSimple(left); }
+ node.left = left;
this.next();
- node.right = this.parseMaybeAssign(noIn);
+ node.right = this.parseMaybeAssign(forInit);
return this.finishNode(node, "AssignmentExpression")
} else {
if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
@@ -2013,16 +2454,16 @@ pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) {
// Parse a ternary conditional (`?:`) operator.
-pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
+pp$4.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)) {
var node = this.startNodeAt(startPos, startLoc);
node.test = expr;
node.consequent = this.parseMaybeAssign();
this.expect(types.colon);
- node.alternate = this.parseMaybeAssign(noIn);
+ node.alternate = this.parseMaybeAssign(forInit);
return this.finishNode(node, "ConditionalExpression")
}
return expr
@@ -2030,11 +2471,11 @@ pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) {
// Start the precedence parser.
-pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
+pp$4.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
@@ -2043,9 +2484,9 @@ pp$3.parseExprOps = function(noIn, refDestructuringErrors) {
// 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$4.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._in)) {
if (prec > minPrec) {
var logical = this.type === types.logicalOR || this.type === types.logicalAND;
var coalesce = this.type === types.coalesce;
@@ -2057,18 +2498,18 @@ pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) {
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))) {
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$4.buildBinary = function(startPos, startLoc, left, right, op, logical) {
var node = this.startNodeAt(startPos, startLoc);
node.left = left;
node.operator = op;
@@ -2078,67 +2519,81 @@ pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) {
// Parse unary operators, both prefix and postfix.
-pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) {
+pp$4.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;
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); }
+ if (update) { this.checkLValSimple(node.argument); }
else if (this.strict && node.operator === "delete" &&
node.argument.type === "Identifier")
{ this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
+ else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
+ { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
else { sawUnary = true; }
expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
} else {
- 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.starstar)) {
+ if (sawUnary)
+ { this.unexpected(this.lastTokStart); }
+ else
+ { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
+ } else {
+ return expr
+ }
};
+function isPrivateFieldAccess(node) {
+ return (
+ node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
+ node.type === "ChainExpression" && isPrivateFieldAccess(node.expression)
+ )
+}
+
// Parse call, dot, and `[]`-subscript expressions.
-pp$3.parseExprSubscripts = function(refDestructuringErrors) {
+pp$4.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$4.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") {
@@ -2154,7 +2609,7 @@ pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) {
}
};
-pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained) {
+pp$4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
var optionalSupported = this.options.ecmaVersion >= 11;
var optional = optionalSupported && this.eat(types.questionDot);
if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }
@@ -2163,9 +2618,15 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
if (computed || (optional && this.type !== types.parenL && this.type !== types.backQuote) || this.eat(types.dot)) {
var node = this.startNodeAt(startPos, startLoc);
node.object = base;
- node.property = computed ? this.parseExpression() : this.parseIdent(this.options.allowReserved !== "never");
+ if (computed) {
+ node.property = this.parseExpression();
+ this.expect(types.bracketR);
+ } else if (this.type === types.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;
}
@@ -2184,7 +2645,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
this.yieldPos = oldYieldPos;
this.awaitPos = oldAwaitPos;
this.awaitIdentPos = oldAwaitIdentPos;
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true)
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
}
this.checkExpressionErrors(refDestructuringErrors, true);
this.yieldPos = oldYieldPos || this.yieldPos;
@@ -2214,7 +2675,7 @@ pp$3.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArro
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
// or `{}`.
-pp$3.parseExprAtom = function(refDestructuringErrors) {
+pp$4.parseExprAtom = function(refDestructuringErrors, forInit) {
// If a division operator appears in an expression position, the
// tokenizer got confused, and we force it to read a regexp instead.
if (this.type === types.slash) { this.readRegexp(); }
@@ -2246,16 +2707,19 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
case types.name:
var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
var id = this.parseIdent(false);
- if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function))
- { return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true) }
+ if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) {
+ this.overrideContext(types$1.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) {
+ { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
+ if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc &&
+ (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
id = this.parseIdent(false);
if (this.canInsertSemicolon() || !this.eat(types.arrow))
{ this.unexpected(); }
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true)
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
}
}
return id
@@ -2277,7 +2741,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
return this.finishNode(node, "Literal")
case types.parenL:
- var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow);
+ var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
if (refDestructuringErrors) {
if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
{ refDestructuringErrors.parenthesizedAssign = start; }
@@ -2293,6 +2757,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
return this.finishNode(node, "ArrayExpression")
case types.braceL:
+ this.overrideContext(types$1.b_expr);
return this.parseObj(false, refDestructuringErrors)
case types._function:
@@ -2321,7 +2786,7 @@ pp$3.parseExprAtom = function(refDestructuringErrors) {
}
};
-pp$3.parseExprImport = function() {
+pp$4.parseExprImport = function() {
var node = this.startNode();
// Consume `import` as an identifier for `import.meta`.
@@ -2340,7 +2805,7 @@ pp$3.parseExprImport = function() {
}
};
-pp$3.parseDynamicImport = function(node) {
+pp$4.parseDynamicImport = function(node) {
this.next(); // skip `(`
// Parse node.source.
@@ -2359,7 +2824,7 @@ pp$3.parseDynamicImport = function(node) {
return this.finishNode(node, "ImportExpression")
};
-pp$3.parseImportMeta = function(node) {
+pp$4.parseImportMeta = function(node) {
this.next(); // skip `.`
var containsEsc = this.containsEsc;
@@ -2369,13 +2834,13 @@ pp$3.parseImportMeta = function(node) {
{ 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$4.parseLiteral = function(value) {
var node = this.startNode();
node.value = value;
node.raw = this.input.slice(this.start, this.end);
@@ -2384,14 +2849,14 @@ pp$3.parseLiteral = function(value) {
return this.finishNode(node, "Literal")
};
-pp$3.parseParenExpression = function() {
+pp$4.parseParenExpression = function() {
this.expect(types.parenL);
var val = this.parseExpression();
this.expect(types.parenR);
return val
};
-pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
+pp$4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
if (this.options.ecmaVersion >= 6) {
this.next();
@@ -2416,7 +2881,7 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
}
}
- var innerEndPos = this.start, innerEndLoc = this.startLoc;
+ var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
this.expect(types.parenR);
if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
@@ -2424,7 +2889,7 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
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); }
@@ -2453,12 +2918,12 @@ pp$3.parseParenAndDistinguishExpression = function(canBeArrow) {
}
};
-pp$3.parseParenItem = function(item) {
+pp$4.parseParenItem = function(item) {
return item
};
-pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
- return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList)
+pp$4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
+ return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, forInit)
};
// New's precedence is slightly tricky. It must allow its argument to
@@ -2469,7 +2934,7 @@ pp$3.parseParenArrowList = function(startPos, startLoc, exprList) {
var empty$1 = [];
-pp$3.parseNew = function() {
+pp$4.parseNew = function() {
if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
var node = this.startNode();
var meta = this.parseIdent(true);
@@ -2481,12 +2946,12 @@ pp$3.parseNew = function() {
{ 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);
+ node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false);
if (isImport && node.callee.type === "ImportExpression") {
this.raise(startPos, "Cannot use new with import()");
}
@@ -2497,7 +2962,7 @@ pp$3.parseNew = function() {
// Parse template expression.
-pp$3.parseTemplateElement = function(ref) {
+pp$4.parseTemplateElement = function(ref) {
var isTagged = ref.isTagged;
var elem = this.startNode();
@@ -2520,7 +2985,7 @@ pp$3.parseTemplateElement = function(ref) {
return this.finishNode(elem, "TemplateElement")
};
-pp$3.parseTemplate = function(ref) {
+pp$4.parseTemplate = function(ref) {
if ( ref === void 0 ) ref = {};
var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;
@@ -2540,7 +3005,7 @@ pp$3.parseTemplate = function(ref) {
return this.finishNode(node, "TemplateLiteral")
};
-pp$3.isAsyncProp = function(prop) {
+pp$4.isAsyncProp = function(prop) {
return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
(this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&
!lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
@@ -2548,7 +3013,7 @@ pp$3.isAsyncProp = function(prop) {
// Parse an object literal or binding pattern.
-pp$3.parseObj = function(isPattern, refDestructuringErrors) {
+pp$4.parseObj = function(isPattern, refDestructuringErrors) {
var node = this.startNode(), first = true, propHash = {};
node.properties = [];
this.next();
@@ -2565,7 +3030,7 @@ pp$3.parseObj = function(isPattern, refDestructuringErrors) {
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
};
-pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
+pp$4.parseProperty = function(isPattern, refDestructuringErrors) {
var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) {
if (isPattern) {
@@ -2616,7 +3081,7 @@ pp$3.parseProperty = function(isPattern, refDestructuringErrors) {
return this.finishNode(prop, "Property")
};
-pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
+pp$4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
if ((isGenerator || isAsync) && this.type === types.colon)
{ this.unexpected(); }
@@ -2654,19 +3119,19 @@ pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
{ this.awaitIdentPos = startPos; }
prop.kind = "init";
if (isPattern) {
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
+ prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
} else if (this.type === types.eq && refDestructuringErrors) {
if (refDestructuringErrors.shorthandAssign < 0)
{ refDestructuringErrors.shorthandAssign = this.start; }
- prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key);
+ 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$4.parsePropertyName = function(prop) {
if (this.options.ecmaVersion >= 6) {
if (this.eat(types.bracketL)) {
prop.computed = true;
@@ -2682,7 +3147,7 @@ pp$3.parsePropertyName = function(prop) {
// Initialize empty function node.
-pp$3.initFunction = function(node) {
+pp$4.initFunction = function(node) {
node.id = null;
if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
if (this.options.ecmaVersion >= 8) { node.async = false; }
@@ -2690,7 +3155,7 @@ pp$3.initFunction = function(node) {
// Parse object or class method.
-pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
+pp$4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
this.initFunction(node);
@@ -2707,7 +3172,7 @@ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
this.expect(types.parenL);
node.params = this.parseBindingList(types.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;
@@ -2717,7 +3182,7 @@ pp$3.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
// Parse arrow function expression with given parameters.
-pp$3.parseArrowExpression = function(node, params, isAsync) {
+pp$4.parseArrowExpression = function(node, params, isAsync, forInit) {
var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
@@ -2729,7 +3194,7 @@ pp$3.parseArrowExpression = function(node, params, isAsync) {
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;
@@ -2739,12 +3204,12 @@ pp$3.parseArrowExpression = function(node, params, isAsync) {
// Parse function body and check parameters.
-pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
+pp$4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
var isExpression = isArrowFunction && this.type !== types.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 {
@@ -2767,7 +3232,7 @@ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
// 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);
@@ -2776,7 +3241,7 @@ pp$3.parseFunctionBody = function(node, isArrowFunction, isMethod) {
this.exitScope();
};
-pp$3.isSimpleParamList = function(params) {
+pp$4.isSimpleParamList = function(params) {
for (var i = 0, list = params; i < list.length; i += 1)
{
var param = list[i];
@@ -2789,13 +3254,13 @@ pp$3.isSimpleParamList = function(params) {
// 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$4.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);
}
};
@@ -2805,7 +3270,7 @@ pp$3.checkParams = function(node, allowDuplicates) {
// nothing in between them to be parsed as `null` (which is needed
// for array literals).
-pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
+pp$4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
var elts = [], first = true;
while (!this.eat(close)) {
if (!first) {
@@ -2828,7 +3293,7 @@ pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestruct
return elts
};
-pp$3.checkUnreserved = function(ref) {
+pp$4.checkUnreserved = function(ref) {
var start = ref.start;
var end = ref.end;
var name = ref.name;
@@ -2837,6 +3302,10 @@ pp$3.checkUnreserved = function(ref) {
{ 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 &&
@@ -2853,7 +3322,7 @@ pp$3.checkUnreserved = function(ref) {
// when parsing properties), it will also convert keywords into
// identifiers.
-pp$3.parseIdent = function(liberal, isBinding) {
+pp$4.parseIdent = function(liberal, isBinding) {
var node = this.startNode();
if (this.type === types.name) {
node.name = this.value;
@@ -2881,9 +3350,29 @@ pp$3.parseIdent = function(liberal, isBinding) {
return node
};
+pp$4.parsePrivateIdent = function() {
+ var node = this.startNode();
+ if (this.type === types.privateId) {
+ node.name = this.value;
+ } else {
+ this.unexpected();
+ }
+ this.next();
+ this.finishNode(node, "PrivateIdentifier");
+
+ // For validating existence
+ if (this.privateNameStack.length === 0) {
+ this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
+ } else {
+ this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
+ }
+
+ return node
+};
+
// Parses yield expression inside generator.
-pp$3.parseYield = function(noIn) {
+pp$4.parseYield = function(forInit) {
if (!this.yieldPos) { this.yieldPos = this.start; }
var node = this.startNode();
@@ -2893,21 +3382,21 @@ pp$3.parseYield = function(noIn) {
node.argument = null;
} else {
node.delegate = this.eat(types.star);
- node.argument = this.parseMaybeAssign(noIn);
+ node.argument = this.parseMaybeAssign(forInit);
}
return this.finishNode(node, "YieldExpression")
};
-pp$3.parseAwait = function() {
+pp$4.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")
};
-var pp$4 = Parser.prototype;
+var pp$5 = Parser.prototype;
// This function is used to raise exceptions on parse errors. It
// takes an offset integer (into the current `input`) to indicate
@@ -2915,7 +3404,7 @@ var pp$4 = Parser.prototype;
// of the error message, and then raises a `SyntaxError` with that
// message.
-pp$4.raise = function(pos, message) {
+pp$5.raise = function(pos, message) {
var loc = getLineInfo(this.input, pos);
message += " (" + loc.line + ":" + loc.column + ")";
var err = new SyntaxError(message);
@@ -2923,15 +3412,15 @@ pp$4.raise = function(pos, message) {
throw err
};
-pp$4.raiseRecoverable = pp$4.raise;
+pp$5.raiseRecoverable = pp$5.raise;
-pp$4.curPosition = function() {
+pp$5.curPosition = function() {
if (this.options.locations) {
return new Position(this.curLine, this.pos - this.lineStart)
}
};
-var pp$5 = Parser.prototype;
+var pp$6 = Parser.prototype;
var Scope = function Scope(flags) {
this.flags = flags;
@@ -2941,26 +3430,28 @@ var Scope = function Scope(flags) {
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$6.enterScope = function(flags) {
this.scopeStack.push(new Scope(flags));
};
-pp$5.exitScope = function() {
+pp$6.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$6.treatFunctionsAsVarInScope = function(scope) {
return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
};
-pp$5.declareName = function(name, bindingType, pos) {
+pp$6.declareName = function(name, bindingType, pos) {
var redeclared = false;
if (bindingType === BIND_LEXICAL) {
var scope = this.currentScope();
@@ -2995,7 +3486,7 @@ pp$5.declareName = function(name, bindingType, pos) {
if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
};
-pp$5.checkLocalExport = function(id) {
+pp$6.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) {
@@ -3003,11 +3494,11 @@ pp$5.checkLocalExport = function(id) {
}
};
-pp$5.currentScope = function() {
+pp$6.currentScope = function() {
return this.scopeStack[this.scopeStack.length - 1]
};
-pp$5.currentVarScope = function() {
+pp$6.currentVarScope = function() {
for (var i = this.scopeStack.length - 1;; i--) {
var scope = this.scopeStack[i];
if (scope.flags & SCOPE_VAR) { return scope }
@@ -3015,7 +3506,7 @@ pp$5.currentVarScope = function() {
};
// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
-pp$5.currentThisScope = function() {
+pp$6.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 }
@@ -3036,13 +3527,13 @@ var Node = function Node(parser, pos, loc) {
// Start an AST node, attaching a start offset.
-var pp$6 = Parser.prototype;
+var pp$7 = Parser.prototype;
-pp$6.startNode = function() {
+pp$7.startNode = function() {
return new Node(this, this.start, this.startLoc)
};
-pp$6.startNodeAt = function(pos, loc) {
+pp$7.startNodeAt = function(pos, loc) {
return new Node(this, pos, loc)
};
@@ -3058,156 +3549,20 @@ function finishNodeAt(node, type, pos, loc) {
return node
}
-pp$6.finishNode = function(node, type) {
+pp$7.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$7.finishNodeAt = function(node, type, pos, loc) {
return finishNodeAt.call(this, node, type, pos, loc)
};
-// The algorithm used to determine whether a regexp can appear at a
-
-var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
- this.token = token;
- this.isExpr = !!isExpr;
- this.preserveSpace = !!preserveSpace;
- this.override = override;
- this.generator = !!generator;
-};
-
-var types$1 = {
- b_stat: new TokContext("{", false),
- b_expr: new TokContext("{", true),
- b_tmpl: new TokContext("${", false),
- p_stat: new TokContext("(", false),
- p_expr: new TokContext("(", true),
- q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
- f_stat: new TokContext("function", false),
- f_expr: new TokContext("function", true),
- f_expr_gen: new TokContext("function", true, false, null, true),
- f_gen: new TokContext("function", false, false, null, true)
-};
-
-var pp$7 = Parser.prototype;
-
-pp$7.initialContext = function() {
- return [types$1.b_stat]
-};
-
-pp$7.braceIsBlock = function(prevType) {
- var parent = this.curContext();
- if (parent === types$1.f_expr || parent === types$1.f_stat)
- { return true }
- if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr))
- { return !parent.isExpr }
-
- // The check for `tt.name && exprAllowed` detects whether we are
- // after a `yield` or `of` construct. See the `updateContext` for
- // `tt.name`.
- if (prevType === types._return || prevType === types.name && this.exprAllowed)
- { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
- if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)
- { return true }
- if (prevType === types.braceL)
- { return parent === types$1.b_stat }
- if (prevType === types._var || prevType === types._const || prevType === types.name)
- { return false }
- return !this.exprAllowed
-};
-
-pp$7.inGeneratorContext = function() {
- for (var i = this.context.length - 1; i >= 1; i--) {
- var context = this.context[i];
- if (context.token === "function")
- { return context.generator }
- }
- return false
-};
-
-pp$7.updateContext = function(prevType) {
- var update, type = this.type;
- if (type.keyword && prevType === types.dot)
- { this.exprAllowed = false; }
- else if (update = type.updateContext)
- { update.call(this, prevType); }
- else
- { this.exprAllowed = type.beforeExpr; }
-};
-
-// Token-specific context update code
-
-types.parenR.updateContext = types.braceR.updateContext = function() {
- if (this.context.length === 1) {
- this.exprAllowed = true;
- return
- }
- var out = this.context.pop();
- if (out === types$1.b_stat && this.curContext().token === "function") {
- out = this.context.pop();
- }
- this.exprAllowed = !out.isExpr;
-};
-
-types.braceL.updateContext = function(prevType) {
- this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr);
- this.exprAllowed = true;
-};
-
-types.dollarBraceL.updateContext = function() {
- this.context.push(types$1.b_tmpl);
- this.exprAllowed = true;
-};
-
-types.parenL.updateContext = function(prevType) {
- var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
- this.context.push(statementParens ? types$1.p_stat : types$1.p_expr);
- this.exprAllowed = true;
-};
-
-types.incDec.updateContext = function() {
- // tokExprAllowed stays unchanged
-};
-
-types._function.updateContext = types._class.updateContext = function(prevType) {
- if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else &&
- !(prevType === types._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
- !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))
- { this.context.push(types$1.f_expr); }
- else
- { this.context.push(types$1.f_stat); }
- this.exprAllowed = false;
-};
-
-types.backQuote.updateContext = function() {
- if (this.curContext() === types$1.q_tmpl)
- { this.context.pop(); }
- else
- { this.context.push(types$1.q_tmpl); }
- this.exprAllowed = false;
-};
-
-types.star.updateContext = function(prevType) {
- if (prevType === types._function) {
- var index = this.context.length - 1;
- if (this.context[index] === types$1.f_expr)
- { this.context[index] = types$1.f_expr_gen; }
- else
- { this.context[index] = types$1.f_gen; }
- }
- this.exprAllowed = true;
-};
-
-types.name.updateContext = function(prevType) {
- var allowed = false;
- if (this.options.ecmaVersion >= 6 && prevType !== types.dot) {
- if (this.value === "of" && !this.exprAllowed ||
- this.value === "yield" && this.inGeneratorContext())
- { allowed = true; }
- }
- this.exprAllowed = allowed;
+pp$7.copyNode = function(node) {
+ var newNode = new Node(this, node.start, this.startLoc);
+ for (var prop in node) { newNode[prop] = node[prop]; }
+ return newNode
};
// This file contains Unicode properties extracted from the ECMAScript
@@ -3218,10 +3573,12 @@ types.name.updateContext = function(prevType) {
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 unicodeBinaryProperties = {
9: ecma9BinaryProperties,
10: ecma10BinaryProperties,
- 11: ecma11BinaryProperties
+ 11: ecma11BinaryProperties,
+ 12: ecma12BinaryProperties
};
// #table-unicode-general-category-values
@@ -3231,10 +3588,12 @@ var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connect
var ecma9ScriptValues = "Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
+var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
var unicodeScriptValues = {
9: ecma9ScriptValues,
10: ecma10ScriptValues,
- 11: ecma11ScriptValues
+ 11: ecma11ScriptValues,
+ 12: ecma12ScriptValues
};
var data = {};
@@ -3255,13 +3614,14 @@ function buildUnicodeData(ecmaVersion) {
buildUnicodeData(9);
buildUnicodeData(10);
buildUnicodeData(11);
+buildUnicodeData(12);
var pp$8 = Parser.prototype;
var RegExpValidationState = function RegExpValidationState(parser) {
this.parser = parser;
- this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "");
- this.unicodeProperties = data[parser.options.ecmaVersion >= 11 ? 11 : parser.options.ecmaVersion];
+ this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "");
+ this.unicodeProperties = data[parser.options.ecmaVersion >= 12 ? 12 : parser.options.ecmaVersion];
this.source = "";
this.flags = "";
this.start = 0;
@@ -4375,10 +4735,6 @@ if (typeof Symbol !== "undefined")
// 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.
@@ -4405,9 +4761,9 @@ pp$9.readToken = function(code) {
pp$9.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() {
@@ -4626,6 +4982,20 @@ pp$9.readToken_question = function() { // '?'
return this.finishOp(types.question, 1)
};
+pp$9.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.privateId, this.readWord1())
+ }
+ }
+
+ this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
+};
+
pp$9.getTokenFromCode = function(code) {
switch (code) {
// The interpretation of a dot depends on whether it is followed
@@ -4697,6 +5067,9 @@ pp$9.getTokenFromCode = function(code) {
case 126: // '~'
return this.finishOp(types.prefix, 1)
+
+ case 35: // '#'
+ return this.readToken_numberSign()
}
this.raise(this.pos, "Unexpected character '" + codePointToString$1(code) + "'");
@@ -4881,8 +5254,15 @@ pp$9.readString = function(quote) {
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;
}
}
@@ -5006,6 +5386,12 @@ pp$9.readEscapedChar = function(inTemplate) {
return ""
case 56:
case 57:
+ if (this.strict) {
+ this.invalidStringToken(
+ this.pos - 1,
+ "Invalid escape sequence"
+ );
+ }
if (inTemplate) {
var codePos = this.pos - 1;
@@ -5102,7 +5488,7 @@ pp$9.readWord = function() {
// Acorn is a tiny, fast JavaScript parser written in JavaScript.
-var version = "7.4.1";
+var version = "8.5.0";
Parser.acorn = {
Parser: Parser,
diff --git a/tools/node_modules/eslint/node_modules/acorn/dist/bin.js b/tools/node_modules/eslint/node_modules/acorn/dist/bin.js
index faa461e6587..d35d6ee9909 100644
--- a/tools/node_modules/eslint/node_modules/acorn/dist/bin.js
+++ b/tools/node_modules/eslint/node_modules/acorn/dist/bin.js
@@ -4,22 +4,26 @@ var path = require('path');
var fs = require('fs');
var acorn = require('./acorn.js');
-var infile, forceFile, silent = false, compact = false, tokenize = false;
+var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
var options = {};
function help(status) {
var print = (status === 0) ? console.log : console.error;
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
- print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]");
+ print(" [--tokenize] [--locations] [---allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
process.exit(status);
}
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i];
- if ((arg === "-" || arg[0] !== "-") && !infile) { infile = arg; }
- else if (arg === "--" && !infile && i + 2 === process.argv.length) { forceFile = infile = process.argv[++i]; }
- else if (arg === "--locations") { options.locations = true; }
+ if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
+ else if (arg === "--") {
+ inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
+ forceFileName = true;
+ break
+ } else if (arg === "--locations") { options.locations = true; }
else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
+ else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
else if (arg === "--silent") { silent = true; }
else if (arg === "--compact") { compact = true; }
else if (arg === "--help") { help(0); }
@@ -34,31 +38,34 @@ for (var i = 2; i < process.argv.length; ++i) {
}
}
-function run(code) {
- var result;
+function run(codeList) {
+ var result = [], fileIdx = 0;
try {
- if (!tokenize) {
- result = acorn.parse(code, options);
- } else {
- result = [];
- var tokenizer = acorn.tokenizer(code, options), token;
- do {
- token = tokenizer.getToken();
- result.push(token);
- } while (token.type !== acorn.tokTypes.eof)
- }
+ codeList.forEach(function (code, idx) {
+ fileIdx = idx;
+ if (!tokenize) {
+ result = acorn.parse(code, options);
+ options.program = result;
+ } else {
+ var tokenizer = acorn.tokenizer(code, options), token;
+ do {
+ token = tokenizer.getToken();
+ result.push(token);
+ } while (token.type !== acorn.tokTypes.eof)
+ }
+ });
} catch (e) {
- console.error(infile && infile !== "-" ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + infile + " " + m.slice(1); }) : e.message);
+ console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
process.exit(1);
}
if (!silent) { console.log(JSON.stringify(result, null, compact ? null : 2)); }
}
-if (forceFile || infile && infile !== "-") {
- run(fs.readFileSync(infile, "utf8"));
+if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
+ run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
} else {
var code = "";
process.stdin.resume();
process.stdin.on("data", function (chunk) { return code += chunk; });
- process.stdin.on("end", function () { return run(code); });
+ process.stdin.on("end", function () { return run([code]); });
}
diff --git a/tools/node_modules/eslint/node_modules/acorn/package.json b/tools/node_modules/eslint/node_modules/acorn/package.json
index 10699306d36..138b7873d37 100644
--- a/tools/node_modules/eslint/node_modules/acorn/package.json
+++ b/tools/node_modules/eslint/node_modules/acorn/package.json
@@ -5,7 +5,18 @@
"main": "dist/acorn.js",
"types": "dist/acorn.d.ts",
"module": "dist/acorn.mjs",
- "version": "7.4.1",
+ "exports": {
+ ".": [
+ {
+ "import": "./dist/acorn.mjs",
+ "require": "./dist/acorn.js",
+ "default": "./dist/acorn.js"
+ },
+ "./dist/acorn.js"
+ ],
+ "./package.json": "./package.json"
+ },
+ "version": "8.5.0",
"engines": {"node": ">=0.4.0"},
"maintainers": [
{
diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/index.js b/tools/node_modules/eslint/node_modules/ansi-regex/index.js
index 35054aa6774..616ff837d3f 100644
--- a/tools/node_modules/eslint/node_modules/ansi-regex/index.js
+++ b/tools/node_modules/eslint/node_modules/ansi-regex/index.js
@@ -2,7 +2,7 @@
module.exports = ({onlyFirst = false} = {}) => {
const pattern = [
- '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
+ '[\\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('|');
diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/ansi-regex/package.json
index 7af801f3522..017f53116a9 100644
--- a/tools/node_modules/eslint/node_modules/ansi-regex/package.json
+++ b/tools/node_modules/eslint/node_modules/ansi-regex/package.json
@@ -1,6 +1,6 @@
{
"name": "ansi-regex",
- "version": "5.0.0",
+ "version": "5.0.1",
"description": "Regular expression for matching ANSI escape codes",
"license": "MIT",
"repository": "chalk/ansi-regex",
diff --git a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
index 3c2b77c4354..4d848bc36f6 100644
--- a/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
+++ b/tools/node_modules/eslint/node_modules/ansi-regex/readme.md
@@ -1,4 +1,4 @@
-# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
+# ansi-regex
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
diff --git a/tools/node_modules/eslint/node_modules/argparse/LICENSE b/tools/node_modules/eslint/node_modules/argparse/LICENSE
index 1afdae55840..66a3ac80d72 100644
--- a/tools/node_modules/eslint/node_modules/argparse/LICENSE
+++ b/tools/node_modules/eslint/node_modules/argparse/LICENSE
@@ -1,21 +1,254 @@
-(The MIT License)
-
-Copyright (C) 2012 by Vitaly Puzrin
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
+A. HISTORY OF THE SOFTWARE
+==========================
+
+Python was created in the early 1990s by Guido van Rossum at Stichting
+Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
+as a successor of a language called ABC. Guido remains Python's
+principal author, although it includes many contributions from others.
+
+In 1995, Guido continued his work on Python at the Corporation for
+National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
+in Reston, Virginia where he released several versions of the
+software.
+
+In May 2000, Guido and the Python core development team moved to
+BeOpen.com to form the BeOpen PythonLabs team. In October of the same
+year, the PythonLabs team moved to Digital Creations, which became
+Zope Corporation. In 2001, the Python Software Foundation (PSF, see
+https://www.python.org/psf/) was formed, a non-profit organization
+created specifically to own Python-related Intellectual Property.
+Zope Corporation was a sponsoring member of the PSF.
+
+All Python releases are Open Source (see http://www.opensource.org for
+the Open Source Definition). Historically, most, but not all, Python
+releases have also been GPL-compatible; the table below summarizes
+the various releases.
+
+ Release Derived Year Owner GPL-
+ from compatible? (1)
+
+ 0.9.0 thru 1.2 1991-1995 CWI yes
+ 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
+ 1.6 1.5.2 2000 CNRI no
+ 2.0 1.6 2000 BeOpen.com no
+ 1.6.1 1.6 2001 CNRI yes (2)
+ 2.1 2.0+1.6.1 2001 PSF no
+ 2.0.1 2.0+1.6.1 2001 PSF yes
+ 2.1.1 2.1+2.0.1 2001 PSF yes
+ 2.1.2 2.1.1 2002 PSF yes
+ 2.1.3 2.1.2 2002 PSF yes
+ 2.2 and above 2.1.1 2001-now PSF yes
+
+Footnotes:
+
+(1) GPL-compatible doesn't mean that we're distributing Python under
+ the GPL. All Python licenses, unlike the GPL, let you distribute
+ a modified version without making your changes open source. The
+ GPL-compatible licenses make it possible to combine Python with
+ other software that is released under the GPL; the others don't.
+
+(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
+ because its license has a choice of law clause. According to
+ CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
+ is "not incompatible" with the GPL.
+
+Thanks to the many outside volunteers who have worked under Guido's
+direction to make these releases possible.
+
+
+B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
+===============================================================
+
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF hereby
+grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
+analyze, test, perform and/or display publicly, prepare derivative works,
+distribute, and otherwise use Python alone or in any derivative version,
+provided, however, that PSF's License Agreement and PSF's notice of copyright,
+i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
+All Rights Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee. This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+-------------------------------------------
+
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
+
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization ("Licensee") accessing and otherwise using
+this software in source or binary form and its associated
+documentation ("the Software").
+
+2. Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+3. BeOpen is making the Software available to Licensee on an "AS IS"
+basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+5. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+6. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions. Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee. This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party. As an exception, the "BeOpen Python" logos available at
+http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+7. By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+
+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
+---------------------------------------
+
+1. This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 ("CNRI"), and the Individual or Organization
+("Licensee") accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI's
+License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
+1995-2001 Corporation for National Research Initiatives; All Rights
+Reserved" are retained in Python 1.6.1 alone or in any derivative
+version prepared by Licensee. Alternately, in lieu of CNRI's License
+Agreement, Licensee may substitute the following text (omitting the
+quotes): "Python 1.6.1 is made available subject to the terms and
+conditions in CNRI's License Agreement. This Agreement together with
+Python 1.6.1 may be located on the Internet using the following
+unique, persistent identifier (known as a handle): 1895.22/1013. This
+Agreement may also be obtained from a proxy server on the Internet
+using the following URL: http://hdl.handle.net/1895.22/1013".
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
+basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia's conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee. This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+8. By clicking on the "ACCEPT" button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+
+ ACCEPT
+
+
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+--------------------------------------------------
+
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
+The Netherlands. All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/tools/node_modules/eslint/node_modules/argparse/README.md b/tools/node_modules/eslint/node_modules/argparse/README.md
index 7fa6c40503e..550b5c9b7b0 100644
--- a/tools/node_modules/eslint/node_modules/argparse/README.md
+++ b/tools/node_modules/eslint/node_modules/argparse/README.md
@@ -4,69 +4,54 @@ argparse
[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
-CLI arguments parser for node.js. Javascript port of python's
-[argparse](http://docs.python.org/dev/library/argparse.html) module
-(original version 3.2). That's a full port, except some very rare options,
-recorded in issue tracker.
+CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)).
-**NB. Difference with original.**
+**Difference with original.**
-- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
-- Use `defaultValue` instead of `default`.
-- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and
- similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE`
- (aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and
- `SUPPRESS`.
+- JS has no keyword arguments support.
+ - Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`.
+- JS has no python's types `int`, `float`, ...
+ - Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`.
+- `%r` format specifier uses `require('util').inspect()`.
+
+More details in [doc](./doc).
Example
-=======
+-------
-test.js file:
+`test.js` file:
```javascript
#!/usr/bin/env node
'use strict';
-var ArgumentParser = require('../lib/argparse').ArgumentParser;
-var parser = new ArgumentParser({
- version: '0.0.1',
- addHelp:true,
+const { ArgumentParser } = require('argparse');
+const { version } = require('./package.json');
+
+const parser = new ArgumentParser({
description: 'Argparse example'
});
-parser.addArgument(
- [ '-f', '--foo' ],
- {
- help: 'foo bar'
- }
-);
-parser.addArgument(
- [ '-b', '--bar' ],
- {
- help: 'bar foo'
- }
-);
-parser.addArgument(
- '--baz',
- {
- help: 'baz bar'
- }
-);
-var args = parser.parseArgs();
-console.dir(args);
+
+parser.add_argument('-v', '--version', { action: 'version', version });
+parser.add_argument('-f', '--foo', { help: 'foo bar' });
+parser.add_argument('-b', '--bar', { help: 'bar foo' });
+parser.add_argument('--baz', { help: 'baz bar' });
+
+console.dir(parser.parse_args());
```
Display help:
```
$ ./test.js -h
-usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
+usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
Argparse example
-Optional arguments:
- -h, --help Show this help message and exit.
- -v, --version Show program's version number and exit.
+optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
-f FOO, --foo FOO foo bar
-b BAR, --bar BAR bar foo
--baz BAZ baz bar
@@ -79,179 +64,21 @@ $ ./test.js -f=3 --bar=4 --baz 5
{ foo: '3', bar: '4', baz: '5' }
```
-More [examples](https://github.com/nodeca/argparse/tree/master/examples).
-
-
-ArgumentParser objects
-======================
-
-```
-new ArgumentParser({parameters hash});
-```
-
-Creates a new ArgumentParser object.
-
-**Supported params:**
-
-- ```description``` - Text to display before the argument help.
-- ```epilog``` - Text to display after the argument help.
-- ```addHelp``` - Add a -h/ā€“help option to the parser. (default: true)
-- ```argumentDefault``` - Set the global default value for arguments. (default: null)
-- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.
-- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ā€˜-ā€˜)
-- ```formatterClass``` - A class for customizing the help output.
-- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`)
-- ```usage``` - The string describing the program usage (default: generated)
-- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.
-
-**Not supported yet**
-
-- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.
-
-
-Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)
-
-
-addArgument() method
-====================
-
-```
-ArgumentParser.addArgument(name or flag or [name] or [flags...], {options})
-```
-
-Defines how a single command-line argument should be parsed.
-
-- ```name or flag or [name] or [flags...]``` - Either a positional name
- (e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array
- of a single positional name (e.g., `['foo']`), or an array of options
- (e.g., `['-f', '--foo']`).
-
-Options:
-
-- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.
-- ```nargs```- The number of command-line arguments that should be consumed.
-- ```constant``` - A constant value required by some action and nargs selections.
-- ```defaultValue``` - The value produced if the argument is absent from the command line.
-- ```type``` - The type to which the command-line argument should be converted.
-- ```choices``` - A container of the allowable values for the argument.
-- ```required``` - Whether or not the command-line option may be omitted (optionals only).
-- ```help``` - A brief description of what the argument does.
-- ```metavar``` - A name for the argument in usage messages.
-- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().
-
-Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)
-
-
-Action (some details)
-================
-
-ArgumentParser objects associate command-line arguments with actions.
-These actions can do just about anything with the command-line arguments associated
-with them, though most actions simply add an attribute to the object returned by
-parseArgs(). The action keyword argument specifies how the command-line arguments
-should be handled. The supported actions are:
-
-- ```store``` - Just stores the argumentā€™s value. This is the default action.
-- ```storeConst``` - Stores value, specified by the const keyword argument.
- (Note that the const keyword argument defaults to the rather unhelpful None.)
- The 'storeConst' action is most commonly used with optional arguments, that
- specify some sort of flag.
-- ```storeTrue``` and ```storeFalse``` - Stores values True and False
- respectively. These are special cases of 'storeConst'.
-- ```append``` - Stores a list, and appends each argument value to the list.
- This is useful to allow an option to be specified multiple times.
-- ```appendConst``` - Stores a list, and appends value, specified by the
- const keyword argument to the list. (Note, that the const keyword argument defaults
- is None.) The 'appendConst' action is typically used when multiple arguments need
- to store constants to the same list.
-- ```count``` - Counts the number of times a keyword argument occurs. For example,
- used for increasing verbosity levels.
-- ```help``` - Prints a complete help message for all the options in the current
- parser and then exits. By default a help action is automatically added to the parser.
- See ArgumentParser for details of how the output is created.
-- ```version``` - Prints version information and exit. Expects a `version=`
- keyword argument in the addArgument() call.
-
-Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action)
-
-
-Sub-commands
-============
-
-ArgumentParser.addSubparsers()
-
-Many programs split their functionality into a number of sub-commands, for
-example, the svn program can invoke sub-commands like `svn checkout`, `svn update`,
-and `svn commit`. Splitting up functionality this way can be a particularly good
-idea when a program performs several different functions which require different
-kinds of command-line arguments. `ArgumentParser` supports creation of such
-sub-commands with `addSubparsers()` method. The `addSubparsers()` method is
-normally called with no arguments and returns an special action object.
-This object has a single method `addParser()`, which takes a command name and
-any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object
-that can be modified as usual.
-
-Example:
-
-sub_commands.js
-```javascript
-#!/usr/bin/env node
-'use strict';
-
-var ArgumentParser = require('../lib/argparse').ArgumentParser;
-var parser = new ArgumentParser({
- version: '0.0.1',
- addHelp:true,
- description: 'Argparse examples: sub-commands',
-});
-
-var subparsers = parser.addSubparsers({
- title:'subcommands',
- dest:"subcommand_name"
-});
-
-var bar = subparsers.addParser('c1', {addHelp:true});
-bar.addArgument(
- [ '-f', '--foo' ],
- {
- action: 'store',
- help: 'foo3 bar3'
- }
-);
-var bar = subparsers.addParser(
- 'c2',
- {aliases:['co'], addHelp:true}
-);
-bar.addArgument(
- [ '-b', '--bar' ],
- {
- action: 'store',
- type: 'int',
- help: 'foo3 bar3'
- }
-);
-
-var args = parser.parseArgs();
-console.dir(args);
-
-```
-
-Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)
-
-Contributors
-============
+API docs
+--------
-- [Eugene Shkuropat](https://github.com/shkuropat)
-- [Paul Jacobson](https://github.com/hpaulj)
+Since this is a port with minimal divergence, there's no separate documentation.
+Use original one instead, with notes about difference.
-[others](https://github.com/nodeca/argparse/graphs/contributors)
+1. [Original doc](https://docs.python.org/3.9/library/argparse.html).
+2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html).
+3. [Difference with python](./doc).
-License
-=======
-Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
-Released under the MIT license. See
-[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
+argparse for enterprise
+-----------------------
+Available as part of the Tidelift Subscription
+The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/tools/node_modules/eslint/node_modules/argparse/argparse.js b/tools/node_modules/eslint/node_modules/argparse/argparse.js
new file mode 100644
index 00000000000..2b8c8c63177
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/argparse/argparse.js
@@ -0,0 +1,3707 @@
+// Port of python's argparse module, version 3.9.0:
+// https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py
+
+'use strict'
+
+// Copyright (C) 2010-2020 Python Software Foundation.
+// Copyright (C) 2020 argparse.js authors
+
+/*
+ * Command-line parsing library
+ *
+ * This module is an optparse-inspired command-line parsing library that:
+ *
+ * - handles both optional and positional arguments
+ * - produces highly informative usage messages
+ * - supports parsers that dispatch to sub-parsers
+ *
+ * The following is a simple usage example that sums integers from the
+ * command-line and writes the result to a file::
+ *
+ * parser = argparse.ArgumentParser(
+ * description='sum the integers at the command line')
+ * parser.add_argument(
+ * 'integers', metavar='int', nargs='+', type=int,
+ * help='an integer to be summed')
+ * parser.add_argument(
+ * '--log', default=sys.stdout, type=argparse.FileType('w'),
+ * help='the file where the sum should be written')
+ * args = parser.parse_args()
+ * args.log.write('%s' % sum(args.integers))
+ * args.log.close()
+ *
+ * The module contains the following public classes:
+ *
+ * - ArgumentParser -- The main entry point for command-line parsing. As the
+ * example above shows, the add_argument() method is used to populate
+ * the parser with actions for optional and positional arguments. Then
+ * the parse_args() method is invoked to convert the args at the
+ * command-line into an object with attributes.
+ *
+ * - ArgumentError -- The exception raised by ArgumentParser objects when
+ * there are errors with the parser's actions. Errors raised while
+ * parsing the command-line are caught by ArgumentParser and emitted
+ * as command-line messages.
+ *
+ * - FileType -- A factory for defining types of files to be created. As the
+ * example above shows, instances of FileType are typically passed as
+ * the type= argument of add_argument() calls.
+ *
+ * - Action -- The base class for parser actions. Typically actions are
+ * selected by passing strings like 'store_true' or 'append_const' to
+ * the action= argument of add_argument(). However, for greater
+ * customization of ArgumentParser actions, subclasses of Action may
+ * be defined and passed as the action= argument.
+ *
+ * - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
+ * ArgumentDefaultsHelpFormatter -- Formatter classes which
+ * may be passed as the formatter_class= argument to the
+ * ArgumentParser constructor. HelpFormatter is the default,
+ * RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
+ * not to change the formatting for help text, and
+ * ArgumentDefaultsHelpFormatter adds information about argument defaults
+ * to the help.
+ *
+ * All other classes in this module are considered implementation details.
+ * (Also note that HelpFormatter and RawDescriptionHelpFormatter are only
+ * considered public as object names -- the API of the formatter objects is
+ * still considered an implementation detail.)
+ */
+
+const SUPPRESS = '==SUPPRESS=='
+
+const OPTIONAL = '?'
+const ZERO_OR_MORE = '*'
+const ONE_OR_MORE = '+'
+const PARSER = 'A...'
+const REMAINDER = '...'
+const _UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
+
+
+// ==================================
+// Utility functions used for porting
+// ==================================
+const assert = require('assert')
+const util = require('util')
+const fs = require('fs')
+const sub = require('./lib/sub')
+const path = require('path')
+const repr = util.inspect
+
+function get_argv() {
+ // omit first argument (which is assumed to be interpreter - `node`, `coffee`, `ts-node`, etc.)
+ return process.argv.slice(1)
+}
+
+function get_terminal_size() {
+ return {
+ columns: +process.env.COLUMNS || process.stdout.columns || 80
+ }
+}
+
+function hasattr(object, name) {
+ return Object.prototype.hasOwnProperty.call(object, name)
+}
+
+function getattr(object, name, value) {
+ return hasattr(object, name) ? object[name] : value
+}
+
+function setattr(object, name, value) {
+ object[name] = value
+}
+
+function setdefault(object, name, value) {
+ if (!hasattr(object, name)) object[name] = value
+ return object[name]
+}
+
+function delattr(object, name) {
+ delete object[name]
+}
+
+function range(from, to, step=1) {
+ // range(10) is equivalent to range(0, 10)
+ if (arguments.length === 1) [ to, from ] = [ from, 0 ]
+ if (typeof from !== 'number' || typeof to !== 'number' || typeof step !== 'number') {
+ throw new TypeError('argument cannot be interpreted as an integer')
+ }
+ if (step === 0) throw new TypeError('range() arg 3 must not be zero')
+
+ let result = []
+ if (step > 0) {
+ for (let i = from; i < to; i += step) result.push(i)
+ } else {
+ for (let i = from; i > to; i += step) result.push(i)
+ }
+ return result
+}
+
+function splitlines(str, keepends = false) {
+ let result
+ if (!keepends) {
+ result = str.split(/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/)
+ } else {
+ result = []
+ let parts = str.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/)
+ for (let i = 0; i < parts.length; i += 2) {
+ result.push(parts[i] + (i + 1 < parts.length ? parts[i + 1] : ''))
+ }
+ }
+ if (!result[result.length - 1]) result.pop()
+ return result
+}
+
+function _string_lstrip(string, prefix_chars) {
+ let idx = 0
+ while (idx < string.length && prefix_chars.includes(string[idx])) idx++
+ return idx ? string.slice(idx) : string
+}
+
+function _string_split(string, sep, maxsplit) {
+ let result = string.split(sep)
+ if (result.length > maxsplit) {
+ result = result.slice(0, maxsplit).concat([ result.slice(maxsplit).join(sep) ])
+ }
+ return result
+}
+
+function _array_equal(array1, array2) {
+ if (array1.length !== array2.length) return false
+ for (let i = 0; i < array1.length; i++) {
+ if (array1[i] !== array2[i]) return false
+ }
+ return true
+}
+
+function _array_remove(array, item) {
+ let idx = array.indexOf(item)
+ if (idx === -1) throw new TypeError(sub('%r not in list', item))
+ array.splice(idx, 1)
+}
+
+// normalize choices to array;
+// this isn't required in python because `in` and `map` operators work with anything,
+// but in js dealing with multiple types here is too clunky
+function _choices_to_array(choices) {
+ if (choices === undefined) {
+ return []
+ } else if (Array.isArray(choices)) {
+ return choices
+ } else if (choices !== null && typeof choices[Symbol.iterator] === 'function') {
+ return Array.from(choices)
+ } else if (typeof choices === 'object' && choices !== null) {
+ return Object.keys(choices)
+ } else {
+ throw new Error(sub('invalid choices value: %r', choices))
+ }
+}
+
+// decorator that allows a class to be called without new
+function _callable(cls) {
+ let result = { // object is needed for inferred class name
+ [cls.name]: function (...args) {
+ let this_class = new.target === result || !new.target
+ return Reflect.construct(cls, args, this_class ? cls : new.target)
+ }
+ }
+ result[cls.name].prototype = cls.prototype
+ // fix default tag for toString, e.g. [object Action] instead of [object Object]
+ cls.prototype[Symbol.toStringTag] = cls.name
+ return result[cls.name]
+}
+
+function _alias(object, from, to) {
+ try {
+ let name = object.constructor.name
+ Object.defineProperty(object, from, {
+ value: util.deprecate(object[to], sub('%s.%s() is renamed to %s.%s()',
+ name, from, name, to)),
+ enumerable: false
+ })
+ } catch {}
+}
+
+// decorator that allows snake_case class methods to be called with camelCase and vice versa
+function _camelcase_alias(_class) {
+ for (let name of Object.getOwnPropertyNames(_class.prototype)) {
+ let camelcase = name.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase())
+ if (camelcase !== name) _alias(_class.prototype, camelcase, name)
+ }
+ return _class
+}
+
+function _to_legacy_name(key) {
+ key = key.replace(/\w_[a-z]/g, s => s[0] + s[2].toUpperCase())
+ if (key === 'default') key = 'defaultValue'
+ if (key === 'const') key = 'constant'
+ return key
+}
+
+function _to_new_name(key) {
+ if (key === 'defaultValue') key = 'default'
+ if (key === 'constant') key = 'const'
+ key = key.replace(/[A-Z]/g, c => '_' + c.toLowerCase())
+ return key
+}
+
+// parse options
+let no_default = Symbol('no_default_value')
+function _parse_opts(args, descriptor) {
+ function get_name() {
+ let stack = new Error().stack.split('\n')
+ .map(x => x.match(/^ at (.*) \(.*\)$/))
+ .filter(Boolean)
+ .map(m => m[1])
+ .map(fn => fn.match(/[^ .]*$/)[0])
+
+ if (stack.length && stack[0] === get_name.name) stack.shift()
+ if (stack.length && stack[0] === _parse_opts.name) stack.shift()
+ return stack.length ? stack[0] : ''
+ }
+
+ args = Array.from(args)
+ let kwargs = {}
+ let result = []
+ let last_opt = args.length && args[args.length - 1]
+
+ if (typeof last_opt === 'object' && last_opt !== null && !Array.isArray(last_opt) &&
+ (!last_opt.constructor || last_opt.constructor.name === 'Object')) {
+ kwargs = Object.assign({}, args.pop())
+ }
+
+ // LEGACY (v1 compatibility): camelcase
+ let renames = []
+ for (let key of Object.keys(descriptor)) {
+ let old_name = _to_legacy_name(key)
+ if (old_name !== key && (old_name in kwargs)) {
+ if (key in kwargs) {
+ // default and defaultValue specified at the same time, happens often in old tests
+ //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key))
+ } else {
+ kwargs[key] = kwargs[old_name]
+ }
+ renames.push([ old_name, key ])
+ delete kwargs[old_name]
+ }
+ }
+ if (renames.length) {
+ let name = get_name()
+ deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s',
+ name, renames.map(([ a, b ]) => sub('%r -> %r', a, b))))
+ }
+ // end
+
+ let missing_positionals = []
+ let positional_count = args.length
+
+ for (let [ key, def ] of Object.entries(descriptor)) {
+ if (key[0] === '*') {
+ if (key.length > 0 && key[1] === '*') {
+ // LEGACY (v1 compatibility): camelcase
+ let renames = []
+ for (let key of Object.keys(kwargs)) {
+ let new_name = _to_new_name(key)
+ if (new_name !== key && (key in kwargs)) {
+ if (new_name in kwargs) {
+ // default and defaultValue specified at the same time, happens often in old tests
+ //throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), new_name))
+ } else {
+ kwargs[new_name] = kwargs[key]
+ }
+ renames.push([ key, new_name ])
+ delete kwargs[key]
+ }
+ }
+ if (renames.length) {
+ let name = get_name()
+ deprecate('camelcase_' + name, sub('%s(): following options are renamed: %s',
+ name, renames.map(([ a, b ]) => sub('%r -> %r', a, b))))
+ }
+ // end
+ result.push(kwargs)
+ kwargs = {}
+ } else {
+ result.push(args)
+ args = []
+ }
+ } else if (key in kwargs && args.length > 0) {
+ throw new TypeError(sub('%s() got multiple values for argument %r', get_name(), key))
+ } else if (key in kwargs) {
+ result.push(kwargs[key])
+ delete kwargs[key]
+ } else if (args.length > 0) {
+ result.push(args.shift())
+ } else if (def !== no_default) {
+ result.push(def)
+ } else {
+ missing_positionals.push(key)
+ }
+ }
+
+ if (Object.keys(kwargs).length) {
+ throw new TypeError(sub('%s() got an unexpected keyword argument %r',
+ get_name(), Object.keys(kwargs)[0]))
+ }
+
+ if (args.length) {
+ let from = Object.entries(descriptor).filter(([ k, v ]) => k[0] !== '*' && v !== no_default).length
+ let to = Object.entries(descriptor).filter(([ k ]) => k[0] !== '*').length
+ throw new TypeError(sub('%s() takes %s positional argument%s but %s %s given',
+ get_name(),
+ from === to ? sub('from %s to %s', from, to) : to,
+ from === to && to === 1 ? '' : 's',
+ positional_count,
+ positional_count === 1 ? 'was' : 'were'))
+ }
+
+ if (missing_positionals.length) {
+ let strs = missing_positionals.map(repr)
+ if (strs.length > 1) strs[strs.length - 1] = 'and ' + strs[strs.length - 1]
+ let str_joined = strs.join(strs.length === 2 ? '' : ', ')
+ throw new TypeError(sub('%s() missing %i required positional argument%s: %s',
+ get_name(), strs.length, strs.length === 1 ? '' : 's', str_joined))
+ }
+
+ return result
+}
+
+let _deprecations = {}
+function deprecate(id, string) {
+ _deprecations[id] = _deprecations[id] || util.deprecate(() => {}, string)
+ _deprecations[id]()
+}
+
+
+// =============================
+// Utility functions and classes
+// =============================
+function _AttributeHolder(cls = Object) {
+ /*
+ * Abstract base class that provides __repr__.
+ *
+ * The __repr__ method returns a string in the format::
+ * ClassName(attr=name, attr=name, ...)
+ * The attributes are determined either by a class-level attribute,
+ * '_kwarg_names', or by inspecting the instance __dict__.
+ */
+
+ return class _AttributeHolder extends cls {
+ [util.inspect.custom]() {
+ let type_name = this.constructor.name
+ let arg_strings = []
+ let star_args = {}
+ for (let arg of this._get_args()) {
+ arg_strings.push(repr(arg))
+ }
+ for (let [ name, value ] of this._get_kwargs()) {
+ if (/^[a-z_][a-z0-9_$]*$/i.test(name)) {
+ arg_strings.push(sub('%s=%r', name, value))
+ } else {
+ star_args[name] = value
+ }
+ }
+ if (Object.keys(star_args).length) {
+ arg_strings.push(sub('**%s', repr(star_args)))
+ }
+ return sub('%s(%s)', type_name, arg_strings.join(', '))
+ }
+
+ toString() {
+ return this[util.inspect.custom]()
+ }
+
+ _get_kwargs() {
+ return Object.entries(this)
+ }
+
+ _get_args() {
+ return []
+ }
+ }
+}
+
+
+function _copy_items(items) {
+ if (items === undefined) {
+ return []
+ }
+ return items.slice(0)
+}
+
+
+// ===============
+// Formatting Help
+// ===============
+const HelpFormatter = _camelcase_alias(_callable(class HelpFormatter {
+ /*
+ * Formatter for generating usage messages and argument help strings.
+ *
+ * Only the name of this class is considered a public API. All the methods
+ * provided by the class are considered an implementation detail.
+ */
+
+ constructor() {
+ let [
+ prog,
+ indent_increment,
+ max_help_position,
+ width
+ ] = _parse_opts(arguments, {
+ prog: no_default,
+ indent_increment: 2,
+ max_help_position: 24,
+ width: undefined
+ })
+
+ // default setting for width
+ if (width === undefined) {
+ width = get_terminal_size().columns
+ width -= 2
+ }
+
+ this._prog = prog
+ this._indent_increment = indent_increment
+ this._max_help_position = Math.min(max_help_position,
+ Math.max(width - 20, indent_increment * 2))
+ this._width = width
+
+ this._current_indent = 0
+ this._level = 0
+ this._action_max_length = 0
+
+ this._root_section = this._Section(this, undefined)
+ this._current_section = this._root_section
+
+ this._whitespace_matcher = /[ \t\n\r\f\v]+/g // equivalent to python /\s+/ with ASCII flag
+ this._long_break_matcher = /\n\n\n+/g
+ }
+
+ // ===============================
+ // Section and indentation methods
+ // ===============================
+ _indent() {
+ this._current_indent += this._indent_increment
+ this._level += 1
+ }
+
+ _dedent() {
+ this._current_indent -= this._indent_increment
+ assert(this._current_indent >= 0, 'Indent decreased below 0.')
+ this._level -= 1
+ }
+
+ _add_item(func, args) {
+ this._current_section.items.push([ func, args ])
+ }
+
+ // ========================
+ // Message building methods
+ // ========================
+ start_section(heading) {
+ this._indent()
+ let section = this._Section(this, this._current_section, heading)
+ this._add_item(section.format_help.bind(section), [])
+ this._current_section = section
+ }
+
+ end_section() {
+ this._current_section = this._current_section.parent
+ this._dedent()
+ }
+
+ add_text(text) {
+ if (text !== SUPPRESS && text !== undefined) {
+ this._add_item(this._format_text.bind(this), [text])
+ }
+ }
+
+ add_usage(usage, actions, groups, prefix = undefined) {
+ if (usage !== SUPPRESS) {
+ let args = [ usage, actions, groups, prefix ]
+ this._add_item(this._format_usage.bind(this), args)
+ }
+ }
+
+ add_argument(action) {
+ if (action.help !== SUPPRESS) {
+
+ // find all invocations
+ let invocations = [this._format_action_invocation(action)]
+ for (let subaction of this._iter_indented_subactions(action)) {
+ invocations.push(this._format_action_invocation(subaction))
+ }
+
+ // update the maximum item length
+ let invocation_length = Math.max(...invocations.map(invocation => invocation.length))
+ let action_length = invocation_length + this._current_indent
+ this._action_max_length = Math.max(this._action_max_length,
+ action_length)
+
+ // add the item to the list
+ this._add_item(this._format_action.bind(this), [action])
+ }
+ }
+
+ add_arguments(actions) {
+ for (let action of actions) {
+ this.add_argument(action)
+ }
+ }
+
+ // =======================
+ // Help-formatting methods
+ // =======================
+ format_help() {
+ let help = this._root_section.format_help()
+ if (help) {
+ help = help.replace(this._long_break_matcher, '\n\n')
+ help = help.replace(/^\n+|\n+$/g, '') + '\n'
+ }
+ return help
+ }
+
+ _join_parts(part_strings) {
+ return part_strings.filter(part => part && part !== SUPPRESS).join('')
+ }
+
+ _format_usage(usage, actions, groups, prefix) {
+ if (prefix === undefined) {
+ prefix = 'usage: '
+ }
+
+ // if usage is specified, use that
+ if (usage !== undefined) {
+ usage = sub(usage, { prog: this._prog })
+
+ // if no optionals or positionals are available, usage is just prog
+ } else if (usage === undefined && !actions.length) {
+ usage = sub('%(prog)s', { prog: this._prog })
+
+ // if optionals and positionals are available, calculate usage
+ } else if (usage === undefined) {
+ let prog = sub('%(prog)s', { prog: this._prog })
+
+ // split optionals from positionals
+ let optionals = []
+ let positionals = []
+ for (let action of actions) {
+ if (action.option_strings.length) {
+ optionals.push(action)
+ } else {
+ positionals.push(action)
+ }
+ }
+
+ // build full usage string
+ let action_usage = this._format_actions_usage([].concat(optionals).concat(positionals), groups)
+ usage = [ prog, action_usage ].map(String).join(' ')
+
+ // wrap the usage parts if it's too long
+ let text_width = this._width - this._current_indent
+ if (prefix.length + usage.length > text_width) {
+
+ // break usage into wrappable parts
+ let part_regexp = /\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g
+ let opt_usage = this._format_actions_usage(optionals, groups)
+ let pos_usage = this._format_actions_usage(positionals, groups)
+ let opt_parts = opt_usage.match(part_regexp) || []
+ let pos_parts = pos_usage.match(part_regexp) || []
+ assert(opt_parts.join(' ') === opt_usage)
+ assert(pos_parts.join(' ') === pos_usage)
+
+ // helper for wrapping lines
+ let get_lines = (parts, indent, prefix = undefined) => {
+ let lines = []
+ let line = []
+ let line_len
+ if (prefix !== undefined) {
+ line_len = prefix.length - 1
+ } else {
+ line_len = indent.length - 1
+ }
+ for (let part of parts) {
+ if (line_len + 1 + part.length > text_width && line) {
+ lines.push(indent + line.join(' '))
+ line = []
+ line_len = indent.length - 1
+ }
+ line.push(part)
+ line_len += part.length + 1
+ }
+ if (line.length) {
+ lines.push(indent + line.join(' '))
+ }
+ if (prefix !== undefined) {
+ lines[0] = lines[0].slice(indent.length)
+ }
+ return lines
+ }
+
+ let lines
+
+ // if prog is short, follow it with optionals or positionals
+ if (prefix.length + prog.length <= 0.75 * text_width) {
+ let indent = ' '.repeat(prefix.length + prog.length + 1)
+ if (opt_parts.length) {
+ lines = get_lines([prog].concat(opt_parts), indent, prefix)
+ lines = lines.concat(get_lines(pos_parts, indent))
+ } else if (pos_parts.length) {
+ lines = get_lines([prog].concat(pos_parts), indent, prefix)
+ } else {
+ lines = [prog]
+ }
+
+ // if prog is long, put it on its own line
+ } else {
+ let indent = ' '.repeat(prefix.length)
+ let parts = [].concat(opt_parts).concat(pos_parts)
+ lines = get_lines(parts, indent)
+ if (lines.length > 1) {
+ lines = []
+ lines = lines.concat(get_lines(opt_parts, indent))
+ lines = lines.concat(get_lines(pos_parts, indent))
+ }
+ lines = [prog].concat(lines)
+ }
+
+ // join lines into usage
+ usage = lines.join('\n')
+ }
+ }
+
+ // prefix with 'usage:'
+ return sub('%s%s\n\n', prefix, usage)
+ }
+
+ _format_actions_usage(actions, groups) {
+ // find group indices and identify actions in groups
+ let group_actions = new Set()
+ let inserts = {}
+ for (let group of groups) {
+ let start = actions.indexOf(group._group_actions[0])
+ if (start === -1) {
+ continue
+ } else {
+ let end = start + group._group_actions.length
+ if (_array_equal(actions.slice(start, end), group._group_actions)) {
+ for (let action of group._group_actions) {
+ group_actions.add(action)
+ }
+ if (!group.required) {
+ if (start in inserts) {
+ inserts[start] += ' ['
+ } else {
+ inserts[start] = '['
+ }
+ if (end in inserts) {
+ inserts[end] += ']'
+ } else {
+ inserts[end] = ']'
+ }
+ } else {
+ if (start in inserts) {
+ inserts[start] += ' ('
+ } else {
+ inserts[start] = '('
+ }
+ if (end in inserts) {
+ inserts[end] += ')'
+ } else {
+ inserts[end] = ')'
+ }
+ }
+ for (let i of range(start + 1, end)) {
+ inserts[i] = '|'
+ }
+ }
+ }
+ }
+
+ // collect all actions format strings
+ let parts = []
+ for (let [ i, action ] of Object.entries(actions)) {
+
+ // suppressed arguments are marked with None
+ // remove | separators for suppressed arguments
+ if (action.help === SUPPRESS) {
+ parts.push(undefined)
+ if (inserts[+i] === '|') {
+ delete inserts[+i]
+ } else if (inserts[+i + 1] === '|') {
+ delete inserts[+i + 1]
+ }
+
+ // produce all arg strings
+ } else if (!action.option_strings.length) {
+ let default_value = this._get_default_metavar_for_positional(action)
+ let part = this._format_args(action, default_value)
+
+ // if it's in a group, strip the outer []
+ if (group_actions.has(action)) {
+ if (part[0] === '[' && part[part.length - 1] === ']') {
+ part = part.slice(1, -1)
+ }
+ }
+
+ // add the action string to the list
+ parts.push(part)
+
+ // produce the first way to invoke the option in brackets
+ } else {
+ let option_string = action.option_strings[0]
+ let part
+
+ // if the Optional doesn't take a value, format is:
+ // -s or --long
+ if (action.nargs === 0) {
+ part = action.format_usage()
+
+ // if the Optional takes a value, format is:
+ // -s ARGS or --long ARGS
+ } else {
+ let default_value = this._get_default_metavar_for_optional(action)
+ let args_string = this._format_args(action, default_value)
+ part = sub('%s %s', option_string, args_string)
+ }
+
+ // make it look optional if it's not required or in a group
+ if (!action.required && !group_actions.has(action)) {
+ part = sub('[%s]', part)
+ }
+
+ // add the action string to the list
+ parts.push(part)
+ }
+ }
+
+ // insert things at the necessary indices
+ for (let i of Object.keys(inserts).map(Number).sort((a, b) => b - a)) {
+ parts.splice(+i, 0, inserts[+i])
+ }
+
+ // join all the action items with spaces
+ let text = parts.filter(Boolean).join(' ')
+
+ // clean up separators for mutually exclusive groups
+ text = text.replace(/([\[(]) /g, '$1')
+ text = text.replace(/ ([\])])/g, '$1')
+ text = text.replace(/[\[(] *[\])]/g, '')
+ text = text.replace(/\(([^|]*)\)/g, '$1', text)
+ text = text.trim()
+
+ // return the text
+ return text
+ }
+
+ _format_text(text) {
+ if (text.includes('%(prog)')) {
+ text = sub(text, { prog: this._prog })
+ }
+ let text_width = Math.max(this._width - this._current_indent, 11)
+ let indent = ' '.repeat(this._current_indent)
+ return this._fill_text(text, text_width, indent) + '\n\n'
+ }
+
+ _format_action(action) {
+ // determine the required width and the entry label
+ let help_position = Math.min(this._action_max_length + 2,
+ this._max_help_position)
+ let help_width = Math.max(this._width - help_position, 11)
+ let action_width = help_position - this._current_indent - 2
+ let action_header = this._format_action_invocation(action)
+ let indent_first
+
+ // no help; start on same line and add a final newline
+ if (!action.help) {
+ let tup = [ this._current_indent, '', action_header ]
+ action_header = sub('%*s%s\n', ...tup)
+
+ // short action name; start on the same line and pad two spaces
+ } else if (action_header.length <= action_width) {
+ let tup = [ this._current_indent, '', action_width, action_header ]
+ action_header = sub('%*s%-*s ', ...tup)
+ indent_first = 0
+
+ // long action name; start on the next line
+ } else {
+ let tup = [ this._current_indent, '', action_header ]
+ action_header = sub('%*s%s\n', ...tup)
+ indent_first = help_position
+ }
+
+ // collect the pieces of the action help
+ let parts = [action_header]
+
+ // if there was help for the action, add lines of help text
+ if (action.help) {
+ let help_text = this._expand_help(action)
+ let help_lines = this._split_lines(help_text, help_width)
+ parts.push(sub('%*s%s\n', indent_first, '', help_lines[0]))
+ for (let line of help_lines.slice(1)) {
+ parts.push(sub('%*s%s\n', help_position, '', line))
+ }
+
+ // or add a newline if the description doesn't end with one
+ } else if (!action_header.endsWith('\n')) {
+ parts.push('\n')
+ }
+
+ // if there are any sub-actions, add their help as well
+ for (let subaction of this._iter_indented_subactions(action)) {
+ parts.push(this._format_action(subaction))
+ }
+
+ // return a single string
+ return this._join_parts(parts)
+ }
+
+ _format_action_invocation(action) {
+ if (!action.option_strings.length) {
+ let default_value = this._get_default_metavar_for_positional(action)
+ let metavar = this._metavar_formatter(action, default_value)(1)[0]
+ return metavar
+
+ } else {
+ let parts = []
+
+ // if the Optional doesn't take a value, format is:
+ // -s, --long
+ if (action.nargs === 0) {
+ parts = parts.concat(action.option_strings)
+
+ // if the Optional takes a value, format is:
+ // -s ARGS, --long ARGS
+ } else {
+ let default_value = this._get_default_metavar_for_optional(action)
+ let args_string = this._format_args(action, default_value)
+ for (let option_string of action.option_strings) {
+ parts.push(sub('%s %s', option_string, args_string))
+ }
+ }
+
+ return parts.join(', ')
+ }
+ }
+
+ _metavar_formatter(action, default_metavar) {
+ let result
+ if (action.metavar !== undefined) {
+ result = action.metavar
+ } else if (action.choices !== undefined) {
+ let choice_strs = _choices_to_array(action.choices).map(String)
+ result = sub('{%s}', choice_strs.join(','))
+ } else {
+ result = default_metavar
+ }
+
+ function format(tuple_size) {
+ if (Array.isArray(result)) {
+ return result
+ } else {
+ return Array(tuple_size).fill(result)
+ }
+ }
+ return format
+ }
+
+ _format_args(action, default_metavar) {
+ let get_metavar = this._metavar_formatter(action, default_metavar)
+ let result
+ if (action.nargs === undefined) {
+ result = sub('%s', ...get_metavar(1))
+ } else if (action.nargs === OPTIONAL) {
+ result = sub('[%s]', ...get_metavar(1))
+ } else if (action.nargs === ZERO_OR_MORE) {
+ let metavar = get_metavar(1)
+ if (metavar.length === 2) {
+ result = sub('[%s [%s ...]]', ...metavar)
+ } else {
+ result = sub('[%s ...]', ...metavar)
+ }
+ } else if (action.nargs === ONE_OR_MORE) {
+ result = sub('%s [%s ...]', ...get_metavar(2))
+ } else if (action.nargs === REMAINDER) {
+ result = '...'
+ } else if (action.nargs === PARSER) {
+ result = sub('%s ...', ...get_metavar(1))
+ } else if (action.nargs === SUPPRESS) {
+ result = ''
+ } else {
+ let formats
+ try {
+ formats = range(action.nargs).map(() => '%s')
+ } catch (err) {
+ throw new TypeError('invalid nargs value')
+ }
+ result = sub(formats.join(' '), ...get_metavar(action.nargs))
+ }
+ return result
+ }
+
+ _expand_help(action) {
+ let params = Object.assign({ prog: this._prog }, action)
+ for (let name of Object.keys(params)) {
+ if (params[name] === SUPPRESS) {
+ delete params[name]
+ }
+ }
+ for (let name of Object.keys(params)) {
+ if (params[name] && params[name].name) {
+ params[name] = params[name].name
+ }
+ }
+ if (params.choices !== undefined) {
+ let choices_str = _choices_to_array(params.choices).map(String).join(', ')
+ params.choices = choices_str
+ }
+ // LEGACY (v1 compatibility): camelcase
+ for (let key of Object.keys(params)) {
+ let old_name = _to_legacy_name(key)
+ if (old_name !== key) {
+ params[old_name] = params[key]
+ }
+ }
+ // end
+ return sub(this._get_help_string(action), params)
+ }
+
+ * _iter_indented_subactions(action) {
+ if (typeof action._get_subactions === 'function') {
+ this._indent()
+ yield* action._get_subactions()
+ this._dedent()
+ }
+ }
+
+ _split_lines(text, width) {
+ text = text.replace(this._whitespace_matcher, ' ').trim()
+ // The textwrap module is used only for formatting help.
+ // Delay its import for speeding up the common usage of argparse.
+ let textwrap = require('./lib/textwrap')
+ return textwrap.wrap(text, { width })
+ }
+
+ _fill_text(text, width, indent) {
+ text = text.replace(this._whitespace_matcher, ' ').trim()
+ let textwrap = require('./lib/textwrap')
+ return textwrap.fill(text, { width,
+ initial_indent: indent,
+ subsequent_indent: indent })
+ }
+
+ _get_help_string(action) {
+ return action.help
+ }
+
+ _get_default_metavar_for_optional(action) {
+ return action.dest.toUpperCase()
+ }
+
+ _get_default_metavar_for_positional(action) {
+ return action.dest
+ }
+}))
+
+HelpFormatter.prototype._Section = _callable(class _Section {
+
+ constructor(formatter, parent, heading = undefined) {
+ this.formatter = formatter
+ this.parent = parent
+ this.heading = heading
+ this.items = []
+ }
+
+ format_help() {
+ // format the indented section
+ if (this.parent !== undefined) {
+ this.formatter._indent()
+ }
+ let item_help = this.formatter._join_parts(this.items.map(([ func, args ]) => func.apply(null, args)))
+ if (this.parent !== undefined) {
+ this.formatter._dedent()
+ }
+
+ // return nothing if the section was empty
+ if (!item_help) {
+ return ''
+ }
+
+ // add the heading if the section was non-empty
+ let heading
+ if (this.heading !== SUPPRESS && this.heading !== undefined) {
+ let current_indent = this.formatter._current_indent
+ heading = sub('%*s%s:\n', current_indent, '', this.heading)
+ } else {
+ heading = ''
+ }
+
+ // join the section-initial newline, the heading and the help
+ return this.formatter._join_parts(['\n', heading, item_help, '\n'])
+ }
+})
+
+
+const RawDescriptionHelpFormatter = _camelcase_alias(_callable(class RawDescriptionHelpFormatter extends HelpFormatter {
+ /*
+ * Help message formatter which retains any formatting in descriptions.
+ *
+ * Only the name of this class is considered a public API. All the methods
+ * provided by the class are considered an implementation detail.
+ */
+
+ _fill_text(text, width, indent) {
+ return splitlines(text, true).map(line => indent + line).join('')
+ }
+}))
+
+
+const RawTextHelpFormatter = _camelcase_alias(_callable(class RawTextHelpFormatter extends RawDescriptionHelpFormatter {
+ /*
+ * Help message formatter which retains formatting of all help text.
+ *
+ * Only the name of this class is considered a public API. All the methods
+ * provided by the class are considered an implementation detail.
+ */
+
+ _split_lines(text/*, width*/) {
+ return splitlines(text)
+ }
+}))
+
+
+const ArgumentDefaultsHelpFormatter = _camelcase_alias(_callable(class ArgumentDefaultsHelpFormatter extends HelpFormatter {
+ /*
+ * Help message formatter which adds default values to argument help.
+ *
+ * Only the name of this class is considered a public API. All the methods
+ * provided by the class are considered an implementation detail.
+ */
+
+ _get_help_string(action) {
+ let help = action.help
+ // LEGACY (v1 compatibility): additional check for defaultValue needed
+ if (!action.help.includes('%(default)') && !action.help.includes('%(defaultValue)')) {
+ if (action.default !== SUPPRESS) {
+ let defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
+ if (action.option_strings.length || defaulting_nargs.includes(action.nargs)) {
+ help += ' (default: %(default)s)'
+ }
+ }
+ }
+ return help
+ }
+}))
+
+
+const MetavarTypeHelpFormatter = _camelcase_alias(_callable(class MetavarTypeHelpFormatter extends HelpFormatter {
+ /*
+ * Help message formatter which uses the argument 'type' as the default
+ * metavar value (instead of the argument 'dest')
+ *
+ * Only the name of this class is considered a public API. All the methods
+ * provided by the class are considered an implementation detail.
+ */
+
+ _get_default_metavar_for_optional(action) {
+ return typeof action.type === 'function' ? action.type.name : action.type
+ }
+
+ _get_default_metavar_for_positional(action) {
+ return typeof action.type === 'function' ? action.type.name : action.type
+ }
+}))
+
+
+// =====================
+// Options and Arguments
+// =====================
+function _get_action_name(argument) {
+ if (argument === undefined) {
+ return undefined
+ } else if (argument.option_strings.length) {
+ return argument.option_strings.join('/')
+ } else if (![ undefined, SUPPRESS ].includes(argument.metavar)) {
+ return argument.metavar
+ } else if (![ undefined, SUPPRESS ].includes(argument.dest)) {
+ return argument.dest
+ } else {
+ return undefined
+ }
+}
+
+
+const ArgumentError = _callable(class ArgumentError extends Error {
+ /*
+ * An error from creating or using an argument (optional or positional).
+ *
+ * The string value of this exception is the message, augmented with
+ * information about the argument that caused it.
+ */
+
+ constructor(argument, message) {
+ super()
+ this.name = 'ArgumentError'
+ this._argument_name = _get_action_name(argument)
+ this._message = message
+ this.message = this.str()
+ }
+
+ str() {
+ let format
+ if (this._argument_name === undefined) {
+ format = '%(message)s'
+ } else {
+ format = 'argument %(argument_name)s: %(message)s'
+ }
+ return sub(format, { message: this._message,
+ argument_name: this._argument_name })
+ }
+})
+
+
+const ArgumentTypeError = _callable(class ArgumentTypeError extends Error {
+ /*
+ * An error from trying to convert a command line string to a type.
+ */
+
+ constructor(message) {
+ super(message)
+ this.name = 'ArgumentTypeError'
+ }
+})
+
+
+// ==============
+// Action classes
+// ==============
+const Action = _camelcase_alias(_callable(class Action extends _AttributeHolder(Function) {
+ /*
+ * Information about how to convert command line strings to Python objects.
+ *
+ * Action objects are used by an ArgumentParser to represent the information
+ * needed to parse a single argument from one or more strings from the
+ * command line. The keyword arguments to the Action constructor are also
+ * all attributes of Action instances.
+ *
+ * Keyword Arguments:
+ *
+ * - option_strings -- A list of command-line option strings which
+ * should be associated with this action.
+ *
+ * - dest -- The name of the attribute to hold the created object(s)
+ *
+ * - nargs -- The number of command-line arguments that should be
+ * consumed. By default, one argument will be consumed and a single
+ * value will be produced. Other values include:
+ * - N (an integer) consumes N arguments (and produces a list)
+ * - '?' consumes zero or one arguments
+ * - '*' consumes zero or more arguments (and produces a list)
+ * - '+' consumes one or more arguments (and produces a list)
+ * Note that the difference between the default and nargs=1 is that
+ * with the default, a single value will be produced, while with
+ * nargs=1, a list containing a single value will be produced.
+ *
+ * - const -- The value to be produced if the option is specified and the
+ * option uses an action that takes no values.
+ *
+ * - default -- The value to be produced if the option is not specified.
+ *
+ * - type -- A callable that accepts a single string argument, and
+ * returns the converted value. The standard Python types str, int,
+ * float, and complex are useful examples of such callables. If None,
+ * str is used.
+ *
+ * - choices -- A container of values that should be allowed. If not None,
+ * after a command-line argument has been converted to the appropriate
+ * type, an exception will be raised if it is not a member of this
+ * collection.
+ *
+ * - required -- True if the action must always be specified at the
+ * command line. This is only meaningful for optional command-line
+ * arguments.
+ *
+ * - help -- The help string describing the argument.
+ *
+ * - metavar -- The name to be used for the option's argument with the
+ * help string. If None, the 'dest' value will be used as the name.
+ */
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ nargs,
+ const_value,
+ default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ nargs: undefined,
+ const: undefined,
+ default: undefined,
+ type: undefined,
+ choices: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ // when this class is called as a function, redirect it to .call() method of itself
+ super('return arguments.callee.call.apply(arguments.callee, arguments)')
+
+ this.option_strings = option_strings
+ this.dest = dest
+ this.nargs = nargs
+ this.const = const_value
+ this.default = default_value
+ this.type = type
+ this.choices = choices
+ this.required = required
+ this.help = help
+ this.metavar = metavar
+ }
+
+ _get_kwargs() {
+ let names = [
+ 'option_strings',
+ 'dest',
+ 'nargs',
+ 'const',
+ 'default',
+ 'type',
+ 'choices',
+ 'help',
+ 'metavar'
+ ]
+ return names.map(name => [ name, getattr(this, name) ])
+ }
+
+ format_usage() {
+ return this.option_strings[0]
+ }
+
+ call(/*parser, namespace, values, option_string = undefined*/) {
+ throw new Error('.call() not defined')
+ }
+}))
+
+
+const BooleanOptionalAction = _camelcase_alias(_callable(class BooleanOptionalAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ default: undefined,
+ type: undefined,
+ choices: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ let _option_strings = []
+ for (let option_string of option_strings) {
+ _option_strings.push(option_string)
+
+ if (option_string.startsWith('--')) {
+ option_string = '--no-' + option_string.slice(2)
+ _option_strings.push(option_string)
+ }
+ }
+
+ if (help !== undefined && default_value !== undefined) {
+ help += ` (default: ${default_value})`
+ }
+
+ super({
+ option_strings: _option_strings,
+ dest,
+ nargs: 0,
+ default: default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ })
+ }
+
+ call(parser, namespace, values, option_string = undefined) {
+ if (this.option_strings.includes(option_string)) {
+ setattr(namespace, this.dest, !option_string.startsWith('--no-'))
+ }
+ }
+
+ format_usage() {
+ return this.option_strings.join(' | ')
+ }
+}))
+
+
+const _StoreAction = _callable(class _StoreAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ nargs,
+ const_value,
+ default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ nargs: undefined,
+ const: undefined,
+ default: undefined,
+ type: undefined,
+ choices: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ if (nargs === 0) {
+ throw new TypeError('nargs for store actions must be != 0; if you ' +
+ 'have nothing to store, actions such as store ' +
+ 'true or store const may be more appropriate')
+ }
+ if (const_value !== undefined && nargs !== OPTIONAL) {
+ throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL))
+ }
+ super({
+ option_strings,
+ dest,
+ nargs,
+ const: const_value,
+ default: default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ })
+ }
+
+ call(parser, namespace, values/*, option_string = undefined*/) {
+ setattr(namespace, this.dest, values)
+ }
+})
+
+
+const _StoreConstAction = _callable(class _StoreConstAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ const_value,
+ default_value,
+ required,
+ help
+ //, metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ const: no_default,
+ default: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ nargs: 0,
+ const: const_value,
+ default: default_value,
+ required,
+ help
+ })
+ }
+
+ call(parser, namespace/*, values, option_string = undefined*/) {
+ setattr(namespace, this.dest, this.const)
+ }
+})
+
+
+const _StoreTrueAction = _callable(class _StoreTrueAction extends _StoreConstAction {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ default_value,
+ required,
+ help
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ default: false,
+ required: false,
+ help: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ const: true,
+ default: default_value,
+ required,
+ help
+ })
+ }
+})
+
+
+const _StoreFalseAction = _callable(class _StoreFalseAction extends _StoreConstAction {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ default_value,
+ required,
+ help
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ default: true,
+ required: false,
+ help: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ const: false,
+ default: default_value,
+ required,
+ help
+ })
+ }
+})
+
+
+const _AppendAction = _callable(class _AppendAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ nargs,
+ const_value,
+ default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ nargs: undefined,
+ const: undefined,
+ default: undefined,
+ type: undefined,
+ choices: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ if (nargs === 0) {
+ throw new TypeError('nargs for append actions must be != 0; if arg ' +
+ 'strings are not supplying the value to append, ' +
+ 'the append const action may be more appropriate')
+ }
+ if (const_value !== undefined && nargs !== OPTIONAL) {
+ throw new TypeError(sub('nargs must be %r to supply const', OPTIONAL))
+ }
+ super({
+ option_strings,
+ dest,
+ nargs,
+ const: const_value,
+ default: default_value,
+ type,
+ choices,
+ required,
+ help,
+ metavar
+ })
+ }
+
+ call(parser, namespace, values/*, option_string = undefined*/) {
+ let items = getattr(namespace, this.dest, undefined)
+ items = _copy_items(items)
+ items.push(values)
+ setattr(namespace, this.dest, items)
+ }
+})
+
+
+const _AppendConstAction = _callable(class _AppendConstAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ const_value,
+ default_value,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ const: no_default,
+ default: undefined,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ nargs: 0,
+ const: const_value,
+ default: default_value,
+ required,
+ help,
+ metavar
+ })
+ }
+
+ call(parser, namespace/*, values, option_string = undefined*/) {
+ let items = getattr(namespace, this.dest, undefined)
+ items = _copy_items(items)
+ items.push(this.const)
+ setattr(namespace, this.dest, items)
+ }
+})
+
+
+const _CountAction = _callable(class _CountAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ default_value,
+ required,
+ help
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: no_default,
+ default: undefined,
+ required: false,
+ help: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ nargs: 0,
+ default: default_value,
+ required,
+ help
+ })
+ }
+
+ call(parser, namespace/*, values, option_string = undefined*/) {
+ let count = getattr(namespace, this.dest, undefined)
+ if (count === undefined) {
+ count = 0
+ }
+ setattr(namespace, this.dest, count + 1)
+ }
+})
+
+
+const _HelpAction = _callable(class _HelpAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ dest,
+ default_value,
+ help
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ dest: SUPPRESS,
+ default: SUPPRESS,
+ help: undefined
+ })
+
+ super({
+ option_strings,
+ dest,
+ default: default_value,
+ nargs: 0,
+ help
+ })
+ }
+
+ call(parser/*, namespace, values, option_string = undefined*/) {
+ parser.print_help()
+ parser.exit()
+ }
+})
+
+
+const _VersionAction = _callable(class _VersionAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ version,
+ dest,
+ default_value,
+ help
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ version: undefined,
+ dest: SUPPRESS,
+ default: SUPPRESS,
+ help: "show program's version number and exit"
+ })
+
+ super({
+ option_strings,
+ dest,
+ default: default_value,
+ nargs: 0,
+ help
+ })
+ this.version = version
+ }
+
+ call(parser/*, namespace, values, option_string = undefined*/) {
+ let version = this.version
+ if (version === undefined) {
+ version = parser.version
+ }
+ let formatter = parser._get_formatter()
+ formatter.add_text(version)
+ parser._print_message(formatter.format_help(), process.stdout)
+ parser.exit()
+ }
+})
+
+
+const _SubParsersAction = _camelcase_alias(_callable(class _SubParsersAction extends Action {
+
+ constructor() {
+ let [
+ option_strings,
+ prog,
+ parser_class,
+ dest,
+ required,
+ help,
+ metavar
+ ] = _parse_opts(arguments, {
+ option_strings: no_default,
+ prog: no_default,
+ parser_class: no_default,
+ dest: SUPPRESS,
+ required: false,
+ help: undefined,
+ metavar: undefined
+ })
+
+ let name_parser_map = {}
+
+ super({
+ option_strings,
+ dest,
+ nargs: PARSER,
+ choices: name_parser_map,
+ required,
+ help,
+ metavar
+ })
+
+ this._prog_prefix = prog
+ this._parser_class = parser_class
+ this._name_parser_map = name_parser_map
+ this._choices_actions = []
+ }
+
+ add_parser() {
+ let [
+ name,
+ kwargs
+ ] = _parse_opts(arguments, {
+ name: no_default,
+ '**kwargs': no_default
+ })
+
+ // set prog from the existing prefix
+ if (kwargs.prog === undefined) {
+ kwargs.prog = sub('%s %s', this._prog_prefix, name)
+ }
+
+ let aliases = getattr(kwargs, 'aliases', [])
+ delete kwargs.aliases
+
+ // create a pseudo-action to hold the choice help
+ if ('help' in kwargs) {
+ let help = kwargs.help
+ delete kwargs.help
+ let choice_action = this._ChoicesPseudoAction(name, aliases, help)
+ this._choices_actions.push(choice_action)
+ }
+
+ // create the parser and add it to the map
+ let parser = new this._parser_class(kwargs)
+ this._name_parser_map[name] = parser
+
+ // make parser available under aliases also
+ for (let alias of aliases) {
+ this._name_parser_map[alias] = parser
+ }
+
+ return parser
+ }
+
+ _get_subactions() {
+ return this._choices_actions
+ }
+
+ call(parser, namespace, values/*, option_string = undefined*/) {
+ let parser_name = values[0]
+ let arg_strings = values.slice(1)
+
+ // set the parser name if requested
+ if (this.dest !== SUPPRESS) {
+ setattr(namespace, this.dest, parser_name)
+ }
+
+ // select the parser
+ if (hasattr(this._name_parser_map, parser_name)) {
+ parser = this._name_parser_map[parser_name]
+ } else {
+ let args = {parser_name,
+ choices: this._name_parser_map.join(', ')}
+ let msg = sub('unknown parser %(parser_name)r (choices: %(choices)s)', args)
+ throw new ArgumentError(this, msg)
+ }
+
+ // parse all the remaining options into the namespace
+ // store any unrecognized options on the object, so that the top
+ // level parser can decide what to do with them
+
+ // In case this subparser defines new defaults, we parse them
+ // in a new namespace object and then update the original
+ // namespace for the relevant parts.
+ let subnamespace
+ [ subnamespace, arg_strings ] = parser.parse_known_args(arg_strings, undefined)
+ for (let [ key, value ] of Object.entries(subnamespace)) {
+ setattr(namespace, key, value)
+ }
+
+ if (arg_strings.length) {
+ setdefault(namespace, _UNRECOGNIZED_ARGS_ATTR, [])
+ getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).push(...arg_strings)
+ }
+ }
+}))
+
+
+_SubParsersAction.prototype._ChoicesPseudoAction = _callable(class _ChoicesPseudoAction extends Action {
+ constructor(name, aliases, help) {
+ let metavar = name, dest = name
+ if (aliases.length) {
+ metavar += sub(' (%s)', aliases.join(', '))
+ }
+ super({ option_strings: [], dest, help, metavar })
+ }
+})
+
+
+const _ExtendAction = _callable(class _ExtendAction extends _AppendAction {
+ call(parser, namespace, values/*, option_string = undefined*/) {
+ let items = getattr(namespace, this.dest, undefined)
+ items = _copy_items(items)
+ items = items.concat(values)
+ setattr(namespace, this.dest, items)
+ }
+})
+
+
+// ==============
+// Type classes
+// ==============
+const FileType = _callable(class FileType extends Function {
+ /*
+ * Factory for creating file object types
+ *
+ * Instances of FileType are typically passed as type= arguments to the
+ * ArgumentParser add_argument() method.
+ *
+ * Keyword Arguments:
+ * - mode -- A string indicating how the file is to be opened. Accepts the
+ * same values as the builtin open() function.
+ * - bufsize -- The file's desired buffer size. Accepts the same values as
+ * the builtin open() function.
+ * - encoding -- The file's encoding. Accepts the same values as the
+ * builtin open() function.
+ * - errors -- A string indicating how encoding and decoding errors are to
+ * be handled. Accepts the same value as the builtin open() function.
+ */
+
+ constructor() {
+ let [
+ flags,
+ encoding,
+ mode,
+ autoClose,
+ emitClose,
+ start,
+ end,
+ highWaterMark,
+ fs
+ ] = _parse_opts(arguments, {
+ flags: 'r',
+ encoding: undefined,
+ mode: undefined, // 0o666
+ autoClose: undefined, // true
+ emitClose: undefined, // false
+ start: undefined, // 0
+ end: undefined, // Infinity
+ highWaterMark: undefined, // 64 * 1024
+ fs: undefined
+ })
+
+ // when this class is called as a function, redirect it to .call() method of itself
+ super('return arguments.callee.call.apply(arguments.callee, arguments)')
+
+ Object.defineProperty(this, 'name', {
+ get() {
+ return sub('FileType(%r)', flags)
+ }
+ })
+ this._flags = flags
+ this._options = {}
+ if (encoding !== undefined) this._options.encoding = encoding
+ if (mode !== undefined) this._options.mode = mode
+ if (autoClose !== undefined) this._options.autoClose = autoClose
+ if (emitClose !== undefined) this._options.emitClose = emitClose
+ if (start !== undefined) this._options.start = start
+ if (end !== undefined) this._options.end = end
+ if (highWaterMark !== undefined) this._options.highWaterMark = highWaterMark
+ if (fs !== undefined) this._options.fs = fs
+ }
+
+ call(string) {
+ // the special argument "-" means sys.std{in,out}
+ if (string === '-') {
+ if (this._flags.includes('r')) {
+ return process.stdin
+ } else if (this._flags.includes('w')) {
+ return process.stdout
+ } else {
+ let msg = sub('argument "-" with mode %r', this._flags)
+ throw new TypeError(msg)
+ }
+ }
+
+ // all other arguments are used as file names
+ let fd
+ try {
+ fd = fs.openSync(string, this._flags, this._options.mode)
+ } catch (e) {
+ let args = { filename: string, error: e.message }
+ let message = "can't open '%(filename)s': %(error)s"
+ throw new ArgumentTypeError(sub(message, args))
+ }
+
+ let options = Object.assign({ fd, flags: this._flags }, this._options)
+ if (this._flags.includes('r')) {
+ return fs.createReadStream(undefined, options)
+ } else if (this._flags.includes('w')) {
+ return fs.createWriteStream(undefined, options)
+ } else {
+ let msg = sub('argument "%s" with mode %r', string, this._flags)
+ throw new TypeError(msg)
+ }
+ }
+
+ [util.inspect.custom]() {
+ let args = [ this._flags ]
+ let kwargs = Object.entries(this._options).map(([ k, v ]) => {
+ if (k === 'mode') v = { value: v, [util.inspect.custom]() { return '0o' + this.value.toString(8) } }
+ return [ k, v ]
+ })
+ let args_str = []
+ .concat(args.filter(arg => arg !== -1).map(repr))
+ .concat(kwargs.filter(([/*kw*/, arg]) => arg !== undefined)
+ .map(([kw, arg]) => sub('%s=%r', kw, arg)))
+ .join(', ')
+ return sub('%s(%s)', this.constructor.name, args_str)
+ }
+
+ toString() {
+ return this[util.inspect.custom]()
+ }
+})
+
+// ===========================
+// Optional and Positional Parsing
+// ===========================
+const Namespace = _callable(class Namespace extends _AttributeHolder() {
+ /*
+ * Simple object for storing attributes.
+ *
+ * Implements equality by attribute names and values, and provides a simple
+ * string representation.
+ */
+
+ constructor(options = {}) {
+ super()
+ Object.assign(this, options)
+ }
+})
+
+// unset string tag to mimic plain object
+Namespace.prototype[Symbol.toStringTag] = undefined
+
+
+const _ActionsContainer = _camelcase_alias(_callable(class _ActionsContainer {
+
+ constructor() {
+ let [
+ description,
+ prefix_chars,
+ argument_default,
+ conflict_handler
+ ] = _parse_opts(arguments, {
+ description: no_default,
+ prefix_chars: no_default,
+ argument_default: no_default,
+ conflict_handler: no_default
+ })
+
+ this.description = description
+ this.argument_default = argument_default
+ this.prefix_chars = prefix_chars
+ this.conflict_handler = conflict_handler
+
+ // set up registries
+ this._registries = {}
+
+ // register actions
+ this.register('action', undefined, _StoreAction)
+ this.register('action', 'store', _StoreAction)
+ this.register('action', 'store_const', _StoreConstAction)
+ this.register('action', 'store_true', _StoreTrueAction)
+ this.register('action', 'store_false', _StoreFalseAction)
+ this.register('action', 'append', _AppendAction)
+ this.register('action', 'append_const', _AppendConstAction)
+ this.register('action', 'count', _CountAction)
+ this.register('action', 'help', _HelpAction)
+ this.register('action', 'version', _VersionAction)
+ this.register('action', 'parsers', _SubParsersAction)
+ this.register('action', 'extend', _ExtendAction)
+ // LEGACY (v1 compatibility): camelcase variants
+ ;[ 'storeConst', 'storeTrue', 'storeFalse', 'appendConst' ].forEach(old_name => {
+ let new_name = _to_new_name(old_name)
+ this.register('action', old_name, util.deprecate(this._registry_get('action', new_name),
+ sub('{action: "%s"} is renamed to {action: "%s"}', old_name, new_name)))
+ })
+ // end
+
+ // raise an exception if the conflict handler is invalid
+ this._get_handler()
+
+ // action storage
+ this._actions = []
+ this._option_string_actions = {}
+
+ // groups
+ this._action_groups = []
+ this._mutually_exclusive_groups = []
+
+ // defaults storage
+ this._defaults = {}
+
+ // determines whether an "option" looks like a negative number
+ this._negative_number_matcher = /^-\d+$|^-\d*\.\d+$/
+
+ // whether or not there are any optionals that look like negative
+ // numbers -- uses a list so it can be shared and edited
+ this._has_negative_number_optionals = []
+ }
+
+ // ====================
+ // Registration methods
+ // ====================
+ register(registry_name, value, object) {
+ let registry = setdefault(this._registries, registry_name, {})
+ registry[value] = object
+ }
+
+ _registry_get(registry_name, value, default_value = undefined) {
+ return getattr(this._registries[registry_name], value, default_value)
+ }
+
+ // ==================================
+ // Namespace default accessor methods
+ // ==================================
+ set_defaults(kwargs) {
+ Object.assign(this._defaults, kwargs)
+
+ // if these defaults match any existing arguments, replace
+ // the previous default on the object with the new one
+ for (let action of this._actions) {
+ if (action.dest in kwargs) {
+ action.default = kwargs[action.dest]
+ }
+ }
+ }
+
+ get_default(dest) {
+ for (let action of this._actions) {
+ if (action.dest === dest && action.default !== undefined) {
+ return action.default
+ }
+ }
+ return this._defaults[dest]
+ }
+
+
+ // =======================
+ // Adding argument actions
+ // =======================
+ add_argument() {
+ /*
+ * add_argument(dest, ..., name=value, ...)
+ * add_argument(option_string, option_string, ..., name=value, ...)
+ */
+ let [
+ args,
+ kwargs
+ ] = _parse_opts(arguments, {
+ '*args': no_default,
+ '**kwargs': no_default
+ })
+ // LEGACY (v1 compatibility), old-style add_argument([ args ], { options })
+ if (args.length === 1 && Array.isArray(args[0])) {
+ args = args[0]
+ deprecate('argument-array',
+ sub('use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })', {
+ args: args.map(repr).join(', ')
+ }))
+ }
+ // end
+
+ // if no positional args are supplied or only one is supplied and
+ // it doesn't look like an option string, parse a positional
+ // argument
+ let chars = this.prefix_chars
+ if (!args.length || args.length === 1 && !chars.includes(args[0][0])) {
+ if (args.length && 'dest' in kwargs) {
+ throw new TypeError('dest supplied twice for positional argument')
+ }
+ kwargs = this._get_positional_kwargs(...args, kwargs)
+
+ // otherwise, we're adding an optional argument
+ } else {
+ kwargs = this._get_optional_kwargs(...args, kwargs)
+ }
+
+ // if no default was supplied, use the parser-level default
+ if (!('default' in kwargs)) {
+ let dest = kwargs.dest
+ if (dest in this._defaults) {
+ kwargs.default = this._defaults[dest]
+ } else if (this.argument_default !== undefined) {
+ kwargs.default = this.argument_default
+ }
+ }
+
+ // create the action object, and add it to the parser
+ let action_class = this._pop_action_class(kwargs)
+ if (typeof action_class !== 'function') {
+ throw new TypeError(sub('unknown action "%s"', action_class))
+ }
+ // eslint-disable-next-line new-cap
+ let action = new action_class(kwargs)
+
+ // raise an error if the action type is not callable
+ let type_func = this._registry_get('type', action.type, action.type)
+ if (typeof type_func !== 'function') {
+ throw new TypeError(sub('%r is not callable', type_func))
+ }
+
+ if (type_func === FileType) {
+ throw new TypeError(sub('%r is a FileType class object, instance of it' +
+ ' must be passed', type_func))
+ }
+
+ // raise an error if the metavar does not match the type
+ if ('_get_formatter' in this) {
+ try {
+ this._get_formatter()._format_args(action, undefined)
+ } catch (err) {
+ // check for 'invalid nargs value' is an artifact of TypeError and ValueError in js being the same
+ if (err instanceof TypeError && err.message !== 'invalid nargs value') {
+ throw new TypeError('length of metavar tuple does not match nargs')
+ } else {
+ throw err
+ }
+ }
+ }
+
+ return this._add_action(action)
+ }
+
+ add_argument_group() {
+ let group = _ArgumentGroup(this, ...arguments)
+ this._action_groups.push(group)
+ return group
+ }
+
+ add_mutually_exclusive_group() {
+ // eslint-disable-next-line no-use-before-define
+ let group = _MutuallyExclusiveGroup(this, ...arguments)
+ this._mutually_exclusive_groups.push(group)
+ return group
+ }
+
+ _add_action(action) {
+ // resolve any conflicts
+ this._check_conflict(action)
+
+ // add to actions list
+ this._actions.push(action)
+ action.container = this
+
+ // index the action by any option strings it has
+ for (let option_string of action.option_strings) {
+ this._option_string_actions[option_string] = action
+ }
+
+ // set the flag if any option strings look like negative numbers
+ for (let option_string of action.option_strings) {
+ if (this._negative_number_matcher.test(option_string)) {
+ if (!this._has_negative_number_optionals.length) {
+ this._has_negative_number_optionals.push(true)
+ }
+ }
+ }
+
+ // return the created action
+ return action
+ }
+
+ _remove_action(action) {
+ _array_remove(this._actions, action)
+ }
+
+ _add_container_actions(container) {
+ // collect groups by titles
+ let title_group_map = {}
+ for (let group of this._action_groups) {
+ if (group.title in title_group_map) {
+ let msg = 'cannot merge actions - two groups are named %r'
+ throw new TypeError(sub(msg, group.title))
+ }
+ title_group_map[group.title] = group
+ }
+
+ // map each action to its group
+ let group_map = new Map()
+ for (let group of container._action_groups) {
+
+ // if a group with the title exists, use that, otherwise
+ // create a new group matching the container's group
+ if (!(group.title in title_group_map)) {
+ title_group_map[group.title] = this.add_argument_group({
+ title: group.title,
+ description: group.description,
+ conflict_handler: group.conflict_handler
+ })
+ }
+
+ // map the actions to their new group
+ for (let action of group._group_actions) {
+ group_map.set(action, title_group_map[group.title])
+ }
+ }
+
+ // add container's mutually exclusive groups
+ // NOTE: if add_mutually_exclusive_group ever gains title= and
+ // description= then this code will need to be expanded as above
+ for (let group of container._mutually_exclusive_groups) {
+ let mutex_group = this.add_mutually_exclusive_group({
+ required: group.required
+ })
+
+ // map the actions to their new mutex group
+ for (let action of group._group_actions) {
+ group_map.set(action, mutex_group)
+ }
+ }
+
+ // add all actions to this container or their group
+ for (let action of container._actions) {
+ group_map.get(action)._add_action(action)
+ }
+ }
+
+ _get_positional_kwargs() {
+ let [
+ dest,
+ kwargs
+ ] = _parse_opts(arguments, {
+ dest: no_default,
+ '**kwargs': no_default
+ })
+
+ // make sure required is not specified
+ if ('required' in kwargs) {
+ let msg = "'required' is an invalid argument for positionals"
+ throw new TypeError(msg)
+ }
+
+ // mark positional arguments as required if at least one is
+ // always required
+ if (![OPTIONAL, ZERO_OR_MORE].includes(kwargs.nargs)) {
+ kwargs.required = true
+ }
+ if (kwargs.nargs === ZERO_OR_MORE && !('default' in kwargs)) {
+ kwargs.required = true
+ }
+
+ // return the keyword arguments with no option strings
+ return Object.assign(kwargs, { dest, option_strings: [] })
+ }
+
+ _get_optional_kwargs() {
+ let [
+ args,
+ kwargs
+ ] = _parse_opts(arguments, {
+ '*args': no_default,
+ '**kwargs': no_default
+ })
+
+ // determine short and long option strings
+ let option_strings = []
+ let long_option_strings = []
+ let option_string
+ for (option_string of args) {
+ // error on strings that don't start with an appropriate prefix
+ if (!this.prefix_chars.includes(option_string[0])) {
+ let args = {option: option_string,
+ prefix_chars: this.prefix_chars}
+ let msg = 'invalid option string %(option)r: ' +
+ 'must start with a character %(prefix_chars)r'
+ throw new TypeError(sub(msg, args))
+ }
+
+ // strings starting with two prefix characters are long options
+ option_strings.push(option_string)
+ if (option_string.length > 1 && this.prefix_chars.includes(option_string[1])) {
+ long_option_strings.push(option_string)
+ }
+ }
+
+ // infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
+ let dest = kwargs.dest
+ delete kwargs.dest
+ if (dest === undefined) {
+ let dest_option_string
+ if (long_option_strings.length) {
+ dest_option_string = long_option_strings[0]
+ } else {
+ dest_option_string = option_strings[0]
+ }
+ dest = _string_lstrip(dest_option_string, this.prefix_chars)
+ if (!dest) {
+ let msg = 'dest= is required for options like %r'
+ throw new TypeError(sub(msg, option_string))
+ }
+ dest = dest.replace(/-/g, '_')
+ }
+
+ // return the updated keyword arguments
+ return Object.assign(kwargs, { dest, option_strings })
+ }
+
+ _pop_action_class(kwargs, default_value = undefined) {
+ let action = getattr(kwargs, 'action', default_value)
+ delete kwargs.action
+ return this._registry_get('action', action, action)
+ }
+
+ _get_handler() {
+ // determine function from conflict handler string
+ let handler_func_name = sub('_handle_conflict_%s', this.conflict_handler)
+ if (typeof this[handler_func_name] === 'function') {
+ return this[handler_func_name]
+ } else {
+ let msg = 'invalid conflict_resolution value: %r'
+ throw new TypeError(sub(msg, this.conflict_handler))
+ }
+ }
+
+ _check_conflict(action) {
+
+ // find all options that conflict with this option
+ let confl_optionals = []
+ for (let option_string of action.option_strings) {
+ if (hasattr(this._option_string_actions, option_string)) {
+ let confl_optional = this._option_string_actions[option_string]
+ confl_optionals.push([ option_string, confl_optional ])
+ }
+ }
+
+ // resolve any conflicts
+ if (confl_optionals.length) {
+ let conflict_handler = this._get_handler()
+ conflict_handler.call(this, action, confl_optionals)
+ }
+ }
+
+ _handle_conflict_error(action, conflicting_actions) {
+ let message = conflicting_actions.length === 1 ?
+ 'conflicting option string: %s' :
+ 'conflicting option strings: %s'
+ let conflict_string = conflicting_actions.map(([ option_string/*, action*/ ]) => option_string).join(', ')
+ throw new ArgumentError(action, sub(message, conflict_string))
+ }
+
+ _handle_conflict_resolve(action, conflicting_actions) {
+
+ // remove all conflicting options
+ for (let [ option_string, action ] of conflicting_actions) {
+
+ // remove the conflicting option
+ _array_remove(action.option_strings, option_string)
+ delete this._option_string_actions[option_string]
+
+ // if the option now has no option string, remove it from the
+ // container holding it
+ if (!action.option_strings.length) {
+ action.container._remove_action(action)
+ }
+ }
+ }
+}))
+
+
+const _ArgumentGroup = _callable(class _ArgumentGroup extends _ActionsContainer {
+
+ constructor() {
+ let [
+ container,
+ title,
+ description,
+ kwargs
+ ] = _parse_opts(arguments, {
+ container: no_default,
+ title: undefined,
+ description: undefined,
+ '**kwargs': no_default
+ })
+
+ // add any missing keyword arguments by checking the container
+ setdefault(kwargs, 'conflict_handler', container.conflict_handler)
+ setdefault(kwargs, 'prefix_chars', container.prefix_chars)
+ setdefault(kwargs, 'argument_default', container.argument_default)
+ super(Object.assign({ description }, kwargs))
+
+ // group attributes
+ this.title = title
+ this._group_actions = []
+
+ // share most attributes with the container
+ this._registries = container._registries
+ this._actions = container._actions
+ this._option_string_actions = container._option_string_actions
+ this._defaults = container._defaults
+ this._has_negative_number_optionals =
+ container._has_negative_number_optionals
+ this._mutually_exclusive_groups = container._mutually_exclusive_groups
+ }
+
+ _add_action(action) {
+ action = super._add_action(action)
+ this._group_actions.push(action)
+ return action
+ }
+
+ _remove_action(action) {
+ super._remove_action(action)
+ _array_remove(this._group_actions, action)
+ }
+})
+
+
+const _MutuallyExclusiveGroup = _callable(class _MutuallyExclusiveGroup extends _ArgumentGroup {
+
+ constructor() {
+ let [
+ container,
+ required
+ ] = _parse_opts(arguments, {
+ container: no_default,
+ required: false
+ })
+
+ super(container)
+ this.required = required
+ this._container = container
+ }
+
+ _add_action(action) {
+ if (action.required) {
+ let msg = 'mutually exclusive arguments must be optional'
+ throw new TypeError(msg)
+ }
+ action = this._container._add_action(action)
+ this._group_actions.push(action)
+ return action
+ }
+
+ _remove_action(action) {
+ this._container._remove_action(action)
+ _array_remove(this._group_actions, action)
+ }
+})
+
+
+const ArgumentParser = _camelcase_alias(_callable(class ArgumentParser extends _AttributeHolder(_ActionsContainer) {
+ /*
+ * Object for parsing command line strings into Python objects.
+ *
+ * Keyword Arguments:
+ * - prog -- The name of the program (default: sys.argv[0])
+ * - usage -- A usage message (default: auto-generated from arguments)
+ * - description -- A description of what the program does
+ * - epilog -- Text following the argument descriptions
+ * - parents -- Parsers whose arguments should be copied into this one
+ * - formatter_class -- HelpFormatter class for printing help messages
+ * - prefix_chars -- Characters that prefix optional arguments
+ * - fromfile_prefix_chars -- Characters that prefix files containing
+ * additional arguments
+ * - argument_default -- The default value for all arguments
+ * - conflict_handler -- String indicating how to handle conflicts
+ * - add_help -- Add a -h/-help option
+ * - allow_abbrev -- Allow long options to be abbreviated unambiguously
+ * - exit_on_error -- Determines whether or not ArgumentParser exits with
+ * error info when an error occurs
+ */
+
+ constructor() {
+ let [
+ prog,
+ usage,
+ description,
+ epilog,
+ parents,
+ formatter_class,
+ prefix_chars,
+ fromfile_prefix_chars,
+ argument_default,
+ conflict_handler,
+ add_help,
+ allow_abbrev,
+ exit_on_error,
+ debug, // LEGACY (v1 compatibility), debug mode
+ version // LEGACY (v1 compatibility), version
+ ] = _parse_opts(arguments, {
+ prog: undefined,
+ usage: undefined,
+ description: undefined,
+ epilog: undefined,
+ parents: [],
+ formatter_class: HelpFormatter,
+ prefix_chars: '-',
+ fromfile_prefix_chars: undefined,
+ argument_default: undefined,
+ conflict_handler: 'error',
+ add_help: true,
+ allow_abbrev: true,
+ exit_on_error: true,
+ debug: undefined, // LEGACY (v1 compatibility), debug mode
+ version: undefined // LEGACY (v1 compatibility), version
+ })
+
+ // LEGACY (v1 compatibility)
+ if (debug !== undefined) {
+ deprecate('debug',
+ 'The "debug" argument to ArgumentParser is deprecated. Please ' +
+ 'override ArgumentParser.exit function instead.'
+ )
+ }
+
+ if (version !== undefined) {
+ deprecate('version',
+ 'The "version" argument to ArgumentParser is deprecated. Please use ' +
+ "add_argument(..., { action: 'version', version: 'N', ... }) instead."
+ )
+ }
+ // end
+
+ super({
+ description,
+ prefix_chars,
+ argument_default,
+ conflict_handler
+ })
+
+ // default setting for prog
+ if (prog === undefined) {
+ prog = path.basename(get_argv()[0] || '')
+ }
+
+ this.prog = prog
+ this.usage = usage
+ this.epilog = epilog
+ this.formatter_class = formatter_class
+ this.fromfile_prefix_chars = fromfile_prefix_chars
+ this.add_help = add_help
+ this.allow_abbrev = allow_abbrev
+ this.exit_on_error = exit_on_error
+ // LEGACY (v1 compatibility), debug mode
+ this.debug = debug
+ // end
+
+ this._positionals = this.add_argument_group('positional arguments')
+ this._optionals = this.add_argument_group('optional arguments')
+ this._subparsers = undefined
+
+ // register types
+ function identity(string) {
+ return string
+ }
+ this.register('type', undefined, identity)
+ this.register('type', null, identity)
+ this.register('type', 'auto', identity)
+ this.register('type', 'int', function (x) {
+ let result = Number(x)
+ if (!Number.isInteger(result)) {
+ throw new TypeError(sub('could not convert string to int: %r', x))
+ }
+ return result
+ })
+ this.register('type', 'float', function (x) {
+ let result = Number(x)
+ if (isNaN(result)) {
+ throw new TypeError(sub('could not convert string to float: %r', x))
+ }
+ return result
+ })
+ this.register('type', 'str', String)
+ // LEGACY (v1 compatibility): custom types
+ this.register('type', 'string',
+ util.deprecate(String, 'use {type:"str"} or {type:String} instead of {type:"string"}'))
+ // end
+
+ // add help argument if necessary
+ // (using explicit default to override global argument_default)
+ let default_prefix = prefix_chars.includes('-') ? '-' : prefix_chars[0]
+ if (this.add_help) {
+ this.add_argument(
+ default_prefix + 'h',
+ default_prefix.repeat(2) + 'help',
+ {
+ action: 'help',
+ default: SUPPRESS,
+ help: 'show this help message and exit'
+ }
+ )
+ }
+ // LEGACY (v1 compatibility), version
+ if (version) {
+ this.add_argument(
+ default_prefix + 'v',
+ default_prefix.repeat(2) + 'version',
+ {
+ action: 'version',
+ default: SUPPRESS,
+ version: this.version,
+ help: "show program's version number and exit"
+ }
+ )
+ }
+ // end
+
+ // add parent arguments and defaults
+ for (let parent of parents) {
+ this._add_container_actions(parent)
+ Object.assign(this._defaults, parent._defaults)
+ }
+ }
+
+ // =======================
+ // Pretty __repr__ methods
+ // =======================
+ _get_kwargs() {
+ let names = [
+ 'prog',
+ 'usage',
+ 'description',
+ 'formatter_class',
+ 'conflict_handler',
+ 'add_help'
+ ]
+ return names.map(name => [ name, getattr(this, name) ])
+ }
+
+ // ==================================
+ // Optional/Positional adding methods
+ // ==================================
+ add_subparsers() {
+ let [
+ kwargs
+ ] = _parse_opts(arguments, {
+ '**kwargs': no_default
+ })
+
+ if (this._subparsers !== undefined) {
+ this.error('cannot have multiple subparser arguments')
+ }
+
+ // add the parser class to the arguments if it's not present
+ setdefault(kwargs, 'parser_class', this.constructor)
+
+ if ('title' in kwargs || 'description' in kwargs) {
+ let title = getattr(kwargs, 'title', 'subcommands')
+ let description = getattr(kwargs, 'description', undefined)
+ delete kwargs.title
+ delete kwargs.description
+ this._subparsers = this.add_argument_group(title, description)
+ } else {
+ this._subparsers = this._positionals
+ }
+
+ // prog defaults to the usage message of this parser, skipping
+ // optional arguments and with no "usage:" prefix
+ if (kwargs.prog === undefined) {
+ let formatter = this._get_formatter()
+ let positionals = this._get_positional_actions()
+ let groups = this._mutually_exclusive_groups
+ formatter.add_usage(this.usage, positionals, groups, '')
+ kwargs.prog = formatter.format_help().trim()
+ }
+
+ // create the parsers action and add it to the positionals list
+ let parsers_class = this._pop_action_class(kwargs, 'parsers')
+ // eslint-disable-next-line new-cap
+ let action = new parsers_class(Object.assign({ option_strings: [] }, kwargs))
+ this._subparsers._add_action(action)
+
+ // return the created parsers action
+ return action
+ }
+
+ _add_action(action) {
+ if (action.option_strings.length) {
+ this._optionals._add_action(action)
+ } else {
+ this._positionals._add_action(action)
+ }
+ return action
+ }
+
+ _get_optional_actions() {
+ return this._actions.filter(action => action.option_strings.length)
+ }
+
+ _get_positional_actions() {
+ return this._actions.filter(action => !action.option_strings.length)
+ }
+
+ // =====================================
+ // Command line argument parsing methods
+ // =====================================
+ parse_args(args = undefined, namespace = undefined) {
+ let argv
+ [ args, argv ] = this.parse_known_args(args, namespace)
+ if (argv && argv.length > 0) {
+ let msg = 'unrecognized arguments: %s'
+ this.error(sub(msg, argv.join(' ')))
+ }
+ return args
+ }
+
+ parse_known_args(args = undefined, namespace = undefined) {
+ if (args === undefined) {
+ args = get_argv().slice(1)
+ }
+
+ // default Namespace built from parser defaults
+ if (namespace === undefined) {
+ namespace = new Namespace()
+ }
+
+ // add any action defaults that aren't present
+ for (let action of this._actions) {
+ if (action.dest !== SUPPRESS) {
+ if (!hasattr(namespace, action.dest)) {
+ if (action.default !== SUPPRESS) {
+ setattr(namespace, action.dest, action.default)
+ }
+ }
+ }
+ }
+
+ // add any parser defaults that aren't present
+ for (let dest of Object.keys(this._defaults)) {
+ if (!hasattr(namespace, dest)) {
+ setattr(namespace, dest, this._defaults[dest])
+ }
+ }
+
+ // parse the arguments and exit if there are any errors
+ if (this.exit_on_error) {
+ try {
+ [ namespace, args ] = this._parse_known_args(args, namespace)
+ } catch (err) {
+ if (err instanceof ArgumentError) {
+ this.error(err.message)
+ } else {
+ throw err
+ }
+ }
+ } else {
+ [ namespace, args ] = this._parse_known_args(args, namespace)
+ }
+
+ if (hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR)) {
+ args = args.concat(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
+ delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
+ }
+
+ return [ namespace, args ]
+ }
+
+ _parse_known_args(arg_strings, namespace) {
+ // replace arg strings that are file references
+ if (this.fromfile_prefix_chars !== undefined) {
+ arg_strings = this._read_args_from_files(arg_strings)
+ }
+
+ // map all mutually exclusive arguments to the other arguments
+ // they can't occur with
+ let action_conflicts = new Map()
+ for (let mutex_group of this._mutually_exclusive_groups) {
+ let group_actions = mutex_group._group_actions
+ for (let [ i, mutex_action ] of Object.entries(mutex_group._group_actions)) {
+ let conflicts = action_conflicts.get(mutex_action) || []
+ conflicts = conflicts.concat(group_actions.slice(0, +i))
+ conflicts = conflicts.concat(group_actions.slice(+i + 1))
+ action_conflicts.set(mutex_action, conflicts)
+ }
+ }
+
+ // find all option indices, and determine the arg_string_pattern
+ // which has an 'O' if there is an option at an index,
+ // an 'A' if there is an argument, or a '-' if there is a '--'
+ let option_string_indices = {}
+ let arg_string_pattern_parts = []
+ let arg_strings_iter = Object.entries(arg_strings)[Symbol.iterator]()
+ for (let [ i, arg_string ] of arg_strings_iter) {
+
+ // all args after -- are non-options
+ if (arg_string === '--') {
+ arg_string_pattern_parts.push('-')
+ for ([ i, arg_string ] of arg_strings_iter) {
+ arg_string_pattern_parts.push('A')
+ }
+
+ // otherwise, add the arg to the arg strings
+ // and note the index if it was an option
+ } else {
+ let option_tuple = this._parse_optional(arg_string)
+ let pattern
+ if (option_tuple === undefined) {
+ pattern = 'A'
+ } else {
+ option_string_indices[i] = option_tuple
+ pattern = 'O'
+ }
+ arg_string_pattern_parts.push(pattern)
+ }
+ }
+
+ // join the pieces together to form the pattern
+ let arg_strings_pattern = arg_string_pattern_parts.join('')
+
+ // converts arg strings to the appropriate and then takes the action
+ let seen_actions = new Set()
+ let seen_non_default_actions = new Set()
+ let extras
+
+ let take_action = (action, argument_strings, option_string = undefined) => {
+ seen_actions.add(action)
+ let argument_values = this._get_values(action, argument_strings)
+
+ // error if this argument is not allowed with other previously
+ // seen arguments, assuming that actions that use the default
+ // value don't really count as "present"
+ if (argument_values !== action.default) {
+ seen_non_default_actions.add(action)
+ for (let conflict_action of action_conflicts.get(action) || []) {
+ if (seen_non_default_actions.has(conflict_action)) {
+ let msg = 'not allowed with argument %s'
+ let action_name = _get_action_name(conflict_action)
+ throw new ArgumentError(action, sub(msg, action_name))
+ }
+ }
+ }
+
+ // take the action if we didn't receive a SUPPRESS value
+ // (e.g. from a default)
+ if (argument_values !== SUPPRESS) {
+ action(this, namespace, argument_values, option_string)
+ }
+ }
+
+ // function to convert arg_strings into an optional action
+ let consume_optional = start_index => {
+
+ // get the optional identified at this index
+ let option_tuple = option_string_indices[start_index]
+ let [ action, option_string, explicit_arg ] = option_tuple
+
+ // identify additional optionals in the same arg string
+ // (e.g. -xyz is the same as -x -y -z if no args are required)
+ let action_tuples = []
+ let stop
+ for (;;) {
+
+ // if we found no optional action, skip it
+ if (action === undefined) {
+ extras.push(arg_strings[start_index])
+ return start_index + 1
+ }
+
+ // if there is an explicit argument, try to match the
+ // optional's string arguments to only this
+ if (explicit_arg !== undefined) {
+ let arg_count = this._match_argument(action, 'A')
+
+ // if the action is a single-dash option and takes no
+ // arguments, try to parse more single-dash options out
+ // of the tail of the option string
+ let chars = this.prefix_chars
+ if (arg_count === 0 && !chars.includes(option_string[1])) {
+ action_tuples.push([ action, [], option_string ])
+ let char = option_string[0]
+ option_string = char + explicit_arg[0]
+ let new_explicit_arg = explicit_arg.slice(1) || undefined
+ let optionals_map = this._option_string_actions
+ if (hasattr(optionals_map, option_string)) {
+ action = optionals_map[option_string]
+ explicit_arg = new_explicit_arg
+ } else {
+ let msg = 'ignored explicit argument %r'
+ throw new ArgumentError(action, sub(msg, explicit_arg))
+ }
+
+ // if the action expect exactly one argument, we've
+ // successfully matched the option; exit the loop
+ } else if (arg_count === 1) {
+ stop = start_index + 1
+ let args = [ explicit_arg ]
+ action_tuples.push([ action, args, option_string ])
+ break
+
+ // error if a double-dash option did not use the
+ // explicit argument
+ } else {
+ let msg = 'ignored explicit argument %r'
+ throw new ArgumentError(action, sub(msg, explicit_arg))
+ }
+
+ // if there is no explicit argument, try to match the
+ // optional's string arguments with the following strings
+ // if successful, exit the loop
+ } else {
+ let start = start_index + 1
+ let selected_patterns = arg_strings_pattern.slice(start)
+ let arg_count = this._match_argument(action, selected_patterns)
+ stop = start + arg_count
+ let args = arg_strings.slice(start, stop)
+ action_tuples.push([ action, args, option_string ])
+ break
+ }
+ }
+
+ // add the Optional to the list and return the index at which
+ // the Optional's string args stopped
+ assert(action_tuples.length)
+ for (let [ action, args, option_string ] of action_tuples) {
+ take_action(action, args, option_string)
+ }
+ return stop
+ }
+
+ // the list of Positionals left to be parsed; this is modified
+ // by consume_positionals()
+ let positionals = this._get_positional_actions()
+
+ // function to convert arg_strings into positional actions
+ let consume_positionals = start_index => {
+ // match as many Positionals as possible
+ let selected_pattern = arg_strings_pattern.slice(start_index)
+ let arg_counts = this._match_arguments_partial(positionals, selected_pattern)
+
+ // slice off the appropriate arg strings for each Positional
+ // and add the Positional and its args to the list
+ for (let i = 0; i < positionals.length && i < arg_counts.length; i++) {
+ let action = positionals[i]
+ let arg_count = arg_counts[i]
+ let args = arg_strings.slice(start_index, start_index + arg_count)
+ start_index += arg_count
+ take_action(action, args)
+ }
+
+ // slice off the Positionals that we just parsed and return the
+ // index at which the Positionals' string args stopped
+ positionals = positionals.slice(arg_counts.length)
+ return start_index
+ }
+
+ // consume Positionals and Optionals alternately, until we have
+ // passed the last option string
+ extras = []
+ let start_index = 0
+ let max_option_string_index = Math.max(-1, ...Object.keys(option_string_indices).map(Number))
+ while (start_index <= max_option_string_index) {
+
+ // consume any Positionals preceding the next option
+ let next_option_string_index = Math.min(
+ // eslint-disable-next-line no-loop-func
+ ...Object.keys(option_string_indices).map(Number).filter(index => index >= start_index)
+ )
+ if (start_index !== next_option_string_index) {
+ let positionals_end_index = consume_positionals(start_index)
+
+ // only try to parse the next optional if we didn't consume
+ // the option string during the positionals parsing
+ if (positionals_end_index > start_index) {
+ start_index = positionals_end_index
+ continue
+ } else {
+ start_index = positionals_end_index
+ }
+ }
+
+ // if we consumed all the positionals we could and we're not
+ // at the index of an option string, there were extra arguments
+ if (!(start_index in option_string_indices)) {
+ let strings = arg_strings.slice(start_index, next_option_string_index)
+ extras = extras.concat(strings)
+ start_index = next_option_string_index
+ }
+
+ // consume the next optional and any arguments for it
+ start_index = consume_optional(start_index)
+ }
+
+ // consume any positionals following the last Optional
+ let stop_index = consume_positionals(start_index)
+
+ // if we didn't consume all the argument strings, there were extras
+ extras = extras.concat(arg_strings.slice(stop_index))
+
+ // make sure all required actions were present and also convert
+ // action defaults which were not given as arguments
+ let required_actions = []
+ for (let action of this._actions) {
+ if (!seen_actions.has(action)) {
+ if (action.required) {
+ required_actions.push(_get_action_name(action))
+ } else {
+ // Convert action default now instead of doing it before
+ // parsing arguments to avoid calling convert functions
+ // twice (which may fail) if the argument was given, but
+ // only if it was defined already in the namespace
+ if (action.default !== undefined &&
+ typeof action.default === 'string' &&
+ hasattr(namespace, action.dest) &&
+ action.default === getattr(namespace, action.dest)) {
+ setattr(namespace, action.dest,
+ this._get_value(action, action.default))
+ }
+ }
+ }
+ }
+
+ if (required_actions.length) {
+ this.error(sub('the following arguments are required: %s',
+ required_actions.join(', ')))
+ }
+
+ // make sure all required groups had one option present
+ for (let group of this._mutually_exclusive_groups) {
+ if (group.required) {
+ let no_actions_used = true
+ for (let action of group._group_actions) {
+ if (seen_non_default_actions.has(action)) {
+ no_actions_used = false
+ break
+ }
+ }
+
+ // if no actions were used, report the error
+ if (no_actions_used) {
+ let names = group._group_actions
+ .filter(action => action.help !== SUPPRESS)
+ .map(action => _get_action_name(action))
+ let msg = 'one of the arguments %s is required'
+ this.error(sub(msg, names.join(' ')))
+ }
+ }
+ }
+
+ // return the updated namespace and the extra arguments
+ return [ namespace, extras ]
+ }
+
+ _read_args_from_files(arg_strings) {
+ // expand arguments referencing files
+ let new_arg_strings = []
+ for (let arg_string of arg_strings) {
+
+ // for regular arguments, just add them back into the list
+ if (!arg_string || !this.fromfile_prefix_chars.includes(arg_string[0])) {
+ new_arg_strings.push(arg_string)
+
+ // replace arguments referencing files with the file content
+ } else {
+ try {
+ let args_file = fs.readFileSync(arg_string.slice(1), 'utf8')
+ let arg_strings = []
+ for (let arg_line of splitlines(args_file)) {
+ for (let arg of this.convert_arg_line_to_args(arg_line)) {
+ arg_strings.push(arg)
+ }
+ }
+ arg_strings = this._read_args_from_files(arg_strings)
+ new_arg_strings = new_arg_strings.concat(arg_strings)
+ } catch (err) {
+ this.error(err.message)
+ }
+ }
+ }
+
+ // return the modified argument list
+ return new_arg_strings
+ }
+
+ convert_arg_line_to_args(arg_line) {
+ return [arg_line]
+ }
+
+ _match_argument(action, arg_strings_pattern) {
+ // match the pattern for this action to the arg strings
+ let nargs_pattern = this._get_nargs_pattern(action)
+ let match = arg_strings_pattern.match(new RegExp('^' + nargs_pattern))
+
+ // raise an exception if we weren't able to find a match
+ if (match === null) {
+ let nargs_errors = {
+ undefined: 'expected one argument',
+ [OPTIONAL]: 'expected at most one argument',
+ [ONE_OR_MORE]: 'expected at least one argument'
+ }
+ let msg = nargs_errors[action.nargs]
+ if (msg === undefined) {
+ msg = sub(action.nargs === 1 ? 'expected %s argument' : 'expected %s arguments', action.nargs)
+ }
+ throw new ArgumentError(action, msg)
+ }
+
+ // return the number of arguments matched
+ return match[1].length
+ }
+
+ _match_arguments_partial(actions, arg_strings_pattern) {
+ // progressively shorten the actions list by slicing off the
+ // final actions until we find a match
+ let result = []
+ for (let i of range(actions.length, 0, -1)) {
+ let actions_slice = actions.slice(0, i)
+ let pattern = actions_slice.map(action => this._get_nargs_pattern(action)).join('')
+ let match = arg_strings_pattern.match(new RegExp('^' + pattern))
+ if (match !== null) {
+ result = result.concat(match.slice(1).map(string => string.length))
+ break
+ }
+ }
+
+ // return the list of arg string counts
+ return result
+ }
+
+ _parse_optional(arg_string) {
+ // if it's an empty string, it was meant to be a positional
+ if (!arg_string) {
+ return undefined
+ }
+
+ // if it doesn't start with a prefix, it was meant to be positional
+ if (!this.prefix_chars.includes(arg_string[0])) {
+ return undefined
+ }
+
+ // if the option string is present in the parser, return the action
+ if (arg_string in this._option_string_actions) {
+ let action = this._option_string_actions[arg_string]
+ return [ action, arg_string, undefined ]
+ }
+
+ // if it's just a single character, it was meant to be positional
+ if (arg_string.length === 1) {
+ return undefined
+ }
+
+ // if the option string before the "=" is present, return the action
+ if (arg_string.includes('=')) {
+ let [ option_string, explicit_arg ] = _string_split(arg_string, '=', 1)
+ if (option_string in this._option_string_actions) {
+ let action = this._option_string_actions[option_string]
+ return [ action, option_string, explicit_arg ]
+ }
+ }
+
+ // search through all possible prefixes of the option string
+ // and all actions in the parser for possible interpretations
+ let option_tuples = this._get_option_tuples(arg_string)
+
+ // if multiple actions match, the option string was ambiguous
+ if (option_tuples.length > 1) {
+ let options = option_tuples.map(([ /*action*/, option_string/*, explicit_arg*/ ]) => option_string).join(', ')
+ let args = {option: arg_string, matches: options}
+ let msg = 'ambiguous option: %(option)s could match %(matches)s'
+ this.error(sub(msg, args))
+
+ // if exactly one action matched, this segmentation is good,
+ // so return the parsed action
+ } else if (option_tuples.length === 1) {
+ let [ option_tuple ] = option_tuples
+ return option_tuple
+ }
+
+ // if it was not found as an option, but it looks like a negative
+ // number, it was meant to be positional
+ // unless there are negative-number-like options
+ if (this._negative_number_matcher.test(arg_string)) {
+ if (!this._has_negative_number_optionals.length) {
+ return undefined
+ }
+ }
+
+ // if it contains a space, it was meant to be a positional
+ if (arg_string.includes(' ')) {
+ return undefined
+ }
+
+ // it was meant to be an optional but there is no such option
+ // in this parser (though it might be a valid option in a subparser)
+ return [ undefined, arg_string, undefined ]
+ }
+
+ _get_option_tuples(option_string) {
+ let result = []
+
+ // option strings starting with two prefix characters are only
+ // split at the '='
+ let chars = this.prefix_chars
+ if (chars.includes(option_string[0]) && chars.includes(option_string[1])) {
+ if (this.allow_abbrev) {
+ let option_prefix, explicit_arg
+ if (option_string.includes('=')) {
+ [ option_prefix, explicit_arg ] = _string_split(option_string, '=', 1)
+ } else {
+ option_prefix = option_string
+ explicit_arg = undefined
+ }
+ for (let option_string of Object.keys(this._option_string_actions)) {
+ if (option_string.startsWith(option_prefix)) {
+ let action = this._option_string_actions[option_string]
+ let tup = [ action, option_string, explicit_arg ]
+ result.push(tup)
+ }
+ }
+ }
+
+ // single character options can be concatenated with their arguments
+ // but multiple character options always have to have their argument
+ // separate
+ } else if (chars.includes(option_string[0]) && !chars.includes(option_string[1])) {
+ let option_prefix = option_string
+ let explicit_arg = undefined
+ let short_option_prefix = option_string.slice(0, 2)
+ let short_explicit_arg = option_string.slice(2)
+
+ for (let option_string of Object.keys(this._option_string_actions)) {
+ if (option_string === short_option_prefix) {
+ let action = this._option_string_actions[option_string]
+ let tup = [ action, option_string, short_explicit_arg ]
+ result.push(tup)
+ } else if (option_string.startsWith(option_prefix)) {
+ let action = this._option_string_actions[option_string]
+ let tup = [ action, option_string, explicit_arg ]
+ result.push(tup)
+ }
+ }
+
+ // shouldn't ever get here
+ } else {
+ this.error(sub('unexpected option string: %s', option_string))
+ }
+
+ // return the collected option tuples
+ return result
+ }
+
+ _get_nargs_pattern(action) {
+ // in all examples below, we have to allow for '--' args
+ // which are represented as '-' in the pattern
+ let nargs = action.nargs
+ let nargs_pattern
+
+ // the default (None) is assumed to be a single argument
+ if (nargs === undefined) {
+ nargs_pattern = '(-*A-*)'
+
+ // allow zero or one arguments
+ } else if (nargs === OPTIONAL) {
+ nargs_pattern = '(-*A?-*)'
+
+ // allow zero or more arguments
+ } else if (nargs === ZERO_OR_MORE) {
+ nargs_pattern = '(-*[A-]*)'
+
+ // allow one or more arguments
+ } else if (nargs === ONE_OR_MORE) {
+ nargs_pattern = '(-*A[A-]*)'
+
+ // allow any number of options or arguments
+ } else if (nargs === REMAINDER) {
+ nargs_pattern = '([-AO]*)'
+
+ // allow one argument followed by any number of options or arguments
+ } else if (nargs === PARSER) {
+ nargs_pattern = '(-*A[-AO]*)'
+
+ // suppress action, like nargs=0
+ } else if (nargs === SUPPRESS) {
+ nargs_pattern = '(-*-*)'
+
+ // all others should be integers
+ } else {
+ nargs_pattern = sub('(-*%s-*)', 'A'.repeat(nargs).split('').join('-*'))
+ }
+
+ // if this is an optional action, -- is not allowed
+ if (action.option_strings.length) {
+ nargs_pattern = nargs_pattern.replace(/-\*/g, '')
+ nargs_pattern = nargs_pattern.replace(/-/g, '')
+ }
+
+ // return the pattern
+ return nargs_pattern
+ }
+
+ // ========================
+ // Alt command line argument parsing, allowing free intermix
+ // ========================
+
+ parse_intermixed_args(args = undefined, namespace = undefined) {
+ let argv
+ [ args, argv ] = this.parse_known_intermixed_args(args, namespace)
+ if (argv.length) {
+ let msg = 'unrecognized arguments: %s'
+ this.error(sub(msg, argv.join(' ')))
+ }
+ return args
+ }
+
+ parse_known_intermixed_args(args = undefined, namespace = undefined) {
+ // returns a namespace and list of extras
+ //
+ // positional can be freely intermixed with optionals. optionals are
+ // first parsed with all positional arguments deactivated. The 'extras'
+ // are then parsed. If the parser definition is incompatible with the
+ // intermixed assumptions (e.g. use of REMAINDER, subparsers) a
+ // TypeError is raised.
+ //
+ // positionals are 'deactivated' by setting nargs and default to
+ // SUPPRESS. This blocks the addition of that positional to the
+ // namespace
+
+ let extras
+ let positionals = this._get_positional_actions()
+ let a = positionals.filter(action => [ PARSER, REMAINDER ].includes(action.nargs))
+ if (a.length) {
+ throw new TypeError(sub('parse_intermixed_args: positional arg' +
+ ' with nargs=%s', a[0].nargs))
+ }
+
+ for (let group of this._mutually_exclusive_groups) {
+ for (let action of group._group_actions) {
+ if (positionals.includes(action)) {
+ throw new TypeError('parse_intermixed_args: positional in' +
+ ' mutuallyExclusiveGroup')
+ }
+ }
+ }
+
+ let save_usage
+ try {
+ save_usage = this.usage
+ let remaining_args
+ try {
+ if (this.usage === undefined) {
+ // capture the full usage for use in error messages
+ this.usage = this.format_usage().slice(7)
+ }
+ for (let action of positionals) {
+ // deactivate positionals
+ action.save_nargs = action.nargs
+ // action.nargs = 0
+ action.nargs = SUPPRESS
+ action.save_default = action.default
+ action.default = SUPPRESS
+ }
+ [ namespace, remaining_args ] = this.parse_known_args(args,
+ namespace)
+ for (let action of positionals) {
+ // remove the empty positional values from namespace
+ let attr = getattr(namespace, action.dest)
+ if (Array.isArray(attr) && attr.length === 0) {
+ // eslint-disable-next-line no-console
+ console.warn(sub('Do not expect %s in %s', action.dest, namespace))
+ delattr(namespace, action.dest)
+ }
+ }
+ } finally {
+ // restore nargs and usage before exiting
+ for (let action of positionals) {
+ action.nargs = action.save_nargs
+ action.default = action.save_default
+ }
+ }
+ let optionals = this._get_optional_actions()
+ try {
+ // parse positionals. optionals aren't normally required, but
+ // they could be, so make sure they aren't.
+ for (let action of optionals) {
+ action.save_required = action.required
+ action.required = false
+ }
+ for (let group of this._mutually_exclusive_groups) {
+ group.save_required = group.required
+ group.required = false
+ }
+ [ namespace, extras ] = this.parse_known_args(remaining_args,
+ namespace)
+ } finally {
+ // restore parser values before exiting
+ for (let action of optionals) {
+ action.required = action.save_required
+ }
+ for (let group of this._mutually_exclusive_groups) {
+ group.required = group.save_required
+ }
+ }
+ } finally {
+ this.usage = save_usage
+ }
+ return [ namespace, extras ]
+ }
+
+ // ========================
+ // Value conversion methods
+ // ========================
+ _get_values(action, arg_strings) {
+ // for everything but PARSER, REMAINDER args, strip out first '--'
+ if (![PARSER, REMAINDER].includes(action.nargs)) {
+ try {
+ _array_remove(arg_strings, '--')
+ } catch (err) {}
+ }
+
+ let value
+ // optional argument produces a default when not present
+ if (!arg_strings.length && action.nargs === OPTIONAL) {
+ if (action.option_strings.length) {
+ value = action.const
+ } else {
+ value = action.default
+ }
+ if (typeof value === 'string') {
+ value = this._get_value(action, value)
+ this._check_value(action, value)
+ }
+
+ // when nargs='*' on a positional, if there were no command-line
+ // args, use the default if it is anything other than None
+ } else if (!arg_strings.length && action.nargs === ZERO_OR_MORE &&
+ !action.option_strings.length) {
+ if (action.default !== undefined) {
+ value = action.default
+ } else {
+ value = arg_strings
+ }
+ this._check_value(action, value)
+
+ // single argument or optional argument produces a single value
+ } else if (arg_strings.length === 1 && [undefined, OPTIONAL].includes(action.nargs)) {
+ let arg_string = arg_strings[0]
+ value = this._get_value(action, arg_string)
+ this._check_value(action, value)
+
+ // REMAINDER arguments convert all values, checking none
+ } else if (action.nargs === REMAINDER) {
+ value = arg_strings.map(v => this._get_value(action, v))
+
+ // PARSER arguments convert all values, but check only the first
+ } else if (action.nargs === PARSER) {
+ value = arg_strings.map(v => this._get_value(action, v))
+ this._check_value(action, value[0])
+
+ // SUPPRESS argument does not put anything in the namespace
+ } else if (action.nargs === SUPPRESS) {
+ value = SUPPRESS
+
+ // all other types of nargs produce a list
+ } else {
+ value = arg_strings.map(v => this._get_value(action, v))
+ for (let v of value) {
+ this._check_value(action, v)
+ }
+ }
+
+ // return the converted value
+ return value
+ }
+
+ _get_value(action, arg_string) {
+ let type_func = this._registry_get('type', action.type, action.type)
+ if (typeof type_func !== 'function') {
+ let msg = '%r is not callable'
+ throw new ArgumentError(action, sub(msg, type_func))
+ }
+
+ // convert the value to the appropriate type
+ let result
+ try {
+ try {
+ result = type_func(arg_string)
+ } catch (err) {
+ // Dear TC39, why would you ever consider making es6 classes not callable?
+ // We had one universal interface, [[Call]], which worked for anything
+ // (with familiar this-instanceof guard for classes). Now we have two.
+ if (err instanceof TypeError &&
+ /Class constructor .* cannot be invoked without 'new'/.test(err.message)) {
+ // eslint-disable-next-line new-cap
+ result = new type_func(arg_string)
+ } else {
+ throw err
+ }
+ }
+
+ } catch (err) {
+ // ArgumentTypeErrors indicate errors
+ if (err instanceof ArgumentTypeError) {
+ //let name = getattr(action.type, 'name', repr(action.type))
+ let msg = err.message
+ throw new ArgumentError(action, msg)
+
+ // TypeErrors or ValueErrors also indicate errors
+ } else if (err instanceof TypeError) {
+ let name = getattr(action.type, 'name', repr(action.type))
+ let args = {type: name, value: arg_string}
+ let msg = 'invalid %(type)s value: %(value)r'
+ throw new ArgumentError(action, sub(msg, args))
+ } else {
+ throw err
+ }
+ }
+
+ // return the converted value
+ return result
+ }
+
+ _check_value(action, value) {
+ // converted value must be one of the choices (if specified)
+ if (action.choices !== undefined && !_choices_to_array(action.choices).includes(value)) {
+ let args = {value,
+ choices: _choices_to_array(action.choices).map(repr).join(', ')}
+ let msg = 'invalid choice: %(value)r (choose from %(choices)s)'
+ throw new ArgumentError(action, sub(msg, args))
+ }
+ }
+
+ // =======================
+ // Help-formatting methods
+ // =======================
+ format_usage() {
+ let formatter = this._get_formatter()
+ formatter.add_usage(this.usage, this._actions,
+ this._mutually_exclusive_groups)
+ return formatter.format_help()
+ }
+
+ format_help() {
+ let formatter = this._get_formatter()
+
+ // usage
+ formatter.add_usage(this.usage, this._actions,
+ this._mutually_exclusive_groups)
+
+ // description
+ formatter.add_text(this.description)
+
+ // positionals, optionals and user-defined groups
+ for (let action_group of this._action_groups) {
+ formatter.start_section(action_group.title)
+ formatter.add_text(action_group.description)
+ formatter.add_arguments(action_group._group_actions)
+ formatter.end_section()
+ }
+
+ // epilog
+ formatter.add_text(this.epilog)
+
+ // determine help from format above
+ return formatter.format_help()
+ }
+
+ _get_formatter() {
+ // eslint-disable-next-line new-cap
+ return new this.formatter_class({ prog: this.prog })
+ }
+
+ // =====================
+ // Help-printing methods
+ // =====================
+ print_usage(file = undefined) {
+ if (file === undefined) file = process.stdout
+ this._print_message(this.format_usage(), file)
+ }
+
+ print_help(file = undefined) {
+ if (file === undefined) file = process.stdout
+ this._print_message(this.format_help(), file)
+ }
+
+ _print_message(message, file = undefined) {
+ if (message) {
+ if (file === undefined) file = process.stderr
+ file.write(message)
+ }
+ }
+
+ // ===============
+ // Exiting methods
+ // ===============
+ exit(status = 0, message = undefined) {
+ if (message) {
+ this._print_message(message, process.stderr)
+ }
+ process.exit(status)
+ }
+
+ error(message) {
+ /*
+ * error(message: string)
+ *
+ * Prints a usage message incorporating the message to stderr and
+ * exits.
+ *
+ * If you override this in a subclass, it should not return -- it
+ * should either exit or raise an exception.
+ */
+
+ // LEGACY (v1 compatibility), debug mode
+ if (this.debug === true) throw new Error(message)
+ // end
+ this.print_usage(process.stderr)
+ let args = {prog: this.prog, message: message}
+ this.exit(2, sub('%(prog)s: error: %(message)s\n', args))
+ }
+}))
+
+
+module.exports = {
+ ArgumentParser,
+ ArgumentError,
+ ArgumentTypeError,
+ BooleanOptionalAction,
+ FileType,
+ HelpFormatter,
+ ArgumentDefaultsHelpFormatter,
+ RawDescriptionHelpFormatter,
+ RawTextHelpFormatter,
+ MetavarTypeHelpFormatter,
+ Namespace,
+ Action,
+ ONE_OR_MORE,
+ OPTIONAL,
+ PARSER,
+ REMAINDER,
+ SUPPRESS,
+ ZERO_OR_MORE
+}
+
+// LEGACY (v1 compatibility), Const alias
+Object.defineProperty(module.exports, 'Const', {
+ get() {
+ let result = {}
+ Object.entries({ ONE_OR_MORE, OPTIONAL, PARSER, REMAINDER, SUPPRESS, ZERO_OR_MORE }).forEach(([ n, v ]) => {
+ Object.defineProperty(result, n, {
+ get() {
+ deprecate(n, sub('use argparse.%s instead of argparse.Const.%s', n, n))
+ return v
+ }
+ })
+ })
+ Object.entries({ _UNRECOGNIZED_ARGS_ATTR }).forEach(([ n, v ]) => {
+ Object.defineProperty(result, n, {
+ get() {
+ deprecate(n, sub('argparse.Const.%s is an internal symbol and will no longer be available', n))
+ return v
+ }
+ })
+ })
+ return result
+ },
+ enumerable: false
+})
+// end
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/sub.js b/tools/node_modules/eslint/node_modules/argparse/lib/sub.js
new file mode 100644
index 00000000000..e3eb3215fc1
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/argparse/lib/sub.js
@@ -0,0 +1,67 @@
+// Limited implementation of python % string operator, supports only %s and %r for now
+// (other formats are not used here, but may appear in custom templates)
+
+'use strict'
+
+const { inspect } = require('util')
+
+
+module.exports = function sub(pattern, ...values) {
+ let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g
+
+ let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
+ if (is_literal) return '%'
+
+ let padded_count = 0
+ if (is_padded) {
+ if (values.length === 0) throw new TypeError('not enough arguments for format string')
+ padded_count = values.shift()
+ if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
+ }
+
+ let str
+ if (name !== undefined) {
+ let dict = values[0]
+ if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
+ if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
+ str = dict[name]
+ } else {
+ if (values.length === 0) throw new TypeError('not enough arguments for format string')
+ str = values.shift()
+ }
+
+ switch (format) {
+ case 's':
+ str = String(str)
+ break
+ case 'r':
+ str = inspect(str)
+ break
+ case 'd':
+ case 'i':
+ if (typeof str !== 'number') {
+ throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
+ }
+ str = String(str.toFixed(0))
+ break
+ default:
+ throw new TypeError(`unsupported format character '${format}'`)
+ }
+
+ if (padded_count > 0) {
+ return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
+ } else {
+ return str
+ }
+ })
+
+ if (values.length) {
+ if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
+ // mapping
+ } else {
+ throw new TypeError('not all arguments converted during string formatting')
+ }
+ }
+
+ return result
+}
diff --git a/tools/node_modules/eslint/node_modules/argparse/lib/textwrap.js b/tools/node_modules/eslint/node_modules/argparse/lib/textwrap.js
new file mode 100644
index 00000000000..23d51cdb95c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/argparse/lib/textwrap.js
@@ -0,0 +1,440 @@
+// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
+// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py
+
+'use strict'
+
+/*
+ * Text wrapping and filling.
+ */
+
+// Copyright (C) 1999-2001 Gregory P. Ward.
+// Copyright (C) 2002, 2003 Python Software Foundation.
+// Copyright (C) 2020 argparse.js authors
+// Originally written by Greg Ward <gward@python.net>
+
+// Hardcode the recognized whitespace characters to the US-ASCII
+// whitespace characters. The main reason for doing this is that
+// some Unicode spaces (like \u00a0) are non-breaking whitespaces.
+//
+// This less funky little regex just split on recognized spaces. E.g.
+// "Hello there -- you goof-ball, use the -b option!"
+// splits into
+// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
+const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/
+
+class TextWrapper {
+ /*
+ * Object for wrapping/filling text. The public interface consists of
+ * the wrap() and fill() methods; the other methods are just there for
+ * subclasses to override in order to tweak the default behaviour.
+ * If you want to completely replace the main wrapping algorithm,
+ * you'll probably have to override _wrap_chunks().
+ *
+ * Several instance attributes control various aspects of wrapping:
+ * width (default: 70)
+ * the maximum width of wrapped lines (unless break_long_words
+ * is false)
+ * initial_indent (default: "")
+ * string that will be prepended to the first line of wrapped
+ * output. Counts towards the line's width.
+ * subsequent_indent (default: "")
+ * string that will be prepended to all lines save the first
+ * of wrapped output; also counts towards each line's width.
+ * expand_tabs (default: true)
+ * Expand tabs in input text to spaces before further processing.
+ * Each tab will become 0 .. 'tabsize' spaces, depending on its position
+ * in its line. If false, each tab is treated as a single character.
+ * tabsize (default: 8)
+ * Expand tabs in input text to 0 .. 'tabsize' spaces, unless
+ * 'expand_tabs' is false.
+ * replace_whitespace (default: true)
+ * Replace all whitespace characters in the input text by spaces
+ * after tab expansion. Note that if expand_tabs is false and
+ * replace_whitespace is true, every tab will be converted to a
+ * single space!
+ * fix_sentence_endings (default: false)
+ * Ensure that sentence-ending punctuation is always followed
+ * by two spaces. Off by default because the algorithm is
+ * (unavoidably) imperfect.
+ * break_long_words (default: true)
+ * Break words longer than 'width'. If false, those words will not
+ * be broken, and some lines might be longer than 'width'.
+ * break_on_hyphens (default: true)
+ * Allow breaking hyphenated words. If true, wrapping will occur
+ * preferably on whitespaces and right after hyphens part of
+ * compound words.
+ * drop_whitespace (default: true)
+ * Drop leading and trailing whitespace from lines.
+ * max_lines (default: None)
+ * Truncate wrapped lines.
+ * placeholder (default: ' [...]')
+ * Append to the last line of truncated text.
+ */
+
+ constructor(options = {}) {
+ let {
+ width = 70,
+ initial_indent = '',
+ subsequent_indent = '',
+ expand_tabs = true,
+ replace_whitespace = true,
+ fix_sentence_endings = false,
+ break_long_words = true,
+ drop_whitespace = true,
+ break_on_hyphens = true,
+ tabsize = 8,
+ max_lines = undefined,
+ placeholder=' [...]'
+ } = options
+
+ this.width = width
+ this.initial_indent = initial_indent
+ this.subsequent_indent = subsequent_indent
+ this.expand_tabs = expand_tabs
+ this.replace_whitespace = replace_whitespace
+ this.fix_sentence_endings = fix_sentence_endings
+ this.break_long_words = break_long_words
+ this.drop_whitespace = drop_whitespace
+ this.break_on_hyphens = break_on_hyphens
+ this.tabsize = tabsize
+ this.max_lines = max_lines
+ this.placeholder = placeholder
+ }
+
+
+ // -- Private methods -----------------------------------------------
+ // (possibly useful for subclasses to override)
+
+ _munge_whitespace(text) {
+ /*
+ * _munge_whitespace(text : string) -> string
+ *
+ * Munge whitespace in text: expand tabs and convert all other
+ * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
+ * becomes " foo bar baz".
+ */
+ if (this.expand_tabs) {
+ text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
+ }
+ if (this.replace_whitespace) {
+ text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
+ }
+ return text
+ }
+
+ _split(text) {
+ /*
+ * _split(text : string) -> [string]
+ *
+ * Split the text to wrap into indivisible chunks. Chunks are
+ * not quite the same as words; see _wrap_chunks() for full
+ * details. As an example, the text
+ * Look, goof-ball -- use the -b option!
+ * breaks into the following chunks:
+ * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
+ * 'use', ' ', 'the', ' ', '-b', ' ', 'option!'
+ * if break_on_hyphens is True, or in:
+ * 'Look,', ' ', 'goof-ball', ' ', '--', ' ',
+ * 'use', ' ', 'the', ' ', '-b', ' ', option!'
+ * otherwise.
+ */
+ let chunks = text.split(wordsep_simple_re)
+ chunks = chunks.filter(Boolean)
+ return chunks
+ }
+
+ _handle_long_word(reversed_chunks, cur_line, cur_len, width) {
+ /*
+ * _handle_long_word(chunks : [string],
+ * cur_line : [string],
+ * cur_len : int, width : int)
+ *
+ * Handle a chunk of text (most likely a word, not whitespace) that
+ * is too long to fit in any line.
+ */
+ // Figure out when indent is larger than the specified width, and make
+ // sure at least one character is stripped off on every pass
+ let space_left
+ if (width < 1) {
+ space_left = 1
+ } else {
+ space_left = width - cur_len
+ }
+
+ // If we're allowed to break long words, then do so: put as much
+ // of the next chunk onto the current line as will fit.
+ if (this.break_long_words) {
+ cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
+ reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)
+
+ // Otherwise, we have to preserve the long word intact. Only add
+ // it to the current line if there's nothing already there --
+ // that minimizes how much we violate the width constraint.
+ } else if (!cur_line) {
+ cur_line.push(...reversed_chunks.pop())
+ }
+
+ // If we're not allowed to break long words, and there's already
+ // text on the current line, do nothing. Next time through the
+ // main loop of _wrap_chunks(), we'll wind up here again, but
+ // cur_len will be zero, so the next line will be entirely
+ // devoted to the long word that we can't handle right now.
+ }
+
+ _wrap_chunks(chunks) {
+ /*
+ * _wrap_chunks(chunks : [string]) -> [string]
+ *
+ * Wrap a sequence of text chunks and return a list of lines of
+ * length 'self.width' or less. (If 'break_long_words' is false,
+ * some lines may be longer than this.) Chunks correspond roughly
+ * to words and the whitespace between them: each chunk is
+ * indivisible (modulo 'break_long_words'), but a line break can
+ * come between any two chunks. Chunks should not have internal
+ * whitespace; ie. a chunk is either all whitespace or a "word".
+ * Whitespace chunks will be removed from the beginning and end of
+ * lines, but apart from that whitespace is preserved.
+ */
+ let lines = []
+ let indent
+ if (this.width <= 0) {
+ throw Error(`invalid width ${this.width} (must be > 0)`)
+ }
+ if (this.max_lines !== undefined) {
+ if (this.max_lines > 1) {
+ indent = this.subsequent_indent
+ } else {
+ indent = this.initial_indent
+ }
+ if (indent.length + this.placeholder.trimStart().length > this.width) {
+ throw Error('placeholder too large for max width')
+ }
+ }
+
+ // Arrange in reverse order so items can be efficiently popped
+ // from a stack of chucks.
+ chunks = chunks.reverse()
+
+ while (chunks.length > 0) {
+
+ // Start the list of chunks that will make up the current line.
+ // cur_len is just the length of all the chunks in cur_line.
+ let cur_line = []
+ let cur_len = 0
+
+ // Figure out which static string will prefix this line.
+ let indent
+ if (lines) {
+ indent = this.subsequent_indent
+ } else {
+ indent = this.initial_indent
+ }
+
+ // Maximum width for this line.
+ let width = this.width - indent.length
+
+ // First chunk on line is whitespace -- drop it, unless this
+ // is the very beginning of the text (ie. no lines started yet).
+ if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
+ chunks.pop()
+ }
+
+ while (chunks.length > 0) {
+ let l = chunks[chunks.length - 1].length
+
+ // Can at least squeeze this chunk onto the current line.
+ if (cur_len + l <= width) {
+ cur_line.push(chunks.pop())
+ cur_len += l
+
+ // Nope, this line is full.
+ } else {
+ break
+ }
+ }
+
+ // The current line is full, and the next chunk is too big to
+ // fit on *any* line (not just this one).
+ if (chunks.length && chunks[chunks.length - 1].length > width) {
+ this._handle_long_word(chunks, cur_line, cur_len, width)
+ cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
+ }
+
+ // If the last chunk on this line is all whitespace, drop it.
+ if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
+ cur_len -= cur_line[cur_line.length - 1].length
+ cur_line.pop()
+ }
+
+ if (cur_line) {
+ if (this.max_lines === undefined ||
+ lines.length + 1 < this.max_lines ||
+ (chunks.length === 0 ||
+ this.drop_whitespace &&
+ chunks.length === 1 &&
+ !chunks[0].trim()) && cur_len <= width) {
+ // Convert current line back to a string and store it in
+ // list of all lines (return value).
+ lines.push(indent + cur_line.join(''))
+ } else {
+ let had_break = false
+ while (cur_line) {
+ if (cur_line[cur_line.length - 1].trim() &&
+ cur_len + this.placeholder.length <= width) {
+ cur_line.push(this.placeholder)
+ lines.push(indent + cur_line.join(''))
+ had_break = true
+ break
+ }
+ cur_len -= cur_line[-1].length
+ cur_line.pop()
+ }
+ if (!had_break) {
+ if (lines) {
+ let prev_line = lines[lines.length - 1].trimEnd()
+ if (prev_line.length + this.placeholder.length <=
+ this.width) {
+ lines[lines.length - 1] = prev_line + this.placeholder
+ break
+ }
+ }
+ lines.push(indent + this.placeholder.lstrip())
+ }
+ break
+ }
+ }
+ }
+
+ return lines
+ }
+
+ _split_chunks(text) {
+ text = this._munge_whitespace(text)
+ return this._split(text)
+ }
+
+ // -- Public interface ----------------------------------------------
+
+ wrap(text) {
+ /*
+ * wrap(text : string) -> [string]
+ *
+ * Reformat the single paragraph in 'text' so it fits in lines of
+ * no more than 'self.width' columns, and return a list of wrapped
+ * lines. Tabs in 'text' are expanded with string.expandtabs(),
+ * and all other whitespace characters (including newline) are
+ * converted to space.
+ */
+ let chunks = this._split_chunks(text)
+ // not implemented in js
+ //if (this.fix_sentence_endings) {
+ // this._fix_sentence_endings(chunks)
+ //}
+ return this._wrap_chunks(chunks)
+ }
+
+ fill(text) {
+ /*
+ * fill(text : string) -> string
+ *
+ * Reformat the single paragraph in 'text' to fit in lines of no
+ * more than 'self.width' columns, and return a new string
+ * containing the entire wrapped paragraph.
+ */
+ return this.wrap(text).join('\n')
+ }
+}
+
+
+// -- Convenience interface ---------------------------------------------
+
+function wrap(text, options = {}) {
+ /*
+ * Wrap a single paragraph of text, returning a list of wrapped lines.
+ *
+ * Reformat the single paragraph in 'text' so it fits in lines of no
+ * more than 'width' columns, and return a list of wrapped lines. By
+ * default, tabs in 'text' are expanded with string.expandtabs(), and
+ * all other whitespace characters (including newline) are converted to
+ * space. See TextWrapper class for available keyword args to customize
+ * wrapping behaviour.
+ */
+ let { width = 70, ...kwargs } = options
+ let w = new TextWrapper(Object.assign({ width }, kwargs))
+ return w.wrap(text)
+}
+
+function fill(text, options = {}) {
+ /*
+ * Fill a single paragraph of text, returning a new string.
+ *
+ * Reformat the single paragraph in 'text' to fit in lines of no more
+ * than 'width' columns, and return a new string containing the entire
+ * wrapped paragraph. As with wrap(), tabs are expanded and other
+ * whitespace characters converted to space. See TextWrapper class for
+ * available keyword args to customize wrapping behaviour.
+ */
+ let { width = 70, ...kwargs } = options
+ let w = new TextWrapper(Object.assign({ width }, kwargs))
+ return w.fill(text)
+}
+
+// -- Loosely related functionality -------------------------------------
+
+let _whitespace_only_re = /^[ \t]+$/mg
+let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg
+
+function dedent(text) {
+ /*
+ * Remove any common leading whitespace from every line in `text`.
+ *
+ * This can be used to make triple-quoted strings line up with the left
+ * edge of the display, while still presenting them in the source code
+ * in indented form.
+ *
+ * Note that tabs and spaces are both treated as whitespace, but they
+ * are not equal: the lines " hello" and "\\thello" are
+ * considered to have no common leading whitespace.
+ *
+ * Entirely blank lines are normalized to a newline character.
+ */
+ // Look for the longest leading string of spaces and tabs common to
+ // all lines.
+ let margin = undefined
+ text = text.replace(_whitespace_only_re, '')
+ let indents = text.match(_leading_whitespace_re) || []
+ for (let indent of indents) {
+ indent = indent.slice(0, -1)
+
+ if (margin === undefined) {
+ margin = indent
+
+ // Current line more deeply indented than previous winner:
+ // no change (previous winner is still on top).
+ } else if (indent.startsWith(margin)) {
+ // pass
+
+ // Current line consistent with and no deeper than previous winner:
+ // it's the new winner.
+ } else if (margin.startsWith(indent)) {
+ margin = indent
+
+ // Find the largest common whitespace between current line and previous
+ // winner.
+ } else {
+ for (let i = 0; i < margin.length && i < indent.length; i++) {
+ if (margin[i] !== indent[i]) {
+ margin = margin.slice(0, i)
+ break
+ }
+ }
+ }
+ }
+
+ if (margin) {
+ text = text.replace(new RegExp('^' + margin, 'mg'), '')
+ }
+ return text
+}
+
+module.exports = { wrap, fill, dedent }
diff --git a/tools/node_modules/eslint/node_modules/argparse/package.json b/tools/node_modules/eslint/node_modules/argparse/package.json
index 62fba0a9fcf..647d2aff18d 100644
--- a/tools/node_modules/eslint/node_modules/argparse/package.json
+++ b/tools/node_modules/eslint/node_modules/argparse/package.json
@@ -1,7 +1,7 @@
{
"name": "argparse",
- "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
- "version": "1.0.10",
+ "description": "CLI arguments parser. Native port of python's argparse.",
+ "version": "2.0.1",
"keywords": [
"cli",
"parser",
@@ -9,26 +9,23 @@
"option",
"args"
],
- "contributors": [
- "Eugene Shkuropat",
- "Paul Jacobson"
- ],
+ "main": "argparse.js",
"files": [
- "index.js",
+ "argparse.js",
"lib/"
],
- "license": "MIT",
+ "license": "Python-2.0",
"repository": "nodeca/argparse",
"scripts": {
- "test": "make test"
- },
- "dependencies": {
- "sprintf-js": "~1.0.2"
+ "lint": "eslint .",
+ "test": "npm run lint && nyc mocha",
+ "coverage": "npm run test && nyc report --reporter html"
},
"devDependencies": {
- "eslint": "^2.13.1",
- "istanbul": "^0.4.5",
- "mocha": "^3.1.0",
- "ndoc": "^5.0.1"
+ "@babel/eslint-parser": "^7.11.0",
+ "@babel/plugin-syntax-class-properties": "^7.10.4",
+ "eslint": "^7.5.0",
+ "mocha": "^8.0.1",
+ "nyc": "^15.1.0"
}
}
diff --git a/tools/node_modules/eslint/node_modules/astral-regex/index.js b/tools/node_modules/eslint/node_modules/astral-regex/index.js
deleted file mode 100644
index 651177d40f1..00000000000
--- a/tools/node_modules/eslint/node_modules/astral-regex/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
-
-const astralRegex = options => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g');
-
-module.exports = astralRegex;
diff --git a/tools/node_modules/eslint/node_modules/astral-regex/license b/tools/node_modules/eslint/node_modules/astral-regex/license
deleted file mode 100644
index db6bc32cc7c..00000000000
--- a/tools/node_modules/eslint/node_modules/astral-regex/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Kevin MĆ„rtensson <kevinmartensson@gmail.com> (github.com/kevva)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tools/node_modules/eslint/node_modules/astral-regex/package.json b/tools/node_modules/eslint/node_modules/astral-regex/package.json
deleted file mode 100644
index d1ceea7f3ad..00000000000
--- a/tools/node_modules/eslint/node_modules/astral-regex/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "astral-regex",
- "version": "2.0.0",
- "description": "Regular expression for matching astral symbols",
- "license": "MIT",
- "repository": "kevva/astral-regex",
- "author": {
- "name": "Kevin MĆ„rtensson",
- "email": "kevinmartensson@gmail.com",
- "url": "github.com/kevva"
- },
- "engines": {
- "node": ">=8"
- },
- "scripts": {
- "test": "xo && ava && tsd"
- },
- "files": [
- "index.js",
- "index.d.ts"
- ],
- "keywords": [
- "astral",
- "emoji",
- "regex",
- "surrogate"
- ],
- "devDependencies": {
- "ava": "^1.4.1",
- "tsd": "^0.7.2",
- "xo": "^0.24.0"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/astral-regex/readme.md b/tools/node_modules/eslint/node_modules/astral-regex/readme.md
deleted file mode 100644
index 89d6659a41f..00000000000
--- a/tools/node_modules/eslint/node_modules/astral-regex/readme.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex)
-
-> Regular expression for matching [astral symbols](https://everything2.com/title/astral+plane)
-
-
-## Install
-
-```
-$ npm install astral-regex
-```
-
-
-## Usage
-
-```js
-const astralRegex = require('astral-regex');
-
-astralRegex({exact: true}).test('šŸ¦„');
-//=> true
-
-'foo šŸ¦„ šŸ’© bar'.match(astralRegex());
-//=> ['šŸ¦„', 'šŸ’©']
-```
-
-
-## API
-
-### astralRegex([options])
-
-Returns a `RegExp` for matching astral symbols.
-
-#### options
-
-Type: `Object`
-
-##### exact
-
-Type: `boolean`<br>
-Default: `false` *(Matches any astral symbols in a string)*
-
-Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol.
-
-
-## License
-
-MIT Ā© [Kevin MĆ„rtensson](https://github.com/kevva)
diff --git a/tools/node_modules/eslint/node_modules/deep-is/package.json b/tools/node_modules/eslint/node_modules/deep-is/package.json
index 63628f0d015..dae72d7873e 100644
--- a/tools/node_modules/eslint/node_modules/deep-is/package.json
+++ b/tools/node_modules/eslint/node_modules/deep-is/package.json
@@ -1,6 +1,6 @@
{
"name": "deep-is",
- "version": "0.1.3",
+ "version": "0.1.4",
"description": "node's assert.deepEqual algorithm except for NaN being equal to NaN",
"main": "index.js",
"directories": {
@@ -28,10 +28,7 @@
"email": "thlorenz@gmx.de",
"url": "http://thlorenz.com"
},
- "license": {
- "type": "MIT",
- "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE"
- },
+ "license": "MIT",
"testling": {
"files": "test/*.js",
"browsers": {
diff --git a/tools/node_modules/eslint/node_modules/emoji-regex/LICENSE-MIT.txt b/tools/node_modules/eslint/node_modules/emoji-regex/LICENSE-MIT.txt
deleted file mode 100644
index a41e0a7ef97..00000000000
--- a/tools/node_modules/eslint/node_modules/emoji-regex/LICENSE-MIT.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright Mathias Bynens <https://mathiasbynens.be/>
-
-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/tools/node_modules/eslint/node_modules/emoji-regex/README.md b/tools/node_modules/eslint/node_modules/emoji-regex/README.md
deleted file mode 100644
index f10e1733350..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/index.js
deleted file mode 100644
index b4cf3dcd389..00000000000
--- a/tools/node_modules/eslint/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{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}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\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}]|[\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/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js b/tools/node_modules/eslint/node_modules/emoji-regex/es2015/text.js
deleted file mode 100644
index 780309df58f..00000000000
--- a/tools/node_modules/eslint/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}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\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}]|[\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/tools/node_modules/eslint/node_modules/emoji-regex/index.js b/tools/node_modules/eslint/node_modules/emoji-regex/index.js
deleted file mode 100644
index d993a3a99cb..00000000000
--- a/tools/node_modules/eslint/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\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-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\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\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/tools/node_modules/eslint/node_modules/emoji-regex/package.json b/tools/node_modules/eslint/node_modules/emoji-regex/package.json
deleted file mode 100644
index 6d323528292..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/emoji-regex/text.js b/tools/node_modules/eslint/node_modules/emoji-regex/text.js
deleted file mode 100644
index 0a55ce2f230..00000000000
--- a/tools/node_modules/eslint/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-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\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\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/tools/node_modules/eslint/node_modules/eslint-scope/README.md b/tools/node_modules/eslint/node_modules/eslint-scope/README.md
index 7e7ce0d345c..4ad41d5c1e4 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/README.md
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/README.md
@@ -2,35 +2,47 @@
ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope).
-## Usage
-
-Install:
+## Install
```
npm i eslint-scope --save
```
+## šŸ“– Usage
+
+To use in an ESM file:
+
+```js
+import * as eslintScope from 'eslint-scope';
+```
+
+To use in a CommonJS file:
+
+```js
+const eslintScope = require('eslint-scope');
+```
+
Example:
```js
-var eslintScope = require('eslint-scope');
-var espree = require('espree');
-var estraverse = require('estraverse');
+import * as eslintScope from 'eslint-scope';
+import * as espree from 'espree';
+import estraverse from 'estraverse';
-var ast = espree.parse(code);
-var scopeManager = eslintScope.analyze(ast);
+const ast = espree.parse(code, { range: true });
+const scopeManager = eslintScope.analyze(ast);
-var currentScope = scopeManager.acquire(ast); // global scope
+const currentScope = scopeManager.acquire(ast); // global scope
estraverse.traverse(ast, {
- enter: function(node, parent) {
+ enter (node, parent) {
// do stuff
if (/Function/.test(node.type)) {
currentScope = scopeManager.acquire(node); // get current function scope
}
},
- leave: function(node, parent) {
+ leave(node, parent) {
if (/Function/.test(node.type)) {
currentScope = currentScope.upper; // set to parent scope
}
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/dist/eslint-scope.cjs b/tools/node_modules/eslint/node_modules/eslint-scope/dist/eslint-scope.cjs
new file mode 100644
index 00000000000..5b00bc8bf4a
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/dist/eslint-scope.cjs
@@ -0,0 +1,2213 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var assert = require('assert');
+var estraverse = require('estraverse');
+var esrecurse = require('esrecurse');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
+var estraverse__default = /*#__PURE__*/_interopDefaultLegacy(estraverse);
+var esrecurse__default = /*#__PURE__*/_interopDefaultLegacy(esrecurse);
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const READ = 0x1;
+const WRITE = 0x2;
+const RW = READ | WRITE;
+
+/**
+ * A Reference represents a single occurrence of an identifier in code.
+ * @constructor Reference
+ */
+class Reference {
+ constructor(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
+
+ /**
+ * Identifier syntax node.
+ * @member {espreeIdentifier} Reference#identifier
+ */
+ this.identifier = ident;
+
+ /**
+ * Reference to the enclosing Scope.
+ * @member {Scope} Reference#from
+ */
+ this.from = scope;
+
+ /**
+ * Whether the reference comes from a dynamic scope (such as 'eval',
+ * 'with', etc.), and may be trapped by dynamic scopes.
+ * @member {boolean} Reference#tainted
+ */
+ this.tainted = false;
+
+ /**
+ * The variable this reference is resolved with.
+ * @member {Variable} Reference#resolved
+ */
+ this.resolved = null;
+
+ /**
+ * The read-write mode of the reference. (Value is one of {@link
+ * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
+ * @member {number} Reference#flag
+ * @private
+ */
+ this.flag = flag;
+ if (this.isWrite()) {
+
+ /**
+ * If reference is writeable, this is the tree being written to it.
+ * @member {espreeNode} Reference#writeExpr
+ */
+ this.writeExpr = writeExpr;
+
+ /**
+ * Whether the Reference might refer to a partial value of writeExpr.
+ * @member {boolean} Reference#partial
+ */
+ this.partial = partial;
+
+ /**
+ * Whether the Reference is to write of initialization.
+ * @member {boolean} Reference#init
+ */
+ this.init = init;
+ }
+ this.__maybeImplicitGlobal = maybeImplicitGlobal;
+ }
+
+ /**
+ * Whether the reference is static.
+ * @function Reference#isStatic
+ * @returns {boolean} static
+ */
+ isStatic() {
+ return !this.tainted && this.resolved && this.resolved.scope.isStatic();
+ }
+
+ /**
+ * Whether the reference is writeable.
+ * @function Reference#isWrite
+ * @returns {boolean} write
+ */
+ isWrite() {
+ return !!(this.flag & Reference.WRITE);
+ }
+
+ /**
+ * Whether the reference is readable.
+ * @function Reference#isRead
+ * @returns {boolean} read
+ */
+ isRead() {
+ return !!(this.flag & Reference.READ);
+ }
+
+ /**
+ * Whether the reference is read-only.
+ * @function Reference#isReadOnly
+ * @returns {boolean} read only
+ */
+ isReadOnly() {
+ return this.flag === Reference.READ;
+ }
+
+ /**
+ * Whether the reference is write-only.
+ * @function Reference#isWriteOnly
+ * @returns {boolean} write only
+ */
+ isWriteOnly() {
+ return this.flag === Reference.WRITE;
+ }
+
+ /**
+ * Whether the reference is read-write.
+ * @function Reference#isReadWrite
+ * @returns {boolean} read write
+ */
+ isReadWrite() {
+ return this.flag === Reference.RW;
+ }
+}
+
+/**
+ * @constant Reference.READ
+ * @private
+ */
+Reference.READ = READ;
+
+/**
+ * @constant Reference.WRITE
+ * @private
+ */
+Reference.WRITE = WRITE;
+
+/**
+ * @constant Reference.RW
+ * @private
+ */
+Reference.RW = RW;
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * A Variable represents a locally scoped identifier. These include arguments to
+ * functions.
+ * @constructor Variable
+ */
+class Variable {
+ constructor(name, scope) {
+
+ /**
+ * The variable name, as given in the source code.
+ * @member {string} Variable#name
+ */
+ this.name = name;
+
+ /**
+ * List of defining occurrences of this variable (like in 'var ...'
+ * statements or as parameter), as AST nodes.
+ * @member {espree.Identifier[]} Variable#identifiers
+ */
+ this.identifiers = [];
+
+ /**
+ * List of {@link Reference|references} of this variable (excluding parameter entries)
+ * in its defining scope and all nested scopes. For defining
+ * occurrences only see {@link Variable#defs}.
+ * @member {Reference[]} Variable#references
+ */
+ this.references = [];
+
+ /**
+ * List of defining occurrences of this variable (like in 'var ...'
+ * statements or as parameter), as custom objects.
+ * @member {Definition[]} Variable#defs
+ */
+ this.defs = [];
+
+ this.tainted = false;
+
+ /**
+ * Whether this is a stack variable.
+ * @member {boolean} Variable#stack
+ */
+ this.stack = true;
+
+ /**
+ * Reference to the enclosing Scope.
+ * @member {Scope} Variable#scope
+ */
+ this.scope = scope;
+ }
+}
+
+Variable.CatchClause = "CatchClause";
+Variable.Parameter = "Parameter";
+Variable.FunctionName = "FunctionName";
+Variable.ClassName = "ClassName";
+Variable.Variable = "Variable";
+Variable.ImportBinding = "ImportBinding";
+Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * @constructor Definition
+ */
+class Definition {
+ constructor(type, name, node, parent, index, kind) {
+
+ /**
+ * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
+ */
+ this.type = type;
+
+ /**
+ * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
+ */
+ this.name = name;
+
+ /**
+ * @member {espree.Node} Definition#node - the enclosing node of the identifier.
+ */
+ this.node = node;
+
+ /**
+ * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
+ */
+ this.parent = parent;
+
+ /**
+ * @member {number?} Definition#index - the index in the declaration statement.
+ */
+ this.index = index;
+
+ /**
+ * @member {string?} Definition#kind - the kind of the declaration statement.
+ */
+ this.kind = kind;
+ }
+}
+
+/**
+ * @constructor ParameterDefinition
+ */
+class ParameterDefinition extends Definition {
+ constructor(name, node, index, rest) {
+ super(Variable.Parameter, name, node, null, index, null);
+
+ /**
+ * Whether the parameter definition is a part of a rest parameter.
+ * @member {boolean} ParameterDefinition#rest
+ */
+ this.rest = rest;
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax: Syntax$2 } = estraverse__default['default'];
+
+/**
+ * Test if scope is struct
+ * @param {Scope} scope scope
+ * @param {Block} block block
+ * @param {boolean} isMethodDefinition is method definition
+ * @param {boolean} useDirective use directive
+ * @returns {boolean} is strict scope
+ */
+function isStrictScope(scope, block, isMethodDefinition, useDirective) {
+ let body;
+
+ // When upper scope is exists and strict, inner scope is also strict.
+ if (scope.upper && scope.upper.isStrict) {
+ return true;
+ }
+
+ if (isMethodDefinition) {
+ return true;
+ }
+
+ if (scope.type === "class" || scope.type === "module") {
+ return true;
+ }
+
+ if (scope.type === "block" || scope.type === "switch") {
+ return false;
+ }
+
+ if (scope.type === "function") {
+ if (block.type === Syntax$2.ArrowFunctionExpression && block.body.type !== Syntax$2.BlockStatement) {
+ return false;
+ }
+
+ if (block.type === Syntax$2.Program) {
+ body = block;
+ } else {
+ body = block.body;
+ }
+
+ if (!body) {
+ return false;
+ }
+ } else if (scope.type === "global") {
+ body = block;
+ } else {
+ return false;
+ }
+
+ // Search 'use strict' directive.
+ if (useDirective) {
+ for (let i = 0, iz = body.body.length; i < iz; ++i) {
+ const stmt = body.body[i];
+
+ if (stmt.type !== Syntax$2.DirectiveStatement) {
+ break;
+ }
+ if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") {
+ return true;
+ }
+ }
+ } else {
+ for (let i = 0, iz = body.body.length; i < iz; ++i) {
+ const stmt = body.body[i];
+
+ if (stmt.type !== Syntax$2.ExpressionStatement) {
+ break;
+ }
+ const expr = stmt.expression;
+
+ if (expr.type !== Syntax$2.Literal || typeof expr.value !== "string") {
+ break;
+ }
+ if (expr.raw !== null && expr.raw !== undefined) {
+ if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") {
+ return true;
+ }
+ } else {
+ if (expr.value === "use strict") {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+/**
+ * Register scope
+ * @param {ScopeManager} scopeManager scope manager
+ * @param {Scope} scope scope
+ * @returns {void}
+ */
+function registerScope(scopeManager, scope) {
+ scopeManager.scopes.push(scope);
+
+ const scopes = scopeManager.__nodeToScope.get(scope.block);
+
+ if (scopes) {
+ scopes.push(scope);
+ } else {
+ scopeManager.__nodeToScope.set(scope.block, [scope]);
+ }
+}
+
+/**
+ * Should be statically
+ * @param {Object} def def
+ * @returns {boolean} should be statically
+ */
+function shouldBeStatically(def) {
+ return (
+ (def.type === Variable.ClassName) ||
+ (def.type === Variable.Variable && def.parent.kind !== "var")
+ );
+}
+
+/**
+ * @constructor Scope
+ */
+class Scope {
+ constructor(scopeManager, type, upperScope, block, isMethodDefinition) {
+
+ /**
+ * One of 'module', 'block', 'switch', 'function', 'catch', 'with', 'function', 'class', 'global'.
+ * @member {string} Scope#type
+ */
+ this.type = type;
+
+ /**
+ * The scoped {@link Variable}s of this scope, as <code>{ Variable.name
+ * : Variable }</code>.
+ * @member {Map} Scope#set
+ */
+ this.set = new Map();
+
+ /**
+ * The tainted variables of this scope, as <code>{ Variable.name :
+ * boolean }</code>.
+ * @member {Map} Scope#taints */
+ this.taints = new Map();
+
+ /**
+ * Generally, through the lexical scoping of JS you can always know
+ * which variable an identifier in the source code refers to. There are
+ * a few exceptions to this rule. With 'global' and 'with' scopes you
+ * can only decide at runtime which variable a reference refers to.
+ * Moreover, if 'eval()' is used in a scope, it might introduce new
+ * bindings in this or its parent scopes.
+ * All those scopes are considered 'dynamic'.
+ * @member {boolean} Scope#dynamic
+ */
+ this.dynamic = this.type === "global" || this.type === "with";
+
+ /**
+ * A reference to the scope-defining syntax node.
+ * @member {espree.Node} Scope#block
+ */
+ this.block = block;
+
+ /**
+ * The {@link Reference|references} that are not resolved with this scope.
+ * @member {Reference[]} Scope#through
+ */
+ this.through = [];
+
+ /**
+ * The scoped {@link Variable}s of this scope. In the case of a
+ * 'function' scope this includes the automatic argument <em>arguments</em> as
+ * its first element, as well as all further formal arguments.
+ * @member {Variable[]} Scope#variables
+ */
+ this.variables = [];
+
+ /**
+ * Any variable {@link Reference|reference} found in this scope. This
+ * includes occurrences of local variables as well as variables from
+ * parent scopes (including the global scope). For local variables
+ * this also includes defining occurrences (like in a 'var' statement).
+ * In a 'function' scope this does not include the occurrences of the
+ * formal parameter in the parameter list.
+ * @member {Reference[]} Scope#references
+ */
+ this.references = [];
+
+ /**
+ * For 'global' and 'function' scopes, this is a self-reference. For
+ * other scope types this is the <em>variableScope</em> value of the
+ * parent scope.
+ * @member {Scope} Scope#variableScope
+ */
+ this.variableScope =
+ (this.type === "global" || this.type === "function" || this.type === "module" || this.type === "class-field-initializer") ? this : upperScope.variableScope;
+
+ /**
+ * Whether this scope is created by a FunctionExpression.
+ * @member {boolean} Scope#functionExpressionScope
+ */
+ this.functionExpressionScope = false;
+
+ /**
+ * Whether this is a scope that contains an 'eval()' invocation.
+ * @member {boolean} Scope#directCallToEvalScope
+ */
+ this.directCallToEvalScope = false;
+
+ /**
+ * @member {boolean} Scope#thisFound
+ */
+ this.thisFound = false;
+
+ this.__left = [];
+
+ /**
+ * Reference to the parent {@link Scope|scope}.
+ * @member {Scope} Scope#upper
+ */
+ this.upper = upperScope;
+
+ /**
+ * Whether 'use strict' is in effect in this scope.
+ * @member {boolean} Scope#isStrict
+ */
+ this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective());
+
+ /**
+ * List of nested {@link Scope}s.
+ * @member {Scope[]} Scope#childScopes
+ */
+ this.childScopes = [];
+ if (this.upper) {
+ this.upper.childScopes.push(this);
+ }
+
+ this.__declaredVariables = scopeManager.__declaredVariables;
+
+ registerScope(scopeManager, this);
+ }
+
+ __shouldStaticallyClose(scopeManager) {
+ return (!this.dynamic || scopeManager.__isOptimistic());
+ }
+
+ __shouldStaticallyCloseForGlobal(ref) {
+
+ // On global scope, let/const/class declarations should be resolved statically.
+ const name = ref.identifier.name;
+
+ if (!this.set.has(name)) {
+ return false;
+ }
+
+ const variable = this.set.get(name);
+ const defs = variable.defs;
+
+ return defs.length > 0 && defs.every(shouldBeStatically);
+ }
+
+ __staticCloseRef(ref) {
+ if (!this.__resolve(ref)) {
+ this.__delegateToUpperScope(ref);
+ }
+ }
+
+ __dynamicCloseRef(ref) {
+
+ // notify all names are through to global
+ let current = this;
+
+ do {
+ current.through.push(ref);
+ current = current.upper;
+ } while (current);
+ }
+
+ __globalCloseRef(ref) {
+
+ // let/const/class declarations should be resolved statically.
+ // others should be resolved dynamically.
+ if (this.__shouldStaticallyCloseForGlobal(ref)) {
+ this.__staticCloseRef(ref);
+ } else {
+ this.__dynamicCloseRef(ref);
+ }
+ }
+
+ __close(scopeManager) {
+ let closeRef;
+
+ if (this.__shouldStaticallyClose(scopeManager)) {
+ closeRef = this.__staticCloseRef;
+ } else if (this.type !== "global") {
+ closeRef = this.__dynamicCloseRef;
+ } else {
+ closeRef = this.__globalCloseRef;
+ }
+
+ // Try Resolving all references in this scope.
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ closeRef.call(this, ref);
+ }
+ this.__left = null;
+
+ return this.upper;
+ }
+
+ // To override by function scopes.
+ // References in default parameters isn't resolved to variables which are in their function body.
+ __isValidResolution(ref, variable) { // eslint-disable-line class-methods-use-this, no-unused-vars
+ return true;
+ }
+
+ __resolve(ref) {
+ const name = ref.identifier.name;
+
+ if (!this.set.has(name)) {
+ return false;
+ }
+ const variable = this.set.get(name);
+
+ if (!this.__isValidResolution(ref, variable)) {
+ return false;
+ }
+ variable.references.push(ref);
+ variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
+ if (ref.tainted) {
+ variable.tainted = true;
+ this.taints.set(variable.name, true);
+ }
+ ref.resolved = variable;
+
+ return true;
+ }
+
+ __delegateToUpperScope(ref) {
+ if (this.upper) {
+ this.upper.__left.push(ref);
+ }
+ this.through.push(ref);
+ }
+
+ __addDeclaredVariablesOfNode(variable, node) {
+ if (node === null || node === undefined) {
+ return;
+ }
+
+ let variables = this.__declaredVariables.get(node);
+
+ if (variables === null || variables === undefined) {
+ variables = [];
+ this.__declaredVariables.set(node, variables);
+ }
+ if (variables.indexOf(variable) === -1) {
+ variables.push(variable);
+ }
+ }
+
+ __defineGeneric(name, set, variables, node, def) {
+ let variable;
+
+ variable = set.get(name);
+ if (!variable) {
+ variable = new Variable(name, this);
+ set.set(name, variable);
+ variables.push(variable);
+ }
+
+ if (def) {
+ variable.defs.push(def);
+ this.__addDeclaredVariablesOfNode(variable, def.node);
+ this.__addDeclaredVariablesOfNode(variable, def.parent);
+ }
+ if (node) {
+ variable.identifiers.push(node);
+ }
+ }
+
+ __define(node, def) {
+ if (node && node.type === Syntax$2.Identifier) {
+ this.__defineGeneric(
+ node.name,
+ this.set,
+ this.variables,
+ node,
+ def
+ );
+ }
+ }
+
+ __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
+
+ // because Array element may be null
+ if (!node || node.type !== Syntax$2.Identifier) {
+ return;
+ }
+
+ // Specially handle like `this`.
+ if (node.name === "super") {
+ return;
+ }
+
+ const ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
+
+ this.references.push(ref);
+ this.__left.push(ref);
+ }
+
+ __detectEval() {
+ let current = this;
+
+ this.directCallToEvalScope = true;
+ do {
+ current.dynamic = true;
+ current = current.upper;
+ } while (current);
+ }
+
+ __detectThis() {
+ this.thisFound = true;
+ }
+
+ __isClosed() {
+ return this.__left === null;
+ }
+
+ /**
+ * returns resolved {Reference}
+ * @function Scope#resolve
+ * @param {Espree.Identifier} ident identifier to be resolved.
+ * @returns {Reference} reference
+ */
+ resolve(ident) {
+ let ref, i, iz;
+
+ assert__default['default'](this.__isClosed(), "Scope should be closed.");
+ assert__default['default'](ident.type === Syntax$2.Identifier, "Target should be identifier.");
+ for (i = 0, iz = this.references.length; i < iz; ++i) {
+ ref = this.references[i];
+ if (ref.identifier === ident) {
+ return ref;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * returns this scope is static
+ * @function Scope#isStatic
+ * @returns {boolean} static
+ */
+ isStatic() {
+ return !this.dynamic;
+ }
+
+ /**
+ * returns this scope has materialized arguments
+ * @function Scope#isArgumentsMaterialized
+ * @returns {boolean} arguemnts materialized
+ */
+ isArgumentsMaterialized() { // eslint-disable-line class-methods-use-this
+ return true;
+ }
+
+ /**
+ * returns this scope has materialized `this` reference
+ * @function Scope#isThisMaterialized
+ * @returns {boolean} this materialized
+ */
+ isThisMaterialized() { // eslint-disable-line class-methods-use-this
+ return true;
+ }
+
+ isUsedName(name) {
+ if (this.set.has(name)) {
+ return true;
+ }
+ for (let i = 0, iz = this.through.length; i < iz; ++i) {
+ if (this.through[i].identifier.name === name) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+
+class GlobalScope extends Scope {
+ constructor(scopeManager, block) {
+ super(scopeManager, "global", null, block, false);
+ this.implicit = {
+ set: new Map(),
+ variables: [],
+
+ /**
+ * List of {@link Reference}s that are left to be resolved (i.e. which
+ * need to be linked to the variable they refer to).
+ * @member {Reference[]} Scope#implicit#left
+ */
+ left: []
+ };
+ }
+
+ __close(scopeManager) {
+ const implicit = [];
+
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
+ implicit.push(ref.__maybeImplicitGlobal);
+ }
+ }
+
+ // create an implicit global variable from assignment expression
+ for (let i = 0, iz = implicit.length; i < iz; ++i) {
+ const info = implicit[i];
+
+ this.__defineImplicit(info.pattern,
+ new Definition(
+ Variable.ImplicitGlobalVariable,
+ info.pattern,
+ info.node,
+ null,
+ null,
+ null
+ ));
+
+ }
+
+ this.implicit.left = this.__left;
+
+ return super.__close(scopeManager);
+ }
+
+ __defineImplicit(node, def) {
+ if (node && node.type === Syntax$2.Identifier) {
+ this.__defineGeneric(
+ node.name,
+ this.implicit.set,
+ this.implicit.variables,
+ node,
+ def
+ );
+ }
+ }
+}
+
+class ModuleScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "module", upperScope, block, false);
+ }
+}
+
+class FunctionExpressionNameScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "function-expression-name", upperScope, block, false);
+ this.__define(block.id,
+ new Definition(
+ Variable.FunctionName,
+ block.id,
+ block,
+ null,
+ null,
+ null
+ ));
+ this.functionExpressionScope = true;
+ }
+}
+
+class CatchScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "catch", upperScope, block, false);
+ }
+}
+
+class WithScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "with", upperScope, block, false);
+ }
+
+ __close(scopeManager) {
+ if (this.__shouldStaticallyClose(scopeManager)) {
+ return super.__close(scopeManager);
+ }
+
+ for (let i = 0, iz = this.__left.length; i < iz; ++i) {
+ const ref = this.__left[i];
+
+ ref.tainted = true;
+ this.__delegateToUpperScope(ref);
+ }
+ this.__left = null;
+
+ return this.upper;
+ }
+}
+
+class BlockScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "block", upperScope, block, false);
+ }
+}
+
+class SwitchScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "switch", upperScope, block, false);
+ }
+}
+
+class FunctionScope extends Scope {
+ constructor(scopeManager, upperScope, block, isMethodDefinition) {
+ super(scopeManager, "function", upperScope, block, isMethodDefinition);
+
+ // section 9.2.13, FunctionDeclarationInstantiation.
+ // NOTE Arrow functions never have an arguments objects.
+ if (this.block.type !== Syntax$2.ArrowFunctionExpression) {
+ this.__defineArguments();
+ }
+ }
+
+ isArgumentsMaterialized() {
+
+ // TODO(Constellation)
+ // We can more aggressive on this condition like this.
+ //
+ // function t() {
+ // // arguments of t is always hidden.
+ // function arguments() {
+ // }
+ // }
+ if (this.block.type === Syntax$2.ArrowFunctionExpression) {
+ return false;
+ }
+
+ if (!this.isStatic()) {
+ return true;
+ }
+
+ const variable = this.set.get("arguments");
+
+ assert__default['default'](variable, "Always have arguments variable.");
+ return variable.tainted || variable.references.length !== 0;
+ }
+
+ isThisMaterialized() {
+ if (!this.isStatic()) {
+ return true;
+ }
+ return this.thisFound;
+ }
+
+ __defineArguments() {
+ this.__defineGeneric(
+ "arguments",
+ this.set,
+ this.variables,
+ null,
+ null
+ );
+ this.taints.set("arguments", true);
+ }
+
+ // References in default parameters isn't resolved to variables which are in their function body.
+ // const x = 1
+ // function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
+ // const x = 2
+ // console.log(a)
+ // }
+ __isValidResolution(ref, variable) {
+
+ // If `options.nodejsScope` is true, `this.block` becomes a Program node.
+ if (this.block.type === "Program") {
+ return true;
+ }
+
+ const bodyStart = this.block.body.range[0];
+
+ // It's invalid resolution in the following case:
+ return !(
+ variable.scope === this &&
+ ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
+ variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
+ );
+ }
+}
+
+class ForScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "for", upperScope, block, false);
+ }
+}
+
+class ClassScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class", upperScope, block, false);
+ }
+}
+
+class ClassFieldInitializerScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class-field-initializer", upperScope, block, true);
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * @constructor ScopeManager
+ */
+class ScopeManager {
+ constructor(options) {
+ this.scopes = [];
+ this.globalScope = null;
+ this.__nodeToScope = new WeakMap();
+ this.__currentScope = null;
+ this.__options = options;
+ this.__declaredVariables = new WeakMap();
+ }
+
+ __useDirective() {
+ return this.__options.directive;
+ }
+
+ __isOptimistic() {
+ return this.__options.optimistic;
+ }
+
+ __ignoreEval() {
+ return this.__options.ignoreEval;
+ }
+
+ __isNodejsScope() {
+ return this.__options.nodejsScope;
+ }
+
+ isModule() {
+ return this.__options.sourceType === "module";
+ }
+
+ isImpliedStrict() {
+ return this.__options.impliedStrict;
+ }
+
+ isStrictModeSupported() {
+ return this.__options.ecmaVersion >= 5;
+ }
+
+ // Returns appropriate scope for this node.
+ __get(node) {
+ return this.__nodeToScope.get(node);
+ }
+
+ /**
+ * Get variables that are declared by the node.
+ *
+ * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
+ * If the node declares nothing, this method returns an empty array.
+ * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
+ * @param {Espree.Node} node a node to get.
+ * @returns {Variable[]} variables that declared by the node.
+ */
+ getDeclaredVariables(node) {
+ return this.__declaredVariables.get(node) || [];
+ }
+
+ /**
+ * acquire scope from node.
+ * @function ScopeManager#acquire
+ * @param {Espree.Node} node node for the acquired scope.
+ * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
+ * @returns {Scope?} Scope from node
+ */
+ acquire(node, inner) {
+
+ /**
+ * predicate
+ * @param {Scope} testScope scope to test
+ * @returns {boolean} predicate
+ */
+ function predicate(testScope) {
+ if (testScope.type === "function" && testScope.functionExpressionScope) {
+ return false;
+ }
+ return true;
+ }
+
+ const scopes = this.__get(node);
+
+ if (!scopes || scopes.length === 0) {
+ return null;
+ }
+
+ // Heuristic selection from all scopes.
+ // If you would like to get all scopes, please use ScopeManager#acquireAll.
+ if (scopes.length === 1) {
+ return scopes[0];
+ }
+
+ if (inner) {
+ for (let i = scopes.length - 1; i >= 0; --i) {
+ const scope = scopes[i];
+
+ if (predicate(scope)) {
+ return scope;
+ }
+ }
+ } else {
+ for (let i = 0, iz = scopes.length; i < iz; ++i) {
+ const scope = scopes[i];
+
+ if (predicate(scope)) {
+ return scope;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * acquire all scopes from node.
+ * @function ScopeManager#acquireAll
+ * @param {Espree.Node} node node for the acquired scope.
+ * @returns {Scopes?} Scope array
+ */
+ acquireAll(node) {
+ return this.__get(node);
+ }
+
+ /**
+ * release the node.
+ * @function ScopeManager#release
+ * @param {Espree.Node} node releasing node.
+ * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
+ * @returns {Scope?} upper scope for the node.
+ */
+ release(node, inner) {
+ const scopes = this.__get(node);
+
+ if (scopes && scopes.length) {
+ const scope = scopes[0].upper;
+
+ if (!scope) {
+ return null;
+ }
+ return this.acquire(scope.block, inner);
+ }
+ return null;
+ }
+
+ attach() { } // eslint-disable-line class-methods-use-this
+
+ detach() { } // eslint-disable-line class-methods-use-this
+
+ __nestScope(scope) {
+ if (scope instanceof GlobalScope) {
+ assert__default['default'](this.__currentScope === null);
+ this.globalScope = scope;
+ }
+ this.__currentScope = scope;
+ return scope;
+ }
+
+ __nestGlobalScope(node) {
+ return this.__nestScope(new GlobalScope(this, node));
+ }
+
+ __nestBlockScope(node) {
+ return this.__nestScope(new BlockScope(this, this.__currentScope, node));
+ }
+
+ __nestFunctionScope(node, isMethodDefinition) {
+ return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
+ }
+
+ __nestForScope(node) {
+ return this.__nestScope(new ForScope(this, this.__currentScope, node));
+ }
+
+ __nestCatchScope(node) {
+ return this.__nestScope(new CatchScope(this, this.__currentScope, node));
+ }
+
+ __nestWithScope(node) {
+ return this.__nestScope(new WithScope(this, this.__currentScope, node));
+ }
+
+ __nestClassScope(node) {
+ return this.__nestScope(new ClassScope(this, this.__currentScope, node));
+ }
+
+ __nestClassFieldInitializerScope(node) {
+ return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
+ }
+
+ __nestSwitchScope(node) {
+ return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
+ }
+
+ __nestModuleScope(node) {
+ return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
+ }
+
+ __nestFunctionExpressionNameScope(node) {
+ return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
+ }
+
+ __isES6() {
+ return this.__options.ecmaVersion >= 6;
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax: Syntax$1 } = estraverse__default['default'];
+
+/**
+ * Get last array element
+ * @param {Array} xs array
+ * @returns {any} Last elment
+ */
+function getLast(xs) {
+ return xs[xs.length - 1] || null;
+}
+
+class PatternVisitor extends esrecurse__default['default'].Visitor {
+ static isPattern(node) {
+ const nodeType = node.type;
+
+ return (
+ nodeType === Syntax$1.Identifier ||
+ nodeType === Syntax$1.ObjectPattern ||
+ nodeType === Syntax$1.ArrayPattern ||
+ nodeType === Syntax$1.SpreadElement ||
+ nodeType === Syntax$1.RestElement ||
+ nodeType === Syntax$1.AssignmentPattern
+ );
+ }
+
+ constructor(options, rootPattern, callback) {
+ super(null, options);
+ this.rootPattern = rootPattern;
+ this.callback = callback;
+ this.assignments = [];
+ this.rightHandNodes = [];
+ this.restElements = [];
+ }
+
+ Identifier(pattern) {
+ const lastRestElement = getLast(this.restElements);
+
+ this.callback(pattern, {
+ topLevel: pattern === this.rootPattern,
+ rest: lastRestElement !== null && lastRestElement !== undefined && lastRestElement.argument === pattern,
+ assignments: this.assignments
+ });
+ }
+
+ Property(property) {
+
+ // Computed property's key is a right hand node.
+ if (property.computed) {
+ this.rightHandNodes.push(property.key);
+ }
+
+ // If it's shorthand, its key is same as its value.
+ // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
+ // If it's not shorthand, the name of new variable is its value's.
+ this.visit(property.value);
+ }
+
+ ArrayPattern(pattern) {
+ for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
+ const element = pattern.elements[i];
+
+ this.visit(element);
+ }
+ }
+
+ AssignmentPattern(pattern) {
+ this.assignments.push(pattern);
+ this.visit(pattern.left);
+ this.rightHandNodes.push(pattern.right);
+ this.assignments.pop();
+ }
+
+ RestElement(pattern) {
+ this.restElements.push(pattern);
+ this.visit(pattern.argument);
+ this.restElements.pop();
+ }
+
+ MemberExpression(node) {
+
+ // Computed property's key is a right hand node.
+ if (node.computed) {
+ this.rightHandNodes.push(node.property);
+ }
+
+ // the object is only read, write to its property.
+ this.rightHandNodes.push(node.object);
+ }
+
+ //
+ // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
+ // By spec, LeftHandSideExpression is Pattern or MemberExpression.
+ // (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
+ // But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
+ //
+
+ SpreadElement(node) {
+ this.visit(node.argument);
+ }
+
+ ArrayExpression(node) {
+ node.elements.forEach(this.visit, this);
+ }
+
+ AssignmentExpression(node) {
+ this.assignments.push(node);
+ this.visit(node.left);
+ this.rightHandNodes.push(node.right);
+ this.assignments.pop();
+ }
+
+ CallExpression(node) {
+
+ // arguments are right hand nodes.
+ node.arguments.forEach(a => {
+ this.rightHandNodes.push(a);
+ });
+ this.visit(node.callee);
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+/*
+ Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+const { Syntax } = estraverse__default['default'];
+
+/**
+ * Traverse identifier in pattern
+ * @param {Object} options options
+ * @param {pattern} rootPattern root pattern
+ * @param {Refencer} referencer referencer
+ * @param {callback} callback callback
+ * @returns {void}
+ */
+function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
+
+ // Call the callback at left hand identifier nodes, and Collect right hand nodes.
+ const visitor = new PatternVisitor(options, rootPattern, callback);
+
+ visitor.visit(rootPattern);
+
+ // Process the right hand nodes recursively.
+ if (referencer !== null && referencer !== undefined) {
+ visitor.rightHandNodes.forEach(referencer.visit, referencer);
+ }
+}
+
+// Importing ImportDeclaration.
+// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
+// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
+// FIXME: Now, we don't create module environment, because the context is
+// implementation dependent.
+
+class Importer extends esrecurse__default['default'].Visitor {
+ constructor(declaration, referencer) {
+ super(null, referencer.options);
+ this.declaration = declaration;
+ this.referencer = referencer;
+ }
+
+ visitImport(id, specifier) {
+ this.referencer.visitPattern(id, pattern => {
+ this.referencer.currentScope().__define(pattern,
+ new Definition(
+ Variable.ImportBinding,
+ pattern,
+ specifier,
+ this.declaration,
+ null,
+ null
+ ));
+ });
+ }
+
+ ImportNamespaceSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (local) {
+ this.visitImport(local, node);
+ }
+ }
+
+ ImportDefaultSpecifier(node) {
+ const local = (node.local || node.id);
+
+ this.visitImport(local, node);
+ }
+
+ ImportSpecifier(node) {
+ const local = (node.local || node.id);
+
+ if (node.name) {
+ this.visitImport(node.name, node);
+ } else {
+ this.visitImport(local, node);
+ }
+ }
+}
+
+// Referencing variables and creating bindings.
+class Referencer extends esrecurse__default['default'].Visitor {
+ constructor(options, scopeManager) {
+ super(null, options);
+ this.options = options;
+ this.scopeManager = scopeManager;
+ this.parent = null;
+ this.isInnerMethodDefinition = false;
+ }
+
+ currentScope() {
+ return this.scopeManager.__currentScope;
+ }
+
+ close(node) {
+ while (this.currentScope() && node === this.currentScope().block) {
+ this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
+ }
+ }
+
+ pushInnerMethodDefinition(isInnerMethodDefinition) {
+ const previous = this.isInnerMethodDefinition;
+
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ return previous;
+ }
+
+ popInnerMethodDefinition(isInnerMethodDefinition) {
+ this.isInnerMethodDefinition = isInnerMethodDefinition;
+ }
+
+ referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
+ const scope = this.currentScope();
+
+ assignments.forEach(assignment => {
+ scope.__referencing(
+ pattern,
+ Reference.WRITE,
+ assignment.right,
+ maybeImplicitGlobal,
+ pattern !== assignment.left,
+ init
+ );
+ });
+ }
+
+ visitPattern(node, options, callback) {
+ let visitPatternOptions = options;
+ let visitPatternCallback = callback;
+
+ if (typeof options === "function") {
+ visitPatternCallback = options;
+ visitPatternOptions = { processRightHandNodes: false };
+ }
+
+ traverseIdentifierInPattern(
+ this.options,
+ node,
+ visitPatternOptions.processRightHandNodes ? this : null,
+ visitPatternCallback
+ );
+ }
+
+ visitFunction(node) {
+ let i, iz;
+
+ // FunctionDeclaration name is defined in upper scope
+ // NOTE: Not referring variableScope. It is intended.
+ // Since
+ // in ES5, FunctionDeclaration should be in FunctionBody.
+ // in ES6, FunctionDeclaration should be block scoped.
+
+ if (node.type === Syntax.FunctionDeclaration) {
+
+ // id is defined in upper scope
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.FunctionName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ // FunctionExpression with name creates its special scope;
+ // FunctionExpressionNameScope.
+ if (node.type === Syntax.FunctionExpression && node.id) {
+ this.scopeManager.__nestFunctionExpressionNameScope(node);
+ }
+
+ // Consider this function is in the MethodDefinition.
+ this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
+
+ const that = this;
+
+ /**
+ * Visit pattern callback
+ * @param {pattern} pattern pattern
+ * @param {Object} info info
+ * @returns {void}
+ */
+ function visitPatternCallback(pattern, info) {
+ that.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ i,
+ info.rest
+ ));
+
+ that.referencingDefaultValue(pattern, info.assignments, null, true);
+ }
+
+ // Process parameter declarations.
+ for (i = 0, iz = node.params.length; i < iz; ++i) {
+ this.visitPattern(node.params[i], { processRightHandNodes: true }, visitPatternCallback);
+ }
+
+ // if there's a rest argument, add that
+ if (node.rest) {
+ this.visitPattern({
+ type: "RestElement",
+ argument: node.rest
+ }, pattern => {
+ this.currentScope().__define(pattern,
+ new ParameterDefinition(
+ pattern,
+ node,
+ node.params.length,
+ true
+ ));
+ });
+ }
+
+ // In TypeScript there are a number of function-like constructs which have no body,
+ // so check it exists before traversing
+ if (node.body) {
+
+ // Skip BlockStatement to prevent creating BlockStatement scope.
+ if (node.body.type === Syntax.BlockStatement) {
+ this.visitChildren(node.body);
+ } else {
+ this.visit(node.body);
+ }
+ }
+
+ this.close(node);
+ }
+
+ visitClass(node) {
+ if (node.type === Syntax.ClassDeclaration) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node,
+ null,
+ null,
+ null
+ ));
+ }
+
+ this.visit(node.superClass);
+
+ this.scopeManager.__nestClassScope(node);
+
+ if (node.id) {
+ this.currentScope().__define(node.id,
+ new Definition(
+ Variable.ClassName,
+ node.id,
+ node
+ ));
+ }
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitProperty(node) {
+ let previous;
+
+ if (node.computed) {
+ this.visit(node.key);
+ }
+
+ const isMethodDefinition = node.type === Syntax.MethodDefinition;
+
+ if (isMethodDefinition) {
+ previous = this.pushInnerMethodDefinition(true);
+ }
+ this.visit(node.value);
+ if (isMethodDefinition) {
+ this.popInnerMethodDefinition(previous);
+ }
+ }
+
+ visitForIn(node) {
+ if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ if (node.left.type === Syntax.VariableDeclaration) {
+ this.visit(node.left);
+ this.visitPattern(node.left.declarations[0].id, pattern => {
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
+ });
+ } else {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
+ });
+ }
+ this.visit(node.right);
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ visitVariableDeclaration(variableTargetScope, type, node, index) {
+
+ const decl = node.declarations[index];
+ const init = decl.init;
+
+ this.visitPattern(decl.id, { processRightHandNodes: true }, (pattern, info) => {
+ variableTargetScope.__define(
+ pattern,
+ new Definition(
+ type,
+ pattern,
+ decl,
+ node,
+ index,
+ node.kind
+ )
+ );
+
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ if (init) {
+ this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
+ }
+ });
+ }
+
+ AssignmentExpression(node) {
+ if (PatternVisitor.isPattern(node.left)) {
+ if (node.operator === "=") {
+ this.visitPattern(node.left, { processRightHandNodes: true }, (pattern, info) => {
+ let maybeImplicitGlobal = null;
+
+ if (!this.currentScope().isStrict) {
+ maybeImplicitGlobal = {
+ pattern,
+ node
+ };
+ }
+ this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
+ this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
+ });
+ } else {
+ this.currentScope().__referencing(node.left, Reference.RW, node.right);
+ }
+ } else {
+ this.visit(node.left);
+ }
+ this.visit(node.right);
+ }
+
+ CatchClause(node) {
+ this.scopeManager.__nestCatchScope(node);
+
+ this.visitPattern(node.param, { processRightHandNodes: true }, (pattern, info) => {
+ this.currentScope().__define(pattern,
+ new Definition(
+ Variable.CatchClause,
+ node.param,
+ node,
+ null,
+ null,
+ null
+ ));
+ this.referencingDefaultValue(pattern, info.assignments, null, true);
+ });
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ Program(node) {
+ this.scopeManager.__nestGlobalScope(node);
+
+ if (this.scopeManager.__isNodejsScope()) {
+
+ // Force strictness of GlobalScope to false when using node.js scope.
+ this.currentScope().isStrict = false;
+ this.scopeManager.__nestFunctionScope(node, false);
+ }
+
+ if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
+ this.scopeManager.__nestModuleScope(node);
+ }
+
+ if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
+ this.currentScope().isStrict = true;
+ }
+
+ this.visitChildren(node);
+ this.close(node);
+ }
+
+ Identifier(node) {
+ this.currentScope().__referencing(node);
+ }
+
+ // eslint-disable-next-line class-methods-use-this
+ PrivateIdentifier() {
+
+ // Do nothing.
+ }
+
+ UpdateExpression(node) {
+ if (PatternVisitor.isPattern(node.argument)) {
+ this.currentScope().__referencing(node.argument, Reference.RW, null);
+ } else {
+ this.visitChildren(node);
+ }
+ }
+
+ MemberExpression(node) {
+ this.visit(node.object);
+ if (node.computed) {
+ this.visit(node.property);
+ }
+ }
+
+ Property(node) {
+ this.visitProperty(node);
+ }
+
+ PropertyDefinition(node) {
+ const { computed, key, value } = node;
+
+ if (computed) {
+ this.visit(key);
+ }
+ if (value) {
+ this.scopeManager.__nestClassFieldInitializerScope(value);
+ this.visit(value);
+ this.close(value);
+ }
+ }
+
+ MethodDefinition(node) {
+ this.visitProperty(node);
+ }
+
+ BreakStatement() {} // eslint-disable-line class-methods-use-this
+
+ ContinueStatement() {} // eslint-disable-line class-methods-use-this
+
+ LabeledStatement(node) {
+ this.visit(node.body);
+ }
+
+ ForStatement(node) {
+
+ // Create ForStatement declaration.
+ // NOTE: In ES6, ForStatement dynamically generates
+ // per iteration environment. However, escope is
+ // a static analyzer, we only generate one scope for ForStatement.
+ if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
+ this.scopeManager.__nestForScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ClassExpression(node) {
+ this.visitClass(node);
+ }
+
+ ClassDeclaration(node) {
+ this.visitClass(node);
+ }
+
+ CallExpression(node) {
+
+ // Check this is direct call to eval
+ if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {
+
+ // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
+ // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
+ this.currentScope().variableScope.__detectEval();
+ }
+ this.visitChildren(node);
+ }
+
+ BlockStatement(node) {
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestBlockScope(node);
+ }
+
+ this.visitChildren(node);
+
+ this.close(node);
+ }
+
+ ThisExpression() {
+ this.currentScope().variableScope.__detectThis();
+ }
+
+ WithStatement(node) {
+ this.visit(node.object);
+
+ // Then nest scope for WithStatement.
+ this.scopeManager.__nestWithScope(node);
+
+ this.visit(node.body);
+
+ this.close(node);
+ }
+
+ VariableDeclaration(node) {
+ const variableTargetScope = (node.kind === "var") ? this.currentScope().variableScope : this.currentScope();
+
+ for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
+ const decl = node.declarations[i];
+
+ this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
+ if (decl.init) {
+ this.visit(decl.init);
+ }
+ }
+ }
+
+ // sec 13.11.8
+ SwitchStatement(node) {
+ this.visit(node.discriminant);
+
+ if (this.scopeManager.__isES6()) {
+ this.scopeManager.__nestSwitchScope(node);
+ }
+
+ for (let i = 0, iz = node.cases.length; i < iz; ++i) {
+ this.visit(node.cases[i]);
+ }
+
+ this.close(node);
+ }
+
+ FunctionDeclaration(node) {
+ this.visitFunction(node);
+ }
+
+ FunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ForOfStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ForInStatement(node) {
+ this.visitForIn(node);
+ }
+
+ ArrowFunctionExpression(node) {
+ this.visitFunction(node);
+ }
+
+ ImportDeclaration(node) {
+ assert__default['default'](this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");
+
+ const importer = new Importer(node, this);
+
+ importer.visit(node);
+ }
+
+ visitExportDeclaration(node) {
+ if (node.source) {
+ return;
+ }
+ if (node.declaration) {
+ this.visit(node.declaration);
+ return;
+ }
+
+ this.visitChildren(node);
+ }
+
+ // TODO: ExportDeclaration doesn't exist. for bc?
+ ExportDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportAllDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportDefaultDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportNamedDeclaration(node) {
+ this.visitExportDeclaration(node);
+ }
+
+ ExportSpecifier(node) {
+
+ // TODO: `node.id` doesn't exist. for bc?
+ const local = (node.id || node.local);
+
+ this.visit(local);
+ }
+
+ MetaProperty() { // eslint-disable-line class-methods-use-this
+
+ // do nothing.
+ }
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+const version = "6.0.0";
+
+/*
+ Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
+ Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
+ Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+ * Set the default options
+ * @returns {Object} options
+ */
+function defaultOptions() {
+ return {
+ optimistic: false,
+ directive: false,
+ nodejsScope: false,
+ impliedStrict: false,
+ sourceType: "script", // one of ['script', 'module']
+ ecmaVersion: 5,
+ childVisitorKeys: null,
+ fallback: "iteration"
+ };
+}
+
+/**
+ * Preform deep update on option object
+ * @param {Object} target Options
+ * @param {Object} override Updates
+ * @returns {Object} Updated options
+ */
+function updateDeeply(target, override) {
+
+ /**
+ * Is hash object
+ * @param {Object} value Test value
+ * @returns {boolean} Result
+ */
+ function isHashObject(value) {
+ return typeof value === "object" && value instanceof Object && !(value instanceof Array) && !(value instanceof RegExp);
+ }
+
+ for (const key in override) {
+ if (Object.prototype.hasOwnProperty.call(override, key)) {
+ const val = override[key];
+
+ if (isHashObject(val)) {
+ if (isHashObject(target[key])) {
+ updateDeeply(target[key], val);
+ } else {
+ target[key] = updateDeeply({}, val);
+ }
+ } else {
+ target[key] = val;
+ }
+ }
+ }
+ return target;
+}
+
+/**
+ * Main interface function. Takes an Espree syntax tree and returns the
+ * analyzed scopes.
+ * @function analyze
+ * @param {espree.Tree} tree Abstract Syntax Tree
+ * @param {Object} providedOptions Options that tailor the scope analysis
+ * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
+ * @param {boolean} [providedOptions.directive=false] the directive flag
+ * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
+ * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
+ * script is executed under node.js environment. When enabled, escope adds
+ * a function scope immediately following the global scope.
+ * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
+ * (if ecmaVersion >= 5).
+ * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script' and 'module'
+ * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
+ * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
+ * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
+ * @returns {ScopeManager} ScopeManager
+ */
+function analyze(tree, providedOptions) {
+ const options = updateDeeply(defaultOptions(), providedOptions);
+ const scopeManager = new ScopeManager(options);
+ const referencer = new Referencer(options, scopeManager);
+
+ referencer.visit(tree);
+
+ assert__default['default'](scopeManager.__currentScope === null, "currentScope should be null.");
+
+ return scopeManager;
+}
+
+/* vim: set sw=4 ts=4 et tw=80 : */
+
+exports.Definition = Definition;
+exports.PatternVisitor = PatternVisitor;
+exports.Reference = Reference;
+exports.Referencer = Referencer;
+exports.Scope = Scope;
+exports.ScopeManager = ScopeManager;
+exports.Variable = Variable;
+exports.analyze = analyze;
+exports.version = version;
+//# sourceMappingURL=eslint-scope.cjs.map
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/definition.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
index 172bfe23b5f..9744ef48b8f 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/eslint-scope/lib/index.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/index.js
index 0f16fa40f83..ac386adfb77 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/index.js
@@ -45,18 +45,16 @@
* The main interface is the {@link analyze} function.
* @module escope
*/
-"use strict";
-
/* eslint no-underscore-dangle: ["error", { "allow": ["__currentScope"] }] */
-const assert = require("assert");
+import assert from "assert";
+
+import ScopeManager from "./scope-manager.js";
+import Referencer from "./referencer.js";
+import Reference from "./reference.js";
+import Variable from "./variable.js";
-const ScopeManager = require("./scope-manager");
-const Referencer = require("./referencer");
-const Reference = require("./reference");
-const Variable = require("./variable");
-const Scope = require("./scope").Scope;
-const version = require("../package.json").version;
+import eslintScopeVersion from "./version.js";
/**
* Set the default options
@@ -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' and 'module'
+ * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
+ * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
+ * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
* @returns {ScopeManager} ScopeManager
*/
function analyze(tree, providedOptions) {
@@ -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/tools/node_modules/eslint/node_modules/eslint-scope/lib/pattern-visitor.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/pattern-visitor.js
index afa629173b7..a9ff48e5071 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/pattern-visitor.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/eslint-scope/lib/reference.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/reference.js
index 9529827fe78..e657d628649 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/reference.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/eslint-scope/lib/referencer.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/referencer.js
index 63d1935b3a9..0b90ec875c9 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/referencer.js
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/referencer.js
@@ -21,28 +21,26 @@
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-"use strict";
/* eslint-disable no-underscore-dangle */
/* eslint-disable no-undefined */
-const Syntax = require("estraverse").Syntax;
-const esrecurse = require("esrecurse");
-const Reference = require("./reference");
-const Variable = require("./variable");
-const PatternVisitor = require("./pattern-visitor");
-const definition = require("./definition");
-const assert = require("assert");
+import estraverse from "estraverse";
+import esrecurse from "esrecurse";
+import Reference from "./reference.js";
+import Variable from "./variable.js";
+import PatternVisitor from "./pattern-visitor.js";
+import { Definition, ParameterDefinition } from "./definition.js";
+import assert from "assert";
-const ParameterDefinition = definition.ParameterDefinition;
-const Definition = definition.Definition;
+const { Syntax } = estraverse;
/**
* Traverse identifier in pattern
- * @param {Object} options - options
- * @param {pattern} rootPattern - root pattern
- * @param {Refencer} referencer - referencer
- * @param {callback} callback - callback
+ * @param {Object} options options
+ * @param {pattern} rootPattern root pattern
+ * @param {Refencer} referencer referencer
+ * @param {callback} callback callback
* @returns {void}
*/
function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
@@ -209,8 +207,8 @@ class Referencer extends esrecurse.Visitor {
/**
* Visit pattern callback
- * @param {pattern} pattern - pattern
- * @param {Object} info - info
+ * @param {pattern} pattern pattern
+ * @param {Object} info info
* @returns {void}
*/
function visitPatternCallback(pattern, info) {
@@ -434,6 +432,12 @@ class Referencer extends esrecurse.Visitor {
this.currentScope().__referencing(node);
}
+ // eslint-disable-next-line class-methods-use-this
+ PrivateIdentifier() {
+
+ // Do nothing.
+ }
+
UpdateExpression(node) {
if (PatternVisitor.isPattern(node.argument)) {
this.currentScope().__referencing(node.argument, Reference.RW, null);
@@ -453,6 +457,19 @@ 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);
+ }
+ }
+
MethodDefinition(node) {
this.visitProperty(node);
}
@@ -624,6 +641,6 @@ class Referencer extends esrecurse.Visitor {
}
}
-module.exports = Referencer;
+export default Referencer;
/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope-manager.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope-manager.js
index c1927994b11..5a1231464d3 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope-manager.js
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope-manager.js
@@ -21,26 +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 */
-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,
+ ClassScope,
+ ForScope,
+ FunctionExpressionNameScope,
+ FunctionScope,
+ GlobalScope,
+ ModuleScope,
+ SwitchScope,
+ WithScope
+} from "./scope.js";
+import assert from "assert";
/**
- * @class ScopeManager
+ * @constructor ScopeManager
*/
class ScopeManager {
constructor(options) {
@@ -91,8 +91,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 +100,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 +154,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 +164,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 +224,10 @@ class ScopeManager {
return this.__nestScope(new ClassScope(this, this.__currentScope, node));
}
+ __nestClassFieldInitializerScope(node) {
+ return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
+ }
+
__nestSwitchScope(node) {
return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
}
@@ -242,6 +245,6 @@ class ScopeManager {
}
}
-module.exports = ScopeManager;
+export default ScopeManager;
/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js
index bdb5f637f68..73386e614ff 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/scope.js
+++ b/tools/node_modules/eslint/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,14 @@ 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
+ * @member {string} Scope#type
*/
this.type = type;
@@ -224,7 +225,7 @@ 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 === "function" || this.type === "module" || this.type === "class-field-initializer") ? this : upperScope.variableScope;
/**
* Whether this scope is created by a FunctionExpression.
@@ -461,8 +462,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 +482,7 @@ class Scope {
/**
* returns this scope is static
- * @method Scope#isStatic
+ * @function Scope#isStatic
* @returns {boolean} static
*/
isStatic() {
@@ -490,7 +491,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 +500,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 +528,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 +732,13 @@ class ClassScope extends Scope {
}
}
-module.exports = {
+class ClassFieldInitializerScope extends Scope {
+ constructor(scopeManager, upperScope, block) {
+ super(scopeManager, "class-field-initializer", upperScope, block, true);
+ }
+}
+
+export {
Scope,
GlobalScope,
ModuleScope,
@@ -742,7 +749,8 @@ module.exports = {
SwitchScope,
FunctionScope,
ForScope,
- ClassScope
+ ClassScope,
+ ClassFieldInitializerScope
};
/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/lib/variable.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/variable.js
index 702c4780a24..286202f72a4 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/lib/variable.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/eslint-scope/lib/version.js b/tools/node_modules/eslint/node_modules/eslint-scope/lib/version.js
new file mode 100644
index 00000000000..393adb787f6
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/lib/version.js
@@ -0,0 +1,3 @@
+const version = "6.0.0";
+
+export default version;
diff --git a/tools/node_modules/eslint/node_modules/eslint-scope/package.json b/tools/node_modules/eslint/node_modules/eslint-scope/package.json
index b700b92afbe..c1f8f174631 100644
--- a/tools/node_modules/eslint/node_modules/eslint-scope/package.json
+++ b/tools/node_modules/eslint/node_modules/eslint-scope/package.json
@@ -2,10 +2,18 @@
"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": "6.0.0",
"engines": {
- "node": ">=8.0.0"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"repository": "eslint/eslint-scope",
"bugs": {
@@ -13,8 +21,11 @@
},
"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 +35,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.1.2",
+ "eslint-visitor-keys": "^3.0.0",
+ "espree": "^8.0.0",
+ "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/tools/node_modules/eslint/node_modules/eslint-utils/index.js b/tools/node_modules/eslint/node_modules/eslint-utils/index.js
index 3d55509aa8e..034a19b631c 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/index.js
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.js
@@ -81,12 +81,22 @@ function negate(f) {
}
/**
+ * Checks if the given token is a PunctuatorToken with the given value
+ * @param {Token} token - The token to check.
+ * @param {string} value - The value to check.
+ * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.
+ */
+function isPunctuatorTokenWithValue(token, value) {
+ return token.type === "Punctuator" && token.value === value
+}
+
+/**
* Checks if the given token is an arrow token or not.
* @param {Token} token - The token to check.
* @returns {boolean} `true` if the token is an arrow token.
*/
function isArrowToken(token) {
- return token.value === "=>" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "=>")
}
/**
@@ -95,7 +105,7 @@ function isArrowToken(token) {
* @returns {boolean} `true` if the token is a comma token.
*/
function isCommaToken(token) {
- return token.value === "," && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ",")
}
/**
@@ -104,7 +114,7 @@ function isCommaToken(token) {
* @returns {boolean} `true` if the token is a semicolon token.
*/
function isSemicolonToken(token) {
- return token.value === ";" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ";")
}
/**
@@ -113,7 +123,7 @@ function isSemicolonToken(token) {
* @returns {boolean} `true` if the token is a colon token.
*/
function isColonToken(token) {
- return token.value === ":" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ":")
}
/**
@@ -122,7 +132,7 @@ function isColonToken(token) {
* @returns {boolean} `true` if the token is an opening parenthesis token.
*/
function isOpeningParenToken(token) {
- return token.value === "(" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "(")
}
/**
@@ -131,7 +141,7 @@ function isOpeningParenToken(token) {
* @returns {boolean} `true` if the token is a closing parenthesis token.
*/
function isClosingParenToken(token) {
- return token.value === ")" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ")")
}
/**
@@ -140,7 +150,7 @@ function isClosingParenToken(token) {
* @returns {boolean} `true` if the token is an opening square bracket token.
*/
function isOpeningBracketToken(token) {
- return token.value === "[" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "[")
}
/**
@@ -149,7 +159,7 @@ function isOpeningBracketToken(token) {
* @returns {boolean} `true` if the token is a closing square bracket token.
*/
function isClosingBracketToken(token) {
- return token.value === "]" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "]")
}
/**
@@ -158,7 +168,7 @@ function isClosingBracketToken(token) {
* @returns {boolean} `true` if the token is an opening brace token.
*/
function isOpeningBraceToken(token) {
- return token.value === "{" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "{")
}
/**
@@ -167,7 +177,7 @@ function isOpeningBraceToken(token) {
* @returns {boolean} `true` if the token is a closing brace token.
*/
function isClosingBraceToken(token) {
- return token.value === "}" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "}")
}
/**
@@ -176,11 +186,7 @@ function isClosingBraceToken(token) {
* @returns {boolean} `true` if the token is a comment token.
*/
function isCommentToken(token) {
- return (
- token.type === "Line" ||
- token.type === "Block" ||
- token.type === "Shebang"
- )
+ return ["Block", "Line", "Shebang"].includes(token.type)
}
const isNotArrowToken = negate(isArrowToken);
@@ -225,7 +231,8 @@ function getFunctionHeadLocation(node, sourceCode) {
end = arrowToken.loc.end;
} else if (
parent.type === "Property" ||
- parent.type === "MethodDefinition"
+ parent.type === "MethodDefinition" ||
+ parent.type === "PropertyDefinition"
) {
start = parent.loc.start;
end = getOpeningParenOfParams(node, sourceCode).loc.start;
@@ -235,12 +242,12 @@ function getFunctionHeadLocation(node, sourceCode) {
}
return {
- start: Object.assign({}, start),
- end: Object.assign({}, end),
+ start: { ...start },
+ end: { ...end },
}
}
-/* globals BigInt, globalThis, global, self, window */
+/* globals globalThis, global, self, window */
const globalObject =
typeof globalThis !== "undefined"
@@ -301,7 +308,7 @@ const builtinNames = Object.freeze(
"unescape",
"WeakMap",
"WeakSet",
- ])
+ ]),
);
const callAllowed = new Set(
[
@@ -319,8 +326,8 @@ const callAllowed = new Set(
isNaN,
isPrototypeOf,
...Object.getOwnPropertyNames(Math)
- .map(k => Math[k])
- .filter(f => typeof f === "function"),
+ .map((k) => Math[k])
+ .filter((f) => typeof f === "function"),
Number,
Number.isFinite,
Number.isNaN,
@@ -341,11 +348,10 @@ const callAllowed = new Set(
String.fromCharCode,
String.fromCodePoint,
String.raw,
- Symbol,
Symbol.for,
Symbol.keyFor,
unescape,
- ].filter(f => typeof f === "function")
+ ].filter((f) => typeof f === "function"),
);
const callPassThrough = new Set([
Object.freeze,
@@ -490,6 +496,9 @@ const operations = Object.freeze({
if (args != null) {
if (calleeNode.type === "MemberExpression") {
+ if (calleeNode.property.type === "PrivateIdentifier") {
+ return null
+ }
const object = getStaticValueR(calleeNode.object, initialScope);
if (object != null) {
if (
@@ -498,9 +507,10 @@ const operations = Object.freeze({
) {
return { value: undefined, optional: true }
}
- const property = calleeNode.computed
- ? getStaticValueR(calleeNode.property, initialScope)
- : { value: calleeNode.property.name };
+ const property = getStaticPropertyNameValue(
+ calleeNode,
+ initialScope,
+ );
if (property != null) {
const receiver = object.value;
@@ -607,14 +617,15 @@ const operations = Object.freeze({
},
MemberExpression(node, initialScope) {
+ if (node.property.type === "PrivateIdentifier") {
+ return null
+ }
const object = getStaticValueR(node.object, initialScope);
if (object != null) {
if (object.value == null && (object.optional || node.optional)) {
return { value: undefined, optional: true }
}
- const property = node.computed
- ? getStaticValueR(node.property, initialScope)
- : { value: node.property.name };
+ const property = getStaticPropertyNameValue(node, initialScope);
if (property != null && !isGetter(object.value, property.value)) {
return { value: object.value[property.value] }
@@ -653,9 +664,10 @@ const operations = Object.freeze({
if (propertyNode.kind !== "init") {
return null
}
- const key = propertyNode.computed
- ? getStaticValueR(propertyNode.key, initialScope)
- : { value: propertyNode.key.name };
+ const key = getStaticPropertyNameValue(
+ propertyNode,
+ initialScope,
+ );
const value = getStaticValueR(propertyNode.value, initialScope);
if (key == null || value == null) {
return null
@@ -667,7 +679,7 @@ const operations = Object.freeze({
) {
const argument = getStaticValueR(
propertyNode.argument,
- initialScope
+ initialScope,
);
if (argument == null) {
return null
@@ -690,13 +702,13 @@ const operations = Object.freeze({
const tag = getStaticValueR(node.tag, initialScope);
const expressions = getElementValues(
node.quasi.expressions,
- initialScope
+ initialScope,
);
if (tag != null && expressions != null) {
const func = tag.value;
- const strings = node.quasi.quasis.map(q => q.value.cooked);
- strings.raw = node.quasi.quasis.map(q => q.value.raw);
+ const strings = node.quasi.quasis.map((q) => q.value.cooked);
+ strings.raw = node.quasi.quasis.map((q) => q.value.raw);
if (func === String.raw) {
return { value: func(strings, ...expressions) }
@@ -764,6 +776,33 @@ function getStaticValueR(node, initialScope) {
}
/**
+ * Get the static value of property name from a MemberExpression node or a Property node.
+ * @param {Node} node The node to get.
+ * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
+ * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.
+ */
+function getStaticPropertyNameValue(node, initialScope) {
+ const nameNode = node.type === "Property" ? node.key : node.property;
+
+ if (node.computed) {
+ return getStaticValueR(nameNode, initialScope)
+ }
+
+ if (nameNode.type === "Identifier") {
+ return { value: nameNode.name }
+ }
+
+ if (nameNode.type === "Literal") {
+ if (nameNode.bigint) {
+ return { value: nameNode.bigint }
+ }
+ return { value: String(nameNode.value) }
+ }
+
+ return null
+}
+
+/**
* Get the value of a given node if it's a static value.
* @param {Node} node The node to get.
* @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.
@@ -810,16 +849,23 @@ function getPropertyName(node, initialScope) {
if (node.computed) {
return getStringIfConstant(node.property, initialScope)
}
+ if (node.property.type === "PrivateIdentifier") {
+ return null
+ }
return node.property.name
case "Property":
case "MethodDefinition":
+ case "PropertyDefinition":
if (node.computed) {
return getStringIfConstant(node.key, initialScope)
}
if (node.key.type === "Literal") {
return String(node.key.value)
}
+ if (node.key.type === "PrivateIdentifier") {
+ return null
+ }
return node.key.name
// no default
@@ -831,14 +877,27 @@ function getPropertyName(node, initialScope) {
/**
* Get the name and kind of the given function node.
* @param {ASTNode} node - The function node to get.
+ * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
* @returns {string} The name and kind of the function node.
*/
-function getFunctionNameWithKind(node) {
+// eslint-disable-next-line complexity
+function getFunctionNameWithKind(node, sourceCode) {
const parent = node.parent;
const tokens = [];
-
- if (parent.type === "MethodDefinition" && parent.static) {
- tokens.push("static");
+ const isObjectMethod = parent.type === "Property" && parent.value === node;
+ const isClassMethod =
+ parent.type === "MethodDefinition" && parent.value === node;
+ const isClassFieldMethod =
+ parent.type === "PropertyDefinition" && parent.value === node;
+
+ // Modifiers.
+ if (isClassMethod || isClassFieldMethod) {
+ if (parent.static) {
+ tokens.push("static");
+ }
+ if (parent.key.type === "PrivateIdentifier") {
+ tokens.push("private");
+ }
}
if (node.async) {
tokens.push("async");
@@ -847,12 +906,8 @@ function getFunctionNameWithKind(node) {
tokens.push("generator");
}
- if (node.type === "ArrowFunctionExpression") {
- tokens.push("arrow", "function");
- } else if (
- parent.type === "Property" ||
- parent.type === "MethodDefinition"
- ) {
+ // Kinds.
+ if (isObjectMethod || isClassMethod) {
if (parent.kind === "constructor") {
return "constructor"
}
@@ -863,35 +918,45 @@ function getFunctionNameWithKind(node) {
} else {
tokens.push("method");
}
+ } else if (isClassFieldMethod) {
+ tokens.push("method");
} else {
- tokens.push("function");
- }
-
- if (node.id) {
- tokens.push(`'${node.id.name}'`);
- } else {
- const name = getPropertyName(parent);
-
- if (name) {
- tokens.push(`'${name}'`);
+ if (node.type === "ArrowFunctionExpression") {
+ tokens.push("arrow");
}
+ tokens.push("function");
}
- if (node.type === "ArrowFunctionExpression") {
- if (
- parent.type === "VariableDeclarator" &&
- parent.id &&
- parent.id.type === "Identifier"
- ) {
- tokens.push(`'${parent.id.name}'`);
- }
- if (
- parent.type === "AssignmentExpression" &&
- parent.left &&
- parent.left.type === "Identifier"
- ) {
- tokens.push(`'${parent.left.name}'`);
+ // Names.
+ if (isObjectMethod || isClassMethod || isClassFieldMethod) {
+ if (parent.key.type === "PrivateIdentifier") {
+ tokens.push(`#${parent.key.name}`);
+ } else {
+ const name = getPropertyName(parent);
+ if (name) {
+ tokens.push(`'${name}'`);
+ } else if (sourceCode) {
+ const keyText = sourceCode.getText(parent.key);
+ if (!keyText.includes("\n")) {
+ tokens.push(`[${keyText}]`);
+ }
+ }
}
+ } else if (node.id) {
+ tokens.push(`'${node.id.name}'`);
+ } else if (
+ parent.type === "VariableDeclarator" &&
+ parent.id &&
+ parent.id.type === "Identifier"
+ ) {
+ tokens.push(`'${parent.id.name}'`);
+ } else if (
+ (parent.type === "AssignmentExpression" ||
+ parent.type === "AssignmentPattern") &&
+ parent.left &&
+ parent.left.type === "Identifier"
+ ) {
+ tokens.push(`'${parent.left.name}'`);
}
return tokens.join(" ")
@@ -917,7 +982,7 @@ const typeConversionBinaryOps = Object.freeze(
"^",
"&",
"in",
- ])
+ ]),
);
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));
@@ -1032,6 +1097,16 @@ const visitor = Object.freeze(
}
return this.$visitChildren(node, options, visitorKeys)
},
+ PropertyDefinition(node, options, visitorKeys) {
+ if (
+ options.considerImplicitTypeConversion &&
+ node.computed &&
+ node.key.type !== "Literal"
+ ) {
+ return true
+ }
+ return this.$visitChildren(node, options, visitorKeys)
+ },
UnaryExpression(node, options, visitorKeys) {
if (node.operator === "delete") {
return true
@@ -1051,7 +1126,7 @@ const visitor = Object.freeze(
YieldExpression() {
return true
},
- })
+ }),
);
/**
@@ -1067,12 +1142,12 @@ const visitor = Object.freeze(
function hasSideEffect(
node,
sourceCode,
- { considerGetters = false, considerImplicitTypeConversion = false } = {}
+ { considerGetters = false, considerImplicitTypeConversion = false } = {},
) {
return visitor.$visit(
node,
{ considerGetters, considerImplicitTypeConversion },
- sourceCode.visitorKeys || evk.KEYS
+ sourceCode.visitorKeys || evk.KEYS,
)
}
@@ -1092,7 +1167,7 @@ function getParentSyntaxParen(node, sourceCode) {
if (parent.arguments.length === 1 && parent.arguments[0] === node) {
return sourceCode.getTokenAfter(
parent.callee,
- isOpeningParenToken
+ isOpeningParenToken,
)
}
return null
@@ -1101,7 +1176,7 @@ function getParentSyntaxParen(node, sourceCode) {
if (parent.test === node) {
return sourceCode.getTokenAfter(
parent.body,
- isOpeningParenToken
+ isOpeningParenToken,
)
}
return null
@@ -1152,7 +1227,7 @@ function getParentSyntaxParen(node, sourceCode) {
function isParenthesized(
timesOrNode,
nodeOrSourceCode,
- optionalSourceCode
+ optionalSourceCode,
) {
let times, node, sourceCode, maybeLeftParen, maybeRightParen;
if (typeof timesOrNode === "number") {
@@ -1168,7 +1243,11 @@ function isParenthesized(
sourceCode = nodeOrSourceCode;
}
- if (node == null) {
+ if (
+ node == null ||
+ // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
+ (node.parent.type === "CatchClause" && node.parent.param === node)
+ ) {
return false
}
@@ -1368,7 +1447,7 @@ function isModifiedGlobal(variable) {
return (
variable == null ||
variable.defs.length !== 0 ||
- variable.references.some(r => r.isWrite())
+ variable.references.some((r) => r.isWrite())
)
}
@@ -1412,7 +1491,7 @@ class ReferenceTracker {
{
mode = "strict",
globalObjectNames = ["global", "globalThis", "self", "window"],
- } = {}
+ } = {},
) {
this.variableStack = [];
this.globalScope = globalScope;
@@ -1439,7 +1518,7 @@ class ReferenceTracker {
variable,
path,
nextTraceMap,
- true
+ true,
);
}
@@ -1455,7 +1534,7 @@ class ReferenceTracker {
variable,
path,
traceMap,
- false
+ false,
);
}
}
@@ -1532,11 +1611,8 @@ class ReferenceTracker {
esm
? nextTraceMap
: this.mode === "legacy"
- ? Object.assign(
- { default: nextTraceMap },
- nextTraceMap
- )
- : { default: nextTraceMap }
+ ? { default: nextTraceMap, ...nextTraceMap }
+ : { default: nextTraceMap },
);
if (esm) {
@@ -1622,7 +1698,7 @@ class ReferenceTracker {
yield* this._iteratePropertyReferences(
parent,
path,
- nextTraceMap
+ nextTraceMap,
);
}
return
@@ -1679,7 +1755,7 @@ class ReferenceTracker {
variable,
path,
traceMap,
- false
+ false,
);
}
return
@@ -1705,7 +1781,7 @@ class ReferenceTracker {
yield* this._iterateLhsReferences(
property.value,
nextPath,
- nextTraceMap
+ nextTraceMap,
);
}
return
@@ -1748,7 +1824,7 @@ class ReferenceTracker {
findVariable(this.globalScope, specifierNode.local),
path,
nextTraceMap,
- false
+ false,
);
return
@@ -1759,7 +1835,7 @@ class ReferenceTracker {
findVariable(this.globalScope, specifierNode.local),
path,
traceMap,
- false
+ false,
);
return
}
diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs b/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs
index 6940337c8f8..50edb341d04 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/index.mjs
@@ -75,12 +75,22 @@ function negate(f) {
}
/**
+ * Checks if the given token is a PunctuatorToken with the given value
+ * @param {Token} token - The token to check.
+ * @param {string} value - The value to check.
+ * @returns {boolean} `true` if the token is a PunctuatorToken with the given value.
+ */
+function isPunctuatorTokenWithValue(token, value) {
+ return token.type === "Punctuator" && token.value === value
+}
+
+/**
* Checks if the given token is an arrow token or not.
* @param {Token} token - The token to check.
* @returns {boolean} `true` if the token is an arrow token.
*/
function isArrowToken(token) {
- return token.value === "=>" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "=>")
}
/**
@@ -89,7 +99,7 @@ function isArrowToken(token) {
* @returns {boolean} `true` if the token is a comma token.
*/
function isCommaToken(token) {
- return token.value === "," && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ",")
}
/**
@@ -98,7 +108,7 @@ function isCommaToken(token) {
* @returns {boolean} `true` if the token is a semicolon token.
*/
function isSemicolonToken(token) {
- return token.value === ";" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ";")
}
/**
@@ -107,7 +117,7 @@ function isSemicolonToken(token) {
* @returns {boolean} `true` if the token is a colon token.
*/
function isColonToken(token) {
- return token.value === ":" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ":")
}
/**
@@ -116,7 +126,7 @@ function isColonToken(token) {
* @returns {boolean} `true` if the token is an opening parenthesis token.
*/
function isOpeningParenToken(token) {
- return token.value === "(" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "(")
}
/**
@@ -125,7 +135,7 @@ function isOpeningParenToken(token) {
* @returns {boolean} `true` if the token is a closing parenthesis token.
*/
function isClosingParenToken(token) {
- return token.value === ")" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, ")")
}
/**
@@ -134,7 +144,7 @@ function isClosingParenToken(token) {
* @returns {boolean} `true` if the token is an opening square bracket token.
*/
function isOpeningBracketToken(token) {
- return token.value === "[" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "[")
}
/**
@@ -143,7 +153,7 @@ function isOpeningBracketToken(token) {
* @returns {boolean} `true` if the token is a closing square bracket token.
*/
function isClosingBracketToken(token) {
- return token.value === "]" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "]")
}
/**
@@ -152,7 +162,7 @@ function isClosingBracketToken(token) {
* @returns {boolean} `true` if the token is an opening brace token.
*/
function isOpeningBraceToken(token) {
- return token.value === "{" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "{")
}
/**
@@ -161,7 +171,7 @@ function isOpeningBraceToken(token) {
* @returns {boolean} `true` if the token is a closing brace token.
*/
function isClosingBraceToken(token) {
- return token.value === "}" && token.type === "Punctuator"
+ return isPunctuatorTokenWithValue(token, "}")
}
/**
@@ -170,11 +180,7 @@ function isClosingBraceToken(token) {
* @returns {boolean} `true` if the token is a comment token.
*/
function isCommentToken(token) {
- return (
- token.type === "Line" ||
- token.type === "Block" ||
- token.type === "Shebang"
- )
+ return ["Block", "Line", "Shebang"].includes(token.type)
}
const isNotArrowToken = negate(isArrowToken);
@@ -219,7 +225,8 @@ function getFunctionHeadLocation(node, sourceCode) {
end = arrowToken.loc.end;
} else if (
parent.type === "Property" ||
- parent.type === "MethodDefinition"
+ parent.type === "MethodDefinition" ||
+ parent.type === "PropertyDefinition"
) {
start = parent.loc.start;
end = getOpeningParenOfParams(node, sourceCode).loc.start;
@@ -229,12 +236,12 @@ function getFunctionHeadLocation(node, sourceCode) {
}
return {
- start: Object.assign({}, start),
- end: Object.assign({}, end),
+ start: { ...start },
+ end: { ...end },
}
}
-/* globals BigInt, globalThis, global, self, window */
+/* globals globalThis, global, self, window */
const globalObject =
typeof globalThis !== "undefined"
@@ -295,7 +302,7 @@ const builtinNames = Object.freeze(
"unescape",
"WeakMap",
"WeakSet",
- ])
+ ]),
);
const callAllowed = new Set(
[
@@ -313,8 +320,8 @@ const callAllowed = new Set(
isNaN,
isPrototypeOf,
...Object.getOwnPropertyNames(Math)
- .map(k => Math[k])
- .filter(f => typeof f === "function"),
+ .map((k) => Math[k])
+ .filter((f) => typeof f === "function"),
Number,
Number.isFinite,
Number.isNaN,
@@ -335,11 +342,10 @@ const callAllowed = new Set(
String.fromCharCode,
String.fromCodePoint,
String.raw,
- Symbol,
Symbol.for,
Symbol.keyFor,
unescape,
- ].filter(f => typeof f === "function")
+ ].filter((f) => typeof f === "function"),
);
const callPassThrough = new Set([
Object.freeze,
@@ -484,6 +490,9 @@ const operations = Object.freeze({
if (args != null) {
if (calleeNode.type === "MemberExpression") {
+ if (calleeNode.property.type === "PrivateIdentifier") {
+ return null
+ }
const object = getStaticValueR(calleeNode.object, initialScope);
if (object != null) {
if (
@@ -492,9 +501,10 @@ const operations = Object.freeze({
) {
return { value: undefined, optional: true }
}
- const property = calleeNode.computed
- ? getStaticValueR(calleeNode.property, initialScope)
- : { value: calleeNode.property.name };
+ const property = getStaticPropertyNameValue(
+ calleeNode,
+ initialScope,
+ );
if (property != null) {
const receiver = object.value;
@@ -601,14 +611,15 @@ const operations = Object.freeze({
},
MemberExpression(node, initialScope) {
+ if (node.property.type === "PrivateIdentifier") {
+ return null
+ }
const object = getStaticValueR(node.object, initialScope);
if (object != null) {
if (object.value == null && (object.optional || node.optional)) {
return { value: undefined, optional: true }
}
- const property = node.computed
- ? getStaticValueR(node.property, initialScope)
- : { value: node.property.name };
+ const property = getStaticPropertyNameValue(node, initialScope);
if (property != null && !isGetter(object.value, property.value)) {
return { value: object.value[property.value] }
@@ -647,9 +658,10 @@ const operations = Object.freeze({
if (propertyNode.kind !== "init") {
return null
}
- const key = propertyNode.computed
- ? getStaticValueR(propertyNode.key, initialScope)
- : { value: propertyNode.key.name };
+ const key = getStaticPropertyNameValue(
+ propertyNode,
+ initialScope,
+ );
const value = getStaticValueR(propertyNode.value, initialScope);
if (key == null || value == null) {
return null
@@ -661,7 +673,7 @@ const operations = Object.freeze({
) {
const argument = getStaticValueR(
propertyNode.argument,
- initialScope
+ initialScope,
);
if (argument == null) {
return null
@@ -684,13 +696,13 @@ const operations = Object.freeze({
const tag = getStaticValueR(node.tag, initialScope);
const expressions = getElementValues(
node.quasi.expressions,
- initialScope
+ initialScope,
);
if (tag != null && expressions != null) {
const func = tag.value;
- const strings = node.quasi.quasis.map(q => q.value.cooked);
- strings.raw = node.quasi.quasis.map(q => q.value.raw);
+ const strings = node.quasi.quasis.map((q) => q.value.cooked);
+ strings.raw = node.quasi.quasis.map((q) => q.value.raw);
if (func === String.raw) {
return { value: func(strings, ...expressions) }
@@ -758,6 +770,33 @@ function getStaticValueR(node, initialScope) {
}
/**
+ * Get the static value of property name from a MemberExpression node or a Property node.
+ * @param {Node} node The node to get.
+ * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
+ * @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.
+ */
+function getStaticPropertyNameValue(node, initialScope) {
+ const nameNode = node.type === "Property" ? node.key : node.property;
+
+ if (node.computed) {
+ return getStaticValueR(nameNode, initialScope)
+ }
+
+ if (nameNode.type === "Identifier") {
+ return { value: nameNode.name }
+ }
+
+ if (nameNode.type === "Literal") {
+ if (nameNode.bigint) {
+ return { value: nameNode.bigint }
+ }
+ return { value: String(nameNode.value) }
+ }
+
+ return null
+}
+
+/**
* Get the value of a given node if it's a static value.
* @param {Node} node The node to get.
* @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.
@@ -804,16 +843,23 @@ function getPropertyName(node, initialScope) {
if (node.computed) {
return getStringIfConstant(node.property, initialScope)
}
+ if (node.property.type === "PrivateIdentifier") {
+ return null
+ }
return node.property.name
case "Property":
case "MethodDefinition":
+ case "PropertyDefinition":
if (node.computed) {
return getStringIfConstant(node.key, initialScope)
}
if (node.key.type === "Literal") {
return String(node.key.value)
}
+ if (node.key.type === "PrivateIdentifier") {
+ return null
+ }
return node.key.name
// no default
@@ -825,14 +871,27 @@ function getPropertyName(node, initialScope) {
/**
* Get the name and kind of the given function node.
* @param {ASTNode} node - The function node to get.
+ * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
* @returns {string} The name and kind of the function node.
*/
-function getFunctionNameWithKind(node) {
+// eslint-disable-next-line complexity
+function getFunctionNameWithKind(node, sourceCode) {
const parent = node.parent;
const tokens = [];
-
- if (parent.type === "MethodDefinition" && parent.static) {
- tokens.push("static");
+ const isObjectMethod = parent.type === "Property" && parent.value === node;
+ const isClassMethod =
+ parent.type === "MethodDefinition" && parent.value === node;
+ const isClassFieldMethod =
+ parent.type === "PropertyDefinition" && parent.value === node;
+
+ // Modifiers.
+ if (isClassMethod || isClassFieldMethod) {
+ if (parent.static) {
+ tokens.push("static");
+ }
+ if (parent.key.type === "PrivateIdentifier") {
+ tokens.push("private");
+ }
}
if (node.async) {
tokens.push("async");
@@ -841,12 +900,8 @@ function getFunctionNameWithKind(node) {
tokens.push("generator");
}
- if (node.type === "ArrowFunctionExpression") {
- tokens.push("arrow", "function");
- } else if (
- parent.type === "Property" ||
- parent.type === "MethodDefinition"
- ) {
+ // Kinds.
+ if (isObjectMethod || isClassMethod) {
if (parent.kind === "constructor") {
return "constructor"
}
@@ -857,35 +912,45 @@ function getFunctionNameWithKind(node) {
} else {
tokens.push("method");
}
+ } else if (isClassFieldMethod) {
+ tokens.push("method");
} else {
- tokens.push("function");
- }
-
- if (node.id) {
- tokens.push(`'${node.id.name}'`);
- } else {
- const name = getPropertyName(parent);
-
- if (name) {
- tokens.push(`'${name}'`);
+ if (node.type === "ArrowFunctionExpression") {
+ tokens.push("arrow");
}
+ tokens.push("function");
}
- if (node.type === "ArrowFunctionExpression") {
- if (
- parent.type === "VariableDeclarator" &&
- parent.id &&
- parent.id.type === "Identifier"
- ) {
- tokens.push(`'${parent.id.name}'`);
- }
- if (
- parent.type === "AssignmentExpression" &&
- parent.left &&
- parent.left.type === "Identifier"
- ) {
- tokens.push(`'${parent.left.name}'`);
+ // Names.
+ if (isObjectMethod || isClassMethod || isClassFieldMethod) {
+ if (parent.key.type === "PrivateIdentifier") {
+ tokens.push(`#${parent.key.name}`);
+ } else {
+ const name = getPropertyName(parent);
+ if (name) {
+ tokens.push(`'${name}'`);
+ } else if (sourceCode) {
+ const keyText = sourceCode.getText(parent.key);
+ if (!keyText.includes("\n")) {
+ tokens.push(`[${keyText}]`);
+ }
+ }
}
+ } else if (node.id) {
+ tokens.push(`'${node.id.name}'`);
+ } else if (
+ parent.type === "VariableDeclarator" &&
+ parent.id &&
+ parent.id.type === "Identifier"
+ ) {
+ tokens.push(`'${parent.id.name}'`);
+ } else if (
+ (parent.type === "AssignmentExpression" ||
+ parent.type === "AssignmentPattern") &&
+ parent.left &&
+ parent.left.type === "Identifier"
+ ) {
+ tokens.push(`'${parent.left.name}'`);
}
return tokens.join(" ")
@@ -911,7 +976,7 @@ const typeConversionBinaryOps = Object.freeze(
"^",
"&",
"in",
- ])
+ ]),
);
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));
@@ -1026,6 +1091,16 @@ const visitor = Object.freeze(
}
return this.$visitChildren(node, options, visitorKeys)
},
+ PropertyDefinition(node, options, visitorKeys) {
+ if (
+ options.considerImplicitTypeConversion &&
+ node.computed &&
+ node.key.type !== "Literal"
+ ) {
+ return true
+ }
+ return this.$visitChildren(node, options, visitorKeys)
+ },
UnaryExpression(node, options, visitorKeys) {
if (node.operator === "delete") {
return true
@@ -1045,7 +1120,7 @@ const visitor = Object.freeze(
YieldExpression() {
return true
},
- })
+ }),
);
/**
@@ -1061,12 +1136,12 @@ const visitor = Object.freeze(
function hasSideEffect(
node,
sourceCode,
- { considerGetters = false, considerImplicitTypeConversion = false } = {}
+ { considerGetters = false, considerImplicitTypeConversion = false } = {},
) {
return visitor.$visit(
node,
{ considerGetters, considerImplicitTypeConversion },
- sourceCode.visitorKeys || evk.KEYS
+ sourceCode.visitorKeys || evk.KEYS,
)
}
@@ -1086,7 +1161,7 @@ function getParentSyntaxParen(node, sourceCode) {
if (parent.arguments.length === 1 && parent.arguments[0] === node) {
return sourceCode.getTokenAfter(
parent.callee,
- isOpeningParenToken
+ isOpeningParenToken,
)
}
return null
@@ -1095,7 +1170,7 @@ function getParentSyntaxParen(node, sourceCode) {
if (parent.test === node) {
return sourceCode.getTokenAfter(
parent.body,
- isOpeningParenToken
+ isOpeningParenToken,
)
}
return null
@@ -1146,7 +1221,7 @@ function getParentSyntaxParen(node, sourceCode) {
function isParenthesized(
timesOrNode,
nodeOrSourceCode,
- optionalSourceCode
+ optionalSourceCode,
) {
let times, node, sourceCode, maybeLeftParen, maybeRightParen;
if (typeof timesOrNode === "number") {
@@ -1162,7 +1237,11 @@ function isParenthesized(
sourceCode = nodeOrSourceCode;
}
- if (node == null) {
+ if (
+ node == null ||
+ // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
+ (node.parent.type === "CatchClause" && node.parent.param === node)
+ ) {
return false
}
@@ -1362,7 +1441,7 @@ function isModifiedGlobal(variable) {
return (
variable == null ||
variable.defs.length !== 0 ||
- variable.references.some(r => r.isWrite())
+ variable.references.some((r) => r.isWrite())
)
}
@@ -1406,7 +1485,7 @@ class ReferenceTracker {
{
mode = "strict",
globalObjectNames = ["global", "globalThis", "self", "window"],
- } = {}
+ } = {},
) {
this.variableStack = [];
this.globalScope = globalScope;
@@ -1433,7 +1512,7 @@ class ReferenceTracker {
variable,
path,
nextTraceMap,
- true
+ true,
);
}
@@ -1449,7 +1528,7 @@ class ReferenceTracker {
variable,
path,
traceMap,
- false
+ false,
);
}
}
@@ -1526,11 +1605,8 @@ class ReferenceTracker {
esm
? nextTraceMap
: this.mode === "legacy"
- ? Object.assign(
- { default: nextTraceMap },
- nextTraceMap
- )
- : { default: nextTraceMap }
+ ? { default: nextTraceMap, ...nextTraceMap }
+ : { default: nextTraceMap },
);
if (esm) {
@@ -1616,7 +1692,7 @@ class ReferenceTracker {
yield* this._iteratePropertyReferences(
parent,
path,
- nextTraceMap
+ nextTraceMap,
);
}
return
@@ -1673,7 +1749,7 @@ class ReferenceTracker {
variable,
path,
traceMap,
- false
+ false,
);
}
return
@@ -1699,7 +1775,7 @@ class ReferenceTracker {
yield* this._iterateLhsReferences(
property.value,
nextPath,
- nextTraceMap
+ nextTraceMap,
);
}
return
@@ -1742,7 +1818,7 @@ class ReferenceTracker {
findVariable(this.globalScope, specifierNode.local),
path,
nextTraceMap,
- false
+ false,
);
return
@@ -1753,7 +1829,7 @@ class ReferenceTracker {
findVariable(this.globalScope, specifierNode.local),
path,
traceMap,
- false
+ false,
);
return
}
diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md
index 250f5fa31a6..d7dbe65fa01 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md
@@ -17,7 +17,7 @@ $ npm install eslint-visitor-keys
### Requirements
-- [Node.js] 4.0.0 or later.
+- [Node.js] 10.0.0 or later.
## šŸ“– Usage
diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json
index a33bbc66005..e648ee125ac 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json
@@ -211,6 +211,7 @@
"ObjectPattern": [
"properties"
],
+ "PrivateIdentifier": [],
"Program": [
"body"
],
@@ -218,6 +219,10 @@
"key",
"value"
],
+ "PropertyDefinition": [
+ "key",
+ "value"
+ ],
"RestElement": [
"argument"
],
diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json
index 63267be6437..775706ba4b4 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json
@@ -1,13 +1,13 @@
{
"name": "eslint-visitor-keys",
- "version": "1.3.0",
+ "version": "2.1.0",
"description": "Constants and utilities about visitor keys to traverse AST.",
"main": "lib/index.js",
"files": [
"lib"
],
"engines": {
- "node": ">=4"
+ "node": ">=10"
},
"dependencies": {},
"devDependencies": {
@@ -20,7 +20,6 @@
},
"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",
diff --git a/tools/node_modules/eslint/node_modules/eslint-utils/package.json b/tools/node_modules/eslint/node_modules/eslint-utils/package.json
index 661a97fb097..574d12026c7 100644
--- a/tools/node_modules/eslint/node_modules/eslint-utils/package.json
+++ b/tools/node_modules/eslint/node_modules/eslint-utils/package.json
@@ -1,9 +1,9 @@
{
"name": "eslint-utils",
- "version": "2.1.0",
+ "version": "3.0.0",
"description": "Utilities for ESLint plugins.",
"engines": {
- "node": ">=6"
+ "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
},
"sideEffects": false,
"main": "index",
@@ -11,20 +11,28 @@
"files": [
"index.*"
],
+ "exports": {
+ ".": {
+ "import": "./index.mjs",
+ "require": "./index.js"
+ },
+ "./package.json": "./package.json"
+ },
"dependencies": {
- "eslint-visitor-keys": "^1.1.0"
+ "eslint-visitor-keys": "^2.0.0"
},
"devDependencies": {
- "@mysticatea/eslint-plugin": "^12.0.0",
+ "@mysticatea/eslint-plugin": "^13.0.0",
"codecov": "^3.6.1",
"dot-prop": "^4.2.0",
- "eslint": "^6.5.1",
+ "eslint": "^7.24.0",
"esm": "^3.2.25",
- "espree": "^6.1.1",
+ "espree": "github:eslint/espree#1c744b3a602b783926344811a9459b92afe57444",
"mocha": "^6.2.2",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"opener": "^1.5.1",
+ "prettier": "~2.3.0",
"rimraf": "^3.0.0",
"rollup": "^1.25.0",
"rollup-plugin-sourcemaps": "^0.4.2",
@@ -32,6 +40,9 @@
"vuepress": "^1.2.0",
"warun": "^1.0.0"
},
+ "peerDependencies": {
+ "eslint": ">=5"
+ },
"scripts": {
"prebuild": "npm run -s clean",
"build": "rollup -c",
@@ -40,8 +51,10 @@
"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",
+ "format": "npm run -s format:prettier -- --write",
+ "format:prettier": "prettier docs/.vuepress/config.js src/**/*.js test/**/*.js rollup.config.js .vscode/*.json *.json .github/**/*.yml *.yml docs/**/*.md *.md",
+ "lint": "eslint docs/.vuepress/config.js src test rollup.config.js",
+ "test": "run-s \"format:prettier -- --check\" 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",
diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md
index d7dbe65fa01..71217e381dc 100644
--- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md
+++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/README.md
@@ -21,6 +21,14 @@ $ npm install eslint-visitor-keys
## šŸ“– 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")
```
diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs
new file mode 100644
index 00000000000..4213f0b2f14
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs
@@ -0,0 +1,364 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+const KEYS = {
+ AssignmentExpression: [
+ "left",
+ "right"
+ ],
+ AssignmentPattern: [
+ "left",
+ "right"
+ ],
+ ArrayExpression: [
+ "elements"
+ ],
+ ArrayPattern: [
+ "elements"
+ ],
+ ArrowFunctionExpression: [
+ "params",
+ "body"
+ ],
+ AwaitExpression: [
+ "argument"
+ ],
+ BlockStatement: [
+ "body"
+ ],
+ BinaryExpression: [
+ "left",
+ "right"
+ ],
+ BreakStatement: [
+ "label"
+ ],
+ CallExpression: [
+ "callee",
+ "arguments"
+ ],
+ CatchClause: [
+ "param",
+ "body"
+ ],
+ ChainExpression: [
+ "expression"
+ ],
+ ClassBody: [
+ "body"
+ ],
+ ClassDeclaration: [
+ "id",
+ "superClass",
+ "body"
+ ],
+ ClassExpression: [
+ "id",
+ "superClass",
+ "body"
+ ],
+ ConditionalExpression: [
+ "test",
+ "consequent",
+ "alternate"
+ ],
+ ContinueStatement: [
+ "label"
+ ],
+ DebuggerStatement: [],
+ DoWhileStatement: [
+ "body",
+ "test"
+ ],
+ EmptyStatement: [],
+ ExportAllDeclaration: [
+ "exported",
+ "source"
+ ],
+ ExportDefaultDeclaration: [
+ "declaration"
+ ],
+ ExportNamedDeclaration: [
+ "declaration",
+ "specifiers",
+ "source"
+ ],
+ ExportSpecifier: [
+ "exported",
+ "local"
+ ],
+ ExpressionStatement: [
+ "expression"
+ ],
+ ExperimentalRestProperty: [
+ "argument"
+ ],
+ ExperimentalSpreadProperty: [
+ "argument"
+ ],
+ ForStatement: [
+ "init",
+ "test",
+ "update",
+ "body"
+ ],
+ ForInStatement: [
+ "left",
+ "right",
+ "body"
+ ],
+ ForOfStatement: [
+ "left",
+ "right",
+ "body"
+ ],
+ FunctionDeclaration: [
+ "id",
+ "params",
+ "body"
+ ],
+ FunctionExpression: [
+ "id",
+ "params",
+ "body"
+ ],
+ Identifier: [],
+ IfStatement: [
+ "test",
+ "consequent",
+ "alternate"
+ ],
+ ImportDeclaration: [
+ "specifiers",
+ "source"
+ ],
+ ImportDefaultSpecifier: [
+ "local"
+ ],
+ ImportExpression: [
+ "source"
+ ],
+ ImportNamespaceSpecifier: [
+ "local"
+ ],
+ ImportSpecifier: [
+ "imported",
+ "local"
+ ],
+ JSXAttribute: [
+ "name",
+ "value"
+ ],
+ JSXClosingElement: [
+ "name"
+ ],
+ JSXElement: [
+ "openingElement",
+ "children",
+ "closingElement"
+ ],
+ JSXEmptyExpression: [],
+ JSXExpressionContainer: [
+ "expression"
+ ],
+ JSXIdentifier: [],
+ JSXMemberExpression: [
+ "object",
+ "property"
+ ],
+ JSXNamespacedName: [
+ "namespace",
+ "name"
+ ],
+ JSXOpeningElement: [
+ "name",
+ "attributes"
+ ],
+ JSXSpreadAttribute: [
+ "argument"
+ ],
+ JSXText: [],
+ JSXFragment: [
+ "openingFragment",
+ "children",
+ "closingFragment"
+ ],
+ 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"
+ ]
+};
+
+// Types.
+const NODE_TYPES = Object.keys(KEYS);
+
+// Freeze the keys.
+for (const type of NODE_TYPES) {
+ Object.freeze(KEYS[type]);
+}
+Object.freeze(KEYS);
+
+/**
+ * @author Toru Nagashima <https://github.com/mysticatea>
+ * See LICENSE file in root directory for full license.
+ */
+
+// List to ignore keys.
+const KEY_BLACKLIST = new Set([
+ "parent",
+ "leadingComments",
+ "trailingComments"
+]);
+
+/**
+ * Check whether a given key should be used or not.
+ * @param {string} key The key to check.
+ * @returns {boolean} `true` if the key should be used.
+ */
+function filterKey(key) {
+ return !KEY_BLACKLIST.has(key) && key[0] !== "_";
+}
+
+/**
+ * Get visitor keys of a given node.
+ * @param {Object} node The AST node to get keys.
+ * @returns {string[]} Visitor keys of the node.
+ */
+function getKeys(node) {
+ return Object.keys(node).filter(filterKey);
+}
+
+// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
+// eslint-disable-next-line valid-jsdoc
+/**
+ * Make the union set with `KEYS` and given keys.
+ * @param {Object} additionalKeys The additional keys.
+ * @returns {{ [type: string]: string[] | undefined }} The union set.
+ */
+function unionWith(additionalKeys) {
+ const retv = Object.assign({}, KEYS);
+
+ for (const type of Object.keys(additionalKeys)) {
+ if (Object.prototype.hasOwnProperty.call(retv, type)) {
+ const keys = new Set(additionalKeys[type]);
+
+ for (const key of retv[type]) {
+ keys.add(key);
+ }
+
+ retv[type] = Object.freeze(Array.from(keys));
+ } else {
+ retv[type] = Object.freeze(Array.from(additionalKeys[type]));
+ }
+ }
+
+ return Object.freeze(retv);
+}
+
+exports.KEYS = KEYS;
+exports.getKeys = getKeys;
+exports.unionWith = unionWith;
+//# sourceMappingURL=eslint-visitor-keys.cjs.map
diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js
index cd8a3260834..44f73d6885c 100644
--- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js
+++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/index.js
@@ -2,18 +2,7 @@
* @author Toru Nagashima <https://github.com/mysticatea>
* 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);
+import KEYS from "./visitor-keys.js";
// List to ignore keys.
const KEY_BLACKLIST = new Set([
@@ -31,51 +20,40 @@ function filterKey(key) {
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}
-//------------------------------------------------------------------------------
-// Public interfaces
-//------------------------------------------------------------------------------
-
-module.exports = Object.freeze({
-
- /**
- * Visitor keys.
- * @type {{ [type: string]: string[] | undefined }}
- */
- KEYS,
-
- /**
- * Get visitor keys of a given node.
- * @param {Object} node The AST node to get keys.
- * @returns {string[]} Visitor keys of the node.
- */
- getKeys(node) {
- return Object.keys(node).filter(filterKey);
- },
-
- // Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
- // eslint-disable-next-line valid-jsdoc
- /**
- * Make the union set with `KEYS` and given keys.
- * @param {Object} additionalKeys The additional keys.
- * @returns {{ [type: string]: string[] | undefined }} The union set.
- */
- unionWith(additionalKeys) {
- const retv = Object.assign({}, KEYS);
+/**
+ * Get visitor keys of a given node.
+ * @param {Object} node The AST node to get keys.
+ * @returns {string[]} Visitor keys of the node.
+ */
+export function getKeys(node) {
+ return Object.keys(node).filter(filterKey);
+}
- for (const type of Object.keys(additionalKeys)) {
- if (retv.hasOwnProperty(type)) {
- const keys = new Set(additionalKeys[type]);
+// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
+// eslint-disable-next-line valid-jsdoc
+/**
+ * Make the union set with `KEYS` and given keys.
+ * @param {Object} additionalKeys The additional keys.
+ * @returns {{ [type: string]: string[] | undefined }} The union set.
+ */
+export function unionWith(additionalKeys) {
+ const retv = Object.assign({}, KEYS);
- for (const key of retv[type]) {
- keys.add(key);
- }
+ for (const type of Object.keys(additionalKeys)) {
+ if (Object.prototype.hasOwnProperty.call(retv, type)) {
+ const keys = new Set(additionalKeys[type]);
- retv[type] = Object.freeze(Array.from(keys));
- } else {
- retv[type] = Object.freeze(Array.from(additionalKeys[type]));
+ for (const key of retv[type]) {
+ keys.add(key);
}
- }
- return Object.freeze(retv);
+ retv[type] = Object.freeze(Array.from(keys));
+ } else {
+ retv[type] = Object.freeze(Array.from(additionalKeys[type]));
+ }
}
-});
+
+ return Object.freeze(retv);
+}
+
+export { KEYS };
diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js
index e648ee125ac..ade8fc3bfc7 100644
--- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.json
+++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/lib/visitor-keys.js
@@ -1,289 +1,300 @@
-{
- "AssignmentExpression": [
+const KEYS = {
+ AssignmentExpression: [
"left",
"right"
],
- "AssignmentPattern": [
+ AssignmentPattern: [
"left",
"right"
],
- "ArrayExpression": [
+ ArrayExpression: [
"elements"
],
- "ArrayPattern": [
+ ArrayPattern: [
"elements"
],
- "ArrowFunctionExpression": [
+ ArrowFunctionExpression: [
"params",
"body"
],
- "AwaitExpression": [
+ AwaitExpression: [
"argument"
],
- "BlockStatement": [
+ BlockStatement: [
"body"
],
- "BinaryExpression": [
+ BinaryExpression: [
"left",
"right"
],
- "BreakStatement": [
+ BreakStatement: [
"label"
],
- "CallExpression": [
+ CallExpression: [
"callee",
"arguments"
],
- "CatchClause": [
+ CatchClause: [
"param",
"body"
],
- "ChainExpression": [
+ ChainExpression: [
"expression"
],
- "ClassBody": [
+ ClassBody: [
"body"
],
- "ClassDeclaration": [
+ ClassDeclaration: [
"id",
"superClass",
"body"
],
- "ClassExpression": [
+ ClassExpression: [
"id",
"superClass",
"body"
],
- "ConditionalExpression": [
+ ConditionalExpression: [
"test",
"consequent",
"alternate"
],
- "ContinueStatement": [
+ ContinueStatement: [
"label"
],
- "DebuggerStatement": [],
- "DoWhileStatement": [
+ DebuggerStatement: [],
+ DoWhileStatement: [
"body",
"test"
],
- "EmptyStatement": [],
- "ExportAllDeclaration": [
+ EmptyStatement: [],
+ ExportAllDeclaration: [
"exported",
"source"
],
- "ExportDefaultDeclaration": [
+ ExportDefaultDeclaration: [
"declaration"
],
- "ExportNamedDeclaration": [
+ ExportNamedDeclaration: [
"declaration",
"specifiers",
"source"
],
- "ExportSpecifier": [
+ ExportSpecifier: [
"exported",
"local"
],
- "ExpressionStatement": [
+ ExpressionStatement: [
"expression"
],
- "ExperimentalRestProperty": [
+ ExperimentalRestProperty: [
"argument"
],
- "ExperimentalSpreadProperty": [
+ ExperimentalSpreadProperty: [
"argument"
],
- "ForStatement": [
+ ForStatement: [
"init",
"test",
"update",
"body"
],
- "ForInStatement": [
+ ForInStatement: [
"left",
"right",
"body"
],
- "ForOfStatement": [
+ ForOfStatement: [
"left",
"right",
"body"
],
- "FunctionDeclaration": [
+ FunctionDeclaration: [
"id",
"params",
"body"
],
- "FunctionExpression": [
+ FunctionExpression: [
"id",
"params",
"body"
],
- "Identifier": [],
- "IfStatement": [
+ Identifier: [],
+ IfStatement: [
"test",
"consequent",
"alternate"
],
- "ImportDeclaration": [
+ ImportDeclaration: [
"specifiers",
"source"
],
- "ImportDefaultSpecifier": [
+ ImportDefaultSpecifier: [
"local"
],
- "ImportExpression": [
+ ImportExpression: [
"source"
],
- "ImportNamespaceSpecifier": [
+ ImportNamespaceSpecifier: [
"local"
],
- "ImportSpecifier": [
+ ImportSpecifier: [
"imported",
"local"
],
- "JSXAttribute": [
+ JSXAttribute: [
"name",
"value"
],
- "JSXClosingElement": [
+ JSXClosingElement: [
"name"
],
- "JSXElement": [
+ JSXElement: [
"openingElement",
"children",
"closingElement"
],
- "JSXEmptyExpression": [],
- "JSXExpressionContainer": [
+ JSXEmptyExpression: [],
+ JSXExpressionContainer: [
"expression"
],
- "JSXIdentifier": [],
- "JSXMemberExpression": [
+ JSXIdentifier: [],
+ JSXMemberExpression: [
"object",
"property"
],
- "JSXNamespacedName": [
+ JSXNamespacedName: [
"namespace",
"name"
],
- "JSXOpeningElement": [
+ JSXOpeningElement: [
"name",
"attributes"
],
- "JSXSpreadAttribute": [
+ JSXSpreadAttribute: [
"argument"
],
- "JSXText": [],
- "JSXFragment": [
+ JSXText: [],
+ JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
- "Literal": [],
- "LabeledStatement": [
+ Literal: [],
+ LabeledStatement: [
"label",
"body"
],
- "LogicalExpression": [
+ LogicalExpression: [
"left",
"right"
],
- "MemberExpression": [
+ MemberExpression: [
"object",
"property"
],
- "MetaProperty": [
+ MetaProperty: [
"meta",
"property"
],
- "MethodDefinition": [
+ MethodDefinition: [
"key",
"value"
],
- "NewExpression": [
+ NewExpression: [
"callee",
"arguments"
],
- "ObjectExpression": [
+ ObjectExpression: [
"properties"
],
- "ObjectPattern": [
+ ObjectPattern: [
"properties"
],
- "PrivateIdentifier": [],
- "Program": [
+ PrivateIdentifier: [],
+ Program: [
"body"
],
- "Property": [
+ Property: [
"key",
"value"
],
- "PropertyDefinition": [
+ PropertyDefinition: [
"key",
"value"
],
- "RestElement": [
+ RestElement: [
"argument"
],
- "ReturnStatement": [
+ ReturnStatement: [
"argument"
],
- "SequenceExpression": [
+ SequenceExpression: [
"expressions"
],
- "SpreadElement": [
+ SpreadElement: [
"argument"
],
- "Super": [],
- "SwitchStatement": [
+ Super: [],
+ SwitchStatement: [
"discriminant",
"cases"
],
- "SwitchCase": [
+ SwitchCase: [
"test",
"consequent"
],
- "TaggedTemplateExpression": [
+ TaggedTemplateExpression: [
"tag",
"quasi"
],
- "TemplateElement": [],
- "TemplateLiteral": [
+ TemplateElement: [],
+ TemplateLiteral: [
"quasis",
"expressions"
],
- "ThisExpression": [],
- "ThrowStatement": [
+ ThisExpression: [],
+ ThrowStatement: [
"argument"
],
- "TryStatement": [
+ TryStatement: [
"block",
"handler",
"finalizer"
],
- "UnaryExpression": [
+ UnaryExpression: [
"argument"
],
- "UpdateExpression": [
+ UpdateExpression: [
"argument"
],
- "VariableDeclaration": [
+ VariableDeclaration: [
"declarations"
],
- "VariableDeclarator": [
+ VariableDeclarator: [
"id",
"init"
],
- "WhileStatement": [
+ WhileStatement: [
"test",
"body"
],
- "WithStatement": [
+ WithStatement: [
"object",
"body"
],
- "YieldExpression": [
+ YieldExpression: [
"argument"
]
+};
+
+// Types.
+const NODE_TYPES = Object.keys(KEYS);
+
+// Freeze the keys.
+for (const type of NODE_TYPES) {
+ Object.freeze(KEYS[type]);
}
+Object.freeze(KEYS);
+
+export default KEYS;
diff --git a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json
index 775706ba4b4..82c2115bdb5 100644
--- a/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json
+++ b/tools/node_modules/eslint/node_modules/eslint-visitor-keys/package.json
@@ -1,27 +1,43 @@
{
"name": "eslint-visitor-keys",
- "version": "2.1.0",
+ "version": "3.0.0",
"description": "Constants and utilities about visitor keys to traverse AST.",
- "main": "lib/index.js",
+ "type": "module",
+ "main": "dist/eslint-visitor-keys.cjs",
+ "exports": {
+ ".": [
+ {
+ "import": "./lib/index.js",
+ "require": "./dist/eslint-visitor-keys.cjs"
+ },
+ "./dist/eslint-visitor-keys.cjs"
+ ],
+ "./package.json": "./package.json"
+ },
"files": [
+ "dist/eslint-visitor-keys.cjs",
"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"
+ "c8": "^7.7.3",
+ "eslint": "^7.29.0",
+ "eslint-config-eslint": "^7.0.0",
+ "eslint-plugin-jsdoc": "^35.4.0",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-release": "^3.1.2",
+ "mocha": "^9.0.1",
+ "opener": "^1.5.2",
+ "rollup": "^2.52.1"
},
"scripts": {
- "lint": "eslint lib tests/lib",
- "test": "nyc mocha tests/lib",
- "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
+ "prepare": "npm run build",
+ "build": "rollup -c",
+ "lint": "eslint .",
+ "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js",
+ "coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html",
"generate-release": "eslint-generate-release",
"generate-alpharelease": "eslint-generate-prerelease alpha",
"generate-betarelease": "eslint-generate-prerelease beta",
diff --git a/tools/node_modules/eslint/node_modules/espree/README.md b/tools/node_modules/eslint/node_modules/espree/README.md
index 72d88f83315..d4c49c75a01 100644
--- a/tools/node_modules/eslint/node_modules/espree/README.md
+++ b/tools/node_modules/eslint/node_modules/espree/README.md
@@ -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);
@@ -32,10 +40,10 @@ const ast = espree.parse(code);
- `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 :**
@@ -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);
```
@@ -130,8 +140,9 @@ 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.
+ // Set to 3, 5 (the 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), 2021 (same as 12), or 2022 (same as 13) to use the year-based naming.
+ // You can also set "latest" to use the most recently supported version.
ecmaVersion: 5,
// specify which type of script you're parsing ("script" or "module")
@@ -172,7 +183,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 +229,15 @@ 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 2021 features and partially supports ECMAScript 2022 features.
-Because ECMAScript 2021 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
+Because ECMAScript 2022 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)
+* [Class instance fields](https://github.com/tc39/proposal-class-fields)
+* [Class private instance methods and accessors](https://github.com/tc39/proposal-private-methods)
+* [Class static fields, static private methods and accessors](https://github.com/tc39/proposal-static-class-features)
+* [RegExp match indices](https://github.com/tc39/proposal-regexp-match-indices)
+* [Top-level await](https://github.com/tc39/proposal-top-level-await)
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.
diff --git a/tools/node_modules/eslint/node_modules/espree/dist/espree.cjs b/tools/node_modules/eslint/node_modules/espree/dist/espree.cjs
new file mode 100644
index 00000000000..233a7ab537d
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/espree/dist/espree.cjs
@@ -0,0 +1,989 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var acorn = require('acorn');
+var jsx = require('acorn-jsx');
+var visitorKeys = require('eslint-visitor-keys');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+function _interopNamespace(e) {
+ if (e && e.__esModule) return e;
+ var n = Object.create(null);
+ if (e) {
+ Object.keys(e).forEach(function (k) {
+ if (k !== 'default') {
+ var d = Object.getOwnPropertyDescriptor(e, k);
+ Object.defineProperty(n, k, d.get ? d : {
+ enumerable: true,
+ get: function () {
+ return e[k];
+ }
+ });
+ }
+ });
+ }
+ n['default'] = e;
+ return Object.freeze(n);
+}
+
+var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn);
+var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
+var visitorKeys__namespace = /*#__PURE__*/_interopNamespace(visitorKeys);
+
+/**
+ * @fileoverview The AST node types produced by the parser.
+ * @author Nicholas C. Zakas
+ */
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+// None!
+
+//------------------------------------------------------------------------------
+// Public
+//------------------------------------------------------------------------------
+
+var astNodeTypes = {
+ 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"
+};
+
+/**
+ * @fileoverview Translates tokens between Acorn format and Esprima format.
+ * @author Nicholas C. Zakas
+ */
+/* eslint no-underscore-dangle: 0 */
+
+//------------------------------------------------------------------------------
+// Requirements
+//------------------------------------------------------------------------------
+
+// none!
+
+//------------------------------------------------------------------------------
+// Private
+//------------------------------------------------------------------------------
+
+
+// Esprima Token Types
+const Token = {
+ Boolean: "Boolean",
+ EOF: "<end>",
+ Identifier: "Identifier",
+ PrivateIdentifier: "PrivateIdentifier",
+ Keyword: "Keyword",
+ Null: "Null",
+ Numeric: "Numeric",
+ Punctuator: "Punctuator",
+ String: "String",
+ RegularExpression: "RegularExpression",
+ Template: "Template",
+ JSXIdentifier: "JSXIdentifier",
+ JSXText: "JSXText"
+};
+
+/**
+ * Converts part of a template into an Esprima token.
+ * @param {AcornToken[]} tokens The Acorn tokens representing the template.
+ * @param {string} code The source code.
+ * @returns {EsprimaToken} The Esprima equivalent of the template token.
+ * @private
+ */
+function convertTemplatePart(tokens, code) {
+ const firstToken = tokens[0],
+ lastTemplateToken = tokens[tokens.length - 1];
+
+ const token = {
+ type: Token.Template,
+ value: code.slice(firstToken.start, lastTemplateToken.end)
+ };
+
+ if (firstToken.loc) {
+ token.loc = {
+ start: firstToken.loc.start,
+ end: lastTemplateToken.loc.end
+ };
+ }
+
+ if (firstToken.range) {
+ token.start = firstToken.range[0];
+ token.end = lastTemplateToken.range[1];
+ token.range = [token.start, token.end];
+ }
+
+ return token;
+}
+
+/**
+ * Contains logic to translate Acorn tokens into Esprima tokens.
+ * @param {Object} acornTokTypes The Acorn token types.
+ * @param {string} code The source code Acorn is parsing. This is necessary
+ * to correct the "value" property of some tokens.
+ * @constructor
+ */
+function TokenTranslator(acornTokTypes, code) {
+
+ // token types
+ this._acornTokTypes = acornTokTypes;
+
+ // token buffer for templates
+ this._tokens = [];
+
+ // track the last curly brace
+ this._curlyBrace = null;
+
+ // the source code
+ this._code = code;
+
+}
+
+TokenTranslator.prototype = {
+ constructor: TokenTranslator,
+
+ /**
+ * Translates a single Esprima token to a single Acorn token. This may be
+ * inaccurate due to how templates are handled differently in Esprima and
+ * Acorn, but should be accurate for all other tokens.
+ * @param {AcornToken} token The Acorn token to translate.
+ * @param {Object} extra Espree extra object.
+ * @returns {EsprimaToken} The Esprima version of the token.
+ */
+ translate(token, extra) {
+
+ const type = token.type,
+ tt = this._acornTokTypes;
+
+ if (type === tt.name) {
+ token.type = Token.Identifier;
+
+ // TODO: See if this is an Acorn bug
+ if (token.value === "static") {
+ token.type = Token.Keyword;
+ }
+
+ if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) {
+ token.type = Token.Keyword;
+ }
+
+ } else if (type === tt.privateId) {
+ token.type = Token.PrivateIdentifier;
+
+ } else if (type === tt.semi || type === tt.comma ||
+ type === tt.parenL || type === tt.parenR ||
+ type === tt.braceL || type === tt.braceR ||
+ type === tt.dot || type === tt.bracketL ||
+ type === tt.colon || type === tt.question ||
+ type === tt.bracketR || type === tt.ellipsis ||
+ type === tt.arrow || type === tt.jsxTagStart ||
+ type === tt.incDec || type === tt.starstar ||
+ type === tt.jsxTagEnd || type === tt.prefix ||
+ type === tt.questionDot ||
+ (type.binop && !type.keyword) ||
+ type.isAssign) {
+
+ token.type = Token.Punctuator;
+ token.value = this._code.slice(token.start, token.end);
+ } else if (type === tt.jsxName) {
+ token.type = Token.JSXIdentifier;
+ } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
+ token.type = Token.JSXText;
+ } else if (type.keyword) {
+ if (type.keyword === "true" || type.keyword === "false") {
+ token.type = Token.Boolean;
+ } else if (type.keyword === "null") {
+ token.type = Token.Null;
+ } else {
+ token.type = Token.Keyword;
+ }
+ } else if (type === tt.num) {
+ token.type = Token.Numeric;
+ token.value = this._code.slice(token.start, token.end);
+ } else if (type === tt.string) {
+
+ if (extra.jsxAttrValueToken) {
+ extra.jsxAttrValueToken = false;
+ token.type = Token.JSXText;
+ } else {
+ token.type = Token.String;
+ }
+
+ token.value = this._code.slice(token.start, token.end);
+ } else if (type === tt.regexp) {
+ token.type = Token.RegularExpression;
+ const value = token.value;
+
+ token.regex = {
+ flags: value.flags,
+ pattern: value.pattern
+ };
+ token.value = `/${value.pattern}/${value.flags}`;
+ }
+
+ return token;
+ },
+
+ /**
+ * Function to call during Acorn's onToken handler.
+ * @param {AcornToken} token The Acorn token.
+ * @param {Object} extra The Espree extra object.
+ * @returns {void}
+ */
+ onToken(token, extra) {
+
+ const that = this,
+ tt = this._acornTokTypes,
+ tokens = extra.tokens,
+ templateTokens = this._tokens;
+
+ /**
+ * Flushes the buffered template tokens and resets the template
+ * tracking.
+ * @returns {void}
+ * @private
+ */
+ function translateTemplateTokens() {
+ tokens.push(convertTemplatePart(that._tokens, that._code));
+ that._tokens = [];
+ }
+
+ if (token.type === tt.eof) {
+
+ // might be one last curlyBrace
+ if (this._curlyBrace) {
+ tokens.push(this.translate(this._curlyBrace, extra));
+ }
+
+ return;
+ }
+
+ if (token.type === tt.backQuote) {
+
+ // if there's already a curly, it's not part of the template
+ if (this._curlyBrace) {
+ tokens.push(this.translate(this._curlyBrace, extra));
+ this._curlyBrace = null;
+ }
+
+ templateTokens.push(token);
+
+ // it's the end
+ if (templateTokens.length > 1) {
+ translateTemplateTokens();
+ }
+
+ return;
+ }
+ if (token.type === tt.dollarBraceL) {
+ templateTokens.push(token);
+ translateTemplateTokens();
+ return;
+ }
+ if (token.type === tt.braceR) {
+
+ // if there's already a curly, it's not part of the template
+ if (this._curlyBrace) {
+ tokens.push(this.translate(this._curlyBrace, extra));
+ }
+
+ // store new curly for later
+ this._curlyBrace = token;
+ return;
+ }
+ if (token.type === tt.template || token.type === tt.invalidTemplate) {
+ if (this._curlyBrace) {
+ templateTokens.push(this._curlyBrace);
+ this._curlyBrace = null;
+ }
+
+ templateTokens.push(token);
+ return;
+ }
+
+ if (this._curlyBrace) {
+ tokens.push(this.translate(this._curlyBrace, extra));
+ this._curlyBrace = null;
+ }
+
+ tokens.push(this.translate(token, extra));
+ }
+};
+
+/**
+ * @fileoverview A collection of methods for processing Espree's options.
+ * @author Kai Cataldo
+ */
+
+//------------------------------------------------------------------------------
+// Helpers
+//------------------------------------------------------------------------------
+
+const SUPPORTED_VERSIONS = [
+ 3,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12,
+ 13
+];
+
+/**
+ * Get the latest ECMAScript version supported by Espree.
+ * @returns {number} The latest ECMAScript version.
+ */
+function getLatestEcmaVersion() {
+ return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
+}
+
+/**
+ * Get the list of ECMAScript versions supported by Espree.
+ * @returns {number[]} An array containing the supported ECMAScript versions.
+ */
+function getSupportedEcmaVersions() {
+ return [...SUPPORTED_VERSIONS];
+}
+
+/**
+ * Normalize ECMAScript version from the initial config
+ * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config
+ * @throws {Error} throws an error if the ecmaVersion is invalid.
+ * @returns {number} normalized ECMAScript version
+ */
+function normalizeEcmaVersion(ecmaVersion = 5) {
+
+ let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;
+
+ if (typeof version !== "number") {
+ throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);
+ }
+
+ // Calculate ECMAScript edition number from official year version starting with
+ // ES2015, which corresponds with ES6 (or a difference of 2009).
+ if (version >= 2015) {
+ version -= 2009;
+ }
+
+ if (!SUPPORTED_VERSIONS.includes(version)) {
+ throw new Error("Invalid ecmaVersion.");
+ }
+
+ return version;
+}
+
+/**
+ * Normalize sourceType from the initial config
+ * @param {string} sourceType to normalize
+ * @throws {Error} throw an error if sourceType is invalid
+ * @returns {string} normalized sourceType
+ */
+function normalizeSourceType(sourceType = "script") {
+ if (sourceType === "script" || sourceType === "module") {
+ return sourceType;
+ }
+ throw new Error("Invalid sourceType.");
+}
+
+/**
+ * Normalize parserOptions
+ * @param {Object} options the parser options to normalize
+ * @throws {Error} throw an error if found invalid option.
+ * @returns {Object} normalized options
+ */
+function normalizeOptions(options) {
+ const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
+ const sourceType = normalizeSourceType(options.sourceType);
+ const ranges = options.range === true;
+ const locations = options.loc === true;
+ const allowReserved = ecmaVersion === 3 ? "never" : false;
+
+ if (sourceType === "module" && ecmaVersion < 6) {
+ throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
+ }
+ return Object.assign({}, options, {
+ ecmaVersion,
+ sourceType,
+ ranges,
+ locations,
+ allowReserved
+ });
+}
+
+/* eslint-disable no-param-reassign*/
+
+
+const STATE = Symbol("espree's internal state");
+const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
+
+
+/**
+ * Converts an Acorn comment to a Esprima comment.
+ * @param {boolean} block True if it's a block comment, false if not.
+ * @param {string} text The text of the comment.
+ * @param {int} start The index at which the comment starts.
+ * @param {int} end The index at which the comment ends.
+ * @param {Location} startLoc The location at which the comment starts.
+ * @param {Location} endLoc The location at which the comment ends.
+ * @returns {Object} The comment object.
+ * @private
+ */
+function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) {
+ const comment = {
+ type: block ? "Block" : "Line",
+ value: text
+ };
+
+ if (typeof start === "number") {
+ comment.start = start;
+ comment.end = end;
+ comment.range = [start, end];
+ }
+
+ if (typeof startLoc === "object") {
+ comment.loc = {
+ start: startLoc,
+ end: endLoc
+ };
+ }
+
+ return comment;
+}
+
+var espree = () => Parser => {
+ const tokTypes = Object.assign({}, Parser.acorn.tokTypes);
+
+ if (Parser.acornJsx) {
+ Object.assign(tokTypes, Parser.acornJsx.tokTypes);
+ }
+
+ return class Espree extends Parser {
+ constructor(opts, code) {
+ if (typeof opts !== "object" || opts === null) {
+ opts = {};
+ }
+ if (typeof code !== "string" && !(code instanceof String)) {
+ code = String(code);
+ }
+
+ const options = normalizeOptions(opts);
+ const ecmaFeatures = options.ecmaFeatures || {};
+ const tokenTranslator =
+ options.tokens === true
+ ? new TokenTranslator(tokTypes, code)
+ : null;
+
+ // Initialize acorn parser.
+ super({
+
+ // do not use spread, because we don't want to pass any unknown options to acorn
+ ecmaVersion: options.ecmaVersion,
+ sourceType: options.sourceType,
+ ranges: options.ranges,
+ locations: options.locations,
+ allowReserved: options.allowReserved,
+
+ // Truthy value is true for backward compatibility.
+ allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn),
+
+ // Collect tokens
+ onToken: token => {
+ if (tokenTranslator) {
+
+ // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
+ tokenTranslator.onToken(token, this[STATE]);
+ }
+ if (token.type !== tokTypes.eof) {
+ this[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);
+
+ this[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,
+ templateElements: []
+ };
+ }
+
+ tokenize() {
+ do {
+ this.next();
+ } while (this.type !== tokTypes.eof);
+
+ // Consume the final eof token
+ this.next();
+
+ const extra = this[STATE];
+ const tokens = extra.tokens;
+
+ if (extra.comments) {
+ tokens.comments = extra.comments;
+ }
+
+ return tokens;
+ }
+
+ finishNode(...args) {
+ const result = super.finishNode(...args);
+
+ return this[ESPRIMA_FINISH_NODE](result);
+ }
+
+ finishNodeAt(...args) {
+ const result = super.finishNodeAt(...args);
+
+ return this[ESPRIMA_FINISH_NODE](result);
+ }
+
+ parse() {
+ const extra = this[STATE];
+ const program = super.parse();
+
+ program.sourceType = this.options.sourceType;
+
+ if (extra.comments) {
+ program.comments = extra.comments;
+ }
+ if (extra.tokens) {
+ program.tokens = extra.tokens;
+ }
+
+ /*
+ * Adjust opening and closing position of program to match Esprima.
+ * Acorn always starts programs at range 0 whereas Esprima starts at the
+ * first AST node's start (the only real difference is when there's leading
+ * whitespace or leading comments). Acorn also counts trailing whitespace
+ * as part of the program whereas Esprima only counts up to the last token.
+ */
+ if (program.body.length) {
+ const [firstNode] = program.body;
+
+ if (program.range) {
+ program.range[0] = firstNode.range[0];
+ }
+ if (program.loc) {
+ program.loc.start = firstNode.loc.start;
+ }
+ program.start = firstNode.start;
+ }
+ if (extra.lastToken) {
+ if (program.range) {
+ program.range[1] = extra.lastToken.range[1];
+ }
+ if (program.loc) {
+ program.loc.end = extra.lastToken.loc.end;
+ }
+ program.end = extra.lastToken.end;
+ }
+
+
+ /*
+ * https://github.com/eslint/espree/issues/349
+ * Ensure that template elements have correct range information.
+ * This is one location where Acorn produces a different value
+ * for its start and end properties vs. the values present in the
+ * range property. In order to avoid confusion, we set the start
+ * and end properties to the values that are present in range.
+ * This is done here, instead of in finishNode(), because Acorn
+ * uses the values of start and end internally while parsing, making
+ * it dangerous to change those values while parsing is ongoing.
+ * By waiting until the end of parsing, we can safely change these
+ * values without affect any other part of the process.
+ */
+ this[STATE].templateElements.forEach(templateElement => {
+ const startOffset = -1;
+ const endOffset = templateElement.tail ? 1 : 2;
+
+ templateElement.start += startOffset;
+ templateElement.end += endOffset;
+
+ if (templateElement.range) {
+ templateElement.range[0] += startOffset;
+ templateElement.range[1] += endOffset;
+ }
+
+ if (templateElement.loc) {
+ templateElement.loc.start.column += startOffset;
+ templateElement.loc.end.column += endOffset;
+ }
+ });
+
+ return program;
+ }
+
+ parseTopLevel(node) {
+ if (this[STATE].impliedStrict) {
+ this.strict = true;
+ }
+ return super.parseTopLevel(node);
+ }
+
+ /**
+ * Overwrites the default raise method to throw Esprima-style errors.
+ * @param {int} pos The position of the error.
+ * @param {string} message The error message.
+ * @throws {SyntaxError} A syntax error.
+ * @returns {void}
+ */
+ raise(pos, message) {
+ const loc = Parser.acorn.getLineInfo(this.input, pos);
+ const err = new SyntaxError(message);
+
+ err.index = pos;
+ err.lineNumber = loc.line;
+ err.column = loc.column + 1; // acorn uses 0-based columns
+ throw err;
+ }
+
+ /**
+ * Overwrites the default raise method to throw Esprima-style errors.
+ * @param {int} pos The position of the error.
+ * @param {string} message The error message.
+ * @throws {SyntaxError} A syntax error.
+ * @returns {void}
+ */
+ raiseRecoverable(pos, message) {
+ this.raise(pos, message);
+ }
+
+ /**
+ * Overwrites the default unexpected method to throw Esprima-style errors.
+ * @param {int} pos The position of the error.
+ * @throws {SyntaxError} A syntax error.
+ * @returns {void}
+ */
+ unexpected(pos) {
+ let message = "Unexpected token";
+
+ if (pos !== null && pos !== void 0) {
+ this.pos = pos;
+
+ if (this.options.locations) {
+ while (this.pos < this.lineStart) {
+ this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1;
+ --this.curLine;
+ }
+ }
+
+ this.nextToken();
+ }
+
+ if (this.end > this.start) {
+ message += ` ${this.input.slice(this.start, this.end)}`;
+ }
+
+ this.raise(this.start, message);
+ }
+
+ /*
+ * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
+ * uses regular tt.string without any distinction between this and regular JS
+ * strings. As such, we intercept an attempt to read a JSX string and set a flag
+ * on extra so that when tokens are converted, the next token will be switched
+ * to JSXText via onToken.
+ */
+ jsx_readString(quote) { // eslint-disable-line camelcase
+ const result = super.jsx_readString(quote);
+
+ if (this.type === tokTypes.string) {
+ this[STATE].jsxAttrValueToken = true;
+ }
+ return result;
+ }
+
+ /**
+ * Performs last-minute Esprima-specific compatibility checks and fixes.
+ * @param {ASTNode} result The node to check.
+ * @returns {ASTNode} The finished node.
+ */
+ [ESPRIMA_FINISH_NODE](result) {
+
+ // Acorn doesn't count the opening and closing backticks as part of templates
+ // so we have to adjust ranges/locations appropriately.
+ if (result.type === "TemplateElement") {
+
+ // save template element references to fix start/end later
+ this[STATE].templateElements.push(result);
+ }
+
+ if (result.type.includes("Function") && !result.generator) {
+ result.generator = false;
+ }
+
+ return result;
+ }
+ };
+};
+
+const version$1 = "9.0.0";
+
+/**
+ * @fileoverview Main Espree file that converts Acorn into Esprima output.
+ *
+ * This file contains code from the following MIT-licensed projects:
+ * 1. Acorn
+ * 2. Babylon
+ * 3. Babel-ESLint
+ *
+ * This file also contains code from Esprima, which is BSD licensed.
+ *
+ * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
+ * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
+ * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
+ *
+ * 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+// To initialize lazily.
+const parsers = {
+ _regular: null,
+ _jsx: null,
+
+ get regular() {
+ if (this._regular === null) {
+ this._regular = acorn__namespace.Parser.extend(espree());
+ }
+ return this._regular;
+ },
+
+ get jsx() {
+ if (this._jsx === null) {
+ this._jsx = acorn__namespace.Parser.extend(jsx__default['default'](), espree());
+ }
+ return this._jsx;
+ },
+
+ get(options) {
+ const useJsx = Boolean(
+ options &&
+ options.ecmaFeatures &&
+ options.ecmaFeatures.jsx
+ );
+
+ return useJsx ? this.jsx : this.regular;
+ }
+};
+
+//------------------------------------------------------------------------------
+// Tokenizer
+//------------------------------------------------------------------------------
+
+/**
+ * Tokenizes the given code.
+ * @param {string} code The code to tokenize.
+ * @param {Object} options Options defining how to tokenize.
+ * @returns {Token[]} An array of tokens.
+ * @throws {SyntaxError} If the input code is invalid.
+ * @private
+ */
+function tokenize(code, options) {
+ const Parser = parsers.get(options);
+
+ // Ensure to collect tokens.
+ if (!options || options.tokens !== true) {
+ options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign
+ }
+
+ return new Parser(options, code).tokenize();
+}
+
+//------------------------------------------------------------------------------
+// Parser
+//------------------------------------------------------------------------------
+
+/**
+ * Parses the given code.
+ * @param {string} code The code to tokenize.
+ * @param {Object} options Options defining how to tokenize.
+ * @returns {ASTNode} The "Program" AST node.
+ * @throws {SyntaxError} If the input code is invalid.
+ */
+function parse(code, options) {
+ const Parser = parsers.get(options);
+
+ return new Parser(options, code).parse();
+}
+
+//------------------------------------------------------------------------------
+// Public
+//------------------------------------------------------------------------------
+
+const version = version$1;
+
+
+// Deep copy.
+/* istanbul ignore next */
+const Syntax = (function() {
+ let name,
+ types = {};
+
+ if (typeof Object.create === "function") {
+ types = Object.create(null);
+ }
+
+ for (name in astNodeTypes) {
+ if (Object.hasOwnProperty.call(astNodeTypes, name)) {
+ types[name] = astNodeTypes[name];
+ }
+ }
+
+ if (typeof Object.freeze === "function") {
+ Object.freeze(types);
+ }
+
+ return types;
+}());
+
+/* istanbul ignore next */
+const VisitorKeys = (function() {
+ return visitorKeys__namespace.KEYS;
+}());
+
+const latestEcmaVersion = getLatestEcmaVersion();
+
+const supportedEcmaVersions = getSupportedEcmaVersions();
+
+exports.Syntax = Syntax;
+exports.VisitorKeys = VisitorKeys;
+exports.latestEcmaVersion = latestEcmaVersion;
+exports.parse = parse;
+exports.supportedEcmaVersions = supportedEcmaVersions;
+exports.tokenize = tokenize;
+exports.version = version;
+//# sourceMappingURL=espree.cjs.map
diff --git a/tools/node_modules/eslint/node_modules/espree/espree.js b/tools/node_modules/eslint/node_modules/espree/espree.js
index d8069528b16..b79c86f2474 100644
--- a/tools/node_modules/eslint/node_modules/espree/espree.js
+++ b/tools/node_modules/eslint/node_modules/espree/espree.js
@@ -56,13 +56,14 @@
*/
/* eslint no-undefined:0, no-use-before-define: 0 */
-"use strict";
+import * as acorn from "acorn";
+import jsx from "acorn-jsx";
+import astNodeTypes from "./lib/ast-node-types.js";
+import espree from "./lib/espree.js";
+import espreeVersion from "./lib/version.js";
+import * as visitorKeys from "eslint-visitor-keys";
+import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js";
-const acorn = require("acorn");
-const jsx = require("acorn-jsx");
-const astNodeTypes = require("./lib/ast-node-types");
-const espree = require("./lib/espree");
-const { getLatestEcmaVersion, getSupportedEcmaVersions } = require("./lib/options");
// To initialize lazily.
const parsers = {
@@ -106,7 +107,7 @@ const parsers = {
* @throws {SyntaxError} If the input code is invalid.
* @private
*/
-function tokenize(code, options) {
+export function tokenize(code, options) {
const Parser = parsers.get(options);
// Ensure to collect tokens.
@@ -128,7 +129,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,15 +139,12 @@ function parse(code, options) {
// Public
//------------------------------------------------------------------------------
-exports.version = require("./package.json").version;
+export const version = espreeVersion;
-exports.tokenize = tokenize;
-
-exports.parse = parse;
// Deep copy.
/* istanbul ignore next */
-exports.Syntax = (function() {
+export const Syntax = (function() {
let name,
types = {};
@@ -168,10 +166,10 @@ exports.Syntax = (function() {
}());
/* istanbul ignore next */
-exports.VisitorKeys = (function() {
- return require("eslint-visitor-keys").KEYS;
+export const VisitorKeys = (function() {
+ return visitorKeys.KEYS;
}());
-exports.latestEcmaVersion = getLatestEcmaVersion();
+export const latestEcmaVersion = getLatestEcmaVersion();
-exports.supportedEcmaVersions = getSupportedEcmaVersions();
+export const supportedEcmaVersions = getSupportedEcmaVersions();
diff --git a/tools/node_modules/eslint/node_modules/espree/lib/ast-node-types.js b/tools/node_modules/eslint/node_modules/espree/lib/ast-node-types.js
index 2844024d539..9f7c4e35a9e 100644
--- a/tools/node_modules/eslint/node_modules/espree/lib/ast-node-types.js
+++ b/tools/node_modules/eslint/node_modules/espree/lib/ast-node-types.js
@@ -3,8 +3,6 @@
* @author Nicholas C. Zakas
*/
-"use strict";
-
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
@@ -15,7 +13,7 @@
// Public
//------------------------------------------------------------------------------
-module.exports = {
+export default {
AssignmentExpression: "AssignmentExpression",
AssignmentPattern: "AssignmentPattern",
ArrayExpression: "ArrayExpression",
diff --git a/tools/node_modules/eslint/node_modules/espree/lib/espree.js b/tools/node_modules/eslint/node_modules/espree/lib/espree.js
index 50ca6e42f25..e0be3b5a172 100644
--- a/tools/node_modules/eslint/node_modules/espree/lib/espree.js
+++ b/tools/node_modules/eslint/node_modules/espree/lib/espree.js
@@ -1,8 +1,7 @@
-"use strict";
-
/* eslint-disable no-param-reassign*/
-const TokenTranslator = require("./token-translator");
-const { normalizeOptions } = require("./options");
+import TokenTranslator from "./token-translator.js";
+import { normalizeOptions } from "./options.js";
+
const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");
@@ -41,7 +40,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) {
@@ -67,11 +66,12 @@ module.exports = () => Parser => {
// 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),
@@ -105,7 +105,8 @@ module.exports = () => Parser => {
impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5,
ecmaVersion: this.options.ecmaVersion,
jsxAttrValueToken: false,
- lastToken: null
+ lastToken: null,
+ templateElements: []
};
}
@@ -159,15 +160,59 @@ module.exports = () => Parser => {
* whitespace or leading comments). Acorn also counts trailing whitespace
* as part of the program whereas Esprima only counts up to the last token.
*/
- if (program.range) {
- program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0];
- program.range[1] = extra.lastToken ? extra.lastToken.range[1] : program.range[1];
+ if (program.body.length) {
+ const [firstNode] = program.body;
+
+ if (program.range) {
+ program.range[0] = firstNode.range[0];
+ }
+ if (program.loc) {
+ program.loc.start = firstNode.loc.start;
+ }
+ program.start = firstNode.start;
}
- if (program.loc) {
- program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start;
- program.loc.end = extra.lastToken ? extra.lastToken.loc.end : program.loc.end;
+ if (extra.lastToken) {
+ if (program.range) {
+ program.range[1] = extra.lastToken.range[1];
+ }
+ if (program.loc) {
+ program.loc.end = extra.lastToken.loc.end;
+ }
+ program.end = extra.lastToken.end;
}
+
+ /*
+ * https://github.com/eslint/espree/issues/349
+ * Ensure that template elements have correct range information.
+ * This is one location where Acorn produces a different value
+ * for its start and end properties vs. the values present in the
+ * range property. In order to avoid confusion, we set the start
+ * and end properties to the values that are present in range.
+ * This is done here, instead of in finishNode(), because Acorn
+ * uses the values of start and end internally while parsing, making
+ * it dangerous to change those values while parsing is ongoing.
+ * By waiting until the end of parsing, we can safely change these
+ * values without affect any other part of the process.
+ */
+ this[STATE].templateElements.forEach(templateElement => {
+ const startOffset = -1;
+ const endOffset = templateElement.tail ? 1 : 2;
+
+ templateElement.start += startOffset;
+ templateElement.end += endOffset;
+
+ if (templateElement.range) {
+ templateElement.range[0] += startOffset;
+ templateElement.range[1] += endOffset;
+ }
+
+ if (templateElement.loc) {
+ templateElement.loc.start.column += startOffset;
+ templateElement.loc.end.column += endOffset;
+ }
+ });
+
return program;
}
@@ -262,21 +307,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/tools/node_modules/eslint/node_modules/espree/lib/features.js b/tools/node_modules/eslint/node_modules/espree/lib/features.js
index d1ad5f851f4..31467d288fb 100644
--- a/tools/node_modules/eslint/node_modules/espree/lib/features.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/lib/options.js b/tools/node_modules/eslint/node_modules/espree/lib/options.js
index eddca200e29..acc1e3a2a91 100644
--- a/tools/node_modules/eslint/node_modules/espree/lib/options.js
+++ b/tools/node_modules/eslint/node_modules/espree/lib/options.js
@@ -3,13 +3,10 @@
* @author Kai Cataldo
*/
-"use strict";
-
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
-const DEFAULT_ECMA_VERSION = 5;
const SUPPORTED_VERSIONS = [
3,
5,
@@ -19,21 +16,39 @@ const SUPPORTED_VERSIONS = [
9,
10,
11,
- 12
+ 12,
+ 13
];
/**
+ * 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).
@@ -67,40 +82,21 @@ 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;
+ const allowReserved = ecmaVersion === 3 ? "never" : false;
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
+ });
}
-
-/**
- * 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/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js b/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js
index f06c7c072f6..9aa5e22eef9 100644
--- a/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js
+++ b/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js
@@ -4,8 +4,6 @@
*/
/* eslint no-underscore-dangle: 0 */
-"use strict";
-
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
@@ -22,6 +20,7 @@ const Token = {
Boolean: "Boolean",
EOF: "<end>",
Identifier: "Identifier",
+ PrivateIdentifier: "PrivateIdentifier",
Keyword: "Keyword",
Null: "Null",
Numeric: "Numeric",
@@ -116,6 +115,9 @@ TokenTranslator.prototype = {
token.type = Token.Keyword;
}
+ } else if (type === tt.privateId) {
+ token.type = Token.PrivateIdentifier;
+
} else if (type === tt.semi || type === tt.comma ||
type === tt.parenL || type === tt.parenR ||
type === tt.braceL || type === tt.braceR ||
@@ -260,4 +262,4 @@ TokenTranslator.prototype = {
// Public
//------------------------------------------------------------------------------
-module.exports = TokenTranslator;
+export default TokenTranslator;
diff --git a/tools/node_modules/eslint/node_modules/espree/lib/version.js b/tools/node_modules/eslint/node_modules/espree/lib/version.js
new file mode 100644
index 00000000000..cd9899749da
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/espree/lib/version.js
@@ -0,0 +1,3 @@
+const version = "9.0.0";
+
+export default version;
diff --git a/tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js b/tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js
deleted file mode 100644
index 4216864f1c2..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/LICENSE
deleted file mode 100644
index 17a25538d9b..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/README.md b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/README.md
deleted file mode 100644
index 250f5fa31a6..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js
deleted file mode 100644
index cd8a3260834..00000000000
--- a/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/index.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @author Toru Nagashima <https://github.com/mysticatea>
- * 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/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/lib/visitor-keys.json
deleted file mode 100644
index a33bbc66005..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json b/tools/node_modules/eslint/node_modules/espree/node_modules/eslint-visitor-keys/package.json
deleted file mode 100644
index 63267be6437..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json
index 724e6fcee72..736b8f55b22 100644
--- a/tools/node_modules/eslint/node_modules/espree/package.json
+++ b/tools/node_modules/eslint/node_modules/espree/package.json
@@ -3,14 +3,27 @@
"description": "An Esprima-compatible JavaScript parser built on Acorn",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"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.0.0",
"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": {
@@ -18,24 +31,28 @@
},
"license": "BSD-2-Clause",
"dependencies": {
- "acorn": "^7.4.0",
+ "acorn": "^8.5.0",
"acorn-jsx": "^5.3.1",
- "eslint-visitor-keys": "^1.3.0"
+ "eslint-visitor-keys": "^3.0.0"
},
"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",
+ "@rollup/plugin-commonjs": "^17.1.0",
+ "@rollup/plugin-json": "^4.1.0",
+ "@rollup/plugin-node-resolve": "^11.2.0",
+ "chai": "^4.3.4",
+ "eslint": "^7.22.0",
+ "eslint-config-eslint": "^7.0.0",
+ "eslint-plugin-jsdoc": "^32.2.0",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-release": "^3.1.2",
"esprima": "latest",
"esprima-fb": "^8001.2001.0-dev-harmony-fb",
"json-diff": "^0.5.4",
- "leche": "^2.3.0",
- "mocha": "^6.2.0",
+ "mocha": "^8.3.1",
+ "npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"regenerate": "^1.4.0",
+ "rollup": "^2.41.2",
"shelljs": "^0.3.0",
"shelljs-nodecli": "^0.1.1",
"unicode-6.3.0": "^0.7.5"
@@ -49,12 +66,17 @@
"acorn"
],
"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": "nyc 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 \"*.?(c)js\" lib/ tests/lib/",
+ "fixlint": "npm run lint -- --fix",
+ "build": "rollup -c rollup.config.js",
+ "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/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/LICENSE.BSD b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/LICENSE.BSD
deleted file mode 100644
index 3e580c355a9..00000000000
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/LICENSE.BSD
+++ /dev/null
@@ -1,19 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/README.md b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/README.md
deleted file mode 100644
index ccd3377f3e9..00000000000
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/README.md
+++ /dev/null
@@ -1,153 +0,0 @@
-### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse)
-
-Estraverse ([estraverse](http://github.com/estools/estraverse)) is
-[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
-traversal functions from [esmangle project](http://github.com/estools/esmangle).
-
-### Documentation
-
-You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).
-
-### Example Usage
-
-The following code will output all variables declared at the root of a file.
-
-```javascript
-estraverse.traverse(ast, {
- enter: function (node, parent) {
- if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
- return estraverse.VisitorOption.Skip;
- },
- leave: function (node, parent) {
- if (node.type == 'VariableDeclarator')
- console.log(node.id.name);
- }
-});
-```
-
-We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.
-
-```javascript
-estraverse.traverse(ast, {
- enter: function (node) {
- this.break();
- }
-});
-```
-
-And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.
-
-```javascript
-result = estraverse.replace(tree, {
- enter: function (node) {
- // Replace it with replaced.
- if (node.type === 'Literal')
- return replaced;
- }
-});
-```
-
-By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Extending the existing traversing rules.
- keys: {
- // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
- TestExpression: ['argument']
- }
-});
-```
-
-By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Iterating the child **nodes** of unknown nodes.
- fallback: 'iteration'
-});
-```
-
-When `visitor.fallback` is a function, we can determine which keys to visit on each node.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Skip the `argument` property of each node
- fallback: function(node) {
- return Object.keys(node).filter(function(key) {
- return key !== 'argument';
- });
- }
-});
-```
-
-### License
-
-Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation)
- (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js
deleted file mode 100644
index 93225bb0c40..00000000000
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/estraverse.js
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/*jslint vars:false, bitwise:true*/
-/*jshint indent:4*/
-/*global exports:true*/
-(function clone(exports) {
- 'use strict';
-
- var Syntax,
- VisitorOption,
- VisitorKeys,
- BREAK,
- SKIP,
- REMOVE;
-
- function deepCopy(obj) {
- var ret = {}, key, val;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- val = obj[key];
- if (typeof val === 'object' && val !== null) {
- ret[key] = deepCopy(val);
- } else {
- ret[key] = val;
- }
- }
- }
- return ret;
- }
-
- // based on LLVM libc++ upper_bound / lower_bound
- // MIT License
-
- function upperBound(array, func) {
- var diff, len, i, current;
-
- len = array.length;
- i = 0;
-
- while (len) {
- diff = len >>> 1;
- current = i + diff;
- if (func(array[current])) {
- len = diff;
- } else {
- i = current + 1;
- len -= diff + 1;
- }
- }
- return i;
- }
-
- Syntax = {
- AssignmentExpression: 'AssignmentExpression',
- AssignmentPattern: 'AssignmentPattern',
- ArrayExpression: 'ArrayExpression',
- ArrayPattern: 'ArrayPattern',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
- BlockStatement: 'BlockStatement',
- BinaryExpression: 'BinaryExpression',
- BreakStatement: 'BreakStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ChainExpression: 'ChainExpression',
- ClassBody: 'ClassBody',
- ClassDeclaration: 'ClassDeclaration',
- ClassExpression: 'ClassExpression',
- ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.
- ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.
- ConditionalExpression: 'ConditionalExpression',
- ContinueStatement: 'ContinueStatement',
- DebuggerStatement: 'DebuggerStatement',
- DirectiveStatement: 'DirectiveStatement',
- DoWhileStatement: 'DoWhileStatement',
- EmptyStatement: 'EmptyStatement',
- ExportAllDeclaration: 'ExportAllDeclaration',
- ExportDefaultDeclaration: 'ExportDefaultDeclaration',
- ExportNamedDeclaration: 'ExportNamedDeclaration',
- ExportSpecifier: 'ExportSpecifier',
- ExpressionStatement: 'ExpressionStatement',
- ForStatement: 'ForStatement',
- ForInStatement: 'ForInStatement',
- ForOfStatement: 'ForOfStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- ImportExpression: 'ImportExpression',
- ImportDeclaration: 'ImportDeclaration',
- ImportDefaultSpecifier: 'ImportDefaultSpecifier',
- ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
- ImportSpecifier: 'ImportSpecifier',
- Literal: 'Literal',
- LabeledStatement: 'LabeledStatement',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MetaProperty: 'MetaProperty',
- MethodDefinition: 'MethodDefinition',
- ModuleSpecifier: 'ModuleSpecifier',
- NewExpression: 'NewExpression',
- ObjectExpression: 'ObjectExpression',
- ObjectPattern: 'ObjectPattern',
- Program: 'Program',
- Property: 'Property',
- RestElement: 'RestElement',
- ReturnStatement: 'ReturnStatement',
- SequenceExpression: 'SequenceExpression',
- SpreadElement: 'SpreadElement',
- Super: 'Super',
- SwitchStatement: 'SwitchStatement',
- SwitchCase: 'SwitchCase',
- TaggedTemplateExpression: 'TaggedTemplateExpression',
- TemplateElement: 'TemplateElement',
- TemplateLiteral: 'TemplateLiteral',
- ThisExpression: 'ThisExpression',
- ThrowStatement: 'ThrowStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement',
- WithStatement: 'WithStatement',
- YieldExpression: 'YieldExpression'
- };
-
- VisitorKeys = {
- AssignmentExpression: ['left', 'right'],
- AssignmentPattern: ['left', 'right'],
- ArrayExpression: ['elements'],
- ArrayPattern: ['elements'],
- ArrowFunctionExpression: ['params', 'body'],
- AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
- BlockStatement: ['body'],
- BinaryExpression: ['left', 'right'],
- BreakStatement: ['label'],
- CallExpression: ['callee', 'arguments'],
- CatchClause: ['param', 'body'],
- ChainExpression: ['expression'],
- ClassBody: ['body'],
- ClassDeclaration: ['id', 'superClass', 'body'],
- ClassExpression: ['id', 'superClass', 'body'],
- ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
- ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- ConditionalExpression: ['test', 'consequent', 'alternate'],
- ContinueStatement: ['label'],
- DebuggerStatement: [],
- DirectiveStatement: [],
- DoWhileStatement: ['body', 'test'],
- EmptyStatement: [],
- ExportAllDeclaration: ['source'],
- ExportDefaultDeclaration: ['declaration'],
- ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
- ExportSpecifier: ['exported', 'local'],
- ExpressionStatement: ['expression'],
- ForStatement: ['init', 'test', 'update', 'body'],
- ForInStatement: ['left', 'right', 'body'],
- ForOfStatement: ['left', 'right', 'body'],
- FunctionDeclaration: ['id', 'params', 'body'],
- FunctionExpression: ['id', 'params', 'body'],
- GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- Identifier: [],
- IfStatement: ['test', 'consequent', 'alternate'],
- ImportExpression: ['source'],
- ImportDeclaration: ['specifiers', 'source'],
- ImportDefaultSpecifier: ['local'],
- ImportNamespaceSpecifier: ['local'],
- ImportSpecifier: ['imported', 'local'],
- Literal: [],
- LabeledStatement: ['label', 'body'],
- LogicalExpression: ['left', 'right'],
- MemberExpression: ['object', 'property'],
- MetaProperty: ['meta', 'property'],
- MethodDefinition: ['key', 'value'],
- ModuleSpecifier: [],
- NewExpression: ['callee', 'arguments'],
- ObjectExpression: ['properties'],
- ObjectPattern: ['properties'],
- Program: ['body'],
- Property: ['key', 'value'],
- RestElement: [ 'argument' ],
- ReturnStatement: ['argument'],
- SequenceExpression: ['expressions'],
- SpreadElement: ['argument'],
- Super: [],
- SwitchStatement: ['discriminant', 'cases'],
- SwitchCase: ['test', 'consequent'],
- TaggedTemplateExpression: ['tag', 'quasi'],
- TemplateElement: [],
- TemplateLiteral: ['quasis', 'expressions'],
- ThisExpression: [],
- ThrowStatement: ['argument'],
- TryStatement: ['block', 'handler', 'finalizer'],
- UnaryExpression: ['argument'],
- UpdateExpression: ['argument'],
- VariableDeclaration: ['declarations'],
- VariableDeclarator: ['id', 'init'],
- WhileStatement: ['test', 'body'],
- WithStatement: ['object', 'body'],
- YieldExpression: ['argument']
- };
-
- // unique id
- BREAK = {};
- SKIP = {};
- REMOVE = {};
-
- VisitorOption = {
- Break: BREAK,
- Skip: SKIP,
- Remove: REMOVE
- };
-
- function Reference(parent, key) {
- this.parent = parent;
- this.key = key;
- }
-
- Reference.prototype.replace = function replace(node) {
- this.parent[this.key] = node;
- };
-
- Reference.prototype.remove = function remove() {
- if (Array.isArray(this.parent)) {
- this.parent.splice(this.key, 1);
- return true;
- } else {
- this.replace(null);
- return false;
- }
- };
-
- function Element(node, path, wrap, ref) {
- this.node = node;
- this.path = path;
- this.wrap = wrap;
- this.ref = ref;
- }
-
- function Controller() { }
-
- // API:
- // return property path array from root to current node
- Controller.prototype.path = function path() {
- var i, iz, j, jz, result, element;
-
- function addToPath(result, path) {
- if (Array.isArray(path)) {
- for (j = 0, jz = path.length; j < jz; ++j) {
- result.push(path[j]);
- }
- } else {
- result.push(path);
- }
- }
-
- // root node
- if (!this.__current.path) {
- return null;
- }
-
- // first node is sentinel, second node is root element
- result = [];
- for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
- element = this.__leavelist[i];
- addToPath(result, element.path);
- }
- addToPath(result, this.__current.path);
- return result;
- };
-
- // API:
- // return type of current node
- Controller.prototype.type = function () {
- var node = this.current();
- return node.type || this.__current.wrap;
- };
-
- // API:
- // return array of parent elements
- Controller.prototype.parents = function parents() {
- var i, iz, result;
-
- // first node is sentinel
- result = [];
- for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
- result.push(this.__leavelist[i].node);
- }
-
- return result;
- };
-
- // API:
- // return current node
- Controller.prototype.current = function current() {
- return this.__current.node;
- };
-
- Controller.prototype.__execute = function __execute(callback, element) {
- var previous, result;
-
- result = undefined;
-
- previous = this.__current;
- this.__current = element;
- this.__state = null;
- if (callback) {
- result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
- }
- this.__current = previous;
-
- return result;
- };
-
- // API:
- // notify control skip / break
- Controller.prototype.notify = function notify(flag) {
- this.__state = flag;
- };
-
- // API:
- // skip child nodes of current node
- Controller.prototype.skip = function () {
- this.notify(SKIP);
- };
-
- // API:
- // break traversals
- Controller.prototype['break'] = function () {
- this.notify(BREAK);
- };
-
- // API:
- // remove node
- Controller.prototype.remove = function () {
- this.notify(REMOVE);
- };
-
- Controller.prototype.__initialize = function(root, visitor) {
- this.visitor = visitor;
- this.root = root;
- this.__worklist = [];
- this.__leavelist = [];
- this.__current = null;
- this.__state = null;
- this.__fallback = null;
- if (visitor.fallback === 'iteration') {
- this.__fallback = Object.keys;
- } else if (typeof visitor.fallback === 'function') {
- this.__fallback = visitor.fallback;
- }
-
- this.__keys = VisitorKeys;
- if (visitor.keys) {
- this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
- }
- };
-
- function isNode(node) {
- if (node == null) {
- return false;
- }
- return typeof node === 'object' && typeof node.type === 'string';
- }
-
- function isProperty(nodeType, key) {
- return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
- }
-
- function candidateExistsInLeaveList(leavelist, candidate) {
- for (var i = leavelist.length - 1; i >= 0; --i) {
- if (leavelist[i].node === candidate) {
- return true;
- }
- }
- return false;
- }
-
- Controller.prototype.traverse = function traverse(root, visitor) {
- var worklist,
- leavelist,
- element,
- node,
- nodeType,
- ret,
- key,
- current,
- current2,
- candidates,
- candidate,
- sentinel;
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- worklist.push(new Element(root, null, null, null));
- leavelist.push(new Element(null, null, null, null));
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- ret = this.__execute(visitor.leave, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
- continue;
- }
-
- if (element.node) {
-
- ret = this.__execute(visitor.enter, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || ret === SKIP) {
- continue;
- }
-
- node = element.node;
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
-
- if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
- continue;
- }
-
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', null);
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, null);
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- if (candidateExistsInLeaveList(leavelist, candidate)) {
- continue;
- }
-
- worklist.push(new Element(candidate, key, null, null));
- }
- }
- }
- }
- };
-
- Controller.prototype.replace = function replace(root, visitor) {
- var worklist,
- leavelist,
- node,
- nodeType,
- target,
- element,
- current,
- current2,
- candidates,
- candidate,
- sentinel,
- outer,
- key;
-
- function removeElem(element) {
- var i,
- key,
- nextElem,
- parent;
-
- if (element.ref.remove()) {
- // When the reference is an element of an array.
- key = element.ref.key;
- parent = element.ref.parent;
-
- // If removed from array, then decrease following items' keys.
- i = worklist.length;
- while (i--) {
- nextElem = worklist[i];
- if (nextElem.ref && nextElem.ref.parent === parent) {
- if (nextElem.ref.key < key) {
- break;
- }
- --nextElem.ref.key;
- }
- }
- }
- }
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- outer = {
- root: root
- };
- element = new Element(root, null, null, new Reference(outer, 'root'));
- worklist.push(element);
- leavelist.push(element);
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- target = this.__execute(visitor.leave, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
- continue;
- }
-
- target = this.__execute(visitor.enter, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- element.node = target;
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- element.node = null;
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
-
- // node may be null
- node = element.node;
- if (!node) {
- continue;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || target === SKIP) {
- continue;
- }
-
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, new Reference(node, key)));
- }
- }
- }
-
- return outer.root;
- };
-
- function traverse(root, visitor) {
- var controller = new Controller();
- return controller.traverse(root, visitor);
- }
-
- function replace(root, visitor) {
- var controller = new Controller();
- return controller.replace(root, visitor);
- }
-
- function extendCommentRange(comment, tokens) {
- var target;
-
- target = upperBound(tokens, function search(token) {
- return token.range[0] > comment.range[0];
- });
-
- comment.extendedRange = [comment.range[0], comment.range[1]];
-
- if (target !== tokens.length) {
- comment.extendedRange[1] = tokens[target].range[0];
- }
-
- target -= 1;
- if (target >= 0) {
- comment.extendedRange[0] = tokens[target].range[1];
- }
-
- return comment;
- }
-
- function attachComments(tree, providedComments, tokens) {
- // At first, we should calculate extended comment ranges.
- var comments = [], comment, len, i, cursor;
-
- if (!tree.range) {
- throw new Error('attachComments needs range information');
- }
-
- // tokens array is empty, we attach comments to tree as 'leadingComments'
- if (!tokens.length) {
- if (providedComments.length) {
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comment = deepCopy(providedComments[i]);
- comment.extendedRange = [0, tree.range[0]];
- comments.push(comment);
- }
- tree.leadingComments = comments;
- }
- return tree;
- }
-
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
- }
-
- // This is based on John Freeman's implementation.
- cursor = 0;
- traverse(tree, {
- enter: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (comment.extendedRange[1] > node.range[0]) {
- break;
- }
-
- if (comment.extendedRange[1] === node.range[0]) {
- if (!node.leadingComments) {
- node.leadingComments = [];
- }
- node.leadingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- cursor = 0;
- traverse(tree, {
- leave: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (node.range[1] < comment.extendedRange[0]) {
- break;
- }
-
- if (node.range[1] === comment.extendedRange[0]) {
- if (!node.trailingComments) {
- node.trailingComments = [];
- }
- node.trailingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- return tree;
- }
-
- exports.Syntax = Syntax;
- exports.traverse = traverse;
- exports.replace = replace;
- exports.attachComments = attachComments;
- exports.VisitorKeys = VisitorKeys;
- exports.VisitorOption = VisitorOption;
- exports.Controller = Controller;
- exports.cloneEnvironment = function () { return clone({}); };
-
- return exports;
-}(exports));
-/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json
deleted file mode 100644
index bc99e7c4a64..00000000000
--- a/tools/node_modules/eslint/node_modules/esquery/node_modules/estraverse/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "estraverse",
- "description": "ECMAScript JS AST traversal functions",
- "homepage": "https://github.com/estools/estraverse",
- "main": "estraverse.js",
- "version": "5.2.0",
- "engines": {
- "node": ">=4.0"
- },
- "maintainers": [
- {
- "name": "Yusuke Suzuki",
- "email": "utatane.tea@gmail.com",
- "web": "http://github.com/Constellation"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/estools/estraverse.git"
- },
- "devDependencies": {
- "babel-preset-env": "^1.6.1",
- "babel-register": "^6.3.13",
- "chai": "^2.1.1",
- "espree": "^1.11.0",
- "gulp": "^3.8.10",
- "gulp-bump": "^0.2.2",
- "gulp-filter": "^2.0.0",
- "gulp-git": "^1.0.1",
- "gulp-tag-version": "^1.3.0",
- "jshint": "^2.5.6",
- "mocha": "^2.1.0"
- },
- "license": "BSD-2-Clause",
- "scripts": {
- "test": "npm run-script lint && npm run-script unit-test",
- "lint": "jshint estraverse.js",
- "unit-test": "mocha --compilers js:babel-register"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD
deleted file mode 100644
index 3e580c355a9..00000000000
--- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD
+++ /dev/null
@@ -1,19 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/README.md b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/README.md
deleted file mode 100644
index ccd3377f3e9..00000000000
--- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/README.md
+++ /dev/null
@@ -1,153 +0,0 @@
-### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse)
-
-Estraverse ([estraverse](http://github.com/estools/estraverse)) is
-[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
-traversal functions from [esmangle project](http://github.com/estools/esmangle).
-
-### Documentation
-
-You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).
-
-### Example Usage
-
-The following code will output all variables declared at the root of a file.
-
-```javascript
-estraverse.traverse(ast, {
- enter: function (node, parent) {
- if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
- return estraverse.VisitorOption.Skip;
- },
- leave: function (node, parent) {
- if (node.type == 'VariableDeclarator')
- console.log(node.id.name);
- }
-});
-```
-
-We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.
-
-```javascript
-estraverse.traverse(ast, {
- enter: function (node) {
- this.break();
- }
-});
-```
-
-And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.
-
-```javascript
-result = estraverse.replace(tree, {
- enter: function (node) {
- // Replace it with replaced.
- if (node.type === 'Literal')
- return replaced;
- }
-});
-```
-
-By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Extending the existing traversing rules.
- keys: {
- // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
- TestExpression: ['argument']
- }
-});
-```
-
-By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Iterating the child **nodes** of unknown nodes.
- fallback: 'iteration'
-});
-```
-
-When `visitor.fallback` is a function, we can determine which keys to visit on each node.
-
-```javascript
-// This tree contains a user-defined `TestExpression` node.
-var tree = {
- type: 'TestExpression',
-
- // This 'argument' is the property containing the other **node**.
- argument: {
- type: 'Literal',
- value: 20
- },
-
- // This 'extended' is the property not containing the other **node**.
- extended: true
-};
-estraverse.traverse(tree, {
- enter: function (node) { },
-
- // Skip the `argument` property of each node
- fallback: function(node) {
- return Object.keys(node).filter(function(key) {
- return key !== 'argument';
- });
- }
-});
-```
-
-### License
-
-Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation)
- (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js
deleted file mode 100644
index 93225bb0c40..00000000000
--- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
-
- 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-/*jslint vars:false, bitwise:true*/
-/*jshint indent:4*/
-/*global exports:true*/
-(function clone(exports) {
- 'use strict';
-
- var Syntax,
- VisitorOption,
- VisitorKeys,
- BREAK,
- SKIP,
- REMOVE;
-
- function deepCopy(obj) {
- var ret = {}, key, val;
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- val = obj[key];
- if (typeof val === 'object' && val !== null) {
- ret[key] = deepCopy(val);
- } else {
- ret[key] = val;
- }
- }
- }
- return ret;
- }
-
- // based on LLVM libc++ upper_bound / lower_bound
- // MIT License
-
- function upperBound(array, func) {
- var diff, len, i, current;
-
- len = array.length;
- i = 0;
-
- while (len) {
- diff = len >>> 1;
- current = i + diff;
- if (func(array[current])) {
- len = diff;
- } else {
- i = current + 1;
- len -= diff + 1;
- }
- }
- return i;
- }
-
- Syntax = {
- AssignmentExpression: 'AssignmentExpression',
- AssignmentPattern: 'AssignmentPattern',
- ArrayExpression: 'ArrayExpression',
- ArrayPattern: 'ArrayPattern',
- ArrowFunctionExpression: 'ArrowFunctionExpression',
- AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
- BlockStatement: 'BlockStatement',
- BinaryExpression: 'BinaryExpression',
- BreakStatement: 'BreakStatement',
- CallExpression: 'CallExpression',
- CatchClause: 'CatchClause',
- ChainExpression: 'ChainExpression',
- ClassBody: 'ClassBody',
- ClassDeclaration: 'ClassDeclaration',
- ClassExpression: 'ClassExpression',
- ComprehensionBlock: 'ComprehensionBlock', // CAUTION: It's deferred to ES7.
- ComprehensionExpression: 'ComprehensionExpression', // CAUTION: It's deferred to ES7.
- ConditionalExpression: 'ConditionalExpression',
- ContinueStatement: 'ContinueStatement',
- DebuggerStatement: 'DebuggerStatement',
- DirectiveStatement: 'DirectiveStatement',
- DoWhileStatement: 'DoWhileStatement',
- EmptyStatement: 'EmptyStatement',
- ExportAllDeclaration: 'ExportAllDeclaration',
- ExportDefaultDeclaration: 'ExportDefaultDeclaration',
- ExportNamedDeclaration: 'ExportNamedDeclaration',
- ExportSpecifier: 'ExportSpecifier',
- ExpressionStatement: 'ExpressionStatement',
- ForStatement: 'ForStatement',
- ForInStatement: 'ForInStatement',
- ForOfStatement: 'ForOfStatement',
- FunctionDeclaration: 'FunctionDeclaration',
- FunctionExpression: 'FunctionExpression',
- GeneratorExpression: 'GeneratorExpression', // CAUTION: It's deferred to ES7.
- Identifier: 'Identifier',
- IfStatement: 'IfStatement',
- ImportExpression: 'ImportExpression',
- ImportDeclaration: 'ImportDeclaration',
- ImportDefaultSpecifier: 'ImportDefaultSpecifier',
- ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
- ImportSpecifier: 'ImportSpecifier',
- Literal: 'Literal',
- LabeledStatement: 'LabeledStatement',
- LogicalExpression: 'LogicalExpression',
- MemberExpression: 'MemberExpression',
- MetaProperty: 'MetaProperty',
- MethodDefinition: 'MethodDefinition',
- ModuleSpecifier: 'ModuleSpecifier',
- NewExpression: 'NewExpression',
- ObjectExpression: 'ObjectExpression',
- ObjectPattern: 'ObjectPattern',
- Program: 'Program',
- Property: 'Property',
- RestElement: 'RestElement',
- ReturnStatement: 'ReturnStatement',
- SequenceExpression: 'SequenceExpression',
- SpreadElement: 'SpreadElement',
- Super: 'Super',
- SwitchStatement: 'SwitchStatement',
- SwitchCase: 'SwitchCase',
- TaggedTemplateExpression: 'TaggedTemplateExpression',
- TemplateElement: 'TemplateElement',
- TemplateLiteral: 'TemplateLiteral',
- ThisExpression: 'ThisExpression',
- ThrowStatement: 'ThrowStatement',
- TryStatement: 'TryStatement',
- UnaryExpression: 'UnaryExpression',
- UpdateExpression: 'UpdateExpression',
- VariableDeclaration: 'VariableDeclaration',
- VariableDeclarator: 'VariableDeclarator',
- WhileStatement: 'WhileStatement',
- WithStatement: 'WithStatement',
- YieldExpression: 'YieldExpression'
- };
-
- VisitorKeys = {
- AssignmentExpression: ['left', 'right'],
- AssignmentPattern: ['left', 'right'],
- ArrayExpression: ['elements'],
- ArrayPattern: ['elements'],
- ArrowFunctionExpression: ['params', 'body'],
- AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
- BlockStatement: ['body'],
- BinaryExpression: ['left', 'right'],
- BreakStatement: ['label'],
- CallExpression: ['callee', 'arguments'],
- CatchClause: ['param', 'body'],
- ChainExpression: ['expression'],
- ClassBody: ['body'],
- ClassDeclaration: ['id', 'superClass', 'body'],
- ClassExpression: ['id', 'superClass', 'body'],
- ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
- ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- ConditionalExpression: ['test', 'consequent', 'alternate'],
- ContinueStatement: ['label'],
- DebuggerStatement: [],
- DirectiveStatement: [],
- DoWhileStatement: ['body', 'test'],
- EmptyStatement: [],
- ExportAllDeclaration: ['source'],
- ExportDefaultDeclaration: ['declaration'],
- ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
- ExportSpecifier: ['exported', 'local'],
- ExpressionStatement: ['expression'],
- ForStatement: ['init', 'test', 'update', 'body'],
- ForInStatement: ['left', 'right', 'body'],
- ForOfStatement: ['left', 'right', 'body'],
- FunctionDeclaration: ['id', 'params', 'body'],
- FunctionExpression: ['id', 'params', 'body'],
- GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
- Identifier: [],
- IfStatement: ['test', 'consequent', 'alternate'],
- ImportExpression: ['source'],
- ImportDeclaration: ['specifiers', 'source'],
- ImportDefaultSpecifier: ['local'],
- ImportNamespaceSpecifier: ['local'],
- ImportSpecifier: ['imported', 'local'],
- Literal: [],
- LabeledStatement: ['label', 'body'],
- LogicalExpression: ['left', 'right'],
- MemberExpression: ['object', 'property'],
- MetaProperty: ['meta', 'property'],
- MethodDefinition: ['key', 'value'],
- ModuleSpecifier: [],
- NewExpression: ['callee', 'arguments'],
- ObjectExpression: ['properties'],
- ObjectPattern: ['properties'],
- Program: ['body'],
- Property: ['key', 'value'],
- RestElement: [ 'argument' ],
- ReturnStatement: ['argument'],
- SequenceExpression: ['expressions'],
- SpreadElement: ['argument'],
- Super: [],
- SwitchStatement: ['discriminant', 'cases'],
- SwitchCase: ['test', 'consequent'],
- TaggedTemplateExpression: ['tag', 'quasi'],
- TemplateElement: [],
- TemplateLiteral: ['quasis', 'expressions'],
- ThisExpression: [],
- ThrowStatement: ['argument'],
- TryStatement: ['block', 'handler', 'finalizer'],
- UnaryExpression: ['argument'],
- UpdateExpression: ['argument'],
- VariableDeclaration: ['declarations'],
- VariableDeclarator: ['id', 'init'],
- WhileStatement: ['test', 'body'],
- WithStatement: ['object', 'body'],
- YieldExpression: ['argument']
- };
-
- // unique id
- BREAK = {};
- SKIP = {};
- REMOVE = {};
-
- VisitorOption = {
- Break: BREAK,
- Skip: SKIP,
- Remove: REMOVE
- };
-
- function Reference(parent, key) {
- this.parent = parent;
- this.key = key;
- }
-
- Reference.prototype.replace = function replace(node) {
- this.parent[this.key] = node;
- };
-
- Reference.prototype.remove = function remove() {
- if (Array.isArray(this.parent)) {
- this.parent.splice(this.key, 1);
- return true;
- } else {
- this.replace(null);
- return false;
- }
- };
-
- function Element(node, path, wrap, ref) {
- this.node = node;
- this.path = path;
- this.wrap = wrap;
- this.ref = ref;
- }
-
- function Controller() { }
-
- // API:
- // return property path array from root to current node
- Controller.prototype.path = function path() {
- var i, iz, j, jz, result, element;
-
- function addToPath(result, path) {
- if (Array.isArray(path)) {
- for (j = 0, jz = path.length; j < jz; ++j) {
- result.push(path[j]);
- }
- } else {
- result.push(path);
- }
- }
-
- // root node
- if (!this.__current.path) {
- return null;
- }
-
- // first node is sentinel, second node is root element
- result = [];
- for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
- element = this.__leavelist[i];
- addToPath(result, element.path);
- }
- addToPath(result, this.__current.path);
- return result;
- };
-
- // API:
- // return type of current node
- Controller.prototype.type = function () {
- var node = this.current();
- return node.type || this.__current.wrap;
- };
-
- // API:
- // return array of parent elements
- Controller.prototype.parents = function parents() {
- var i, iz, result;
-
- // first node is sentinel
- result = [];
- for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
- result.push(this.__leavelist[i].node);
- }
-
- return result;
- };
-
- // API:
- // return current node
- Controller.prototype.current = function current() {
- return this.__current.node;
- };
-
- Controller.prototype.__execute = function __execute(callback, element) {
- var previous, result;
-
- result = undefined;
-
- previous = this.__current;
- this.__current = element;
- this.__state = null;
- if (callback) {
- result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
- }
- this.__current = previous;
-
- return result;
- };
-
- // API:
- // notify control skip / break
- Controller.prototype.notify = function notify(flag) {
- this.__state = flag;
- };
-
- // API:
- // skip child nodes of current node
- Controller.prototype.skip = function () {
- this.notify(SKIP);
- };
-
- // API:
- // break traversals
- Controller.prototype['break'] = function () {
- this.notify(BREAK);
- };
-
- // API:
- // remove node
- Controller.prototype.remove = function () {
- this.notify(REMOVE);
- };
-
- Controller.prototype.__initialize = function(root, visitor) {
- this.visitor = visitor;
- this.root = root;
- this.__worklist = [];
- this.__leavelist = [];
- this.__current = null;
- this.__state = null;
- this.__fallback = null;
- if (visitor.fallback === 'iteration') {
- this.__fallback = Object.keys;
- } else if (typeof visitor.fallback === 'function') {
- this.__fallback = visitor.fallback;
- }
-
- this.__keys = VisitorKeys;
- if (visitor.keys) {
- this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
- }
- };
-
- function isNode(node) {
- if (node == null) {
- return false;
- }
- return typeof node === 'object' && typeof node.type === 'string';
- }
-
- function isProperty(nodeType, key) {
- return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
- }
-
- function candidateExistsInLeaveList(leavelist, candidate) {
- for (var i = leavelist.length - 1; i >= 0; --i) {
- if (leavelist[i].node === candidate) {
- return true;
- }
- }
- return false;
- }
-
- Controller.prototype.traverse = function traverse(root, visitor) {
- var worklist,
- leavelist,
- element,
- node,
- nodeType,
- ret,
- key,
- current,
- current2,
- candidates,
- candidate,
- sentinel;
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- worklist.push(new Element(root, null, null, null));
- leavelist.push(new Element(null, null, null, null));
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- ret = this.__execute(visitor.leave, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
- continue;
- }
-
- if (element.node) {
-
- ret = this.__execute(visitor.enter, element);
-
- if (this.__state === BREAK || ret === BREAK) {
- return;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || ret === SKIP) {
- continue;
- }
-
- node = element.node;
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
-
- if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
- continue;
- }
-
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', null);
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, null);
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- if (candidateExistsInLeaveList(leavelist, candidate)) {
- continue;
- }
-
- worklist.push(new Element(candidate, key, null, null));
- }
- }
- }
- }
- };
-
- Controller.prototype.replace = function replace(root, visitor) {
- var worklist,
- leavelist,
- node,
- nodeType,
- target,
- element,
- current,
- current2,
- candidates,
- candidate,
- sentinel,
- outer,
- key;
-
- function removeElem(element) {
- var i,
- key,
- nextElem,
- parent;
-
- if (element.ref.remove()) {
- // When the reference is an element of an array.
- key = element.ref.key;
- parent = element.ref.parent;
-
- // If removed from array, then decrease following items' keys.
- i = worklist.length;
- while (i--) {
- nextElem = worklist[i];
- if (nextElem.ref && nextElem.ref.parent === parent) {
- if (nextElem.ref.key < key) {
- break;
- }
- --nextElem.ref.key;
- }
- }
- }
- }
-
- this.__initialize(root, visitor);
-
- sentinel = {};
-
- // reference
- worklist = this.__worklist;
- leavelist = this.__leavelist;
-
- // initialize
- outer = {
- root: root
- };
- element = new Element(root, null, null, new Reference(outer, 'root'));
- worklist.push(element);
- leavelist.push(element);
-
- while (worklist.length) {
- element = worklist.pop();
-
- if (element === sentinel) {
- element = leavelist.pop();
-
- target = this.__execute(visitor.leave, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
- continue;
- }
-
- target = this.__execute(visitor.enter, element);
-
- // node may be replaced with null,
- // so distinguish between undefined and null in this place
- if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
- // replace
- element.ref.replace(target);
- element.node = target;
- }
-
- if (this.__state === REMOVE || target === REMOVE) {
- removeElem(element);
- element.node = null;
- }
-
- if (this.__state === BREAK || target === BREAK) {
- return outer.root;
- }
-
- // node may be null
- node = element.node;
- if (!node) {
- continue;
- }
-
- worklist.push(sentinel);
- leavelist.push(element);
-
- if (this.__state === SKIP || target === SKIP) {
- continue;
- }
-
- nodeType = node.type || element.wrap;
- candidates = this.__keys[nodeType];
- if (!candidates) {
- if (this.__fallback) {
- candidates = this.__fallback(node);
- } else {
- throw new Error('Unknown node type ' + nodeType + '.');
- }
- }
-
- current = candidates.length;
- while ((current -= 1) >= 0) {
- key = candidates[current];
- candidate = node[key];
- if (!candidate) {
- continue;
- }
-
- if (Array.isArray(candidate)) {
- current2 = candidate.length;
- while ((current2 -= 1) >= 0) {
- if (!candidate[current2]) {
- continue;
- }
- if (isProperty(nodeType, candidates[current])) {
- element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
- } else if (isNode(candidate[current2])) {
- element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
- } else {
- continue;
- }
- worklist.push(element);
- }
- } else if (isNode(candidate)) {
- worklist.push(new Element(candidate, key, null, new Reference(node, key)));
- }
- }
- }
-
- return outer.root;
- };
-
- function traverse(root, visitor) {
- var controller = new Controller();
- return controller.traverse(root, visitor);
- }
-
- function replace(root, visitor) {
- var controller = new Controller();
- return controller.replace(root, visitor);
- }
-
- function extendCommentRange(comment, tokens) {
- var target;
-
- target = upperBound(tokens, function search(token) {
- return token.range[0] > comment.range[0];
- });
-
- comment.extendedRange = [comment.range[0], comment.range[1]];
-
- if (target !== tokens.length) {
- comment.extendedRange[1] = tokens[target].range[0];
- }
-
- target -= 1;
- if (target >= 0) {
- comment.extendedRange[0] = tokens[target].range[1];
- }
-
- return comment;
- }
-
- function attachComments(tree, providedComments, tokens) {
- // At first, we should calculate extended comment ranges.
- var comments = [], comment, len, i, cursor;
-
- if (!tree.range) {
- throw new Error('attachComments needs range information');
- }
-
- // tokens array is empty, we attach comments to tree as 'leadingComments'
- if (!tokens.length) {
- if (providedComments.length) {
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comment = deepCopy(providedComments[i]);
- comment.extendedRange = [0, tree.range[0]];
- comments.push(comment);
- }
- tree.leadingComments = comments;
- }
- return tree;
- }
-
- for (i = 0, len = providedComments.length; i < len; i += 1) {
- comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
- }
-
- // This is based on John Freeman's implementation.
- cursor = 0;
- traverse(tree, {
- enter: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (comment.extendedRange[1] > node.range[0]) {
- break;
- }
-
- if (comment.extendedRange[1] === node.range[0]) {
- if (!node.leadingComments) {
- node.leadingComments = [];
- }
- node.leadingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- cursor = 0;
- traverse(tree, {
- leave: function (node) {
- var comment;
-
- while (cursor < comments.length) {
- comment = comments[cursor];
- if (node.range[1] < comment.extendedRange[0]) {
- break;
- }
-
- if (node.range[1] === comment.extendedRange[0]) {
- if (!node.trailingComments) {
- node.trailingComments = [];
- }
- node.trailingComments.push(comment);
- comments.splice(cursor, 1);
- } else {
- cursor += 1;
- }
- }
-
- // already out of owned node
- if (cursor === comments.length) {
- return VisitorOption.Break;
- }
-
- if (comments[cursor].extendedRange[0] > node.range[1]) {
- return VisitorOption.Skip;
- }
- }
- });
-
- return tree;
- }
-
- exports.Syntax = Syntax;
- exports.traverse = traverse;
- exports.replace = replace;
- exports.attachComments = attachComments;
- exports.VisitorKeys = VisitorKeys;
- exports.VisitorOption = VisitorOption;
- exports.Controller = Controller;
- exports.cloneEnvironment = function () { return clone({}); };
-
- return exports;
-}(exports));
-/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json
deleted file mode 100644
index bc99e7c4a64..00000000000
--- a/tools/node_modules/eslint/node_modules/esrecurse/node_modules/estraverse/package.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "estraverse",
- "description": "ECMAScript JS AST traversal functions",
- "homepage": "https://github.com/estools/estraverse",
- "main": "estraverse.js",
- "version": "5.2.0",
- "engines": {
- "node": ">=4.0"
- },
- "maintainers": [
- {
- "name": "Yusuke Suzuki",
- "email": "utatane.tea@gmail.com",
- "web": "http://github.com/Constellation"
- }
- ],
- "repository": {
- "type": "git",
- "url": "http://github.com/estools/estraverse.git"
- },
- "devDependencies": {
- "babel-preset-env": "^1.6.1",
- "babel-register": "^6.3.13",
- "chai": "^2.1.1",
- "espree": "^1.11.0",
- "gulp": "^3.8.10",
- "gulp-bump": "^0.2.2",
- "gulp-filter": "^2.0.0",
- "gulp-git": "^1.0.1",
- "gulp-tag-version": "^1.3.0",
- "jshint": "^2.5.6",
- "mocha": "^2.1.0"
- },
- "license": "BSD-2-Clause",
- "scripts": {
- "test": "npm run-script lint && npm run-script unit-test",
- "lint": "jshint estraverse.js",
- "unit-test": "mocha --compilers js:babel-register"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/estraverse/estraverse.js b/tools/node_modules/eslint/node_modules/estraverse/estraverse.js
index b106d386a6e..93225bb0c40 100644
--- a/tools/node_modules/eslint/node_modules/estraverse/estraverse.js
+++ b/tools/node_modules/eslint/node_modules/estraverse/estraverse.js
@@ -84,6 +84,7 @@
BreakStatement: 'BreakStatement',
CallExpression: 'CallExpression',
CatchClause: 'CatchClause',
+ ChainExpression: 'ChainExpression',
ClassBody: 'ClassBody',
ClassDeclaration: 'ClassDeclaration',
ClassExpression: 'ClassExpression',
@@ -159,6 +160,7 @@
BreakStatement: ['label'],
CallExpression: ['callee', 'arguments'],
CatchClause: ['param', 'body'],
+ ChainExpression: ['expression'],
ClassBody: ['body'],
ClassDeclaration: ['id', 'superClass', 'body'],
ClassExpression: ['id', 'superClass', 'body'],
@@ -388,6 +390,15 @@
function isProperty(nodeType, key) {
return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
}
+
+ function candidateExistsInLeaveList(leavelist, candidate) {
+ for (var i = leavelist.length - 1; i >= 0; --i) {
+ if (leavelist[i].node === candidate) {
+ return true;
+ }
+ }
+ return false;
+ }
Controller.prototype.traverse = function traverse(root, visitor) {
var worklist,
@@ -469,6 +480,11 @@
if (!candidate[current2]) {
continue;
}
+
+ if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
+ continue;
+ }
+
if (isProperty(nodeType, candidates[current])) {
element = new Element(candidate[current2], [key, current2], 'Property', null);
} else if (isNode(candidate[current2])) {
@@ -479,6 +495,10 @@
worklist.push(element);
}
} else if (isNode(candidate)) {
+ if (candidateExistsInLeaveList(leavelist, candidate)) {
+ continue;
+ }
+
worklist.push(new Element(candidate, key, null, null));
}
}
@@ -767,7 +787,6 @@
return tree;
}
- exports.version = require('./package.json').version;
exports.Syntax = Syntax;
exports.traverse = traverse;
exports.replace = replace;
diff --git a/tools/node_modules/eslint/node_modules/estraverse/package.json b/tools/node_modules/eslint/node_modules/estraverse/package.json
index 11382386723..bc99e7c4a64 100644
--- a/tools/node_modules/eslint/node_modules/estraverse/package.json
+++ b/tools/node_modules/eslint/node_modules/estraverse/package.json
@@ -3,7 +3,7 @@
"description": "ECMAScript JS AST traversal functions",
"homepage": "https://github.com/estools/estraverse",
"main": "estraverse.js",
- "version": "4.3.0",
+ "version": "5.2.0",
"engines": {
"node": ">=4.0"
},
diff --git a/tools/node_modules/eslint/node_modules/glob-parent/LICENSE b/tools/node_modules/eslint/node_modules/glob-parent/LICENSE
index 63222d7a8f9..d701b08324f 100644
--- a/tools/node_modules/eslint/node_modules/glob-parent/LICENSE
+++ b/tools/node_modules/eslint/node_modules/glob-parent/LICENSE
@@ -1,6 +1,6 @@
The ISC License
-Copyright (c) 2015, 2019 Elan Shanker
+Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/tools/node_modules/eslint/node_modules/glob-parent/README.md b/tools/node_modules/eslint/node_modules/glob-parent/README.md
index 36a279384b1..6ae18a1a089 100644
--- a/tools/node_modules/eslint/node_modules/glob-parent/README.md
+++ b/tools/node_modules/eslint/node_modules/glob-parent/README.md
@@ -6,7 +6,7 @@
# glob-parent
-[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
+[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Extract the non-magic parent path from a glob string.
@@ -45,7 +45,7 @@ Takes a string and returns the part of the path before the glob begins. Be aware
```js
{
// Disables the automatic conversion of slashes for Windows
- flipBackslashes: true
+ flipBackslashes: true;
}
```
@@ -66,13 +66,14 @@ The following characters have special significance in glob patterns and must be
**Example**
```js
-globParent('foo/[bar]/') // 'foo'
-globParent('foo/\\[bar]/') // 'foo/[bar]'
+globParent('foo/[bar]/'); // 'foo'
+globParent('foo/\\[bar]/'); // 'foo/[bar]'
```
## Limitations
### Braces & Brackets
+
This library attempts a quick and imperfect method of determining which path
parts have glob magic without fully parsing/lexing the pattern. There are some
advanced use cases that can trip it up, such as nested braces where the outer
@@ -82,6 +83,7 @@ ensure higher-fidelity glob handling in your library, it is recommended that you
pre-process your input with [expand-braces] and/or [expand-brackets].
### Windows
+
Backslashes are not valid path separators for globs. If a path with backslashes
is provided anyway, for simple cases, glob-parent will replace the path
separator for you and return the non-glob parent path (now with
@@ -91,10 +93,10 @@ This cannot be used in conjunction with escape characters.
```js
// BAD
-globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)'
+globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)'
// GOOD
-globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)'
+globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)'
```
If you are using escape characters for a pattern without path parts (i.e.
@@ -102,36 +104,31 @@ relative to `cwd`), prefix with `./` to avoid confusing glob-parent.
```js
// BAD
-globParent('foo \\[bar]') // 'foo '
-globParent('foo \\[bar]*') // 'foo '
+globParent('foo \\[bar]'); // 'foo '
+globParent('foo \\[bar]*'); // 'foo '
// GOOD
-globParent('./foo \\[bar]') // 'foo [bar]'
-globParent('./foo \\[bar]*') // '.'
+globParent('./foo \\[bar]'); // 'foo [bar]'
+globParent('./foo \\[bar]*'); // '.'
```
## License
ISC
-[expand-braces]: https://github.com/jonschlinkert/expand-braces
-[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
-
-[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg
+<!-- prettier-ignore-start -->
+[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
+<!-- prettier-ignore-end -->
-[gitter-url]: https://gitter.im/gulpjs/gulp
-[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
+<!-- prettier-ignore-start -->
+[expand-braces]: https://github.com/jonschlinkert/expand-braces
+[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
+<!-- prettier-ignore-end -->
diff --git a/tools/node_modules/eslint/node_modules/glob-parent/index.js b/tools/node_modules/eslint/node_modules/glob-parent/index.js
index 09e257ea306..09dde64ba7c 100644
--- a/tools/node_modules/eslint/node_modules/glob-parent/index.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/glob-parent/package.json b/tools/node_modules/eslint/node_modules/glob-parent/package.json
index 125c971c270..baeab4217a0 100644
--- a/tools/node_modules/eslint/node_modules/glob-parent/package.json
+++ b/tools/node_modules/eslint/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 <team@gulpjs.com> (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/tools/node_modules/eslint/node_modules/glob/README.md b/tools/node_modules/eslint/node_modules/glob/README.md
index 2dde30a597d..83f0c83a0c1 100644
--- a/tools/node_modules/eslint/node_modules/glob/README.md
+++ b/tools/node_modules/eslint/node_modules/glob/README.md
@@ -276,6 +276,9 @@ the filesystem.
* `absolute` Set to true to always receive absolute paths for matched
files. Unlike `realpath`, this also affects the values returned in
the `match` event.
+* `fs` File-system object with Node's `fs` API. By default, the built-in
+ `fs` module will be used. Set to a volume provided by a library like
+ `memfs` to avoid using the "real" file-system.
## Comparisons to other fnmatch/glob implementations
diff --git a/tools/node_modules/eslint/node_modules/glob/changelog.md b/tools/node_modules/eslint/node_modules/glob/changelog.md
deleted file mode 100644
index 41636771e3a..00000000000
--- a/tools/node_modules/eslint/node_modules/glob/changelog.md
+++ /dev/null
@@ -1,67 +0,0 @@
-## 7.0
-
-- Raise error if `options.cwd` is specified, and not a directory
-
-## 6.0
-
-- Remove comment and negation pattern support
-- Ignore patterns are always in `dot:true` mode
-
-## 5.0
-
-- Deprecate comment and negation patterns
-- Fix regression in `mark` and `nodir` options from making all cache
- keys absolute path.
-- Abort if `fs.readdir` returns an error that's unexpected
-- Don't emit `match` events for ignored items
-- Treat ENOTSUP like ENOTDIR in readdir
-
-## 4.5
-
-- Add `options.follow` to always follow directory symlinks in globstar
-- Add `options.realpath` to call `fs.realpath` on all results
-- Always cache based on absolute path
-
-## 4.4
-
-- Add `options.ignore`
-- Fix handling of broken symlinks
-
-## 4.3
-
-- Bump minimatch to 2.x
-- Pass all tests on Windows
-
-## 4.2
-
-- Add `glob.hasMagic` function
-- Add `options.nodir` flag
-
-## 4.1
-
-- Refactor sync and async implementations for performance
-- Throw if callback provided to sync glob function
-- Treat symbolic links in globstar results the same as Bash 4.3
-
-## 4.0
-
-- Use `^` for dependency versions (bumped major because this breaks
- older npm versions)
-- Ensure callbacks are only ever called once
-- switch to ISC license
-
-## 3.x
-
-- Rewrite in JavaScript
-- Add support for setting root, cwd, and windows support
-- Cache many fs calls
-- Add globstar support
-- emit match events
-
-## 2.x
-
-- Use `glob.h` and `fnmatch.h` from NetBSD
-
-## 1.x
-
-- `glob.h` static binding.
diff --git a/tools/node_modules/eslint/node_modules/glob/common.js b/tools/node_modules/eslint/node_modules/glob/common.js
index d14157a0aec..8e363b6c1f1 100644
--- a/tools/node_modules/eslint/node_modules/glob/common.js
+++ b/tools/node_modules/eslint/node_modules/glob/common.js
@@ -10,6 +10,7 @@ function ownProp (obj, field) {
return Object.prototype.hasOwnProperty.call(obj, field)
}
+var fs = require("fs")
var path = require("path")
var minimatch = require("minimatch")
var isAbsolute = require("path-is-absolute")
@@ -75,6 +76,7 @@ function setopts (self, pattern, options) {
self.stat = !!options.stat
self.noprocess = !!options.noprocess
self.absolute = !!options.absolute
+ self.fs = options.fs || fs
self.maxLength = options.maxLength || Infinity
self.cache = options.cache || Object.create(null)
diff --git a/tools/node_modules/eslint/node_modules/glob/glob.js b/tools/node_modules/eslint/node_modules/glob/glob.js
index dc27aef10b3..afcf82752c3 100644
--- a/tools/node_modules/eslint/node_modules/glob/glob.js
+++ b/tools/node_modules/eslint/node_modules/glob/glob.js
@@ -40,7 +40,6 @@
module.exports = glob
-var fs = require('fs')
var rp = require('fs.realpath')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
@@ -501,7 +500,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) {
var lstatcb = inflight(lstatkey, lstatcb_)
if (lstatcb)
- fs.lstat(abs, lstatcb)
+ self.fs.lstat(abs, lstatcb)
function lstatcb_ (er, lstat) {
if (er && er.code === 'ENOENT')
@@ -542,7 +541,7 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
}
var self = this
- fs.readdir(abs, readdirCb(this, abs, cb))
+ self.fs.readdir(abs, readdirCb(this, abs, cb))
}
function readdirCb (self, abs, cb) {
@@ -746,13 +745,13 @@ Glob.prototype._stat = function (f, cb) {
var self = this
var statcb = inflight('stat\0' + abs, lstatcb_)
if (statcb)
- fs.lstat(abs, statcb)
+ self.fs.lstat(abs, statcb)
function lstatcb_ (er, lstat) {
if (lstat && lstat.isSymbolicLink()) {
// If it's a symlink, then treat it as the target, unless
// the target does not exist, then treat it as a file.
- return fs.stat(abs, function (er, stat) {
+ return self.fs.stat(abs, function (er, stat) {
if (er)
self._stat2(f, abs, null, lstat, cb)
else
diff --git a/tools/node_modules/eslint/node_modules/glob/package.json b/tools/node_modules/eslint/node_modules/glob/package.json
index b345ae1e9fd..cc1a57a896e 100644
--- a/tools/node_modules/eslint/node_modules/glob/package.json
+++ b/tools/node_modules/eslint/node_modules/glob/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "glob",
"description": "a little globber",
- "version": "7.1.7",
+ "version": "7.2.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
@@ -25,6 +25,7 @@
"path-is-absolute": "^1.0.0"
},
"devDependencies": {
+ "memfs": "^3.2.0",
"mkdirp": "0",
"rimraf": "^2.2.8",
"tap": "^15.0.6",
diff --git a/tools/node_modules/eslint/node_modules/glob/sync.js b/tools/node_modules/eslint/node_modules/glob/sync.js
index 10b0ed2c002..4f46f90559a 100644
--- a/tools/node_modules/eslint/node_modules/glob/sync.js
+++ b/tools/node_modules/eslint/node_modules/glob/sync.js
@@ -1,7 +1,6 @@
module.exports = globSync
globSync.GlobSync = GlobSync
-var fs = require('fs')
var rp = require('fs.realpath')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
@@ -246,7 +245,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
var lstat
var stat
try {
- lstat = fs.lstatSync(abs)
+ lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er.code === 'ENOENT') {
// lstat failed, doesn't exist
@@ -283,7 +282,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
}
try {
- return this._readdirEntries(abs, fs.readdirSync(abs))
+ return this._readdirEntries(abs, this.fs.readdirSync(abs))
} catch (er) {
this._readdirError(abs, er)
return null
@@ -442,7 +441,7 @@ GlobSync.prototype._stat = function (f) {
if (!stat) {
var lstat
try {
- lstat = fs.lstatSync(abs)
+ lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
this.statCache[abs] = false
@@ -452,7 +451,7 @@ GlobSync.prototype._stat = function (f) {
if (lstat && lstat.isSymbolicLink()) {
try {
- stat = fs.statSync(abs)
+ stat = this.fs.statSync(abs)
} catch (er) {
stat = lstat
}
diff --git a/tools/node_modules/eslint/node_modules/globals/globals.json b/tools/node_modules/eslint/node_modules/globals/globals.json
index 334ff3e01e9..cbff038f2e9 100644
--- a/tools/node_modules/eslint/node_modules/globals/globals.json
+++ b/tools/node_modules/eslint/node_modules/globals/globals.json
@@ -1687,6 +1687,7 @@
"createObjectIn": false,
"exportFunction": false,
"GM": false,
+ "GM_addElement": false,
"GM_addStyle": false,
"GM_addValueChangeListener": false,
"GM_deleteValue": false,
diff --git a/tools/node_modules/eslint/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/globals/package.json
index a646c1ded41..28457b7aa63 100644
--- a/tools/node_modules/eslint/node_modules/globals/package.json
+++ b/tools/node_modules/eslint/node_modules/globals/package.json
@@ -1,6 +1,6 @@
{
"name": "globals",
- "version": "13.10.0",
+ "version": "13.11.0",
"description": "Global identifiers from different JavaScript environments",
"license": "MIT",
"repository": "sindresorhus/globals",
diff --git a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/index.js
deleted file mode 100644
index 671f97f7607..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/package.json
deleted file mode 100644
index 2137e888fa5..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md b/tools/node_modules/eslint/node_modules/is-fullwidth-code-point/readme.md
deleted file mode 100644
index 4236bba980d..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/is-glob/README.md b/tools/node_modules/eslint/node_modules/is-glob/README.md
index 59444ebe69a..740724b276e 100644
--- a/tools/node_modules/eslint/node_modules/is-glob/README.md
+++ b/tools/node_modules/eslint/node_modules/is-glob/README.md
@@ -1,4 +1,4 @@
-# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Linux Build Status](https://img.shields.io/travis/micromatch/is-glob.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/is-glob) [![Windows Build Status](https://img.shields.io/appveyor/ci/micromatch/is-glob.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/micromatch/is-glob)
+# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions)
> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.
diff --git a/tools/node_modules/eslint/node_modules/is-glob/index.js b/tools/node_modules/eslint/node_modules/is-glob/index.js
index 55826510ce7..620f563eccf 100644
--- a/tools/node_modules/eslint/node_modules/is-glob/index.js
+++ b/tools/node_modules/eslint/node_modules/is-glob/index.js
@@ -7,8 +7,128 @@
var isExtglob = require('is-extglob');
var chars = { '{': '}', '(': ')', '[': ']'};
-var strictRegex = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
-var relaxedRegex = /\\(.)|(^!|[*?{}()[\]]|\(\?)/;
+var strictCheck = function(str) {
+ if (str[0] === '!') {
+ return true;
+ }
+ var index = 0;
+ var pipeIndex = -2;
+ var closeSquareIndex = -2;
+ var closeCurlyIndex = -2;
+ var closeParenIndex = -2;
+ var backSlashIndex = -2;
+ while (index < str.length) {
+ if (str[index] === '*') {
+ return true;
+ }
+
+ if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
+ return true;
+ }
+
+ if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
+ if (closeSquareIndex < index) {
+ closeSquareIndex = str.indexOf(']', index);
+ }
+ if (closeSquareIndex > index) {
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
+ return true;
+ }
+ backSlashIndex = str.indexOf('\\', index);
+ if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
+ return true;
+ }
+ }
+ }
+
+ if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
+ closeCurlyIndex = str.indexOf('}', index);
+ if (closeCurlyIndex > index) {
+ backSlashIndex = str.indexOf('\\', index);
+ if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
+ return true;
+ }
+ }
+ }
+
+ if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
+ closeParenIndex = str.indexOf(')', index);
+ if (closeParenIndex > index) {
+ backSlashIndex = str.indexOf('\\', index);
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
+ return true;
+ }
+ }
+ }
+
+ if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
+ if (pipeIndex < index) {
+ pipeIndex = str.indexOf('|', index);
+ }
+ if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
+ closeParenIndex = str.indexOf(')', pipeIndex);
+ if (closeParenIndex > pipeIndex) {
+ backSlashIndex = str.indexOf('\\', pipeIndex);
+ if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
+ return true;
+ }
+ }
+ }
+ }
+
+ if (str[index] === '\\') {
+ var open = str[index + 1];
+ index += 2;
+ var close = chars[open];
+
+ if (close) {
+ var n = str.indexOf(close, index);
+ if (n !== -1) {
+ index = n + 1;
+ }
+ }
+
+ if (str[index] === '!') {
+ return true;
+ }
+ } else {
+ index++;
+ }
+ }
+ return false;
+};
+
+var relaxedCheck = function(str) {
+ if (str[0] === '!') {
+ return true;
+ }
+ var index = 0;
+ while (index < str.length) {
+ if (/[*?{}()[\]]/.test(str[index])) {
+ return true;
+ }
+
+ if (str[index] === '\\') {
+ var open = str[index + 1];
+ index += 2;
+ var close = chars[open];
+
+ if (close) {
+ var n = str.indexOf(close, index);
+ if (n !== -1) {
+ index = n + 1;
+ }
+ }
+
+ if (str[index] === '!') {
+ return true;
+ }
+ } else {
+ index++;
+ }
+ }
+ return false;
+};
module.exports = function isGlob(str, options) {
if (typeof str !== 'string' || str === '') {
@@ -19,30 +139,12 @@ module.exports = function isGlob(str, options) {
return true;
}
- var regex = strictRegex;
- var match;
+ var check = strictCheck;
- // optionally relax regex
+ // optionally relax check
if (options && options.strict === false) {
- regex = relaxedRegex;
+ check = relaxedCheck;
}
- while ((match = regex.exec(str))) {
- if (match[2]) return true;
- var idx = match.index + match[0].length;
-
- // if an open bracket/brace/paren is escaped,
- // set the index to the next closing character
- var open = match[1];
- var close = open ? chars[open] : null;
- if (open && close) {
- var n = str.indexOf(close, idx);
- if (n !== -1) {
- idx = n + 1;
- }
- }
-
- str = str.slice(idx);
- }
- return false;
+ return check(str);
};
diff --git a/tools/node_modules/eslint/node_modules/is-glob/package.json b/tools/node_modules/eslint/node_modules/is-glob/package.json
index 806000dbdaf..858af0378e9 100644
--- a/tools/node_modules/eslint/node_modules/is-glob/package.json
+++ b/tools/node_modules/eslint/node_modules/is-glob/package.json
@@ -1,7 +1,7 @@
{
"name": "is-glob",
"description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.",
- "version": "4.0.1",
+ "version": "4.0.3",
"homepage": "https://github.com/micromatch/is-glob",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
@@ -22,7 +22,7 @@
"node": ">=0.10.0"
},
"scripts": {
- "test": "mocha"
+ "test": "mocha && node benchmark.js"
},
"dependencies": {
"is-extglob": "^2.1.1"
diff --git a/tools/node_modules/eslint/node_modules/js-tokens/README.md b/tools/node_modules/eslint/node_modules/js-tokens/README.md
deleted file mode 100644
index 00cdf1634db..00000000000
--- a/tools/node_modules/eslint/node_modules/js-tokens/README.md
+++ /dev/null
@@ -1,240 +0,0 @@
-Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens)
-========
-
-A regex that tokenizes JavaScript.
-
-```js
-var jsTokens = require("js-tokens").default
-
-var jsString = "var foo=opts.foo;\n..."
-
-jsString.match(jsTokens)
-// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...]
-```
-
-
-Installation
-============
-
-`npm install js-tokens`
-
-```js
-import jsTokens from "js-tokens"
-// or:
-var jsTokens = require("js-tokens").default
-```
-
-
-Usage
-=====
-
-### `jsTokens` ###
-
-A regex with the `g` flag that matches JavaScript tokens.
-
-The regex _always_ matches, even invalid JavaScript and the empty string.
-
-The next match is always directly after the previous.
-
-### `var token = matchToToken(match)` ###
-
-```js
-import {matchToToken} from "js-tokens"
-// or:
-var matchToToken = require("js-tokens").matchToToken
-```
-
-Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type:
-String, value: String}` object. The following types are available:
-
-- string
-- comment
-- regex
-- number
-- name
-- punctuator
-- whitespace
-- invalid
-
-Multi-line comments and strings also have a `closed` property indicating if the
-token was closed or not (see below).
-
-Comments and strings both come in several flavors. To distinguish them, check if
-the token starts with `//`, `/*`, `'`, `"` or `` ` ``.
-
-Names are ECMAScript IdentifierNames, that is, including both identifiers and
-keywords. You may use [is-keyword-js] to tell them apart.
-
-Whitespace includes both line terminators and other whitespace.
-
-[is-keyword-js]: https://github.com/crissdev/is-keyword-js
-
-
-ECMAScript support
-==================
-
-The intention is to always support the latest ECMAScript version whose feature
-set has been finalized.
-
-If adding support for a newer version requires changes, a new version with a
-major verion bump will be released.
-
-Currently, ECMAScript 2018 is supported.
-
-
-Invalid code handling
-=====================
-
-Unterminated strings are still matched as strings. JavaScript strings cannot
-contain (unescaped) newlines, so unterminated strings simply end at the end of
-the line. Unterminated template strings can contain unescaped newlines, though,
-so they go on to the end of input.
-
-Unterminated multi-line comments are also still matched as comments. They
-simply go on to the end of the input.
-
-Unterminated regex literals are likely matched as division and whatever is
-inside the regex.
-
-Invalid ASCII characters have their own capturing group.
-
-Invalid non-ASCII characters are treated as names, to simplify the matching of
-names (except unicode spaces which are treated as whitespace). Note: See also
-the [ES2018](#es2018) section.
-
-Regex literals may contain invalid regex syntax. They are still matched as
-regex literals. They may also contain repeated regex flags, to keep the regex
-simple.
-
-Strings may contain invalid escape sequences.
-
-
-Limitations
-===========
-
-Tokenizing JavaScript using regexesā€”in fact, _one single regex_ā€”wonā€™t be
-perfect. But thatā€™s not the point either.
-
-You may compare jsTokens with [esprima] by using `esprima-compare.js`.
-See `npm run esprima-compare`!
-
-[esprima]: http://esprima.org/
-
-### Template string interpolation ###
-
-Template strings are matched as single tokens, from the starting `` ` `` to the
-ending `` ` ``, including interpolations (whose tokens are not matched
-individually).
-
-Matching template string interpolations requires recursive balancing of `{` and
-`}`ā€”something that JavaScript regexes cannot do. Only one level of nesting is
-supported.
-
-### Division and regex literals collision ###
-
-Consider this example:
-
-```js
-var g = 9.82
-var number = bar / 2/g
-
-var regex = / 2/g
-```
-
-A human can easily understand that in the `number` line weā€™re dealing with
-division, and in the `regex` line weā€™re dealing with a regex literal. How come?
-Because humans can look at the whole code to put the `/` characters in context.
-A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also
-look backwards. See the [ES2018](#es2018) section).
-
-When the `jsTokens` regex scans throught the above, it will see the following
-at the end of both the `number` and `regex` rows:
-
-```js
-/ 2/g
-```
-
-It is then impossible to know if that is a regex literal, or part of an
-expression dealing with division.
-
-Here is a similar case:
-
-```js
-foo /= 2/g
-foo(/= 2/g)
-```
-
-The first line divides the `foo` variable with `2/g`. The second line calls the
-`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only
-sees forwards, it cannot tell the two cases apart.
-
-There are some cases where we _can_ tell division and regex literals apart,
-though.
-
-First off, we have the simple cases where thereā€™s only one slash in the line:
-
-```js
-var foo = 2/g
-foo /= 2
-```
-
-Regex literals cannot contain newlines, so the above cases are correctly
-identified as division. Things are only problematic when there are more than
-one non-comment slash in a single line.
-
-Secondly, not every character is a valid regex flag.
-
-```js
-var number = bar / 2/e
-```
-
-The above example is also correctly identified as division, because `e` is not a
-valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*`
-(any letter) as flags, but it is not worth it since it increases the amount of
-ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are
-allowed. This means that the above example will be identified as division as
-long as you donā€™t rename the `e` variable to some permutation of `gmiyus` 1 to 6
-characters long.
-
-Lastly, we can look _forward_ for information.
-
-- If the token following what looks like a regex literal is not valid after a
- regex literal, but is valid in a division expression, then the regex literal
- is treated as division instead. For example, a flagless regex cannot be
- followed by a string, number or name, but all of those three can be the
- denominator of a division.
-- Generally, if what looks like a regex literal is followed by an operator, the
- regex literal is treated as division instead. This is because regexes are
- seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division
- could likely be part of such an expression.
-
-Please consult the regex source and the test cases for precise information on
-when regex or division is matched (should you need to know). In short, you
-could sum it up as:
-
-If the end of a statement looks like a regex literal (even if it isnā€™t), it
-will be treated as one. Otherwise it should work as expected (if you write sane
-code).
-
-### ES2018 ###
-
-ES2018 added some nice regex improvements to the language.
-
-- [Unicode property escapes] should allow telling names and invalid non-ASCII
- characters apart without blowing up the regex size.
-- [Lookbehind assertions] should allow matching telling division and regex
- literals apart in more cases.
-- [Named capture groups] might simplify some things.
-
-These things would be nice to do, but are not critical. They probably have to
-wait until the oldest maintained Node.js LTS release supports those features.
-
-[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html
-[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html
-[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html
-
-
-License
-=======
-
-[MIT](LICENSE).
diff --git a/tools/node_modules/eslint/node_modules/js-tokens/index.js b/tools/node_modules/eslint/node_modules/js-tokens/index.js
deleted file mode 100644
index b23a4a0e7f4..00000000000
--- a/tools/node_modules/eslint/node_modules/js-tokens/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell
-// License: MIT. (See LICENSE.)
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-})
-
-// This regex comes from regex.coffee, and is inserted here by generate-index.js
-// (run `npm run build`).
-exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g
-
-exports.matchToToken = function(match) {
- var token = {type: "invalid", value: match[0], closed: undefined}
- if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
- else if (match[ 5]) token.type = "comment"
- else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
- else if (match[ 8]) token.type = "regex"
- else if (match[ 9]) token.type = "number"
- else if (match[10]) token.type = "name"
- else if (match[11]) token.type = "punctuator"
- else if (match[12]) token.type = "whitespace"
- return token
-}
diff --git a/tools/node_modules/eslint/node_modules/js-tokens/package.json b/tools/node_modules/eslint/node_modules/js-tokens/package.json
deleted file mode 100644
index 66752fab275..00000000000
--- a/tools/node_modules/eslint/node_modules/js-tokens/package.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "name": "js-tokens",
- "version": "4.0.0",
- "author": "Simon Lydell",
- "license": "MIT",
- "description": "A regex that tokenizes JavaScript.",
- "keywords": [
- "JavaScript",
- "js",
- "token",
- "tokenize",
- "regex"
- ],
- "files": [
- "index.js"
- ],
- "repository": "lydell/js-tokens",
- "scripts": {
- "test": "mocha --ui tdd",
- "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js",
- "build": "node generate-index.js",
- "dev": "npm run build && npm test"
- },
- "devDependencies": {
- "coffeescript": "2.1.1",
- "esprima": "4.0.0",
- "everything.js": "1.0.3",
- "mocha": "5.0.0"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/README.md b/tools/node_modules/eslint/node_modules/js-yaml/README.md
index 246e5635514..3cbc4bd2ddb 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/README.md
+++ b/tools/node_modules/eslint/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
-<!-- esprima required only for !!js/function -->
-<script src="esprima.js"></script>
-<script src="js-yaml.min.js"></script>
-<script type="text/javascript">
-var doc = jsyaml.load('greeting: hello\nname: world');
-</script>
-```
-
-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 ])
-
-**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": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
-
-// I'm just converting that string, what could possibly go wrong?
-require('js-yaml').load(untrusted_code) + ''
-```
+### loadAll (string [, iterator] [, options ])
-
-### 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 ])
-
-Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
-
-
-### safeDump (object [ , options ])
+### dump (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/tools/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js b/tools/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js
index e79186be6f5..a182f1afb01 100755
--- a/tools/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js
+++ b/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js b/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js
index 7878320743c..4cc0ddf6d26 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js
+++ b/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js
@@ -1,3989 +1,3874 @@
-/*! 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<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
-'use strict';
+/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jsyaml = {}));
+}(this, (function (exports) { 'use strict';
-var loader = require('./js-yaml/loader');
-var dumper = require('./js-yaml/dumper');
-
-
-function deprecated(name) {
- return function () {
- throw new Error('Function ' + name + ' is deprecated and cannot be used.');
- };
-}
-
-
-module.exports.Type = require('./js-yaml/type');
-module.exports.Schema = require('./js-yaml/schema');
-module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe');
-module.exports.JSON_SCHEMA = require('./js-yaml/schema/json');
-module.exports.CORE_SCHEMA = require('./js-yaml/schema/core');
-module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
-module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full');
-module.exports.load = loader.load;
-module.exports.loadAll = loader.loadAll;
-module.exports.safeLoad = loader.safeLoad;
-module.exports.safeLoadAll = loader.safeLoadAll;
-module.exports.dump = dumper.dump;
-module.exports.safeDump = dumper.safeDump;
-module.exports.YAMLException = require('./js-yaml/exception');
+ function isNothing(subject) {
+ return (typeof subject === 'undefined') || (subject === null);
+ }
-// Deprecated schema names from JS-YAML 2.0.x
-module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe');
-module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe');
-module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full');
-// Deprecated functions from JS-YAML 1.x.x
-module.exports.scan = deprecated('scan');
-module.exports.parse = deprecated('parse');
-module.exports.compose = deprecated('compose');
-module.exports.addConstructor = deprecated('addConstructor');
+ function isObject(subject) {
+ return (typeof subject === 'object') && (subject !== null);
+ }
-},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(require,module,exports){
-'use strict';
+ function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
-function isNothing(subject) {
- return (typeof subject === 'undefined') || (subject === null);
-}
+ return [ sequence ];
+ }
-function isObject(subject) {
- return (typeof subject === 'object') && (subject !== null);
-}
+ function extend(target, source) {
+ var index, length, key, sourceKeys;
+ if (source) {
+ sourceKeys = Object.keys(source);
-function toArray(sequence) {
- if (Array.isArray(sequence)) return sequence;
- else if (isNothing(sequence)) return [];
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
- return [ sequence ];
-}
+ return target;
+ }
-function extend(target, source) {
- var index, length, key, sourceKeys;
+ function repeat(string, count) {
+ var result = '', cycle;
- if (source) {
- sourceKeys = Object.keys(source);
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
- for (index = 0, length = sourceKeys.length; index < length; index += 1) {
- key = sourceKeys[index];
- target[key] = source[key];
- }
- }
-
- return target;
-}
+ return result;
+ }
-function repeat(string, count) {
- var result = '', cycle;
-
- for (cycle = 0; cycle < count; cycle += 1) {
- result += string;
+ function isNegativeZero(number) {
+ return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
}
- return result;
-}
+ var isNothing_1 = isNothing;
+ var isObject_1 = isObject;
+ var toArray_1 = toArray;
+ var repeat_1 = repeat;
+ var isNegativeZero_1 = isNegativeZero;
+ var extend_1 = extend;
-function isNegativeZero(number) {
- return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
-}
+ var common = {
+ isNothing: isNothing_1,
+ isObject: isObject_1,
+ toArray: toArray_1,
+ repeat: repeat_1,
+ isNegativeZero: isNegativeZero_1,
+ extend: extend_1
+ };
+ // YAML error class. http://stackoverflow.com/questions/8458984
-module.exports.isNothing = isNothing;
-module.exports.isObject = isObject;
-module.exports.toArray = toArray;
-module.exports.repeat = repeat;
-module.exports.isNegativeZero = isNegativeZero;
-module.exports.extend = extend;
-},{}],3:[function(require,module,exports){
-'use strict';
+ function formatError(exception, compact) {
+ var where = '', message = exception.reason || '(unknown reason)';
-/*eslint-disable no-use-before-define*/
+ if (!exception.mark) return message;
-var common = require('./common');
-var YAMLException = require('./exception');
-var DEFAULT_FULL_SCHEMA = require('./schema/default_full');
-var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe');
+ if (exception.mark.name) {
+ where += 'in "' + exception.mark.name + '" ';
+ }
-var _toString = Object.prototype.toString;
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
+ where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
-var CHAR_TAB = 0x09; /* Tab */
-var CHAR_LINE_FEED = 0x0A; /* LF */
-var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
-var CHAR_SPACE = 0x20; /* Space */
-var CHAR_EXCLAMATION = 0x21; /* ! */
-var CHAR_DOUBLE_QUOTE = 0x22; /* " */
-var CHAR_SHARP = 0x23; /* # */
-var CHAR_PERCENT = 0x25; /* % */
-var CHAR_AMPERSAND = 0x26; /* & */
-var CHAR_SINGLE_QUOTE = 0x27; /* ' */
-var CHAR_ASTERISK = 0x2A; /* * */
-var CHAR_COMMA = 0x2C; /* , */
-var CHAR_MINUS = 0x2D; /* - */
-var CHAR_COLON = 0x3A; /* : */
-var CHAR_EQUALS = 0x3D; /* = */
-var CHAR_GREATER_THAN = 0x3E; /* > */
-var CHAR_QUESTION = 0x3F; /* ? */
-var CHAR_COMMERCIAL_AT = 0x40; /* @ */
-var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
-var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
-var CHAR_GRAVE_ACCENT = 0x60; /* ` */
-var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
-var CHAR_VERTICAL_LINE = 0x7C; /* | */
-var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
-
-var ESCAPE_SEQUENCES = {};
-
-ESCAPE_SEQUENCES[0x00] = '\\0';
-ESCAPE_SEQUENCES[0x07] = '\\a';
-ESCAPE_SEQUENCES[0x08] = '\\b';
-ESCAPE_SEQUENCES[0x09] = '\\t';
-ESCAPE_SEQUENCES[0x0A] = '\\n';
-ESCAPE_SEQUENCES[0x0B] = '\\v';
-ESCAPE_SEQUENCES[0x0C] = '\\f';
-ESCAPE_SEQUENCES[0x0D] = '\\r';
-ESCAPE_SEQUENCES[0x1B] = '\\e';
-ESCAPE_SEQUENCES[0x22] = '\\"';
-ESCAPE_SEQUENCES[0x5C] = '\\\\';
-ESCAPE_SEQUENCES[0x85] = '\\N';
-ESCAPE_SEQUENCES[0xA0] = '\\_';
-ESCAPE_SEQUENCES[0x2028] = '\\L';
-ESCAPE_SEQUENCES[0x2029] = '\\P';
-
-var DEPRECATED_BOOLEANS_SYNTAX = [
- 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
- 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
-];
-
-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 (!compact && exception.mark.snippet) {
+ where += '\n\n' + exception.mark.snippet;
}
- if (line.length && line !== '\n') result += ind;
-
- result += line;
+ return message + ' ' + where;
}
- return result;
-}
-
-function generateNextLine(state, level) {
- return '\n' + common.repeat(' ', state.indent * level);
-}
-function testImplicitResolving(state, str) {
- var index, length, type;
+ function YAMLException$1(reason, mark) {
+ // Super constructor
+ Error.call(this);
- for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
- type = state.implicitTypes[index];
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = formatError(this, false);
- if (type.resolve(str)) {
- return true;
+ // 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 || '';
}
}
- 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.
-}
+ // Inherit from Error
+ YAMLException$1.prototype = Object.create(Error.prototype);
+ YAMLException$1.prototype.constructor = YAMLException$1;
-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) {
+ YAMLException$1.prototype.toString = function toString(compact) {
+ return this.name + ': ' + formatError(this, compact);
+ };
- pairBuffer = '';
- if (index !== 0) pairBuffer += ', ';
- if (state.condenseFlow) pairBuffer += '"';
+ var exception = YAMLException$1;
- objectKey = objectKeyList[index];
- objectValue = object[objectKey];
+ // get snippet for a single line, respecting maxLength
+ function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
+ var head = '';
+ var tail = '';
+ var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
- if (!writeNode(state, level, objectKey, false, false)) {
- continue; // Skip this pair because of invalid key;
+ if (position - lineStart > maxHalfLength) {
+ head = ' ... ';
+ lineStart = position - maxHalfLength + head.length;
}
- 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.
+ if (lineEnd - position > maxHalfLength) {
+ tail = ' ...';
+ lineEnd = position + maxHalfLength - tail.length;
}
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
+ return {
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, 'ā†’') + tail,
+ pos: position - lineStart + head.length // relative position
+ };
}
- 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');
+ function padStart(string, max) {
+ return common.repeat(' ', max - string.length) + string;
}
- 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.
- }
+ function makeSnippet(mark, options) {
+ options = Object.create(options || null);
- explicitPair = (state.tag !== null && state.tag !== '?') ||
- (state.dump && state.dump.length > 1024);
+ if (!mark.buffer) return null;
- if (explicitPair) {
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += '?';
- } else {
- pairBuffer += '? ';
- }
- }
+ 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;
- pairBuffer += state.dump;
+ var re = /\r?\n|\r|\0/g;
+ var lineStarts = [ 0 ];
+ var lineEnds = [];
+ var match;
+ var foundLineNo = -1;
- if (explicitPair) {
- pairBuffer += generateNextLine(state, level);
- }
+ while ((match = re.exec(mark.buffer))) {
+ lineEnds.push(match.index);
+ lineStarts.push(match.index + match[0].length);
- if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
- continue; // Skip this pair because of invalid value.
+ if (mark.position <= match.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
+ }
}
- if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
- pairBuffer += ':';
- } else {
- pairBuffer += ': ';
+ 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;
+ });
+ });
}
- pairBuffer += state.dump;
-
- // Both key and value are valid.
- _result += pairBuffer;
+ return result;
}
- state.tag = _tag;
- state.dump = _result || '{}'; // Empty mapping if no valid pairs.
-}
+ function Type$1(tag, options) {
+ options = options || {};
-function detectType(state, object, explicit) {
- var _result, typeList, index, length, type, style;
-
- typeList = explicit ? state.explicitTypes : state.implicitTypes;
+ 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.');
+ }
+ });
- for (index = 0, length = typeList.length; index < length; index += 1) {
- type = typeList[index];
+ // 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 ((type.instanceOf || type.predicate) &&
- (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
- (!type.predicate || type.predicate(object))) {
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+ }
- state.tag = explicit ? type.tag : '?';
+ var type = Type$1;
- if (type.represent) {
- style = state.styleMap[type.tag] || type.defaultStyle;
+ /*eslint-disable max-len*/
- 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;
+ function compileList(schema, name) {
+ var result = [];
- if (!detectType(state, object, false)) {
- detectType(state, object, true);
- }
+ schema[name].forEach(function (currentType) {
+ var newIndex = result.length;
- var type = _toString.call(state.dump);
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag &&
+ previousType.kind === currentType.kind &&
+ previousType.multi === currentType.multi) {
- if (block) {
- block = (state.flowLevel < 0 || state.flowLevel > level);
- }
+ newIndex = previousIndex;
+ }
+ });
- var objectOrArray = type === '[object Object]' || type === '[object Array]',
- duplicateIndex,
- duplicate;
+ result[newIndex] = currentType;
+ });
- if (objectOrArray) {
- duplicateIndex = state.duplicates.indexOf(object);
- duplicate = duplicateIndex !== -1;
+ return result;
}
- 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;
- }
+ function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length;
+
+ function collectType(type) {
+ if (type.multi) {
+ result.multi[type.kind].push(type);
+ result.multi['fallback'].push(type);
} else {
- writeFlowSequence(state, arrayLevel, state.dump);
- if (duplicate) {
- state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
- }
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
}
- } 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;
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
}
+ return result;
}
- return true;
-}
-function getDuplicateReferences(object, state) {
- var objects = [],
- duplicatesIndexes = [],
- index,
- length;
+ function Schema$1(definition) {
+ return this.extend(definition);
+ }
- 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);
-}
+ Schema$1.prototype.extend = function extend(definition) {
+ var implicit = [];
+ var explicit = [];
-function inspectNode(object, objects, duplicatesIndexes) {
- var objectKeyList,
- index,
- length;
+ if (definition instanceof type) {
+ // Schema.extend(type)
+ explicit.push(definition);
- 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);
+ } else if (Array.isArray(definition)) {
+ // Schema.extend([ type1, type2, ... ])
+ explicit = explicit.concat(definition);
- if (Array.isArray(object)) {
- for (index = 0, length = object.length; index < length; index += 1) {
- inspectNode(object[index], objects, duplicatesIndexes);
- }
- } else {
- objectKeyList = Object.keys(object);
+ } 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);
- for (index = 0, length = objectKeyList.length; index < length; index += 1) {
- inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
- }
- }
+ } else {
+ throw new exception('Schema.extend argument should be a Type, [ Type ], ' +
+ 'or a schema definition ({ implicit: [...], explicit: [...] })');
}
- }
-}
-function dump(input, options) {
- options = options || {};
+ 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.');
+ }
- var state = new State(options);
+ 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 (!state.noRefs) getDuplicateReferences(input, state);
+ 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.');
+ }
+ });
- if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
+ 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.');
+ }
+ });
- return '';
-}
+ var result = Object.create(Schema$1.prototype);
-function safeDump(input, options) {
- return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
+ result.implicit = (this.implicit || []).concat(implicit);
+ result.explicit = (this.explicit || []).concat(explicit);
-module.exports.dump = dump;
-module.exports.safeDump = safeDump;
+ result.compiledImplicit = compileList(result, 'implicit');
+ result.compiledExplicit = compileList(result, 'explicit');
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
-},{"./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';
+ return result;
+ };
-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() : '');
+ var schema = Schema$1;
- // 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 || '';
- }
-}
+ 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 : []; }
+ });
-// Inherit from Error
-YAMLException.prototype = Object.create(Error.prototype);
-YAMLException.prototype.constructor = YAMLException;
+ 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
+ ]
+ });
-YAMLException.prototype.toString = function toString(compact) {
- var result = this.name + ': ';
+ function resolveYamlNull(data) {
+ if (data === null) return true;
- result += this.reason || '(unknown reason)';
+ var max = data.length;
- if (!compact && this.mark) {
- result += ' ' + this.mark.toString();
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
}
- 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 constructYamlNull() {
+ return null;
+ }
-function is_WHITE_SPACE(c) {
- return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
-}
+ function isNull(object) {
+ return object === null;
+ }
-function is_WS_OR_EOL(c) {
- return (c === 0x09/* Tab */) ||
- (c === 0x20/* Space */) ||
- (c === 0x0A/* LF */) ||
- (c === 0x0D/* CR */);
-}
+ var _null = new type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; },
+ empty: function () { return ''; }
+ },
+ defaultStyle: 'lowercase'
+ });
-function is_FLOW_INDICATOR(c) {
- return c === 0x2C/* , */ ||
- c === 0x5B/* [ */ ||
- c === 0x5D/* ] */ ||
- c === 0x7B/* { */ ||
- c === 0x7D/* } */;
-}
+ function resolveYamlBoolean(data) {
+ if (data === null) return false;
-function fromHexCode(c) {
- var lc;
+ var max = data.length;
- if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
- return c - 0x30;
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
}
- /*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 constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+ }
-function charFromCodepoint(c) {
- if (c <= 0xFFFF) {
- return String.fromCharCode(c);
+ function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
}
- // 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);
-}
+ 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 State(input, options) {
- this.input = input;
+ function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+ }
- 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;
+ function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+ }
- this.implicitTypes = this.schema.compiledImplicit;
- this.typeMap = this.schema.compiledTypeMap;
+ function resolveYamlInteger(data) {
+ if (data === null) return false;
- this.length = input.length;
- this.position = 0;
- this.line = 0;
- this.lineStart = 0;
- this.lineIndent = 0;
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
- this.documents = [];
+ if (!max) return false;
- /*
- this.version;
- this.checkLineBreaks;
- this.tagMap;
- this.anchorMap;
- this.tag;
- this.anchor;
- this.kind;
- this.result;*/
+ ch = data[index];
-}
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
-function generateError(state, message) {
- return new YAMLException(
- message,
- new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
-}
+ // base 2, base 8, base 16
-function throwError(state, message) {
- throw generateError(state, message);
-}
+ if (ch === 'b') {
+ // base 2
+ index++;
-function throwWarning(state, message) {
- if (state.onWarning) {
- state.onWarning.call(null, generateError(state, message));
- }
-}
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
-var directiveHandlers = {
+ if (ch === 'x') {
+ // base 16
+ index++;
- YAML: function handleYamlDirective(state, name, args) {
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
- var match, major, minor;
- if (state.version !== null) {
- throwError(state, 'duplication of %YAML directive');
- }
+ if (ch === 'o') {
+ // base 8
+ index++;
- if (args.length !== 1) {
- throwError(state, 'YAML directive accepts exactly one argument');
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
}
- match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
-
- if (match === null) {
- throwError(state, 'ill-formed argument of the YAML directive');
- }
+ // base 10 (except 0)
- major = parseInt(match[1], 10);
- minor = parseInt(match[2], 10);
+ // value should not start with `_`;
+ if (ch === '_') return false;
- if (major !== 1) {
- throwError(state, 'unacceptable YAML version of the document');
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
}
- state.version = args[0];
- state.checkLineBreaks = (minor < 2);
-
- if (minor !== 1 && minor !== 2) {
- throwWarning(state, 'unsupported YAML version of the document');
- }
- },
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
- TAG: function handleTagDirective(state, name, args) {
+ return true;
+ }
- var handle, prefix;
+ function constructYamlInteger(data) {
+ var value = data, sign = 1, ch;
- if (args.length !== 2) {
- throwError(state, 'TAG directive accepts exactly two arguments');
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
}
- handle = args[0];
- prefix = args[1];
+ ch = value[0];
- if (!PATTERN_TAG_HANDLE.test(handle)) {
- throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
}
- if (_hasOwnProperty.call(state.tagMap, handle)) {
- throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
- }
+ if (value === '0') return 0;
- if (!PATTERN_TAG_URI.test(prefix)) {
- throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ 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);
}
- state.tagMap[handle] = prefix;
+ return sign * parseInt(value, 10);
}
-};
+ function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+ }
-function captureSegment(state, start, end, checkJson) {
- var _position, _length, _character, _result;
-
- if (start < end) {
- _result = state.input.slice(start, end);
+ 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' ]
+ }
+ });
- 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');
+ 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;
}
- state.result += _result;
+ return true;
}
-}
-function mergeMappings(state, destination, source, overridableKeys) {
- var sourceKeys, key, index, quantity;
+ function constructYamlFloat(data) {
+ var value, sign;
- if (!common.isObject(source)) {
- throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
- }
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
- sourceKeys = Object.keys(source);
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
- for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
- key = sourceKeys[index];
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
- if (!_hasOwnProperty.call(destination, key)) {
- destination[key] = source[key];
- overridableKeys[key] = true;
+ } else if (value === '.nan') {
+ return NaN;
}
+ return sign * parseFloat(value, 10);
}
-}
-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);
+ var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
- for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
- if (Array.isArray(keyNode[index])) {
- throwError(state, 'nested arrays are not supported inside keys');
- }
+ function representYamlFloat(object, style) {
+ var res;
- if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
- keyNode[index] = '[object Object]';
+ 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';
}
- }
-
- // 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]';
- }
+ res = object.toString(10);
- keyNode = String(keyNode);
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
- if (_result === null) {
- _result = {};
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
}
- 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];
+ function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
}
- return _result;
-}
-
-function readLineBreak(state) {
- var ch;
+ var float = new type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+ });
- ch = state.input.charCodeAt(state.position);
+ var json = failsafe.extend({
+ implicit: [
+ _null,
+ bool,
+ int,
+ float
+ ]
+ });
- 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');
+ var core = json;
+
+ var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+ var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+ function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
}
- state.line += 1;
- state.lineStart = state.position;
-}
+ function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
-function skipSeparationSpace(state, allowComments, checkIndent) {
- var lineBreaks = 0,
- ch = state.input.charCodeAt(state.position);
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
- while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
+ if (match === null) throw new Error('Date resolve error');
- if (allowComments && ch === 0x23/* # */) {
- do {
- ch = state.input.charCodeAt(++state.position);
- } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
- }
+ // match: [1] year [2] month [3] day
- if (is_EOL(ch)) {
- readLineBreak(state);
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
- 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 (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
}
- }
- if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
- throwWarning(state, 'deficient indentation');
- }
+ // match: [4] hour [5] minute [6] second [7] fraction
- return lineBreaks;
-}
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
-function testDocumentSeparator(state) {
- var _position = state.position,
- ch;
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
- ch = state.input.charCodeAt(_position);
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
- // 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)) {
+ 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;
+ }
- _position += 3;
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
- ch = state.input.charCodeAt(_position);
+ if (delta) date.setTime(date.getTime() - delta);
- if (ch === 0 || is_WS_OR_EOL(ch)) {
- return true;
- }
+ return date;
}
- 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;
+ function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
}
- if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
- following = state.input.charCodeAt(state.position + 1);
+ var timestamp = new type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+ });
- if (is_WS_OR_EOL(following) ||
- withinFlowCollection && is_FLOW_INDICATOR(following)) {
- return false;
- }
+ function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
}
- state.kind = 'scalar';
- state.result = '';
- captureStart = captureEnd = state.position;
- hasPendingContent = false;
+ var merge = new type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+ });
- while (ch !== 0) {
- if (ch === 0x3A/* : */) {
- following = state.input.charCodeAt(state.position + 1);
+ /*eslint-disable no-bitwise*/
- 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);
+ // [ 64, 65, 66 ] -> [ padding, CR, LF ]
+ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
- 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);
- }
+ function resolveYamlBinary(data) {
+ if (data === null) return false;
- captureSegment(state, captureStart, captureEnd, false);
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
- if (state.result) {
- return true;
- }
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
- state.kind = _kind;
- state.result = _result;
- return false;
-}
+ // Skip CR/LF
+ if (code > 64) continue;
-function readSingleQuotedScalar(state, nodeIndent) {
- var ch,
- captureStart, captureEnd;
+ // Fail on illegal characters
+ if (code < 0) return false;
- ch = state.input.charCodeAt(state.position);
+ bitlen += 6;
+ }
- if (ch !== 0x27/* ' */) {
- return false;
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
}
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
+ 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 = [];
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x27/* ' */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
+ // Collect by 6*4 bits (3 bytes)
- if (ch === 0x27/* ' */) {
- captureStart = state.position;
- state.position++;
- captureEnd = state.position;
- } else {
- return true;
+ 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);
}
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a single quoted scalar');
+ // Dump tail
- } else {
- state.position++;
- captureEnd = state.position;
+ 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);
}
- throwError(state, 'unexpected end of the stream within a single quoted scalar');
-}
+ function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
-function readDoubleQuotedScalar(state, nodeIndent) {
- var captureStart,
- captureEnd,
- hexLength,
- hexResult,
- tmp,
- ch;
+ // Convert every three bytes to 4 ASCII characters.
- ch = state.input.charCodeAt(state.position);
+ 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];
+ }
- if (ch !== 0x22/* " */) {
- return false;
- }
+ bits = (bits << 8) + object[idx];
+ }
- state.kind = 'scalar';
- state.result = '';
- state.position++;
- captureStart = captureEnd = state.position;
+ // Dump tail
- while ((ch = state.input.charCodeAt(state.position)) !== 0) {
- if (ch === 0x22/* " */) {
- captureSegment(state, captureStart, state.position, true);
- state.position++;
- return true;
+ tail = max % 3;
- } else if (ch === 0x5C/* \ */) {
- captureSegment(state, captureStart, state.position, true);
- ch = state.input.charCodeAt(++state.position);
+ 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];
+ }
- if (is_EOL(ch)) {
- skipSeparationSpace(state, false, nodeIndent);
+ return result;
+ }
- // TODO: rework to inline fn with no type cast?
- } else if (ch < 256 && simpleEscapeCheck[ch]) {
- state.result += simpleEscapeMap[ch];
- state.position++;
+ function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === '[object Uint8Array]';
+ }
- } else if ((tmp = escapedHexLen(ch)) > 0) {
- hexLength = tmp;
- hexResult = 0;
+ var binary = new type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+ });
- for (; hexLength > 0; hexLength--) {
- ch = state.input.charCodeAt(++state.position);
+ var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ var _toString$2 = Object.prototype.toString;
- if ((tmp = fromHexCode(ch)) >= 0) {
- hexResult = (hexResult << 4) + tmp;
+ function resolveYamlOmap(data) {
+ if (data === null) return true;
- } else {
- throwError(state, 'expected hexadecimal character');
- }
- }
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
- state.result += charFromCodepoint(hexResult);
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
- state.position++;
+ if (_toString$2.call(pair) !== '[object Object]') return false;
- } else {
- throwError(state, 'unknown escape sequence');
+ for (pairKey in pair) {
+ if (_hasOwnProperty$3.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
}
- captureStart = captureEnd = state.position;
-
- } else if (is_EOL(ch)) {
- captureSegment(state, captureStart, captureEnd, true);
- writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
- captureStart = captureEnd = state.position;
+ if (!pairHasKey) return false;
- } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
- throwError(state, 'unexpected end of the document within a double quoted scalar');
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
- } 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;
+ return true;
}
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
+ function constructYamlOmap(data) {
+ return data !== null ? data : [];
}
- ch = state.input.charCodeAt(++state.position);
+ var omap = new type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+ });
- while (ch !== 0) {
- skipSeparationSpace(state, true, nodeIndent);
+ var _toString$1 = Object.prototype.toString;
- ch = state.input.charCodeAt(state.position);
+ function resolveYamlPairs(data) {
+ if (data === null) return true;
- 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');
- }
+ var index, length, pair, keys, result,
+ object = data;
- keyTag = keyNode = valueNode = null;
- isPair = isExplicitPair = false;
+ result = new Array(object.length);
- if (ch === 0x3F/* ? */) {
- following = state.input.charCodeAt(state.position + 1);
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
- if (is_WS_OR_EOL(following)) {
- isPair = isExplicitPair = true;
- state.position++;
- skipSeparationSpace(state, true, nodeIndent);
- }
- }
+ if (_toString$1.call(pair) !== '[object Object]') return false;
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
- keyTag = state.tag;
- keyNode = state.result;
- skipSeparationSpace(state, true, nodeIndent);
+ keys = Object.keys(pair);
- ch = state.input.charCodeAt(state.position);
+ if (keys.length !== 1) return false;
- 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;
+ result[index] = [ keys[0], pair[keys[0]] ];
}
- 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);
- }
+ return true;
+ }
- skipSeparationSpace(state, true, nodeIndent);
+ function constructYamlPairs(data) {
+ if (data === null) return [];
- ch = state.input.charCodeAt(state.position);
+ var index, length, pair, keys, result,
+ object = data;
- if (ch === 0x2C/* , */) {
- readNext = true;
- ch = state.input.charCodeAt(++state.position);
- } else {
- readNext = false;
- }
- }
+ result = new Array(object.length);
- throwError(state, 'unexpected end of the stream within a flow collection');
-}
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
-function readBlockScalar(state, nodeIndent) {
- var captureStart,
- folding,
- chomping = CHOMPING_CLIP,
- didReadContent = false,
- detectedIndent = false,
- textIndent = nodeIndent,
- emptyLines = 0,
- atMoreIndented = false,
- tmp,
- ch;
+ keys = Object.keys(pair);
- ch = state.input.charCodeAt(state.position);
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
- if (ch === 0x7C/* | */) {
- folding = false;
- } else if (ch === 0x3E/* > */) {
- folding = true;
- } else {
- return false;
+ return result;
}
- state.kind = 'scalar';
- state.result = '';
+ var pairs = new type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+ });
- while (ch !== 0) {
- ch = state.input.charCodeAt(++state.position);
+ var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- 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');
- }
+ function resolveYamlSet(data) {
+ if (data === null) return true;
- } 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');
- }
+ var key, object = data;
- } else {
- break;
+ for (key in object) {
+ if (_hasOwnProperty$2.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
}
- }
- 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));
- }
+ return true;
}
- while (ch !== 0) {
- readLineBreak(state);
- state.lineIndent = 0;
+ function constructYamlSet(data) {
+ return data !== null ? data : {};
+ }
- ch = state.input.charCodeAt(state.position);
+ var set = new type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+ });
- while ((!detectedIndent || state.lineIndent < textIndent) &&
- (ch === 0x20/* Space */)) {
- state.lineIndent++;
- ch = state.input.charCodeAt(++state.position);
- }
+ var _default = core.extend({
+ implicit: [
+ timestamp,
+ merge
+ ],
+ explicit: [
+ binary,
+ omap,
+ pairs,
+ set
+ ]
+ });
- if (!detectedIndent && state.lineIndent > textIndent) {
- textIndent = state.lineIndent;
- }
+ /*eslint-disable max-len,no-use-before-define*/
- 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);
+ var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- // 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);
- }
+ var CONTEXT_FLOW_IN = 1;
+ var CONTEXT_FLOW_OUT = 2;
+ var CONTEXT_BLOCK_IN = 3;
+ var CONTEXT_BLOCK_OUT = 4;
- // 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;
+ var CHOMPING_CLIP = 1;
+ var CHOMPING_STRIP = 2;
+ var CHOMPING_KEEP = 3;
- while (!is_EOL(ch) && (ch !== 0)) {
- ch = state.input.charCodeAt(++state.position);
- }
- captureSegment(state, captureStart, state.position, false);
- }
+ 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;
- return true;
-}
-function readBlockSequence(state, nodeIndent) {
- var _line,
- _tag = state.tag,
- _anchor = state.anchor,
- _result = [],
- following,
- detected = false,
- ch;
+ function _class(obj) { return Object.prototype.toString.call(obj); }
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
+ function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
}
- ch = state.input.charCodeAt(state.position);
+ function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+ }
- while (ch !== 0) {
+ function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+ }
- if (ch !== 0x2D/* - */) {
- break;
- }
+ function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+ }
- following = state.input.charCodeAt(state.position + 1);
+ function fromHexCode(c) {
+ var lc;
- if (!is_WS_OR_EOL(following)) {
- break;
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
}
- detected = true;
- state.position++;
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
- if (skipSeparationSpace(state, true, -1)) {
- if (state.lineIndent <= nodeIndent) {
- _result.push(null);
- ch = state.input.charCodeAt(state.position);
- continue;
- }
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
}
- _line = state.line;
- composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
- _result.push(state.result);
- skipSeparationSpace(state, true, -1);
+ return -1;
+ }
- ch = state.input.charCodeAt(state.position);
+ function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+ }
- if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
- throwError(state, 'bad indentation of a sequence entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
+ function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
}
+
+ return -1;
}
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'sequence';
- state.result = _result;
- return true;
+ 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' : '';
}
- 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;
+ 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
+ );
+ }
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = _result;
+ 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);
}
- 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;
+ function State$1(input, options) {
+ this.input = input;
- //
- // 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)) {
+ 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;
- if (ch === 0x3F/* ? */) {
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- keyTag = keyNode = valueNode = null;
- }
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
- detected = true;
- atExplicitKey = true;
- allowCompact = true;
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
- } else if (atExplicitKey) {
- // i.e. 0x3A/* : */ === character after the explicit key.
- atExplicitKey = false;
- allowCompact = true;
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
- } else {
- throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
- }
+ // position of first leading tab in the current line,
+ // used to make sure there are no tabs in the indentation
+ this.firstTabInLine = -1;
- state.position += 1;
- ch = following;
+ this.documents = [];
- //
- // Implicit notation case. Flow-style node as the key first, then ":", and the value.
- //
- } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
- 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);
+ 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
+ };
- if (!is_WS_OR_EOL(ch)) {
- throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
- }
+ mark.snippet = snippet(mark);
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- keyTag = keyNode = valueNode = null;
- }
+ return new exception(message, mark);
+ }
- detected = true;
- atExplicitKey = false;
- allowCompact = false;
- keyTag = state.tag;
- keyNode = state.result;
+ function throwError(state, message) {
+ throw generateError(state, message);
+ }
- } else if (detected) {
- throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+ function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+ }
- } 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');
+ var directiveHandlers = {
- } else {
- state.tag = _tag;
- state.anchor = _anchor;
- return true; // Keep the result of `composeNode`.
- }
+ YAML: function handleYamlDirective(state, name, args) {
- } else {
- break; // Reading is done. Go to the epilogue.
- }
+ var match, major, minor;
- //
- // 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 (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
}
- if (!atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
- keyTag = keyNode = valueNode = null;
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
}
- skipSeparationSpace(state, true, -1);
- ch = state.input.charCodeAt(state.position);
- }
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
- if (state.lineIndent > nodeIndent && (ch !== 0)) {
- throwError(state, 'bad indentation of a mapping entry');
- } else if (state.lineIndent < nodeIndent) {
- break;
- }
- }
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
- //
- // Epilogue.
- //
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
- // Special case: last mapping's node contains only the key in explicit notation.
- if (atExplicitKey) {
- storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
- }
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
- // Expose the resulting mapping.
- if (detected) {
- state.tag = _tag;
- state.anchor = _anchor;
- state.kind = 'mapping';
- state.result = _result;
- }
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
- return detected;
-}
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
-function readTagProperty(state) {
- var _position,
- isVerbatim = false,
- isNamed = false,
- tagHandle,
- tagName,
- ch;
+ TAG: function handleTagDirective(state, name, args) {
- ch = state.input.charCodeAt(state.position);
+ var handle, prefix;
- if (ch !== 0x21/* ! */) return false;
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
- if (state.tag !== null) {
- throwError(state, 'duplication of a tag property');
- }
+ handle = args[0];
+ prefix = args[1];
- ch = state.input.charCodeAt(++state.position);
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
- if (ch === 0x3C/* < */) {
- isVerbatim = true;
- ch = state.input.charCodeAt(++state.position);
+ if (_hasOwnProperty$1.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
- } else if (ch === 0x21/* ! */) {
- isNamed = true;
- tagHandle = '!!';
- ch = state.input.charCodeAt(++state.position);
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
- } else {
- tagHandle = '!';
- }
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state, 'tag prefix is malformed: ' + prefix);
+ }
- _position = state.position;
+ state.tagMap[handle] = prefix;
+ }
+ };
- 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)) {
+ function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
- if (ch === 0x21/* ! */) {
- if (!isNamed) {
- tagHandle = state.input.slice(_position - 1, state.position + 1);
+ if (start < end) {
+ _result = state.input.slice(start, end);
- if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
- throwError(state, 'named tag handle cannot contain such characters');
+ 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');
}
-
- isNamed = true;
- _position = state.position + 1;
- } else {
- throwError(state, 'tag suffix cannot contain exclamation marks');
}
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
}
- ch = state.input.charCodeAt(++state.position);
+ state.result += _result;
}
-
- 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;
+ function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
- } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
- state.tag = state.tagMap[tagHandle] + tagName;
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
- } else if (tagHandle === '!') {
- state.tag = '!' + tagName;
+ sourceKeys = Object.keys(source);
- } else if (tagHandle === '!!') {
- state.tag = 'tag:yaml.org,2002:' + tagName;
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
- } else {
- throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ if (!_hasOwnProperty$1.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
}
- return true;
-}
-
-function readAnchorProperty(state) {
- var _position,
- ch;
-
- ch = state.input.charCodeAt(state.position);
-
- if (ch !== 0x26/* & */) return false;
+ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
+ startLine, startLineStart, startPos) {
- if (state.anchor !== null) {
- throwError(state, 'duplication of an anchor property');
- }
+ var index, quantity;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
+ // 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);
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
+ 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 (state.position === _position) {
- throwError(state, 'name of an anchor node must contain at least one character');
- }
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
- state.anchor = state.input.slice(_position, state.position);
- return true;
-}
+ // 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]';
+ }
-function readAlias(state) {
- var _position, alias,
- ch;
- ch = state.input.charCodeAt(state.position);
+ keyNode = String(keyNode);
- if (ch !== 0x2A/* * */) return false;
+ if (_result === null) {
+ _result = {};
+ }
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
+ 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');
+ }
- while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
+ // 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];
+ }
- if (state.position === _position) {
- throwError(state, 'name of an alias node must contain at least one character');
+ return _result;
}
- alias = state.input.slice(_position, state.position);
+ function readLineBreak(state) {
+ var ch;
- if (!_hasOwnProperty.call(state.anchorMap, alias)) {
- throwError(state, 'unidentified alias "' + alias + '"');
- }
-
- state.result = state.anchorMap[alias];
- skipSeparationSpace(state, true, -1);
- return true;
-}
+ ch = state.input.charCodeAt(state.position);
-function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
- var allowBlockStyles,
- allowBlockScalars,
- allowBlockCollections,
- indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
- atNewLine = false,
- hasContent = false,
- typeIndex,
- typeQuantity,
- type,
- flowIndent,
- blockIndent;
+ 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');
+ }
- if (state.listener !== null) {
- state.listener('open', state);
+ state.line += 1;
+ state.lineStart = state.position;
+ state.firstTabInLine = -1;
}
- state.tag = null;
- state.anchor = null;
- state.kind = null;
- state.result = null;
-
- allowBlockStyles = allowBlockScalars = allowBlockCollections =
- CONTEXT_BLOCK_OUT === nodeContext ||
- CONTEXT_BLOCK_IN === nodeContext;
+ function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
- if (allowToSeek) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
+ 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 (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
}
- }
- }
- if (indentStatus === 1) {
- while (readTagProperty(state) || readAnchorProperty(state)) {
- if (skipSeparationSpace(state, true, -1)) {
- atNewLine = true;
- allowBlockCollections = allowBlockStyles;
+ if (is_EOL(ch)) {
+ readLineBreak(state);
- if (state.lineIndent > parentIndent) {
- indentStatus = 1;
- } else if (state.lineIndent === parentIndent) {
- indentStatus = 0;
- } else if (state.lineIndent < parentIndent) {
- indentStatus = -1;
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
}
} else {
- allowBlockCollections = false;
+ break;
}
}
- }
- 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;
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
}
- blockIndent = state.position - state.lineStart;
+ return lineBreaks;
+ }
- 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;
+ function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
- } else if (readAlias(state)) {
- hasContent = true;
+ ch = state.input.charCodeAt(_position);
- if (state.tag !== null || state.anchor !== null) {
- throwError(state, 'alias node should not have any properties');
- }
+ // 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)) {
- } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
- hasContent = true;
+ _position += 3;
- if (state.tag === null) {
- state.tag = '?';
- }
- }
+ ch = state.input.charCodeAt(_position);
- if (state.anchor !== null) {
- state.anchorMap[state.anchor] = state.result;
- }
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
}
- } 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 + '>');
- }
+ return false;
}
- if (state.listener !== null) {
- state.listener('close', state);
+ function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
}
- 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);
+ 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 (state.lineIndent > 0 || ch !== 0x25/* % */) {
- break;
+ 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;
}
- hasDirectives = true;
- ch = state.input.charCodeAt(++state.position);
- _position = state.position;
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
}
- 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');
- }
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
while (ch !== 0) {
- while (is_WHITE_SPACE(ch)) {
- ch = state.input.charCodeAt(++state.position);
- }
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
- if (ch === 0x23/* # */) {
- do { ch = state.input.charCodeAt(++state.position); }
- while (ch !== 0 && !is_EOL(ch));
+ 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;
- }
- if (is_EOL(ch)) break;
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
- _position = state.position;
+ 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;
+ }
+ }
- while (ch !== 0 && !is_WS_OR_EOL(ch)) {
- ch = state.input.charCodeAt(++state.position);
+ 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;
}
- directiveArgs.push(state.input.slice(_position, state.position));
+ ch = state.input.charCodeAt(++state.position);
}
- if (ch !== 0) readLineBreak(state);
+ captureSegment(state, captureStart, captureEnd, false);
- if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
- directiveHandlers[directiveName](state, directiveName, directiveArgs);
- } else {
- throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ if (state.result) {
+ return true;
}
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
}
- skipSeparationSpace(state, true, -1);
+ function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
- 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);
+ ch = state.input.charCodeAt(state.position);
- } else if (hasDirectives) {
- throwError(state, 'directives end mark is expected');
- }
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
- composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
- skipSeparationSpace(state, true, -1);
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
- 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');
- }
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
- state.documents.push(state.result);
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
- if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
- if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
- state.position += 3;
- skipSeparationSpace(state, true, -1);
+ } 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;
+ }
}
- return;
- }
- if (state.position < (state.length - 1)) {
- throwError(state, 'end of the stream or a document separator is expected');
- } else {
- return;
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
}
-}
-
-function loadDocuments(input, options) {
- input = String(input);
- options = options || {};
+ function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
- if (input.length !== 0) {
+ ch = state.input.charCodeAt(state.position);
- // Add tailing `\n` if not exists
- if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
- input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
- input += '\n';
+ if (ch !== 0x22/* " */) {
+ return false;
}
- // Strip BOM
- if (input.charCodeAt(0) === 0xFEFF) {
- input = input.slice(1);
- }
- }
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
- var state = new State(input, options);
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
- var nullpos = input.indexOf('\0');
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
- if (nullpos !== -1) {
- state.position = nullpos;
- throwError(state, 'null byte is not allowed in input');
- }
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
- // Use 0 as string terminator. That significantly simplifies bounds check.
- state.input += '\0';
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
- while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
- state.lineIndent += 1;
- state.position += 1;
- }
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
- while (state.position < (state.length - 1)) {
- readDocument(state);
- }
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
- return state.documents;
-}
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
-function loadAll(input, iterator, options) {
- if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
+ state.result += charFromCodepoint(hexResult);
- var documents = loadDocuments(input, options);
+ state.position++;
- if (typeof iterator !== 'function') {
- return documents;
- }
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
- for (var index = 0, length = documents.length; index < length; index += 1) {
- iterator(documents[index]);
- }
-}
+ captureStart = captureEnd = state.position;
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
-function load(input, options) {
- var documents = loadDocuments(input, options);
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
- 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');
-}
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+ }
+
+ function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _lineStart,
+ _pos,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = Object.create(null),
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
-function safeLoadAll(input, iterator, options) {
- if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
- options = iterator;
- iterator = null;
- }
+ ch = state.input.charCodeAt(state.position);
- return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
+ 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;
+ }
-function safeLoad(input, options) {
- return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
-}
+ ch = state.input.charCodeAt(++state.position);
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
-module.exports.loadAll = loadAll;
-module.exports.load = load;
-module.exports.safeLoadAll = safeLoadAll;
-module.exports.safeLoad = safeLoad;
+ ch = state.input.charCodeAt(state.position);
-},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){
-'use strict';
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ } else if (ch === 0x2C/* , */) {
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
+ throwError(state, "expected the node content, but found ','");
+ }
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
-var common = require('./common');
+ 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);
+ }
+ }
-function Mark(name, buffer, position, line, column) {
- this.name = name;
- this.buffer = buffer;
- this.position = position;
- this.line = line;
- this.column = column;
-}
+ _line = state.line; // Save the current line.
+ _lineStart = state.lineStart;
+ _pos = state.position;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+ ch = state.input.charCodeAt(state.position);
-Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
- var head, start, tail, end, snippet;
+ 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 (!this.buffer) return null;
+ 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);
+ }
- indent = indent || 4;
- maxLength = maxLength || 75;
+ skipSeparationSpace(state, true, nodeIndent);
- head = '';
- start = this.position;
+ ch = state.input.charCodeAt(state.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;
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
}
- }
- 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;
- }
+ throwError(state, 'unexpected end of the stream within a flow collection');
}
- snippet = this.buffer.slice(start, end);
+ function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
- return common.repeat(' ', indent) + head + snippet + tail + '\n' +
- common.repeat(' ', indent + this.position - start + head.length) + '^';
-};
+ ch = state.input.charCodeAt(state.position);
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
-Mark.prototype.toString = function toString(compact) {
- var snippet, where = '';
+ state.kind = 'scalar';
+ state.result = '';
- if (this.name) {
- where += 'in "' + this.name + '" ';
- }
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
- where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
+ 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 (!compact) {
- snippet = this.getSnippet();
+ } 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 (snippet) {
- where += ':\n' + snippet;
+ } else {
+ break;
+ }
}
- }
- return where;
-};
+ 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));
+ }
+ }
-module.exports = Mark;
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
-},{"./common":2}],7:[function(require,module,exports){
-'use strict';
+ ch = state.input.charCodeAt(state.position);
-/*eslint-disable max-len*/
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
-var common = require('./common');
-var YAMLException = require('./exception');
-var Type = require('./type');
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
-function compileList(schema, name, result) {
- var exclude = [];
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
- schema.include.forEach(function (includedSchema) {
- result = compileList(includedSchema, name, result);
- });
+ // 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';
+ }
+ }
- schema[name].forEach(function (currentType) {
- result.forEach(function (previousType, previousIndex) {
- if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
- exclude.push(previousIndex);
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
}
- });
- result.push(currentType);
- });
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
- return result.filter(function (type, index) {
- return exclude.indexOf(index) === -1;
- });
-}
+ // 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);
-function compileMap(/* lists... */) {
- var result = {
- scalar: {},
- sequence: {},
- mapping: {},
- fallback: {}
- }, index, length;
+ // 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 += ' ';
+ }
- function collectType(type) {
- result[type.kind][type.tag] = result['fallback'][type.tag] = type;
- }
+ // 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);
+ }
- for (index = 0, length = arguments.length; index < length; index += 1) {
- arguments[index].forEach(collectType);
+ 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;
}
- return result;
-}
+ function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
-function Schema(definition) {
- this.include = definition.include || [];
- this.implicit = definition.implicit || [];
- this.explicit = definition.explicit || [];
+ // 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;
- 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.');
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
}
- });
- this.compiledImplicit = compileList(this, 'implicit', []);
- this.compiledExplicit = compileList(this, 'explicit', []);
- this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
-}
+ 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');
+ }
-Schema.DEFAULT = null;
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+ following = state.input.charCodeAt(state.position + 1);
-Schema.create = function createSchema() {
- var schemas, types;
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
- switch (arguments.length) {
- case 1:
- schemas = Schema.DEFAULT;
- types = arguments[0];
- break;
+ detected = true;
+ state.position++;
- case 2:
- schemas = arguments[0];
- types = arguments[1];
- break;
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
- default:
- throw new YAMLException('Wrong number of arguments for Schema.create function');
- }
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
- schemas = common.toArray(schemas);
- types = common.toArray(types);
+ ch = state.input.charCodeAt(state.position);
- 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 ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
- 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.');
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
}
- return new Schema({
- include: schemas,
- explicit: types
- });
-};
+ 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);
-module.exports = Schema;
+ while (ch !== 0) {
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
-},{"./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.
+ 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)) {
-'use strict';
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
-var Schema = require('../schema');
+ } 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');
+ }
-module.exports = new Schema({
- include: [
- require('./json')
- ]
-});
+ state.position += 1;
+ ch = following;
-},{"../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.
+ //
+ // 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;
+ }
-'use strict';
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
-var Schema = require('../schema');
+ 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');
+ }
-module.exports = Schema.DEFAULT = new Schema({
- include: [
- require('./default_safe')
- ],
- explicit: [
- require('../type/js/undefined'),
- require('../type/js/regexp'),
- require('../type/js/function')
- ]
-});
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
-},{"../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/)
+ 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');
-'use strict';
+ } 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');
-var Schema = require('../schema');
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+ }
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+ }
-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')
- ]
-});
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
-},{"../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
+ 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);
+ }
-'use strict';
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+ //
+ // Epilogue.
+ //
-var Schema = require('../schema');
+ // 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;
+ }
-module.exports = new Schema({
- explicit: [
- require('../type/str'),
- require('../type/seq'),
- require('../type/map')
- ]
-});
+ return detected;
+ }
-},{"../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.
+ function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+ ch = state.input.charCodeAt(state.position);
-'use strict';
+ if (ch !== 0x21/* ! */) return false;
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
-var Schema = require('../schema');
+ 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 = '!';
+ }
-module.exports = new Schema({
- include: [
- require('./failsafe')
- ],
- implicit: [
- require('../type/null'),
- require('../type/bool'),
- require('../type/int'),
- require('../type/float')
- ]
-});
+ _position = state.position;
-},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){
-'use strict';
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
-var YAMLException = require('./exception');
+ 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)) {
-var TYPE_CONSTRUCTOR_OPTIONS = [
- 'kind',
- 'resolve',
- 'construct',
- 'instanceOf',
- 'predicate',
- 'represent',
- 'defaultStyle',
- 'styleAliases'
-];
-
-var YAML_NODE_KINDS = [
- 'scalar',
- 'sequence',
- 'mapping'
-];
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
-function compileStyleAliases(map) {
- var result = {};
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
- if (map !== null) {
- Object.keys(map).forEach(function (style) {
- map[style].forEach(function (alias) {
- result[String(alias)] = style;
- });
- });
- }
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
- return result;
-}
+ ch = state.input.charCodeAt(++state.position);
+ }
-function Type(tag, options) {
- options = options || {};
+ tagName = state.input.slice(_position, state.position);
- 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.');
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
}
- });
-
- // 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.');
- }
-}
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
-module.exports = Type;
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state, 'tag name is malformed: ' + tagName);
+ }
-},{"./exception":4}],14:[function(require,module,exports){
-'use strict';
+ if (isVerbatim) {
+ state.tag = tagName;
-/*eslint-disable no-bitwise*/
+ } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
-var NodeBuffer;
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
-try {
- // A trick for browserified version, to not include `Buffer` shim
- var _require = require;
- NodeBuffer = _require('buffer').Buffer;
-} catch (__) {}
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
-var Type = require('../type');
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+ return true;
+ }
-// [ 64, 65, 66 ] -> [ padding, CR, LF ]
-var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+ function readAnchorProperty(state) {
+ var _position,
+ ch;
+ ch = state.input.charCodeAt(state.position);
-function resolveYamlBinary(data) {
- if (data === null) return false;
+ if (ch !== 0x26/* & */) return false;
- var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
- // Convert one by one.
- for (idx = 0; idx < max; idx++) {
- code = map.indexOf(data.charAt(idx));
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
- // Skip CR/LF
- if (code > 64) continue;
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
- // Fail on illegal characters
- if (code < 0) return false;
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
- bitlen += 6;
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
}
- // If there are any bits left, source was corrupted
- return (bitlen % 8) === 0;
-}
+ function readAlias(state) {
+ var _position, alias,
+ ch;
-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 = [];
+ ch = state.input.charCodeAt(state.position);
- // Collect by 6*4 bits (3 bytes)
+ if (ch !== 0x2A/* * */) return false;
- 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);
+ 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);
}
- bits = (bits << 6) | map.indexOf(input.charAt(idx));
- }
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
- // Dump tail
+ alias = state.input.slice(_position, state.position);
- tailbits = (max % 4) * 6;
+ if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
- 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);
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
}
- // 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);
- }
+ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ typeList,
+ type,
+ flowIndent,
+ blockIndent;
- return result;
-}
+ if (state.listener !== null) {
+ state.listener('open', state);
+ }
-function representYamlBinary(object /*, style*/) {
- var result = '', bits = 0, idx, tail,
- max = object.length,
- map = BASE64_MAP;
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
- // Convert every three bytes to 4 ASCII characters.
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
- 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];
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
}
- bits = (bits << 8) + object[idx];
- }
-
- // Dump tail
-
- tail = max % 3;
-
- if (tail === 0) {
- result += map[(bits >> 18) & 0x3F];
- result += map[(bits >> 12) & 0x3F];
- result += map[(bits >> 6) & 0x3F];
- result += map[bits & 0x3F];
- } else if (tail === 2) {
- result += map[(bits >> 10) & 0x3F];
- result += map[(bits >> 4) & 0x3F];
- result += map[(bits << 2) & 0x3F];
- result += map[64];
- } else if (tail === 1) {
- result += map[(bits >> 2) & 0x3F];
- result += map[(bits << 4) & 0x3F];
- result += map[64];
- result += map[64];
- }
-
- return result;
-}
-
-function isBinary(object) {
- return NodeBuffer && NodeBuffer.isBuffer(object);
-}
-
-module.exports = new Type('tag:yaml.org,2002:binary', {
- kind: 'scalar',
- resolve: resolveYamlBinary,
- construct: constructYamlBinary,
- predicate: isBinary,
- represent: representYamlBinary
-});
-
-},{"../type":13}],15:[function(require,module,exports){
-'use strict';
-
-var Type = require('../type');
-
-function resolveYamlBoolean(data) {
- if (data === null) return false;
-
- var max = data.length;
-
- return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
- (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
-}
-
-function constructYamlBoolean(data) {
- return data === 'true' ||
- data === 'True' ||
- data === 'TRUE';
-}
-
-function isBoolean(object) {
- return Object.prototype.toString.call(object) === '[object Boolean]';
-}
-
-module.exports = new Type('tag:yaml.org,2002:bool', {
- kind: 'scalar',
- resolve: resolveYamlBoolean,
- construct: constructYamlBoolean,
- predicate: isBoolean,
- represent: {
- lowercase: function (object) { return object ? 'true' : 'false'; },
- uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
- camelcase: function (object) { return object ? 'True' : 'False'; }
- },
- defaultStyle: 'lowercase'
-});
-
-},{"../type":13}],16:[function(require,module,exports){
-'use strict';
-
-var common = require('../common');
-var Type = require('../type');
-
-var YAML_FLOAT_PATTERN = new RegExp(
- // 2.5e4, 2.5 and integers
- '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
- // .2e4, .2
- // special case, seems not from spec
- '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
- // 20:59
- '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
- // .inf
- '|[-+]?\\.(?:inf|Inf|INF)' +
- // .nan
- '|\\.(?:nan|NaN|NAN))$');
-
-function resolveYamlFloat(data) {
- if (data === null) return false;
-
- if (!YAML_FLOAT_PATTERN.test(data) ||
- // Quick hack to not allow integers end with `_`
- // Probably should update regexp & check speed
- data[data.length - 1] === '_') {
- return false;
- }
+ 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;
+ }
+ }
+ }
- return true;
-}
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
-function constructYamlFloat(data) {
- var value, sign, base, digits;
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
- value = data.replace(/_/g, '').toLowerCase();
- sign = value[0] === '-' ? -1 : 1;
- digits = [];
+ blockIndent = state.position - state.lineStart;
- if ('+-'.indexOf(value[0]) >= 0) {
- value = value.slice(1);
- }
+ 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;
- if (value === '.inf') {
- return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+ } else if (readAlias(state)) {
+ hasContent = true;
- } else if (value === '.nan') {
- return NaN;
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
- } else if (value.indexOf(':') >= 0) {
- value.split(':').forEach(function (v) {
- digits.unshift(parseFloat(v, 10));
- });
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
- value = 0.0;
- base = 1;
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
- digits.forEach(function (d) {
- value += d * base;
- base *= 60;
- });
+ 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);
+ }
+ }
- return sign * value;
+ if (state.tag === null) {
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
- }
- return sign * parseFloat(value, 10);
-}
+ } else if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!<?> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
-var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (state.tag !== '!') {
+ if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+ } else {
+ // looking for multi type
+ type = null;
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
+
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type = typeList[typeIndex];
+ break;
+ }
+ }
+ }
-function representYamlFloat(object, style) {
- var res;
+ if (!type) {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
- 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';
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result, state.tag);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
}
- } else if (Number.NEGATIVE_INFINITY === object) {
- switch (style) {
- case 'lowercase': return '-.inf';
- case 'uppercase': return '-.INF';
- case 'camelcase': return '-.Inf';
+
+ if (state.listener !== null) {
+ state.listener('close', state);
}
- } else if (common.isNegativeZero(object)) {
- return '-0.0';
+ return state.tag !== null || state.anchor !== null || hasContent;
}
- res = object.toString(10);
+ function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
- // JS stringifier can build scientific format without dots: 5e-100,
- // while YAML requres dot: 5.e-100. Fix it with simple hack
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = Object.create(null);
+ state.anchorMap = Object.create(null);
- return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
-}
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
-function isFloat(object) {
- return (Object.prototype.toString.call(object) === '[object Number]') &&
- (object % 1 !== 0 || common.isNegativeZero(object));
-}
+ ch = state.input.charCodeAt(state.position);
-module.exports = new Type('tag:yaml.org,2002:float', {
- kind: 'scalar',
- resolve: resolveYamlFloat,
- construct: constructYamlFloat,
- predicate: isFloat,
- represent: representYamlFloat,
- defaultStyle: 'lowercase'
-});
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
-},{"../common":2,"../type":13}],17:[function(require,module,exports){
-'use strict';
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
-var common = require('../common');
-var Type = require('../type');
+ 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);
+ }
-function isHexCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
- ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
- ((0x61/* a */ <= c) && (c <= 0x66/* f */));
-}
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
-function isOctCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
-}
+ if (is_EOL(ch)) break;
-function isDecCode(c) {
- return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
-}
+ _position = state.position;
-function resolveYamlInteger(data) {
- if (data === null) return false;
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
- var max = data.length,
- index = 0,
- hasDigits = false,
- ch;
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
- if (!max) return false;
+ if (ch !== 0) readLineBreak(state);
- ch = data[index];
+ if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
- // sign
- if (ch === '-' || ch === '+') {
- ch = data[++index];
- }
+ skipSeparationSpace(state, true, -1);
- if (ch === '0') {
- // 0
- if (index + 1 === max) return true;
- ch = data[++index];
+ 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);
- // base 2, base 8, base 16
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
- if (ch === 'b') {
- // base 2
- index++;
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch !== '0' && ch !== '1') return false;
- hasDigits = true;
- }
- return hasDigits && ch !== '_';
+ 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 (ch === 'x') {
- // base 16
- index++;
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isHexCode(data.charCodeAt(index))) return false;
- hasDigits = true;
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
}
- return hasDigits && ch !== '_';
+ return;
}
- // base 8
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (!isOctCode(data.charCodeAt(index))) return false;
- hasDigits = true;
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
}
- return hasDigits && ch !== '_';
}
- // base 10 (except 0) or base 60
- // value should not start with `_`;
- if (ch === '_') return false;
+ function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
- for (; index < max; index++) {
- ch = data[index];
- if (ch === '_') continue;
- if (ch === ':') break;
- if (!isDecCode(data.charCodeAt(index))) {
- return false;
- }
- hasDigits = true;
- }
+ if (input.length !== 0) {
- // Should have digits and should not end with `_`
- if (!hasDigits || ch === '_') return false;
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
- // if !base60 - done;
- if (ch !== ':') return true;
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
- // base60 almost not used, no needs to optimize
- return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
-}
+ var state = new State$1(input, options);
-function constructYamlInteger(data) {
- var value = data, sign = 1, ch, base, digits = [];
+ var nullpos = input.indexOf('\0');
- if (value.indexOf('_') !== -1) {
- value = value.replace(/_/g, '');
- }
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
- ch = value[0];
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
- if (ch === '-' || ch === '+') {
- if (ch === '-') sign = -1;
- value = value.slice(1);
- ch = value[0];
- }
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
- if (value === '0') return 0;
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
- 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);
+ return state.documents;
}
- if (value.indexOf(':') !== -1) {
- value.split(':').forEach(function (v) {
- digits.unshift(parseInt(v, 10));
- });
- value = 0;
- base = 1;
+ function loadAll$1(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
- digits.forEach(function (d) {
- value += (d * base);
- base *= 60;
- });
+ var documents = loadDocuments(input, options);
- return sign * value;
-
- }
-
- return sign * parseInt(value, 10);
-}
-
-function isInteger(object) {
- return (Object.prototype.toString.call(object)) === '[object Number]' &&
- (object % 1 === 0 && !common.isNegativeZero(object));
-}
-
-module.exports = new Type('tag:yaml.org,2002:int', {
- kind: 'scalar',
- resolve: resolveYamlInteger,
- construct: constructYamlInteger,
- predicate: isInteger,
- represent: {
- binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
- octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
- decimal: function (obj) { return obj.toString(10); },
- /* eslint-disable max-len */
- hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
- },
- defaultStyle: 'decimal',
- styleAliases: {
- binary: [ 2, 'bin' ],
- octal: [ 8, 'oct' ],
- decimal: [ 10, 'dec' ],
- hexadecimal: [ 16, 'hex' ]
- }
-});
-
-},{"../common":2,"../type":13}],18:[function(require,module,exports){
-'use strict';
-
-var esprima;
-
-// Browserified version does not have esprima
-//
-// 1. For node.js just require module as deps
-// 2. For browser try to require mudule via external AMD system.
-// If not found - try to fallback to window.esprima. If not
-// found too - then fail to parse.
-//
-try {
- // workaround to exclude package from browserify list.
- var _require = require;
- esprima = _require('esprima');
-} catch (_) {
- /* eslint-disable no-redeclare */
- /* global window */
- if (typeof window !== 'undefined') esprima = window.esprima;
-}
-
-var Type = require('../../type');
-
-function resolveJavascriptFunction(data) {
- if (data === null) return false;
-
- try {
- var source = '(' + data + ')',
- ast = esprima.parse(source, { range: true });
-
- if (ast.type !== 'Program' ||
- ast.body.length !== 1 ||
- ast.body[0].type !== 'ExpressionStatement' ||
- (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
- ast.body[0].expression.type !== 'FunctionExpression')) {
- return false;
+ if (typeof iterator !== 'function') {
+ return documents;
}
- return true;
- } catch (err) {
- return false;
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
}
-}
-function constructJavascriptFunction(data) {
- /*jslint evil:true*/
- var source = '(' + data + ')',
- ast = esprima.parse(source, { range: true }),
- params = [],
- body;
+ function load$1(input, options) {
+ var documents = loadDocuments(input, options);
- 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');
+ 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');
}
- 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]));
-}
+ var loadAll_1 = loadAll$1;
+ var load_1 = load$1;
-function representJavascriptFunction(object /*, style*/) {
- return object.toString();
-}
+ var loader = {
+ loadAll: loadAll_1,
+ load: load_1
+ };
-function isFunction(object) {
- return Object.prototype.toString.call(object) === '[object Function]';
-}
+ /*eslint-disable no-use-before-define*/
+
+
+
+
+
+ var _toString = Object.prototype.toString;
+ var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+ var CHAR_BOM = 0xFEFF;
+ var CHAR_TAB = 0x09; /* Tab */
+ var CHAR_LINE_FEED = 0x0A; /* LF */
+ var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+ var CHAR_SPACE = 0x20; /* Space */
+ var CHAR_EXCLAMATION = 0x21; /* ! */
+ var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+ var CHAR_SHARP = 0x23; /* # */
+ var CHAR_PERCENT = 0x25; /* % */
+ var CHAR_AMPERSAND = 0x26; /* & */
+ var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+ var CHAR_ASTERISK = 0x2A; /* * */
+ var CHAR_COMMA = 0x2C; /* , */
+ var CHAR_MINUS = 0x2D; /* - */
+ var CHAR_COLON = 0x3A; /* : */
+ var CHAR_EQUALS = 0x3D; /* = */
+ var CHAR_GREATER_THAN = 0x3E; /* > */
+ var CHAR_QUESTION = 0x3F; /* ? */
+ var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+ var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+ var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+ var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+ var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+ var CHAR_VERTICAL_LINE = 0x7C; /* | */
+ var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+ var ESCAPE_SEQUENCES = {};
+
+ ESCAPE_SEQUENCES[0x00] = '\\0';
+ ESCAPE_SEQUENCES[0x07] = '\\a';
+ ESCAPE_SEQUENCES[0x08] = '\\b';
+ ESCAPE_SEQUENCES[0x09] = '\\t';
+ ESCAPE_SEQUENCES[0x0A] = '\\n';
+ ESCAPE_SEQUENCES[0x0B] = '\\v';
+ ESCAPE_SEQUENCES[0x0C] = '\\f';
+ ESCAPE_SEQUENCES[0x0D] = '\\r';
+ ESCAPE_SEQUENCES[0x1B] = '\\e';
+ ESCAPE_SEQUENCES[0x22] = '\\"';
+ ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ ESCAPE_SEQUENCES[0x85] = '\\N';
+ ESCAPE_SEQUENCES[0xA0] = '\\_';
+ ESCAPE_SEQUENCES[0x2028] = '\\L';
+ ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+ var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+ ];
+
+ var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+
+ function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
-module.exports = new Type('tag:yaml.org,2002:js/function', {
- kind: 'scalar',
- resolve: resolveJavascriptFunction,
- construct: constructJavascriptFunction,
- predicate: isFunction,
- represent: representJavascriptFunction
-});
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
-},{"../../type":13}],19:[function(require,module,exports){
-'use strict';
+ result[tag] = style;
+ }
-var Type = require('../../type');
+ return result;
+ }
-function resolveJavascriptRegExp(data) {
- if (data === null) return false;
- if (data.length === 0) return false;
+ function encodeHex(character) {
+ var string, handle, length;
- var regexp = data,
- tail = /\/([gim]*)$/.exec(data),
- modifiers = '';
+ string = character.toString(16).toUpperCase();
- // 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 (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');
+ }
- 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 '\\' + handle + common.repeat('0', length - string.length) + string;
}
- 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);
- }
+ var QUOTING_TYPE_SINGLE = 1,
+ QUOTING_TYPE_DOUBLE = 2;
- return new RegExp(regexp, modifiers);
-}
+ 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;
-function representJavascriptRegExp(object /*, style*/) {
- var result = '/' + object.source + '/';
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
- if (object.global) result += 'g';
- if (object.multiline) result += 'm';
- if (object.ignoreCase) result += 'i';
+ this.tag = null;
+ this.result = '';
- return result;
-}
+ this.duplicates = [];
+ this.usedDuplicates = null;
+ }
-function isRegExp(object) {
- return Object.prototype.toString.call(object) === '[object RegExp]';
-}
+ // 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;
-module.exports = new Type('tag:yaml.org,2002:js/regexp', {
- kind: 'scalar',
- resolve: resolveJavascriptRegExp,
- construct: constructJavascriptRegExp,
- predicate: isRegExp,
- represent: representJavascriptRegExp
-});
+ 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;
+ }
-},{"../../type":13}],20:[function(require,module,exports){
-'use strict';
+ if (line.length && line !== '\n') result += ind;
-var Type = require('../../type');
+ result += line;
+ }
-function resolveJavascriptUndefined() {
- return true;
-}
+ return result;
+ }
-function constructJavascriptUndefined() {
- /*eslint-disable no-undefined*/
- return undefined;
-}
+ function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+ }
-function representJavascriptUndefined() {
- return '';
-}
+ function testImplicitResolving(state, str) {
+ var index, length, type;
-function isUndefined(object) {
- return typeof object === 'undefined';
-}
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
-module.exports = new Type('tag:yaml.org,2002:js/undefined', {
- kind: 'scalar',
- resolve: resolveJavascriptUndefined,
- construct: constructJavascriptUndefined,
- predicate: isUndefined,
- represent: representJavascriptUndefined
-});
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
-},{"../../type":13}],21:[function(require,module,exports){
-'use strict';
+ return false;
+ }
-var Type = require('../type');
+ // [33] s-white ::= s-space | s-tab
+ function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+ }
+
+ // Returns true if the character can be printed without escaping.
+ // From YAML 1.2: "any allowed characters known to be non-printable
+ // should also be escaped. [However,] This isnā€™t mandatory"
+ // Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+ function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
+ || (0x10000 <= c && c <= 0x10FFFF);
+ }
+
+ // [34] ns-char ::= nb-char - s-white
+ // [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+ // [26] b-char ::= b-line-feed | b-carriage-return
+ // Including s-white (for some reason, examples doesn't match specs in this aspect)
+ // ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
+ function isNsCharOrWhitespace(c) {
+ return isPrintable(c)
+ && c !== CHAR_BOM
+ // - b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+ }
+
+ // [127] ns-plain-safe(c) ::= c = flow-out ā‡’ ns-plain-safe-out
+ // c = flow-in ā‡’ ns-plain-safe-in
+ // c = block-key ā‡’ ns-plain-safe-out
+ // c = flow-key ā‡’ ns-plain-safe-in
+ // [128] ns-plain-safe-out ::= ns-char
+ // [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
+ // [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - ā€œ:ā€ - ā€œ#ā€ )
+ // | ( /* An ns-char preceding */ ā€œ#ā€ )
+ // | ( ā€œ:ā€ /* Followed by an ns-plain-safe(c) */ )
+ function isPlainSafe(c, prev, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
+ return (
+ // ns-plain-safe
+ inblock ? // c = flow-in
+ cIsNsCharOrWhitespace
+ : cIsNsCharOrWhitespace
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ )
+ // ns-plain-char
+ && c !== CHAR_SHARP // false on '#'
+ && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
+ || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
+ || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
+ }
+
+ // Simplified test for values allowed as the first character in plain style.
+ function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ // No support of ( ( ā€œ?ā€ | ā€œ:ā€ | ā€œ-ā€ ) /* Followed by an ns-plain-safe(c)) */ ) part
+ return isPrintable(c) && c !== CHAR_BOM
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // ā€œ-ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ,ā€ | ā€œ[ā€ | ā€œ]ā€ | ā€œ{ā€ | ā€œ}ā€
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | ā€œ#ā€ | ā€œ&ā€ | ā€œ*ā€ | ā€œ!ā€ | ā€œ|ā€ | ā€œ=ā€ | ā€œ>ā€ | ā€œ'ā€ | ā€œ"ā€
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | ā€œ%ā€ | ā€œ@ā€ | ā€œ`ā€)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+ }
+
+ // Simplified test for values allowed as the last character in plain style.
+ function isPlainSafeLast(c) {
+ // just not whitespace or colon, it will be checked to be plain character later
+ return !isWhitespace(c) && c !== CHAR_COLON;
+ }
+
+ // Same as 'string'.codePointAt(pos), but works in older browsers.
+ function codePointAt(string, pos) {
+ var first = string.charCodeAt(pos), second;
+ if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
+ second = string.charCodeAt(pos + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+ }
+
+ // Determines whether block indentation indicator is required.
+ function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+ }
+
+ var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+ // Determines which scalar styles are possible and returns the preferred style.
+ // lineWidth = -1 => no limit.
+ // Pre-conditions: str.length > 0.
+ // Post-conditions:
+ // STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+ // STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+ // STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
+ testAmbiguousType, quotingType, forceQuotes, inblock) {
+
+ var i;
+ var char = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(codePointAt(string, 0))
+ && isPlainSafeLast(codePointAt(string, string.length - 1));
+
+ if (singleLineOnly || forceQuotes) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ if (plain && !forceQuotes && !testAmbiguousType(string)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+
+ // Note: line breaking/folding is implemented for only the folded style.
+ // NB. We drop the last trailing newline (if any) of a returned block scalar
+ // since the dumper adds its own newline. This always works:
+ // ā€¢ No ending newline => unaffected; already using strip "-" chomping.
+ // ā€¢ Ending newline => removed then restored.
+ // Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+ function writeScalar(state, string, level, iskey, inblock) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
+ }
+ }
-module.exports = new Type('tag:yaml.org,2002:map', {
- kind: 'mapping',
- construct: function (data) { return data !== null ? data : {}; }
-});
+ 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);
+ }
-},{"../type":13}],22:[function(require,module,exports){
-'use strict';
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
+ testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
+
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string) + '"';
+ default:
+ throw new exception('impossible error: invalid scalar style');
+ }
+ }());
+ }
+
+ // Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+ function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+ }
+
+ // (See the note for writeScalar.)
+ function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+ }
+
+ // Note: a long line without a suitable break point will exceed the width limit.
+ // Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+ function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlinesā€”
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+ }
+
+ // Greedy line breaking.
+ // Picks the longest line under the limit each time,
+ // otherwise settles for the shortest line over the limit.
+ // NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+ function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
-var Type = require('../type');
+ // 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);
+ }
-function resolveYamlMerge(data) {
- return data === '<<' || data === null;
-}
+ return result.slice(1); // drop extra \n joiner
+ }
-module.exports = new Type('tag:yaml.org,2002:merge', {
- kind: 'scalar',
- resolve: resolveYamlMerge
-});
+ // Escapes a double-quoted string.
+ function escapeString(string) {
+ var result = '';
+ var char = 0;
+ var escapeSeq;
-},{"../type":13}],23:[function(require,module,exports){
-'use strict';
+ for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ escapeSeq = ESCAPE_SEQUENCES[char];
-var Type = require('../type');
+ if (!escapeSeq && isPrintable(char)) {
+ result += string[i];
+ if (char >= 0x10000) result += string[i + 1];
+ } else {
+ result += escapeSeq || encodeHex(char);
+ }
+ }
-function resolveYamlNull(data) {
- if (data === null) return true;
+ return result;
+ }
- var max = data.length;
+ function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
- return (max === 1 && data === '~') ||
- (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
-}
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
-function constructYamlNull() {
- return null;
-}
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
-function isNull(object) {
- return object === null;
-}
+ // 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))) {
-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'
-});
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
-},{"../type":13}],24:[function(require,module,exports){
-'use strict';
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+ }
-var Type = require('../type');
+ function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
-var _toString = Object.prototype.toString;
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
-function resolveYamlOmap(data) {
- if (data === null) return true;
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
- var objectKeys = [], index, length, pair, pairKey, pairHasKey,
- object = data;
+ // 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))) {
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
- pairHasKey = false;
+ if (!compact || _result !== '') {
+ _result += generateNextLine(state, level);
+ }
- if (_toString.call(pair) !== '[object Object]') return false;
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
- for (pairKey in pair) {
- if (_hasOwnProperty.call(pair, pairKey)) {
- if (!pairHasKey) pairHasKey = true;
- else return false;
+ _result += state.dump;
}
}
- if (!pairHasKey) return false;
-
- if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
- else return false;
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
}
- return true;
-}
+ function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
-function constructYamlOmap(data) {
- return data !== null ? data : [];
-}
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
-module.exports = new Type('tag:yaml.org,2002:omap', {
- kind: 'sequence',
- resolve: resolveYamlOmap,
- construct: constructYamlOmap
-});
+ pairBuffer = '';
+ if (_result !== '') pairBuffer += ', ';
-},{"../type":13}],25:[function(require,module,exports){
-'use strict';
+ if (state.condenseFlow) pairBuffer += '"';
-var Type = require('../type');
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
-var _toString = Object.prototype.toString;
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
-function resolveYamlPairs(data) {
- if (data === null) return true;
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
- var index, length, pair, keys, result,
- object = data;
+ if (state.dump.length > 1024) pairBuffer += '? ';
- result = new Array(object.length);
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
- if (_toString.call(pair) !== '[object Object]') return false;
+ pairBuffer += state.dump;
- keys = Object.keys(pair);
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
- if (keys.length !== 1) return false;
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+ }
+
+ function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new exception('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || _result !== '') {
+ pairBuffer += generateNextLine(state, level);
+ }
- result[index] = [ keys[0], pair[keys[0]] ];
- }
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
- return true;
-}
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
-function constructYamlPairs(data) {
- if (data === null) return [];
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
- var index, length, pair, keys, result,
- object = data;
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
- result = new Array(object.length);
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
- for (index = 0, length = object.length; index < length; index += 1) {
- pair = object[index];
+ pairBuffer += state.dump;
- keys = Object.keys(pair);
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
- result[index] = [ keys[0], pair[keys[0]] ];
- }
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
- return result;
-}
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
-module.exports = new Type('tag:yaml.org,2002:pairs', {
- kind: 'sequence',
- resolve: resolveYamlPairs,
- construct: constructYamlPairs
-});
+ pairBuffer += state.dump;
-},{"../type":13}],26:[function(require,module,exports){
-'use strict';
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
-var Type = require('../type');
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+ }
-module.exports = new Type('tag:yaml.org,2002:seq', {
- kind: 'sequence',
- construct: function (data) { return data !== null ? data : []; }
-});
+ function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
-},{"../type":13}],27:[function(require,module,exports){
-'use strict';
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
-var Type = require('../type');
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
-var _hasOwnProperty = Object.prototype.hasOwnProperty;
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
-function resolveYamlSet(data) {
- if (data === null) return true;
+ if (explicit) {
+ if (type.multi && type.representName) {
+ state.tag = type.representName(object);
+ } else {
+ state.tag = type.tag;
+ }
+ } else {
+ state.tag = '?';
+ }
- var key, object = data;
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
- for (key in object) {
- if (_hasOwnProperty.call(object, key)) {
- if (object[key] !== null) 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');
+ }
- return true;
-}
+ state.dump = _result;
+ }
-function constructYamlSet(data) {
- return data !== null ? data : {};
-}
+ return true;
+ }
+ }
-module.exports = new Type('tag:yaml.org,2002:set', {
- kind: 'mapping',
- resolve: resolveYamlSet,
- construct: constructYamlSet
-});
+ return false;
+ }
-},{"../type":13}],28:[function(require,module,exports){
-'use strict';
+ // 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;
-var Type = require('../type');
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
-module.exports = new Type('tag:yaml.org,2002:str', {
- kind: 'scalar',
- construct: function (data) { return data !== null ? data : ''; }
-});
+ var type = _toString.call(state.dump);
+ var inblock = block;
+ var tagStr;
-},{"../type":13}],29:[function(require,module,exports){
-'use strict';
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
-var Type = require('../type');
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
-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 (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
-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
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
-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 (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);
+ }
-function constructYamlTimestamp(data) {
- var match, year, month, day, hour, minute, second, fraction = 0,
- delta = null, tz_hour, tz_minute, date;
+ 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 + '>';
+ }
- match = YAML_DATE_REGEXP.exec(data);
- if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+ state.dump = tagStr + ' ' + state.dump;
+ }
+ }
- if (match === null) throw new Error('Date resolve error');
+ return true;
+ }
- // match: [1] year [2] month [3] day
+ function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
- year = +(match[1]);
- month = +(match[2]) - 1; // JS month starts with 0
- day = +(match[3]);
+ inspectNode(object, objects, duplicatesIndexes);
- if (!match[4]) { // no hour
- return new Date(Date.UTC(year, month, day));
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
}
- // match: [4] hour [5] minute [6] second [7] fraction
+ function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
- hour = +(match[4]);
- minute = +(match[5]);
- second = +(match[6]);
+ 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 (match[7]) {
- fraction = match[7].slice(0, 3);
- while (fraction.length < 3) { // milli-seconds
- fraction += '0';
+ 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);
+ }
+ }
+ }
}
- 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;
- }
+ function dump$1(input, options) {
+ options = options || {};
- date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+ var state = new State(options);
- if (delta) date.setTime(date.getTime() - delta);
+ if (!state.noRefs) getDuplicateReferences(input, state);
- return date;
-}
+ var value = input;
-function representYamlTimestamp(object /*, style*/) {
- return object.toISOString();
-}
+ if (state.replacer) {
+ value = state.replacer.call({ '': value }, '', value);
+ }
-module.exports = new Type('tag:yaml.org,2002:timestamp', {
- kind: 'scalar',
- resolve: resolveYamlTimestamp,
- construct: constructYamlTimestamp,
- instanceOf: Date,
- represent: representYamlTimestamp
-});
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
-},{"../type":13}],"/":[function(require,module,exports){
-'use strict';
+ return '';
+ }
+ var dump_1 = dump$1;
-var yaml = require('./lib/js-yaml.js');
+ var dumper = {
+ dump: dump_1
+ };
+ function renamed(from, to) {
+ return function () {
+ throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
+ 'Use yaml.' + to + ' instead, which is now safe by default.');
+ };
+ }
+
+
+ var Type = type;
+ var Schema = schema;
+ var FAILSAFE_SCHEMA = failsafe;
+ var JSON_SCHEMA = json;
+ var CORE_SCHEMA = core;
+ var DEFAULT_SCHEMA = _default;
+ var load = loader.load;
+ var loadAll = loader.loadAll;
+ var dump = dumper.dump;
+ var YAMLException = exception;
+
+ // Re-export all types in case user wants to create custom schema
+ var types = {
+ binary: binary,
+ float: float,
+ map: map,
+ null: _null,
+ pairs: pairs,
+ set: set,
+ timestamp: timestamp,
+ bool: bool,
+ int: int,
+ merge: merge,
+ omap: omap,
+ seq: seq,
+ str: str
+ };
-module.exports = yaml;
+ // Removed functions from JS-YAML 3.0.x
+ var safeLoad = renamed('safeLoad', 'load');
+ var safeLoadAll = renamed('safeLoadAll', 'loadAll');
+ var safeDump = renamed('safeDump', 'dump');
+
+ var jsYaml = {
+ Type: Type,
+ Schema: Schema,
+ FAILSAFE_SCHEMA: FAILSAFE_SCHEMA,
+ JSON_SCHEMA: JSON_SCHEMA,
+ CORE_SCHEMA: CORE_SCHEMA,
+ DEFAULT_SCHEMA: DEFAULT_SCHEMA,
+ load: load,
+ loadAll: loadAll,
+ dump: dump,
+ YAMLException: YAMLException,
+ types: types,
+ safeLoad: safeLoad,
+ safeLoadAll: safeLoadAll,
+ safeDump: safeDump
+ };
-},{"./lib/js-yaml.js":1}]},{},[])("/")
-});
+ exports.CORE_SCHEMA = CORE_SCHEMA;
+ exports.DEFAULT_SCHEMA = DEFAULT_SCHEMA;
+ exports.FAILSAFE_SCHEMA = FAILSAFE_SCHEMA;
+ exports.JSON_SCHEMA = JSON_SCHEMA;
+ exports.Schema = Schema;
+ exports.Type = Type;
+ exports.YAMLException = YAMLException;
+ exports.default = jsYaml;
+ exports.dump = dump;
+ exports.load = load;
+ exports.loadAll = loadAll;
+ exports.safeDump = safeDump;
+ exports.safeLoad = safeLoad;
+ exports.safeLoadAll = safeLoadAll;
+ exports.types = types;
+
+ Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js b/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js
index 1b6ecc16b2a..bdd8eef542b 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js
+++ b/tools/node_modules/eslint/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<a.length;e++)s(a[e]);return s}({1:[function(e,t,n){"use strict";var i=e("./js-yaml/loader"),r=e("./js-yaml/dumper");function o(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}t.exports.Type=e("./js-yaml/type"),t.exports.Schema=e("./js-yaml/schema"),t.exports.FAILSAFE_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.JSON_SCHEMA=e("./js-yaml/schema/json"),t.exports.CORE_SCHEMA=e("./js-yaml/schema/core"),t.exports.DEFAULT_SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_FULL_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.load=i.load,t.exports.loadAll=i.loadAll,t.exports.safeLoad=i.safeLoad,t.exports.safeLoadAll=i.safeLoadAll,t.exports.dump=r.dump,t.exports.safeDump=r.safeDump,t.exports.YAMLException=e("./js-yaml/exception"),t.exports.MINIMAL_SCHEMA=e("./js-yaml/schema/failsafe"),t.exports.SAFE_SCHEMA=e("./js-yaml/schema/default_safe"),t.exports.DEFAULT_SCHEMA=e("./js-yaml/schema/default_full"),t.exports.scan=o("scan"),t.exports.parse=o("parse"),t.exports.compose=o("compose"),t.exports.addConstructor=o("addConstructor")},{"./js-yaml/dumper":3,"./js-yaml/exception":4,"./js-yaml/loader":5,"./js-yaml/schema":7,"./js-yaml/schema/core":8,"./js-yaml/schema/default_full":9,"./js-yaml/schema/default_safe":10,"./js-yaml/schema/failsafe":11,"./js-yaml/schema/json":12,"./js-yaml/type":13}],2:[function(e,t,n){"use strict";function i(e){return null==e}t.exports.isNothing=i,t.exports.isObject=function(e){return"object"==typeof e&&null!==e},t.exports.toArray=function(e){return Array.isArray(e)?e:i(e)?[]:[e]},t.exports.repeat=function(e,t){for(var n="",i=0;i<t;i+=1)n+=e;return n},t.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},t.exports.extend=function(e,t){var n,i,r,o;if(t)for(n=0,i=(o=Object.keys(t)).length;n<i;n+=1)e[r=o[n]]=t[r];return e}},{}],3:[function(e,t,n){"use strict";var c=e("./common"),f=e("./exception"),i=e("./schema/default_full"),r=e("./schema/default_safe"),l=Object.prototype.toString,u=Object.prototype.hasOwnProperty,o=9,h=10,a=13,s=32,m=33,g=34,y=35,x=37,A=38,b=39,v=42,w=44,C=45,k=58,j=61,S=62,I=63,O=64,E=91,F=93,_=96,N=123,M=124,T=125,p={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},d=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function L(e){var t,n,i=e.toString(16).toUpperCase();if(e<=255)t="x",n=2;else if(e<=65535)t="u",n=4;else{if(!(e<=4294967295))throw new f("code point within a string may not be greater than 0xFFFFFFFF");t="U",n=8}return"\\"+t+c.repeat("0",n-i.length)+i}function D(e){this.schema=e.schema||i,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=c.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,a,s,c;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r<o;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&u.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function U(e,t){for(var n,i,r=c.repeat(" ",t),o=0,a="",s=e.length;o<s;)o=-1===(n=e.indexOf("\n",o))?(i=e.slice(o),s):(i=e.slice(o,n+1),n+1),i.length&&"\n"!==i&&(a+=r),a+=i;return a}function q(e,t){return"\n"+c.repeat(" ",e.indent*t)}function Y(e){return e===s||e===o}function R(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&65279!==e||65536<=e&&e<=1114111}function B(e,t){return R(e)&&65279!==e&&e!==w&&e!==E&&e!==F&&e!==N&&e!==T&&e!==k&&(e!==y||t&&(R(t=t)&&!Y(t)&&65279!==t&&t!==a&&t!==h))}function W(e){return/^\n* /.test(e)}var K=1,P=2,$=3,H=4,G=5;function V(e,t,n,i,r){var o,a,s,c,u=!1,l=!1,p=-1!==i,f=-1,d=R(c=e.charCodeAt(0))&&65279!==c&&!Y(c)&&c!==C&&c!==I&&c!==k&&c!==w&&c!==E&&c!==F&&c!==N&&c!==T&&c!==y&&c!==A&&c!==v&&c!==m&&c!==M&&c!==j&&c!==S&&c!==b&&c!==g&&c!==x&&c!==O&&c!==_&&!Y(e.charCodeAt(e.length-1));if(t)for(o=0;o<e.length;o++){if(!R(a=e.charCodeAt(o)))return G;s=0<o?e.charCodeAt(o-1):null,d=d&&B(a,s)}else{for(o=0;o<e.length;o++){if((a=e.charCodeAt(o))===h)u=!0,p&&(l=l||i<o-f-1&&" "!==e[f+1],f=o);else if(!R(a))return G;s=0<o?e.charCodeAt(o-1):null,d=d&&B(a,s)}l=l||p&&i<o-f-1&&" "!==e[f+1]}return u||l?9<n&&W(e)?G:l?H:$:d&&!r(e)?K:P}function Z(i,r,o,a){i.dump=function(){if(0===r.length)return"''";if(!i.noCompatMode&&-1!==d.indexOf(r))return"'"+r+"'";var e=i.indent*Math.max(1,o),t=-1===i.lineWidth?-1:Math.max(Math.min(i.lineWidth,40),i.lineWidth-e),n=a||-1<i.flowLevel&&o>=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(i,e)})){case K:return r;case P:return"'"+r.replace(/'/g,"''")+"'";case $:return"|"+z(r,i.indent)+J(U(r,e));case H:return">"+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;o<e.length;o++)55296<=(t=e.charCodeAt(o))&&t<=56319&&56320<=(n=e.charCodeAt(o+1))&&n<=57343?(r+=L(1024*(t-55296)+n-56320+65536),o++):(i=p[t],r+=!i&&R(t)?e[o]:i||L(t));return r}(r)+'"';default:throw new f("impossible error: invalid scalar style")}}()}function z(e,t){var n=W(e)?String(t):"",t="\n"===e[e.length-1];return n+(t&&("\n"===e[e.length-2]||"\n"===e)?"+":t?"":"-")+"\n"}function J(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Q(e,t){if(""===e||" "===e[0])return e;for(var n,i,r=/ [^ ]/g,o=0,a=0,s="";n=r.exec(e);)t<(i=n.index)-o&&(n=o<a?a:i,s+="\n"+e.slice(o,n),o=n+1),a=i;return s+="\n",e.length-o>t&&o<a?s+=e.slice(o,a)+"\n"+e.slice(a+1):s+=e.slice(o),s.slice(1)}function X(e,t,n){for(var i,r,o,a=n?e.explicitTypes:e.implicitTypes,s=0,c=a.length;s<c;s+=1)if(((r=a[s]).instanceOf||r.predicate)&&(!r.instanceOf||"object"==typeof t&&t instanceof r.instanceOf)&&(!r.predicate||r.predicate(t))){if(e.tag=n?r.tag:"?",r.represent){if(o=e.styleMap[r.tag]||r.defaultStyle,"[object Function]"===l.call(r.represent))i=r.represent(t,o);else{if(!u.call(r.represent,o))throw new f("!<"+r.tag+'> 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<t)&&(r=!1),c&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(u&&c&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)i&&0!==Object.keys(e.dump).length?(function(e,t,n,i){var r,o,a,s,c,u="",l=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new f("sortKeys must be a boolean or a function");for(r=0,o=p.length;r<o;r+=1)c="",i&&0===r||(c+=q(e,t)),a=n[s=p[r]],ee(e,t+1,s,!0,!0,!0)&&((s=null!==e.tag&&"?"!==e.tag||e.dump&&1024<e.dump.length)&&(e.dump&&h===e.dump.charCodeAt(0)?c+="?":c+="? "),c+=e.dump,s&&(c+=q(e,t)),ee(e,t+1,a,!0,s)&&(e.dump&&h===e.dump.charCodeAt(0)?c+=":":c+=": ",u+=c+=e.dump));e.tag=l,e.dump=u||"{}"}(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(function(e,t,n){for(var i,r,o,a="",s=e.tag,c=Object.keys(n),u=0,l=c.length;u<l;u+=1)o="",0!==u&&(o+=", "),e.condenseFlow&&(o+='"'),r=n[i=c[u]],ee(e,t,i,!1,!1)&&(1024<e.dump.length&&(o+="? "),o+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ee(e,t,r,!1,!1)&&(a+=o+=e.dump));e.tag=s,e.dump="{"+a+"}"}(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a){u=e.noArrayIndent&&0<t?t-1:t;i&&0!==e.dump.length?(function(e,t,n,i){for(var r="",o=e.tag,a=0,s=n.length;a<s;a+=1)ee(e,t+1,n[a],!0,!0)&&(i&&0===a||(r+=q(e,t)),e.dump&&h===e.dump.charCodeAt(0)?r+="-":r+="- ",r+=e.dump);e.tag=o,e.dump=r||"[]"}(e,u,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(function(e,t,n){for(var i="",r=e.tag,o=0,a=n.length;o<a;o+=1)ee(e,t,n[o],!1,!1)&&(0!==o&&(i+=","+(e.condenseFlow?"":" ")),i+=e.dump);e.tag=r,e.dump="["+i+"]"}(e,u,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump))}else{if("[object String]"!==a){if(e.skipInvalid)return;throw new f("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&Z(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+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<a;o+=1)e(t[o],n,i);else for(r=Object.keys(t),o=0,a=r.length;o<a;o+=1)e(t[r[o]],n,i)}(e,r,o),n=0,i=o.length;n<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function ne(e,t){t=new D(t=t||{});return t.noRefs||te(e,t),ee(t,0,e,!0,!0)?t.dump+"\n":""}t.exports.dump=ne,t.exports.safeDump=function(e,t){return ne(e,c.extend({schema:r},t))}},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t,n){"use strict";function i(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}((i.prototype=Object.create(Error.prototype)).constructor=i).prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=i},{}],5:[function(e,t,n){"use strict";var h=e("./common"),i=e("./exception"),r=e("./mark"),o=e("./schema/default_safe"),a=e("./schema/default_full"),m=Object.prototype.hasOwnProperty,g=1,y=2,x=3,A=4,b=1,v=2,w=3,c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s=/[\x85\u2028\u2029]/,C=/[,\[\]\{\}]/,k=/^(?:!|!!|![a-z\-]+!)$/i,j=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function l(e){return Object.prototype.toString.call(e)}function S(e){return 10===e||13===e}function I(e){return 9===e||32===e}function O(e){return 9===e||32===e||10===e||13===e}function E(e){return 44===e||91===e||93===e||123===e||125===e}function u(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"Ā…":95===e?"Ā ":76===e?"\u2028":80===e?"\u2029":""}for(var p=new Array(256),f=new Array(256),d=0;d<256;d++)p[d]=u(d)?1:0,f[d]=u(d);function F(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,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.documents=[]}function _(e,t){return new i(t,new r(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function N(e,t){throw _(e,t)}function M(e,t){e.onWarning&&e.onWarning.call(null,_(e,t))}var T={YAML:function(e,t,n){var i,r;null!==e.version&&N(e,"duplication of %YAML directive"),1!==n.length&&N(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&N(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),r=parseInt(r[2],10),1!==i&&N(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=r<2,1!==r&&2!==r&&M(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i;2!==n.length&&N(e,"TAG directive accepts exactly two arguments"),i=n[0],n=n[1],k.test(i)||N(e,"ill-formed tag handle (first argument) of the TAG directive"),m.call(e.tagMap,i)&&N(e,'there is a previously declared suffix for "'+i+'" tag handle'),j.test(n)||N(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=n}};function L(e,t,n,i){var r,o,a,s;if(t<n){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;r<o;r+=1)9===(a=s.charCodeAt(r))||32<=a&&a<=1114111||N(e,"expected valid JSON character");else c.test(s)&&N(e,"the stream contains non-printable characters");e.result+=s}}function D(e,t,n,i){var r,o,a,s;for(h.isObject(n)||N(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(r=Object.keys(n)).length;a<s;a+=1)o=r[a],m.call(t,o)||(t[o]=n[o],i[o]=!0)}function U(e,t,n,i,r,o,a,s){var c,u;if(Array.isArray(r))for(c=0,u=(r=Array.prototype.slice.call(r)).length;c<u;c+=1)Array.isArray(r[c])&&N(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===l(r[c])&&(r[c]="[object Object]");if("object"==typeof r&&"[object Object]"===l(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(c=0,u=o.length;c<u;c+=1)D(e,t,o[c],n);else D(e,t,o,n);else e.json||m.call(n,r)||!m.call(t,r)||(e.line=a||e.line,e.position=s||e.position,N(e,"duplicated mapping key")),t[r]=o,delete n[r];return t}function q(e){var t=e.input.charCodeAt(e.position);10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):N(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function Y(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;I(r);)r=e.input.charCodeAt(++e.position);if(t&&35===r)for(;r=e.input.charCodeAt(++e.position),10!==r&&13!==r&&0!==r;);if(!S(r))break;for(q(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&M(e,"deficient indentation"),i}function R(e){var t=e.position,n=e.input.charCodeAt(t);return 45!==n&&46!==n||n!==e.input.charCodeAt(t+1)||n!==e.input.charCodeAt(t+2)||(t+=3,0!==(n=e.input.charCodeAt(t))&&!O(n))?void 0:1}function B(e,t){1===t?e.result+=" ":1<t&&(e.result+=h.repeat("\n",t-1))}function W(e,t){var n,i,r,o,a,s,c,u=e.input.charCodeAt(e.position);if(34===u){for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(u=e.input.charCodeAt(e.position));){if(34===u)return L(e,n,e.position,!0),e.position++,1;if(92===u){if(L(e,n,e.position,!0),S(u=e.input.charCodeAt(++e.position)))Y(e,!1,t);else if(u<256&&p[u])e.result+=f[u],e.position++;else if(0<(a=120===(c=u)?2:117===c?4:85===c?8:0)){for(r=a,o=0;0<r;r--)u=e.input.charCodeAt(++e.position),0<=(a=48<=(s=u)&&s<=57?s-48:97<=(s=32|s)&&s<=102?s-97+10:-1)?o=(o<<4)+a:N(e,"expected hexadecimal character");e.result+=(c=o)<=65535?String.fromCharCode(c):String.fromCharCode(55296+(c-65536>>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.lineIndent<t)break;return!!s&&(e.tag=r,e.anchor=o,e.kind="sequence",e.result=a,!0)}function P(e,t,n,i,r){var o,a,s,c,u,l,p=1,f=!1,d=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=A===n||x===n,i&&Y(e,!0,-1)&&(f=!0,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)),1===p)for(;function(e){var t,n,i,r=!1,o=!1,a=e.input.charCodeAt(e.position);if(33===a){if(null!==e.tag&&N(e,"duplication of a tag property"),60===(a=e.input.charCodeAt(++e.position))?(r=!0,a=e.input.charCodeAt(++e.position)):33===a?(o=!0,n="!!",a=e.input.charCodeAt(++e.position)):n="!",t=e.position,r){for(;a=e.input.charCodeAt(++e.position),0!==a&&62!==a;);e.position<e.length?(i=e.input.slice(t,e.position),a=e.input.charCodeAt(++e.position)):N(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==a&&!O(a);)33===a&&(o?N(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),k.test(n)||N(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),a=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),C.test(i)&&N(e,"tag suffix cannot contain flow indicator characters")}return i&&!j.test(i)&&N(e,"tag name cannot contain such characters: "+i),r?e.tag=i:m.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:N(e,'undeclared tag handle "'+n+'"'),1}}(e)||function(e){var t,n=e.input.charCodeAt(e.position);if(38===n){for(null!==e.anchor&&N(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!O(n)&&!E(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),1}}(e);)Y(e,!0,-1)?(f=!0,s=o,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)):s=!1;if(s=s&&(f||r),1!==p&&A!==n||(i=g===n||y===n?t:t+1,r=e.position-e.lineStart,1===p?s&&(K(e,r)||function(e,t,n){var i,r,o,a,s,c=e.tag,u=e.anchor,l={},p={},f=null,d=null,h=null,m=!1,g=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=l),s=e.input.charCodeAt(e.position);0!==s;){if(i=e.input.charCodeAt(e.position+1),o=e.line,a=e.position,63!==s&&58!==s||!O(i)){if(!P(e,n,y,!1,!0))break;if(e.line===o){for(s=e.input.charCodeAt(e.position);I(s);)s=e.input.charCodeAt(++e.position);if(58===s)O(s=e.input.charCodeAt(++e.position))||N(e,"a whitespace character is expected after the key-value separator within a block mapping"),m&&(U(e,l,p,f,d,null),f=d=h=null),r=m=!(g=!0),f=e.tag,d=e.result;else{if(!g)return e.tag=c,e.anchor=u,1;N(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!g)return e.tag=c,e.anchor=u,1;N(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(m&&(U(e,l,p,f,d,null),f=d=h=null),r=m=g=!0):m?r=!(m=!1):N(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=i;if((e.line===o||e.lineIndent>t)&&(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.lineIndent<t)break}return m&&U(e,l,p,f,d,null),g&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=l),g}(e,r,i))||function(e,t){var n,i,r,o,a,s,c,u,l,p=!0,f=e.tag,d=e.anchor,h={},m=e.input.charCodeAt(e.position);if(91===m)s=!(r=93),i=[];else{if(123!==m)return;r=125,s=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),m=e.input.charCodeAt(++e.position);0!==m;){if(Y(e,!0,t),(m=e.input.charCodeAt(e.position))===r)return e.position++,e.tag=f,e.anchor=d,e.kind=s?"mapping":"sequence",e.result=i,1;p||N(e,"missed comma between flow collection entries"),l=null,o=a=!1,63===m&&O(e.input.charCodeAt(e.position+1))&&(o=a=!0,e.position++,Y(e,!0,t)),n=e.line,P(e,t,g,!1,!0),u=e.tag,c=e.result,Y(e,!0,t),m=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==m||(o=!0,m=e.input.charCodeAt(++e.position),Y(e,!0,t),P(e,t,g,!1,!0),l=e.result),s?U(e,i,h,u,c,l):o?i.push(U(e,null,h,u,c,l)):i.push(c),Y(e,!0,t),44===(m=e.input.charCodeAt(e.position))?(p=!0,m=e.input.charCodeAt(++e.position)):p=!1}N(e,"unexpected end of the stream within a flow collection")}(e,i)?d=!0:(a&&function(e,t){var n,i,r,o=b,a=!1,s=!1,c=t,u=0,l=!1,p=e.input.charCodeAt(e.position);if(124===p)i=!1;else{if(62!==p)return;i=!0}for(e.kind="scalar",e.result="";0!==p;)if(43===(p=e.input.charCodeAt(++e.position))||45===p)b===o?o=43===p?w:v:N(e,"repeat of a chomping mode identifier");else{if(!(0<=(r=48<=(r=p)&&r<=57?r-48:-1)))break;0==r?N(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?N(e,"repeat of an indentation width identifier"):(c=t+r-1,s=!0)}if(I(p)){for(;p=e.input.charCodeAt(++e.position),I(p););if(35===p)for(;p=e.input.charCodeAt(++e.position),!S(p)&&0!==p;);}for(;0!==p;){for(q(e),e.lineIndent=0,p=e.input.charCodeAt(e.position);(!s||e.lineIndent<c)&&32===p;)e.lineIndent++,p=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>c&&(c=e.lineIndent),S(p))u++;else{if(e.lineIndent<c){o===w?e.result+=h.repeat("\n",a?1+u:u):o===b&&a&&(e.result+="\n");break}for(i?I(p)?(l=!0,e.result+=h.repeat("\n",a?1+u:u)):l?(l=!1,e.result+=h.repeat("\n",u+1)):0===u?a&&(e.result+=" "):e.result+=h.repeat("\n",u):e.result+=h.repeat("\n",a?1+u:u),s=a=!0,u=0,n=e.position;!S(p)&&0!==p;)p=e.input.charCodeAt(++e.position);L(e,n,e.position,!1)}}return 1}(e,i)||function(e,t){var n,i,r=e.input.charCodeAt(e.position);if(39===r){for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(r=e.input.charCodeAt(e.position));)if(39===r){if(L(e,n,e.position,!0),39!==(r=e.input.charCodeAt(++e.position)))return 1;n=e.position,e.position++,i=e.position}else S(r)?(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 single quoted scalar"):(e.position++,i=e.position);N(e,"unexpected end of the stream within a single quoted scalar")}}(e,i)||W(e,i)?d=!0:!function(e){var t,n=e.input.charCodeAt(e.position);if(42===n){for(n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!O(n)&&!E(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&N(e,"name of an alias node must contain at least one character"),t=e.input.slice(t,e.position),m.call(e.anchorMap,t)||N(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],Y(e,!0,-1),1}}(e)?function(e,t,n){var i,r,o,a,s,c,u,l=e.kind,p=e.result,f=e.input.charCodeAt(e.position);if(!O(f)&&!E(f)&&35!==f&&38!==f&&42!==f&&33!==f&&124!==f&&62!==f&&39!==f&&34!==f&&37!==f&&64!==f&&96!==f&&(63!==f&&45!==f||!(O(i=e.input.charCodeAt(e.position+1))||n&&E(i)))){for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==f;){if(58===f){if(O(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===f){if(O(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&R(e)||n&&E(f))break;if(S(f)){if(s=e.line,c=e.lineStart,u=e.lineIndent,Y(e,!1,-1),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<u;c+=1)if((l=e.implicitTypes[c]).resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else m.call(e.typeMap[e.kind||"fallback"],e.tag)?(l=e.typeMap[e.kind||"fallback"][e.tag],null!==e.result&&l.kind!==e.kind&&N(e,"unacceptable node kind for !<"+e.tag+'> 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.position<n.length-1;)!function(e){var t,n,i,r,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(r=e.input.charCodeAt(e.position))&&(Y(e,!0,-1),r=e.input.charCodeAt(e.position),!(0<e.lineIndent||37!==r));){for(a=!0,r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!O(r);)r=e.input.charCodeAt(++e.position);for(i=[],(n=e.input.slice(t,e.position)).length<1&&N(e,"directive name must not be less than one character in length");0!==r;){for(;I(r);)r=e.input.charCodeAt(++e.position);if(35===r){for(;r=e.input.charCodeAt(++e.position),0!==r&&!S(r););break}if(S(r))break;for(t=e.position;0!==r&&!O(r);)r=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}0!==r&&q(e),m.call(T,n)?T[n](e,n,i):M(e,'unknown document directive "'+n+'"')}Y(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,Y(e,!0,-1)):a&&N(e,"directives end mark is expected"),P(e,e.lineIndent-1,A,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&s.test(e.input.slice(o,e.position))&&M(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&R(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,Y(e,!0,-1)):e.position<e.length-1&&N(e,"end of the stream or a document separator is expected")}(n);return n.documents}function H(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=$(e,n);if("function"!=typeof t)return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])}function G(e,t){t=$(e,t);if(0!==t.length){if(1===t.length)return t[0];throw new i("expected a single document in the stream, but found more")}}t.exports.loadAll=H,t.exports.load=G,t.exports.safeLoadAll=function(e,t,n){return"object"==typeof t&&null!==t&&void 0===n&&(n=t,t=null),H(e,t,h.extend({schema:o},n))},t.exports.safeLoad=function(e,t){return G(e,h.extend({schema:o},t))}},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t,n){"use strict";var s=e("./common");function i(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}i.prototype.getSnippet=function(e,t){var n,i,r,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;0<i&&-1==="\0\r\nĀ…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(--i,this.position-i>t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;o<this.buffer.length&&-1==="\0\r\nĀ…\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/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<t;e+=1)arguments[e].forEach(i);return n}(this.compiledImplicit,this.compiledExplicit)}c.DEFAULT=null,c.create=function(e,t){var n,i;switch(arguments.length){case 1:n=c.DEFAULT,i=e;break;case 2:n=e,i=t;break;default:throw new o("Wrong number of arguments for Schema.create function")}if(n=r.toArray(n),i=r.toArray(i),!n.every(function(e){return e instanceof c}))throw new o("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!i.every(function(e){return e instanceof a}))throw new o("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new c({include:n,explicit:i})},t.exports=c},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t,n){"use strict";var i=e("../schema");t.exports=i.DEFAULT=new i({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../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(e,t,n){"use strict";var i=e("../schema");t.exports=new i({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t,n){"use strict";var r=e("./exception"),o=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=function(t,e){var n,i;if(e=e||{},Object.keys(e).forEach(function(e){if(-1===o.indexOf(e))throw new r('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(e){return e},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(n=e.styleAliases||null,i={},null!==n&&Object.keys(n).forEach(function(t){n[t].forEach(function(e){i[String(e)]=t})}),i),-1===a.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},{"./exception":4}],14:[function(e,t,n){"use strict";try{var s=e("buffer").Buffer}catch(e){}var i=e("../type"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;for(var t,n=0,i=e.length,r=c,o=0;o<i;o++)if(!(64<(t=r.indexOf(e.charAt(o))))){if(t<0)return!1;n+=6}return n%8==0},construct:function(e){for(var t=e.replace(/[\r\n=]/g,""),n=t.length,i=c,r=0,o=[],a=0;a<n;a++)a%4==0&&a&&(o.push(r>>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<r;a++)a%3==0&&a&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return e=e.toString(10),o.test(e)?e.replace("e",".e"):e},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a<o;a++)if("_"!==(t=e[a])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(a++;a<o;a++)if("_"!==(t=e[a])){if(!(48<=(i=e.charCodeAt(a))&&i<=57||65<=i&&i<=70||97<=i&&i<=102))return!1;s=!0}return s&&"_"!==t}for(;a<o;a++)if("_"!==(t=e[a])){if(!(48<=(n=e.charCodeAt(a))&&n<=55))return!1;s=!0}return s&&"_"!==t}if("_"===t)return!1;for(;a<o;a++)if("_"!==(t=e[a])){if(":"===t)break;if(!(48<=(r=e.charCodeAt(a))&&r<=57))return!1;s=!0}return!(!s||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(a)))},construct:function(e){var t,n=e,i=1,r=[];return-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(e=n[0])&&"+"!==e||("-"===e&&(i=-1),e=(n=n.slice(1))[0]),"0"===n?0:"0"===e?"b"===n[1]?i*parseInt(n.slice(2),2):"x"===n[1]?i*parseInt(n,16):i*parseInt(n,8):-1!==n.indexOf(":")?(n.split(":").forEach(function(e){r.unshift(parseInt(e,10))}),n=0,t=1,r.forEach(function(e){n+=e*t,t*=60}),i*n):i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!i.isNegativeZero(e)},represent:{binary:function(e){return 0<=e?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return 0<=e?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return 0<=e?"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"]}})},{"../common":2,"../type":13}],18:[function(e,t,n){"use strict";try{var r=e("esprima")}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var i=e("../../type");t.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",t=r.parse(t,{range:!0});return"Program"!==t.type||1!==t.body.length||"ExpressionStatement"!==t.body[0].type||"ArrowFunctionExpression"!==t.body[0].expression.type&&"FunctionExpression"!==t.body[0].expression.type?!1:!0}catch(e){return!1}},construct:function(e){var t="("+e+")",n=r.parse(t,{range:!0}),i=[];if("Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"ArrowFunctionExpression"!==n.body[0].expression.type&&"FunctionExpression"!==n.body[0].expression.type)throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(e){i.push(e.name)}),e=n.body[0].expression.body.range,"BlockStatement"===n.body[0].expression.body.type?new Function(i,t.slice(e[0]+1,e[1]-1)):new Function(i,"return "+t.slice(e[0],e[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},{"../../type":13}],19:[function(e,t,n){"use strict";e=e("../../type");t.exports=new e("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),e="";if("/"===t[0]){if(n&&(e=n[1]),3<e.length)return!1;if("/"!==t[t.length-e.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),e="";return"/"===t[0]&&(n&&(e=n[1]),t=t.slice(1,t.length-e.length-1)),new RegExp(t,e)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},{"../../type":13}],20:[function(e,t,n){"use strict";e=e("../../type");t.exports=new e("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},{"../../type":13}],21:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},{"../type":13}],23:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t,n){"use strict";var e=e("../type"),c=Object.prototype.hasOwnProperty,u=Object.prototype.toString;t.exports=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var t,n,i,r=[],o=e,a=0,s=o.length;a<s;a+=1){if(t=o[a],i=!1,"[object Object]"!==u.call(t))return!1;for(n in t)if(c.call(t,n)){if(i)return!1;i=!0}if(!i)return!1;if(-1!==r.indexOf(n))return!1;r.push(n)}return!0},construct:function(e){return null!==e?e:[]}})},{"../type":13}],25:[function(e,t,n){"use strict";var e=e("../type"),s=Object.prototype.toString;t.exports=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;for(var t,n,i=e,r=new Array(i.length),o=0,a=i.length;o<a;o+=1){if(t=i[o],"[object Object]"!==s.call(t))return!1;if(1!==(n=Object.keys(t)).length)return!1;r[o]=[n[0],t[n[0]]]}return!0},construct:function(e){if(null===e)return[];for(var t,n,i=e,r=new Array(i.length),o=0,a=i.length;o<a;o+=1)t=i[o],n=Object.keys(t),r[o]=[n[0],t[n[0]]];return r}})},{"../type":13}],26:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t,n){"use strict";var e=e("../type"),i=Object.prototype.hasOwnProperty;t.exports=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},{"../type":13}],28:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t,n){"use strict";var e=e("../type"),u=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),l=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]))?))?$");t.exports=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==u.exec(e)||null!==l.exec(e))},construct:function(e){var t,n,i,r,o,a=0,s=null,c=u.exec(e);if(null===c&&(c=l.exec(e)),null===c)throw new Error("Date resolve error");if(t=+c[1],n=+c[2]-1,i=+c[3],!c[4])return new Date(Date.UTC(t,n,i));if(r=+c[4],o=+c[5],e=+c[6],c[7]){for(a=c[7].slice(0,3);a.length<3;)a+="0";a=+a}return c[9]&&(s=6e4*(60*+c[10]+ +(c[11]||0)),"-"===c[9]&&(s=-s)),e=new Date(Date.UTC(t,n,i,r,o,e,a)),s&&e.setTime(e.getTime()-s),e},instanceOf:Date,represent:function(e){return e.toISOString()}})},{"../type":13}],"/":[function(e,t,n){"use strict";e=e("./lib/js-yaml.js");t.exports=e},{"./lib/js-yaml.js":1}]},{},[])("/")});
+/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jsyaml={})}(this,(function(e){"use strict";function t(e){return null==e}var n={isNothing:t,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:t(e)?[]:[e]},repeat:function(e,t){var n,i="";for(n=0;n<t;n+=1)i+=e;return i},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,i,r,o;if(t)for(n=0,i=(o=Object.keys(t)).length;n<i;n+=1)e[r=o[n]]=t[r];return e}};function i(e,t){var n="",i=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),i+" "+n):i}function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=i(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){return this.name+": "+i(this,e)};var o=r;function a(e,t,n,i,r){var o="",a="",l=Math.floor(r/2)-1;return i-t>l&&(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<t;e+=1)arguments[e].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var h=d,g=new p("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),m=new p("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),y=new p("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),b=new h({explicit:[g,m,y]});var A=new p("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var v=new p("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"});function w(e){return 48<=e&&e<=55}function k(e){return 48<=e&&e<=57}var C=new p("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i=e.length,r=0,o=!1;if(!i)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===i)return!0;if("b"===(t=e[++r])){for(r++;r<i;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;o=!0}return o&&"_"!==t}if("x"===t){for(r++;r<i;r++)if("_"!==(t=e[r])){if(!(48<=(n=e.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;o=!0}return o&&"_"!==t}if("o"===t){for(r++;r<i;r++)if("_"!==(t=e[r])){if(!w(e.charCodeAt(r)))return!1;o=!0}return o&&"_"!==t}}if("_"===t)return!1;for(;r<i;r++)if("_"!==(t=e[r])){if(!k(e.charCodeAt(r)))return!1;o=!0}return!(!o||"_"===t)},construct:function(e){var t,n=e,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(i=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!n.isNegativeZero(e)},represent:{binary:function(e){return 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;n<r;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){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<r;t++)t%4==0&&t&&(l.push(a>>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<o;t++)t%3==0&&t&&(i+=a[r>>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<n;t+=1){if(i=l[t],o=!1,"[object Object]"!==D.call(i))return!1;for(r in i)if(_.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(r))return!1;a.push(r)}return!0},construct:function(e){return null!==e?e:[]}}),q=Object.prototype.toString;var Y=new p("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(i=a[t],"[object Object]"!==q.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;o[t]=[r[0],i[r[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}}),R=Object.prototype.hasOwnProperty;var B=new p("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(R.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}}),K=j.extend({implicit:[F,E],explicit:[L,U,Y,B]}),P=Object.prototype.hasOwnProperty,W=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,H=/[\x85\u2028\u2029]/,$=/[,\[\]\{\}]/,G=/^(?:!|!!|![a-z\-]+!)$/i,V=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Z(e){return Object.prototype.toString.call(e)}function J(e){return 10===e||13===e}function Q(e){return 9===e||32===e}function z(e){return 9===e||32===e||10===e||13===e}function X(e){return 44===e||91===e||93===e||123===e||125===e}function ee(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function te(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"Ā…":95===e?"Ā ":76===e?"\u2028":80===e?"\u2029":""}function ne(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>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(t<n){if(l=e.input.slice(t,n),i)for(r=0,o=l.length;r<o;r+=1)9===(a=l.charCodeAt(r))||32<=a&&a<=1114111||ce(e,"expected valid JSON character");else W.test(l)&&ce(e,"the stream contains non-printable characters");e.result+=l}}function fe(e,t,i,r){var o,a,l,c;for(n.isObject(i)||ce(e,"cannot merge mappings; the provided source object is unacceptable"),l=0,c=(o=Object.keys(i)).length;l<c;l+=1)a=o[l],P.call(t,a)||(t[a]=i[a],r[a]=!0)}function de(e,t,n,i,r,o,a,l,c){var s,u;if(Array.isArray(r))for(s=0,u=(r=Array.prototype.slice.call(r)).length;s<u;s+=1)Array.isArray(r[s])&&ce(e,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===Z(r[s])&&(r[s]="[object Object]");if("object"==typeof r&&"[object Object]"===Z(r)&&(r="[object Object]"),r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(s=0,u=o.length;s<u;s+=1)fe(e,t,o[s],n);else fe(e,t,o,n);else e.json||P.call(n,r)||!P.call(t,r)||(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,ce(e,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(t,r,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[r]=o,delete n[r];return t}function he(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):ce(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function ge(e,t,n){for(var i=0,r=e.input.charCodeAt(e.position);0!==r;){for(;Q(r);)9===r&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&35===r)do{r=e.input.charCodeAt(++e.position)}while(10!==r&&13!==r&&0!==r);if(!J(r))break;for(he(e),r=e.input.charCodeAt(e.position),i++,e.lineIndent=0;32===r;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return-1!==n&&0!==i&&e.lineIndent<n&&se(e,"deficient indentation"),i}function me(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!z(t)))}function ye(e,t){1===t?e.result+=" ":t>1&&(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.lineIndent<t)break;return!!l&&(e.tag=r,e.anchor=o,e.kind="sequence",e.result=a,!0)}function Ae(e){var t,n,i,r,o=!1,a=!1;if(33!==(r=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&ce(e,"duplication of a tag property"),60===(r=e.input.charCodeAt(++e.position))?(o=!0,r=e.input.charCodeAt(++e.position)):33===r?(a=!0,n="!!",r=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{r=e.input.charCodeAt(++e.position)}while(0!==r&&62!==r);e.position<e.length?(i=e.input.slice(t,e.position),r=e.input.charCodeAt(++e.position)):ce(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!z(r);)33===r&&(a?ce(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),G.test(n)||ce(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),r=e.input.charCodeAt(++e.position);i=e.input.slice(t,e.position),$.test(i)&&ce(e,"tag suffix cannot contain flow indicator characters")}i&&!V.test(i)&&ce(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(t){ce(e,"tag name is malformed: "+i)}return o?e.tag=i:P.call(e.tagMap,n)?e.tag=e.tagMap[n]+i:"!"===n?e.tag="!"+i:"!!"===n?e.tag="tag:yaml.org,2002:"+i:ce(e,'undeclared tag handle "'+n+'"'),!0}function ve(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&ce(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!z(n)&&!X(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&ce(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function we(e,t,i,r,o){var a,l,c,s,u,p,f,d,h,g=1,m=!1,y=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=l=c=4===i||3===i,r&&ge(e,!0,-1)&&(m=!0,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)),1===g)for(;Ae(e)||ve(e);)ge(e,!0,-1)?(m=!0,c=a,e.lineIndent>t?g=1:e.lineIndent===t?g=0:e.lineIndent<t&&(g=-1)):c=!1;if(c&&(c=m||o),1!==g&&4!==i||(d=1===i||2===i?t:t+1,h=e.position-e.lineStart,1===g?c&&(be(e,h)||function(e,t,n){var i,r,o,a,l,c,s,u=e.tag,p=e.anchor,f={},d=Object.create(null),h=null,g=null,m=null,y=!1,b=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),s=e.input.charCodeAt(e.position);0!==s;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,ce(e,"tab characters must not be used in indentation")),i=e.input.charCodeAt(e.position+1),o=e.line,63!==s&&58!==s||!z(i)){if(a=e.line,l=e.lineStart,c=e.position,!we(e,n,2,!1,!0))break;if(e.line===o){for(s=e.input.charCodeAt(e.position);Q(s);)s=e.input.charCodeAt(++e.position);if(58===s)z(s=e.input.charCodeAt(++e.position))||ce(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(de(e,f,d,h,g,null,a,l,c),h=g=m=null),b=!0,y=!1,r=!1,h=e.tag,g=e.result;else{if(!b)return e.tag=u,e.anchor=p,!0;ce(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!b)return e.tag=u,e.anchor=p,!0;ce(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(y&&(de(e,f,d,h,g,null,a,l,c),h=g=m=null),b=!0,y=!0,r=!0):y?(y=!1,r=!0):ce(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=i;if((e.line===o||e.lineIndent>t)&&(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<t)break}return y&&de(e,f,d,h,g,null,a,l,c),b&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),b}(e,h,d))||function(e,t){var n,i,r,o,a,l,c,s,u,p,f,d,h=!0,g=e.tag,m=e.anchor,y=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,s=!1,o=[];else{if(123!==d)return!1;a=125,s=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);0!==d;){if(ge(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=g,e.anchor=m,e.kind=s?"mapping":"sequence",e.result=o,!0;h?44===d&&ce(e,"expected the node content, but found ','"):ce(e,"missed comma between flow collection entries"),f=null,l=c=!1,63===d&&z(e.input.charCodeAt(e.position+1))&&(l=c=!0,e.position++,ge(e,!0,t)),n=e.line,i=e.lineStart,r=e.position,we(e,t,1,!1,!0),p=e.tag,u=e.result,ge(e,!0,t),d=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==d||(l=!0,d=e.input.charCodeAt(++e.position),ge(e,!0,t),we(e,t,1,!1,!0),f=e.result),s?de(e,o,y,p,u,f,n,i,r):l?o.push(de(e,null,y,p,u,f,n,i,r)):o.push(u),ge(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(h=!0,d=e.input.charCodeAt(++e.position)):h=!1}ce(e,"unexpected end of the stream within a flow collection")}(e,d)?y=!0:(l&&function(e,t){var i,r,o,a,l,c=1,s=!1,u=!1,p=t,f=0,d=!1;if(124===(a=e.input.charCodeAt(e.position)))r=!1;else{if(62!==a)return!1;r=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===c?c=43===a?3:2:ce(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(l=a)&&l<=57?l-48:-1)>=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.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>p&&(p=e.lineIndent),J(a))f++;else{if(e.lineIndent<p){3===c?e.result+=n.repeat("\n",s?1+f:f):1===c&&s&&(e.result+="\n");break}for(r?Q(a)?(d=!0,e.result+=n.repeat("\n",s?1+f:f)):d?(d=!1,e.result+=n.repeat("\n",f+1)):0===f?s&&(e.result+=" "):e.result+=n.repeat("\n",f):e.result+=n.repeat("\n",s?1+f:f),s=!0,u=!0,f=0,i=e.position;!J(a)&&0!==a;)a=e.input.charCodeAt(++e.position);pe(e,i,e.position,!1)}}return!0}(e,d)||function(e,t){var n,i,r;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(pe(e,i,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;i=e.position,e.position++,r=e.position}else J(n)?(pe(e,i,r,!0),ye(e,ge(e,!1,t)),i=r=e.position):e.position===e.lineStart&&me(e)?ce(e,"unexpected end of the document within a single quoted scalar"):(e.position++,r=e.position);ce(e,"unexpected end of the stream within a single quoted scalar")}(e,d)||function(e,t){var n,i,r,o,a,l,c;if(34!==(l=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return pe(e,n,e.position,!0),e.position++,!0;if(92===l){if(pe(e,n,e.position,!0),J(l=e.input.charCodeAt(++e.position)))ge(e,!1,t);else if(l<256&&ie[l])e.result+=re[l],e.position++;else if((a=120===(c=l)?2:117===c?4:85===c?8:0)>0){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<u;s+=1)if((f=e.implicitTypes[s]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(P.call(e.typeMap[e.kind||"fallback"],e.tag))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,s=0,u=(p=e.typeMap.multi[e.kind||"fallback"]).length;s<u;s+=1)if(e.tag.slice(0,p[s].tag.length)===p[s].tag){f=p[s];break}f||ce(e,"unknown tag !<"+e.tag+">"),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<e.length-1&&ce(e,"end of the stream or a document separator is expected")}function Ce(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 ae(e,t),i=e.indexOf("\0");for(-1!==i&&(n.position=i,ce(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.position<n.length-1;)ke(n);return n.documents}var xe={loadAll:function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var i=Ce(e,n);if("function"!=typeof t)return i;for(var r=0,o=i.length;r<o;r+=1)t(i[r])},load:function(e,t){var n=Ce(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new o("expected a single document in the stream, but found more")}}},Ie=Object.prototype.toString,Se=Object.prototype.hasOwnProperty,Oe=65279,je={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},Te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ne=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Fe(e){var t,i,r;if(t=e.toString(16).toUpperCase(),e<=255)i="x",r=2;else if(e<=65535)i="u",r=4;else{if(!(e<=4294967295))throw new o("code point within a string may not be greater than 0xFFFFFFFF");i="U",r=8}return"\\"+i+n.repeat("0",r-t.length)+t}function Ee(e){this.schema=e.schema||K,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=n.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,i,r,o,a,l,c;if(null===t)return{};for(n={},r=0,o=(i=Object.keys(t)).length;r<o;r+=1)a=i[r],l=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&Se.call(c.styleAliases,l)&&(l=c.styleAliases[l]),n[a]=l;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Me(e,t){for(var i,r=n.repeat(" ",t),o=0,a=-1,l="",c=e.length;o<c;)-1===(a=e.indexOf("\n",o))?(i=e.slice(o),o=c):(i=e.slice(o,a+1),o=a+1),i.length&&"\n"!==i&&(l+=r),l+=i;return l}function Le(e,t){return"\n"+n.repeat(" ",e.indent*t)}function _e(e){return 32===e||9===e}function De(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==Oe||65536<=e&&e<=1114111}function Ue(e){return De(e)&&e!==Oe&&13!==e&&10!==e}function qe(e,t,n){var i=Ue(e),r=i&&!_e(e);return(n?i:i&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!r)||Ue(t)&&!_e(t)&&35===e||58===t&&r}function Ye(e,t){var n,i=e.charCodeAt(t);return i>=55296&&i<=56319&&t+1<e.length&&(n=e.charCodeAt(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<e.length;u>=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<e.length;u>=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<i;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!i,r)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+Pe(t,e.indent)+We(Me(t,a));case 4:return">"+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<e.length;i>=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<o;r+=1)a=n[r],e.replacer&&(a=e.replacer.call(n,String(r),a)),(Ve(e,t+1,a,!0,!0,!1,!0)||void 0===a&&Ve(e,t+1,null,!0,!0,!1,!0))&&(i&&""===l||(l+=Le(e,t)),e.dump&&10===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=c,e.dump=l||"[]"}function Ge(e,t,n){var i,r,a,l,c,s;for(a=0,l=(r=n?e.explicitTypes:e.implicitTypes).length;a<l;a+=1)if(((c=r[a]).instanceOf||c.predicate)&&(!c.instanceOf||"object"==typeof t&&t instanceof c.instanceOf)&&(!c.predicate||c.predicate(t))){if(n?c.multi&&c.representName?e.tag=c.representName(t):e.tag=c.tag:e.tag="?",c.represent){if(s=e.styleMap[c.tag]||c.defaultStyle,"[object Function]"===Ie.call(c.represent))i=c.represent(t,s);else{if(!Se.call(c.represent,s))throw new o("!<"+c.tag+'> 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;r<a;r+=1)u="",i&&""===p||(u+=Le(e,t)),c=n[l=d[r]],e.replacer&&(c=e.replacer.call(n,l,c)),Ve(e,t+1,l,!0,!0,!0)&&((s=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(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;i<r;i+=1)l="",""!==c&&(l+=", "),e.condenseFlow&&(l+='"'),a=n[o=u[i]],e.replacer&&(a=e.replacer.call(n,o,a)),Ve(e,t,o,!1,!1)&&(e.dump.length>1024&&(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<r;i+=1)o=n[i],e.replacer&&(o=e.replacer.call(n,String(i),o)),(Ve(e,t,o,!1,!1)||void 0===o&&Ve(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=l,e.dump="["+a+"]"}(e,t,e.dump),f&&(e.dump="&ref_"+p+" "+e.dump));else{if("[object String]"!==s){if("[object Undefined]"===s)return!1;if(e.skipInvalid)return!1;throw new o("unacceptable kind of an object to dump "+s)}"?"!==e.tag&&Ke(e,e.dump,t,a,u)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",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<i;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function Je(e,t,n){var i,r,o;if(null!==e&&"object"==typeof e)if(-1!==(r=t.indexOf(e)))-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;r<o;r+=1)Je(e[r],t,n);else for(r=0,o=(i=Object.keys(e)).length;r<o;r+=1)Je(e[i[r]],t,n)}function Qe(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var ze=p,Xe=h,et=b,tt=O,nt=j,it=K,rt=xe.load,ot=xe.loadAll,at={dump:function(e,t){var n=new Ee(t=t||{});n.noRefs||Ze(e,n);var i=e;return n.replacer&&(i=n.replacer.call({"":i},"",i)),Ve(n,0,i,!0,!0)?n.dump+"\n":""}}.dump,lt=o,ct={binary:L,float:S,map:y,null:A,pairs:Y,set:B,timestamp:F,bool:v,int:C,merge:E,omap:U,seq:m,str:g},st=Qe("safeLoad","load"),ut=Qe("safeLoadAll","loadAll"),pt=Qe("safeDump","dump"),ft={Type:ze,Schema:Xe,FAILSAFE_SCHEMA:et,JSON_SCHEMA:tt,CORE_SCHEMA:nt,DEFAULT_SCHEMA:it,load:rt,loadAll:ot,dump:at,YAMLException:lt,types:ct,safeLoad:st,safeLoadAll:ut,safeDump:pt};e.CORE_SCHEMA=nt,e.DEFAULT_SCHEMA=it,e.FAILSAFE_SCHEMA=et,e.JSON_SCHEMA=tt,e.Schema=Xe,e.Type=ze,e.YAMLException=lt,e.default=ft,e.dump=at,e.load=rt,e.loadAll=ot,e.safeDump=pt,e.safeLoad=st,e.safeLoadAll=ut,e.types=ct,Object.defineProperty(e,"__esModule",{value:!0})}));
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.mjs b/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.mjs
new file mode 100644
index 00000000000..be71cad18da
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.mjs
@@ -0,0 +1,3851 @@
+
+/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (subject === null);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (subject !== null);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
+
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+var isNothing_1 = isNothing;
+var isObject_1 = isObject;
+var toArray_1 = toArray;
+var repeat_1 = repeat;
+var isNegativeZero_1 = isNegativeZero;
+var extend_1 = extend;
+
+var common = {
+ isNothing: isNothing_1,
+ isObject: isObject_1,
+ toArray: toArray_1,
+ repeat: repeat_1,
+ isNegativeZero: isNegativeZero_1,
+ extend: extend_1
+};
+
+// YAML error class. http://stackoverflow.com/questions/8458984
+
+
+function formatError(exception, compact) {
+ var where = '', message = exception.reason || '(unknown reason)';
+
+ if (!exception.mark) return message;
+
+ if (exception.mark.name) {
+ where += 'in "' + exception.mark.name + '" ';
+ }
+
+ where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
+
+ if (!compact && exception.mark.snippet) {
+ where += '\n\n' + exception.mark.snippet;
+ }
+
+ return message + ' ' + where;
+}
+
+
+function YAMLException$1(reason, mark) {
+ // Super constructor
+ Error.call(this);
+
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = formatError(this, false);
+
+ // Include stack trace in error object
+ if (Error.captureStackTrace) {
+ // Chrome and NodeJS
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ // FF, IE 10+ and Safari 6+. Fallback for others
+ this.stack = (new Error()).stack || '';
+ }
+}
+
+
+// Inherit from Error
+YAMLException$1.prototype = Object.create(Error.prototype);
+YAMLException$1.prototype.constructor = YAMLException$1;
+
+
+YAMLException$1.prototype.toString = function toString(compact) {
+ return this.name + ': ' + formatError(this, compact);
+};
+
+
+var exception = YAMLException$1;
+
+// get snippet for a single line, respecting maxLength
+function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
+ var head = '';
+ var tail = '';
+ var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
+
+ if (position - lineStart > maxHalfLength) {
+ head = ' ... ';
+ lineStart = position - maxHalfLength + head.length;
+ }
+
+ if (lineEnd - position > maxHalfLength) {
+ tail = ' ...';
+ lineEnd = position + maxHalfLength - tail.length;
+ }
+
+ return {
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, 'ā†’') + tail,
+ pos: position - lineStart + head.length // relative position
+ };
+}
+
+
+function padStart(string, max) {
+ return common.repeat(' ', max - string.length) + string;
+}
+
+
+function makeSnippet(mark, options) {
+ options = Object.create(options || null);
+
+ if (!mark.buffer) return null;
+
+ if (!options.maxLength) options.maxLength = 79;
+ if (typeof options.indent !== 'number') options.indent = 1;
+ if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
+ if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
+
+ var re = /\r?\n|\r|\0/g;
+ var lineStarts = [ 0 ];
+ var lineEnds = [];
+ var match;
+ var foundLineNo = -1;
+
+ while ((match = re.exec(mark.buffer))) {
+ lineEnds.push(match.index);
+ lineStarts.push(match.index + match[0].length);
+
+ if (mark.position <= match.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
+ }
+ }
+
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
+
+ var result = '', i, line;
+ var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
+ var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
+
+ for (i = 1; i <= options.linesBefore; i++) {
+ if (foundLineNo - i < 0) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo - i],
+ lineEnds[foundLineNo - i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
+ maxLineLength
+ );
+ result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n' + result;
+ }
+
+ line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
+ result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
+
+ for (i = 1; i <= options.linesAfter; i++) {
+ if (foundLineNo + i >= lineEnds.length) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo + i],
+ lineEnds[foundLineNo + i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
+ maxLineLength
+ );
+ result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ }
+
+ return result.replace(/\n$/, '');
+}
+
+
+var snippet = makeSnippet;
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'multi',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'representName',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (map !== null) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type$1(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.options = options; // keep original options in case user wants to extend this type later
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.representName = options['representName'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.multi = options['multi'] || false;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+var type = Type$1;
+
+/*eslint-disable max-len*/
+
+
+
+
+
+function compileList(schema, name) {
+ var result = [];
+
+ schema[name].forEach(function (currentType) {
+ var newIndex = result.length;
+
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag &&
+ previousType.kind === currentType.kind &&
+ previousType.multi === currentType.multi) {
+
+ newIndex = previousIndex;
+ }
+ });
+
+ result[newIndex] = currentType;
+ });
+
+ return result;
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length;
+
+ function collectType(type) {
+ if (type.multi) {
+ result.multi[type.kind].push(type);
+ result.multi['fallback'].push(type);
+ } else {
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
+ }
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+}
+
+
+function Schema$1(definition) {
+ return this.extend(definition);
+}
+
+
+Schema$1.prototype.extend = function extend(definition) {
+ var implicit = [];
+ var explicit = [];
+
+ if (definition instanceof type) {
+ // Schema.extend(type)
+ explicit.push(definition);
+
+ } else if (Array.isArray(definition)) {
+ // Schema.extend([ type1, type2, ... ])
+ explicit = explicit.concat(definition);
+
+ } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
+ // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
+
+ } else {
+ throw new exception('Schema.extend argument should be a Type, [ Type ], ' +
+ 'or a schema definition ({ implicit: [...], explicit: [...] })');
+ }
+
+ implicit.forEach(function (type$1) {
+ if (!(type$1 instanceof type)) {
+ throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ if (type$1.loadKind && type$1.loadKind !== 'scalar') {
+ throw new exception('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+
+ if (type$1.multi) {
+ throw new exception('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
+ }
+ });
+
+ explicit.forEach(function (type$1) {
+ if (!(type$1 instanceof type)) {
+ throw new exception('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+ });
+
+ var result = Object.create(Schema$1.prototype);
+
+ result.implicit = (this.implicit || []).concat(implicit);
+ result.explicit = (this.explicit || []).concat(explicit);
+
+ result.compiledImplicit = compileList(result, 'implicit');
+ result.compiledExplicit = compileList(result, 'explicit');
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
+
+ return result;
+};
+
+
+var schema = Schema$1;
+
+var str = new type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return data !== null ? data : ''; }
+});
+
+var seq = new type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return data !== null ? data : []; }
+});
+
+var map = new type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return data !== null ? data : {}; }
+});
+
+var failsafe = new schema({
+ explicit: [
+ str,
+ seq,
+ map
+ ]
+});
+
+function resolveYamlNull(data) {
+ if (data === null) return true;
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return object === null;
+}
+
+var _null = new type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; },
+ empty: function () { return ''; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+function resolveYamlBoolean(data) {
+ if (data === null) return false;
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
+}
+
+var bool = new type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (data === null) return false;
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) return false;
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'o') {
+ // base 8
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+ }
+
+ // base 10 (except 0)
+
+ // value should not start with `_`;
+ if (ch === '_') return false;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
+
+ return true;
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch;
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if (value === '0') return 0;
+
+ if (ch === '0') {
+ if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
+ if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
+ if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+}
+
+var int = new type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
+ octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
+ decimal: function (obj) { return obj.toString(10); },
+ /* eslint-disable max-len */
+ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
+ // .2e4, .2
+ // special case, seems not from spec
+ '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
+ // .inf
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ // .nan
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (data === null) return false;
+
+ if (!YAML_FLOAT_PATTERN.test(data) ||
+ // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data[data.length - 1] === '_') {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
+
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
+
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if (value === '.nan') {
+ return NaN;
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase': return '.nan';
+ case 'uppercase': return '.NAN';
+ case 'camelcase': return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '.inf';
+ case 'uppercase': return '.INF';
+ case 'camelcase': return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '-.inf';
+ case 'uppercase': return '-.INF';
+ case 'camelcase': return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
+}
+
+var float = new type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
+
+var json = failsafe.extend({
+ implicit: [
+ _null,
+ bool,
+ int,
+ float
+ ]
+});
+
+var core = json;
+
+var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (match === null) throw new Error('Date resolve error');
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if (match[9] === '-') delta = -delta;
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) date.setTime(date.getTime() - delta);
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+var timestamp = new type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
+
+function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
+}
+
+var merge = new type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
+
+/*eslint-disable no-bitwise*/
+
+
+
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (data === null) return false;
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) continue;
+
+ // Fail on illegal characters
+ if (code < 0) return false;
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ return new Uint8Array(result);
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === '[object Uint8Array]';
+}
+
+var binary = new type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
+
+var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+var _toString$2 = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (data === null) return true;
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if (_toString$2.call(pair) !== '[object Object]') return false;
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty$3.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
+ }
+
+ if (!pairHasKey) return false;
+
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return data !== null ? data : [];
+}
+
+var omap = new type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
+
+var _toString$1 = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (data === null) return true;
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if (_toString$1.call(pair) !== '[object Object]') return false;
+
+ keys = Object.keys(pair);
+
+ if (keys.length !== 1) return false;
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (data === null) return [];
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+var pairs = new type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
+
+var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (data === null) return true;
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty$2.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return data !== null ? data : {};
+}
+
+var set = new type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
+
+var _default = core.extend({
+ implicit: [
+ timestamp,
+ merge
+ ],
+ explicit: [
+ binary,
+ omap,
+ pairs,
+ set
+ ]
+});
+
+/*eslint-disable max-len,no-use-before-define*/
+
+
+
+
+
+
+
+var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function _class(obj) { return Object.prototype.toString.call(obj); }
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ /* eslint-disable indent */
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(
+ ((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00
+ );
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State$1(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || _default;
+ this.onWarning = options['onWarning'] || null;
+ // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
+ // if such documents have no explicit %YAML directive
+ this.legacy = options['legacy'] || false;
+
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ // position of first leading tab in the current line,
+ // used to make sure there are no tabs in the indentation
+ this.firstTabInLine = -1;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ var mark = {
+ name: state.filename,
+ buffer: state.input.slice(0, -1), // omit trailing \0
+ position: state.position,
+ line: state.line,
+ column: state.position - state.lineStart
+ };
+
+ mark.snippet = snippet(mark);
+
+ return new exception(message, mark);
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty$1.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state, 'tag prefix is malformed: ' + prefix);
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 0x09 ||
+ (0x20 <= _character && _character <= 0x10FFFF))) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty$1.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+}
+
+function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
+ startLine, startLineStart, startPos) {
+
+ var index, quantity;
+
+ // The output is a plain object here, so keys can only be strings.
+ // We need to convert keyNode to a string, but doing so can hang the process
+ // (deeply nested arrays that explode exponentially using aliases).
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state, 'nested arrays are not supported inside keys');
+ }
+
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
+
+ // Avoid code execution in load() via toString property
+ // (still use its own toString for arrays, timestamps,
+ // and whatever user schema extensions happen to have @@toStringTag)
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
+ keyNode = '[object Object]';
+ }
+
+
+ keyNode = String(keyNode);
+
+ if (_result === null) {
+ _result = {};
+ }
+
+ if (keyTag === 'tag:yaml.org,2002:merge') {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state.json &&
+ !_hasOwnProperty$1.call(overridableKeys, keyNode) &&
+ _hasOwnProperty$1.call(_result, keyNode)) {
+ state.line = startLine || state.line;
+ state.lineStart = startLineStart || state.lineStart;
+ state.position = startPos || state.position;
+ throwError(state, 'duplicated mapping key');
+ }
+
+ // used for this specific key only because Object.defineProperty is slow
+ if (keyNode === '__proto__') {
+ Object.defineProperty(_result, keyNode, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: valueNode
+ });
+ } else {
+ _result[keyNode] = valueNode;
+ }
+ delete overridableKeys[keyNode];
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x0A/* LF */) {
+ state.position++;
+ } else if (ch === 0x0D/* CR */) {
+ state.position++;
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+ state.firstTabInLine = -1;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
+ state.firstTabInLine = state.position;
+ }
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
+ ch === state.input.charCodeAt(_position + 1) &&
+ ch === state.input.charCodeAt(_position + 2)) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ ch === 0x23/* # */ ||
+ ch === 0x26/* & */ ||
+ ch === 0x2A/* * */ ||
+ ch === 0x21/* ! */ ||
+ ch === 0x7C/* | */ ||
+ ch === 0x3E/* > */ ||
+ ch === 0x27/* ' */ ||
+ ch === 0x22/* " */ ||
+ ch === 0x25/* % */ ||
+ ch === 0x40/* @ */ ||
+ ch === 0x60/* ` */) {
+ return false;
+ }
+
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (ch !== 0) {
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (ch === 0x23/* # */) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x22/* " */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _lineStart,
+ _pos,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = Object.create(null),
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ } else if (ch === 0x2C/* , */) {
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
+ throwError(state, "expected the node content, but found ','");
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (ch === 0x3F/* ? */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line; // Save the current line.
+ _lineStart = state.lineStart;
+ _pos = state.position;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (ch !== 0));
+ }
+ }
+
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ // except for the first content line (cf. Example 8.1)
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (emptyLines === 0) {
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else {
+ // Keep all line breaks except the header line break.
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ }
+
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (ch !== 0)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _keyLine,
+ _keyLineStart,
+ _keyPos,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ overridableKeys = Object.create(null),
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
+
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ // Neither implicit nor explicit notation.
+ // Reading is done. Go to the epilogue.
+ break;
+ }
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x3A/* : */) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+ }
+
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x21/* ! */) return false;
+
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x3C/* < */) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (ch === 0x21/* ! */) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state, 'tag name is malformed: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
+
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x26/* & */) return false;
+
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x2A/* * */) return false;
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ typeList,
+ type,
+ flowIndent,
+ blockIndent;
+
+ if (state.listener !== null) {
+ state.listener('open', state);
+ }
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (indentStatus === 1) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (indentStatus === 1) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (indentStatus === 0) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (state.tag === null) {
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+
+ } else if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!<?> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (state.tag !== '!') {
+ if (_hasOwnProperty$1.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+ } else {
+ // looking for multi type
+ type = null;
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
+
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type = typeList[typeIndex];
+ break;
+ }
+ }
+ }
+
+ if (!type) {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result, state.tag);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ }
+
+ if (state.listener !== null) {
+ state.listener('close', state);
+ }
+ return state.tag !== null || state.anchor !== null || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = Object.create(null);
+ state.anchorMap = Object.create(null);
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) break;
+
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (ch !== 0) readLineBreak(state);
+
+ if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (state.lineIndent === 0 &&
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State$1(input, options);
+
+ var nullpos = input.indexOf('\0');
+
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll$1(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ var documents = loadDocuments(input, options);
+
+ if (typeof iterator !== 'function') {
+ return documents;
+ }
+
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load$1(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (documents.length === 0) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new exception('expected a single document in the stream, but found more');
+}
+
+
+var loadAll_1 = loadAll$1;
+var load_1 = load$1;
+
+var loader = {
+ loadAll: loadAll_1,
+ load: load_1
+};
+
+/*eslint-disable no-use-before-define*/
+
+
+
+
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_BOM = 0xFEFF;
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_EQUALS = 0x3D; /* = */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new exception('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+
+var QUOTING_TYPE_SINGLE = 1,
+ QUOTING_TYPE_DOUBLE = 2;
+
+function State(options) {
+ this.schema = options['schema'] || _default;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.noArrayIndent = options['noArrayIndent'] || false;
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+ this.noRefs = options['noRefs'] || false;
+ this.noCompatMode = options['noCompatMode'] || false;
+ this.condenseFlow = options['condenseFlow'] || false;
+ this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
+ this.forceQuotes = options['forceQuotes'] || false;
+ this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+// Indents every line in a string. Empty lines (\n only) are not indented.
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+
+ if (line.length && line !== '\n') result += ind;
+
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// [33] s-white ::= s-space | s-tab
+function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+}
+
+// Returns true if the character can be printed without escaping.
+// From YAML 1.2: "any allowed characters known to be non-printable
+// should also be escaped. [However,] This isnā€™t mandatory"
+// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
+ || (0x10000 <= c && c <= 0x10FFFF);
+}
+
+// [34] ns-char ::= nb-char - s-white
+// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+// [26] b-char ::= b-line-feed | b-carriage-return
+// Including s-white (for some reason, examples doesn't match specs in this aspect)
+// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
+function isNsCharOrWhitespace(c) {
+ return isPrintable(c)
+ && c !== CHAR_BOM
+ // - b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+}
+
+// [127] ns-plain-safe(c) ::= c = flow-out ā‡’ ns-plain-safe-out
+// c = flow-in ā‡’ ns-plain-safe-in
+// c = block-key ā‡’ ns-plain-safe-out
+// c = flow-key ā‡’ ns-plain-safe-in
+// [128] ns-plain-safe-out ::= ns-char
+// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
+// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - ā€œ:ā€ - ā€œ#ā€ )
+// | ( /* An ns-char preceding */ ā€œ#ā€ )
+// | ( ā€œ:ā€ /* Followed by an ns-plain-safe(c) */ )
+function isPlainSafe(c, prev, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
+ return (
+ // ns-plain-safe
+ inblock ? // c = flow-in
+ cIsNsCharOrWhitespace
+ : cIsNsCharOrWhitespace
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ )
+ // ns-plain-char
+ && c !== CHAR_SHARP // false on '#'
+ && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
+ || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
+ || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
+}
+
+// Simplified test for values allowed as the first character in plain style.
+function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ // No support of ( ( ā€œ?ā€ | ā€œ:ā€ | ā€œ-ā€ ) /* Followed by an ns-plain-safe(c)) */ ) part
+ return isPrintable(c) && c !== CHAR_BOM
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // ā€œ-ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ,ā€ | ā€œ[ā€ | ā€œ]ā€ | ā€œ{ā€ | ā€œ}ā€
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | ā€œ#ā€ | ā€œ&ā€ | ā€œ*ā€ | ā€œ!ā€ | ā€œ|ā€ | ā€œ=ā€ | ā€œ>ā€ | ā€œ'ā€ | ā€œ"ā€
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | ā€œ%ā€ | ā€œ@ā€ | ā€œ`ā€)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+}
+
+// Simplified test for values allowed as the last character in plain style.
+function isPlainSafeLast(c) {
+ // just not whitespace or colon, it will be checked to be plain character later
+ return !isWhitespace(c) && c !== CHAR_COLON;
+}
+
+// Same as 'string'.codePointAt(pos), but works in older browsers.
+function codePointAt(string, pos) {
+ var first = string.charCodeAt(pos), second;
+ if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
+ second = string.charCodeAt(pos + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+}
+
+// Determines whether block indentation indicator is required.
+function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+}
+
+var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+// Determines which scalar styles are possible and returns the preferred style.
+// lineWidth = -1 => no limit.
+// Pre-conditions: str.length > 0.
+// Post-conditions:
+// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
+ testAmbiguousType, quotingType, forceQuotes, inblock) {
+
+ var i;
+ var char = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(codePointAt(string, 0))
+ && isPlainSafeLast(codePointAt(string, string.length - 1));
+
+ if (singleLineOnly || forceQuotes) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ if (plain && !forceQuotes && !testAmbiguousType(string)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+}
+
+// Note: line breaking/folding is implemented for only the folded style.
+// NB. We drop the last trailing newline (if any) of a returned block scalar
+// since the dumper adds its own newline. This always works:
+// ā€¢ No ending newline => unaffected; already using strip "-" chomping.
+// ā€¢ Ending newline => removed then restored.
+// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+function writeScalar(state, string, level, iskey, inblock) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
+ }
+ }
+
+ var indent = state.indent * Math.max(1, level); // no 0-indent scalars
+ // As indentation gets deeper, let the width decrease monotonically
+ // to the lower bound min(state.lineWidth, 40).
+ // Note that this implies
+ // state.lineWidth ā‰¤ 40 + state.indent: width is fixed at the lower bound.
+ // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
+ // This behaves better than a constant minimum width which disallows narrower options,
+ // or an indent threshold which causes the width to suddenly increase.
+ var lineWidth = state.lineWidth === -1
+ ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
+
+ // Without knowing if keys are implicit/explicit, assume implicit for safety.
+ var singleLineOnly = iskey
+ // No block styles in flow mode.
+ || (state.flowLevel > -1 && level >= state.flowLevel);
+ function testAmbiguity(string) {
+ return testImplicitResolving(state, string);
+ }
+
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
+ testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
+
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string) + '"';
+ default:
+ throw new exception('impossible error: invalid scalar style');
+ }
+ }());
+}
+
+// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+}
+
+// (See the note for writeScalar.)
+function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+}
+
+// Note: a long line without a suitable break point will exceed the width limit.
+// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlinesā€”
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+}
+
+// Greedy line breaking.
+// Picks the longest line under the limit each time,
+// otherwise settles for the shortest line over the limit.
+// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
+
+ // By the invariants, start <= length-1, so there is something left over.
+ // It is either the whole string or a part starting from non-whitespace.
+ result += '\n';
+ // Insert a break if the remainder is too long and there is a break available.
+ if (line.length - start > width && curr > start) {
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
+ } else {
+ result += line.slice(start);
+ }
+
+ return result.slice(1); // drop extra \n joiner
+}
+
+// Escapes a double-quoted string.
+function escapeString(string) {
+ var result = '';
+ var char = 0;
+ var escapeSeq;
+
+ for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ escapeSeq = ESCAPE_SEQUENCES[char];
+
+ if (!escapeSeq && isPrintable(char)) {
+ result += string[i];
+ if (char >= 0x10000) result += string[i + 1];
+ } else {
+ result += escapeSeq || encodeHex(char);
+ }
+ }
+
+ return result;
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level, value, false, false) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level, null, false, false))) {
+
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level + 1, value, true, true, false, true) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level + 1, null, true, true, false, true))) {
+
+ if (!compact || _result !== '') {
+ _result += generateNextLine(state, level);
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
+
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+
+ pairBuffer = '';
+ if (_result !== '') pairBuffer += ', ';
+
+ if (state.condenseFlow) pairBuffer += '"';
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) pairBuffer += '? ';
+
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new exception('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || _result !== '') {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ if (explicit) {
+ if (type.multi && type.representName) {
+ state.tag = type.representName(object);
+ } else {
+ state.tag = type.tag;
+ }
+ } else {
+ state.tag = '?';
+ }
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if (_toString.call(type.represent) === '[object Function]') {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new exception('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey, isblockseq) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+ var inblock = block;
+ var tagStr;
+
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
+
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type === '[object Object]') {
+ if (block && (Object.keys(state.dump).length !== 0)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object Array]') {
+ if (block && (state.dump.length !== 0)) {
+ if (state.noArrayIndent && !isblockseq && level > 0) {
+ writeBlockSequence(state, level - 1, state.dump, compact);
+ } else {
+ writeBlockSequence(state, level, state.dump, compact);
+ }
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object String]') {
+ if (state.tag !== '?') {
+ writeScalar(state, state.dump, level, iskey, inblock);
+ }
+ } else if (type === '[object Undefined]') {
+ return false;
+ } else {
+ if (state.skipInvalid) return false;
+ throw new exception('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (state.tag !== null && state.tag !== '?') {
+ // Need to encode all characters except those allowed by the spec:
+ //
+ // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
+ // [36] ns-hex-digit ::= ns-dec-digit
+ // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
+ // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
+ // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | ā€œ-ā€
+ // [39] ns-uri-char ::= ā€œ%ā€ ns-hex-digit ns-hex-digit | ns-word-char | ā€œ#ā€
+ // | ā€œ;ā€ | ā€œ/ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ@ā€ | ā€œ&ā€ | ā€œ=ā€ | ā€œ+ā€ | ā€œ$ā€ | ā€œ,ā€
+ // | ā€œ_ā€ | ā€œ.ā€ | ā€œ!ā€ | ā€œ~ā€ | ā€œ*ā€ | ā€œ'ā€ | ā€œ(ā€ | ā€œ)ā€ | ā€œ[ā€ | ā€œ]ā€
+ //
+ // Also need to encode '!' because it has special meaning (end of tag prefix).
+ //
+ tagStr = encodeURI(
+ state.tag[0] === '!' ? state.tag.slice(1) : state.tag
+ ).replace(/!/g, '%21');
+
+ if (state.tag[0] === '!') {
+ tagStr = '!' + tagStr;
+ } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
+ tagStr = '!!' + tagStr.slice(18);
+ } else {
+ tagStr = '!<' + tagStr + '>';
+ }
+
+ state.dump = tagStr + ' ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (object !== null && typeof object === 'object') {
+ index = objects.indexOf(object);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump$1(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ if (!state.noRefs) getDuplicateReferences(input, state);
+
+ var value = input;
+
+ if (state.replacer) {
+ value = state.replacer.call({ '': value }, '', value);
+ }
+
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
+
+ return '';
+}
+
+var dump_1 = dump$1;
+
+var dumper = {
+ dump: dump_1
+};
+
+function renamed(from, to) {
+ return function () {
+ throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
+ 'Use yaml.' + to + ' instead, which is now safe by default.');
+ };
+}
+
+
+var Type = type;
+var Schema = schema;
+var FAILSAFE_SCHEMA = failsafe;
+var JSON_SCHEMA = json;
+var CORE_SCHEMA = core;
+var DEFAULT_SCHEMA = _default;
+var load = loader.load;
+var loadAll = loader.loadAll;
+var dump = dumper.dump;
+var YAMLException = exception;
+
+// Re-export all types in case user wants to create custom schema
+var types = {
+ binary: binary,
+ float: float,
+ map: map,
+ null: _null,
+ pairs: pairs,
+ set: set,
+ timestamp: timestamp,
+ bool: bool,
+ int: int,
+ merge: merge,
+ omap: omap,
+ seq: seq,
+ str: str
+};
+
+// Removed functions from JS-YAML 3.0.x
+var safeLoad = renamed('safeLoad', 'load');
+var safeLoadAll = renamed('safeLoadAll', 'loadAll');
+var safeDump = renamed('safeDump', 'dump');
+
+var jsYaml = {
+ Type: Type,
+ Schema: Schema,
+ FAILSAFE_SCHEMA: FAILSAFE_SCHEMA,
+ JSON_SCHEMA: JSON_SCHEMA,
+ CORE_SCHEMA: CORE_SCHEMA,
+ DEFAULT_SCHEMA: DEFAULT_SCHEMA,
+ load: load,
+ loadAll: loadAll,
+ dump: dump,
+ YAMLException: YAMLException,
+ types: types,
+ safeLoad: safeLoad,
+ safeLoadAll: safeLoadAll,
+ safeDump: safeDump
+};
+
+export default jsYaml;
+export { CORE_SCHEMA, DEFAULT_SCHEMA, FAILSAFE_SCHEMA, JSON_SCHEMA, Schema, Type, YAMLException, dump, load, loadAll, safeDump, safeLoad, safeLoadAll, types };
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/index.js b/tools/node_modules/eslint/node_modules/js-yaml/index.js
index 13744352448..bcb7eba7ada 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/index.js
+++ b/tools/node_modules/eslint/node_modules/js-yaml/index.js
@@ -1,7 +1,47 @@
'use strict';
-var yaml = require('./lib/js-yaml.js');
+var loader = require('./lib/loader');
+var dumper = require('./lib/dumper');
-module.exports = yaml;
+function renamed(from, to) {
+ return function () {
+ throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +
+ 'Use yaml.' + to + ' instead, which is now safe by default.');
+ };
+}
+
+
+module.exports.Type = require('./lib/type');
+module.exports.Schema = require('./lib/schema');
+module.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');
+module.exports.JSON_SCHEMA = require('./lib/schema/json');
+module.exports.CORE_SCHEMA = require('./lib/schema/core');
+module.exports.DEFAULT_SCHEMA = require('./lib/schema/default');
+module.exports.load = loader.load;
+module.exports.loadAll = loader.loadAll;
+module.exports.dump = dumper.dump;
+module.exports.YAMLException = require('./lib/exception');
+
+// Re-export all types in case user wants to create custom schema
+module.exports.types = {
+ binary: require('./lib/type/binary'),
+ float: require('./lib/type/float'),
+ map: require('./lib/type/map'),
+ null: require('./lib/type/null'),
+ pairs: require('./lib/type/pairs'),
+ set: require('./lib/type/set'),
+ timestamp: require('./lib/type/timestamp'),
+ bool: require('./lib/type/bool'),
+ int: require('./lib/type/int'),
+ merge: require('./lib/type/merge'),
+ omap: require('./lib/type/omap'),
+ seq: require('./lib/type/seq'),
+ str: require('./lib/type/str')
+};
+
+// Removed functions from JS-YAML 3.0.x
+module.exports.safeLoad = renamed('safeLoad', 'load');
+module.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');
+module.exports.safeDump = renamed('safeDump', 'dump');
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/common.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/common.js
new file mode 100644
index 00000000000..25ef7d8e4a3
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/common.js
@@ -0,0 +1,59 @@
+'use strict';
+
+
+function isNothing(subject) {
+ return (typeof subject === 'undefined') || (subject === null);
+}
+
+
+function isObject(subject) {
+ return (typeof subject === 'object') && (subject !== null);
+}
+
+
+function toArray(sequence) {
+ if (Array.isArray(sequence)) return sequence;
+ else if (isNothing(sequence)) return [];
+
+ return [ sequence ];
+}
+
+
+function extend(target, source) {
+ var index, length, key, sourceKeys;
+
+ if (source) {
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, length = sourceKeys.length; index < length; index += 1) {
+ key = sourceKeys[index];
+ target[key] = source[key];
+ }
+ }
+
+ return target;
+}
+
+
+function repeat(string, count) {
+ var result = '', cycle;
+
+ for (cycle = 0; cycle < count; cycle += 1) {
+ result += string;
+ }
+
+ return result;
+}
+
+
+function isNegativeZero(number) {
+ return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
+}
+
+
+module.exports.isNothing = isNothing;
+module.exports.isObject = isObject;
+module.exports.toArray = toArray;
+module.exports.repeat = repeat;
+module.exports.isNegativeZero = isNegativeZero;
+module.exports.extend = extend;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/dumper.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/dumper.js
new file mode 100644
index 00000000000..f357a6aee98
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/dumper.js
@@ -0,0 +1,965 @@
+'use strict';
+
+/*eslint-disable no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var DEFAULT_SCHEMA = require('./schema/default');
+
+var _toString = Object.prototype.toString;
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+var CHAR_BOM = 0xFEFF;
+var CHAR_TAB = 0x09; /* Tab */
+var CHAR_LINE_FEED = 0x0A; /* LF */
+var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
+var CHAR_SPACE = 0x20; /* Space */
+var CHAR_EXCLAMATION = 0x21; /* ! */
+var CHAR_DOUBLE_QUOTE = 0x22; /* " */
+var CHAR_SHARP = 0x23; /* # */
+var CHAR_PERCENT = 0x25; /* % */
+var CHAR_AMPERSAND = 0x26; /* & */
+var CHAR_SINGLE_QUOTE = 0x27; /* ' */
+var CHAR_ASTERISK = 0x2A; /* * */
+var CHAR_COMMA = 0x2C; /* , */
+var CHAR_MINUS = 0x2D; /* - */
+var CHAR_COLON = 0x3A; /* : */
+var CHAR_EQUALS = 0x3D; /* = */
+var CHAR_GREATER_THAN = 0x3E; /* > */
+var CHAR_QUESTION = 0x3F; /* ? */
+var CHAR_COMMERCIAL_AT = 0x40; /* @ */
+var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
+var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
+var CHAR_GRAVE_ACCENT = 0x60; /* ` */
+var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
+var CHAR_VERTICAL_LINE = 0x7C; /* | */
+var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
+
+var ESCAPE_SEQUENCES = {};
+
+ESCAPE_SEQUENCES[0x00] = '\\0';
+ESCAPE_SEQUENCES[0x07] = '\\a';
+ESCAPE_SEQUENCES[0x08] = '\\b';
+ESCAPE_SEQUENCES[0x09] = '\\t';
+ESCAPE_SEQUENCES[0x0A] = '\\n';
+ESCAPE_SEQUENCES[0x0B] = '\\v';
+ESCAPE_SEQUENCES[0x0C] = '\\f';
+ESCAPE_SEQUENCES[0x0D] = '\\r';
+ESCAPE_SEQUENCES[0x1B] = '\\e';
+ESCAPE_SEQUENCES[0x22] = '\\"';
+ESCAPE_SEQUENCES[0x5C] = '\\\\';
+ESCAPE_SEQUENCES[0x85] = '\\N';
+ESCAPE_SEQUENCES[0xA0] = '\\_';
+ESCAPE_SEQUENCES[0x2028] = '\\L';
+ESCAPE_SEQUENCES[0x2029] = '\\P';
+
+var DEPRECATED_BOOLEANS_SYNTAX = [
+ 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
+ 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
+];
+
+var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
+
+function compileStyleMap(schema, map) {
+ var result, keys, index, length, tag, style, type;
+
+ if (map === null) return {};
+
+ result = {};
+ keys = Object.keys(map);
+
+ for (index = 0, length = keys.length; index < length; index += 1) {
+ tag = keys[index];
+ style = String(map[tag]);
+
+ if (tag.slice(0, 2) === '!!') {
+ tag = 'tag:yaml.org,2002:' + tag.slice(2);
+ }
+ type = schema.compiledTypeMap['fallback'][tag];
+
+ if (type && _hasOwnProperty.call(type.styleAliases, style)) {
+ style = type.styleAliases[style];
+ }
+
+ result[tag] = style;
+ }
+
+ return result;
+}
+
+function encodeHex(character) {
+ var string, handle, length;
+
+ string = character.toString(16).toUpperCase();
+
+ if (character <= 0xFF) {
+ handle = 'x';
+ length = 2;
+ } else if (character <= 0xFFFF) {
+ handle = 'u';
+ length = 4;
+ } else if (character <= 0xFFFFFFFF) {
+ handle = 'U';
+ length = 8;
+ } else {
+ throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
+ }
+
+ return '\\' + handle + common.repeat('0', length - string.length) + string;
+}
+
+
+var QUOTING_TYPE_SINGLE = 1,
+ QUOTING_TYPE_DOUBLE = 2;
+
+function State(options) {
+ this.schema = options['schema'] || DEFAULT_SCHEMA;
+ this.indent = Math.max(1, (options['indent'] || 2));
+ this.noArrayIndent = options['noArrayIndent'] || false;
+ this.skipInvalid = options['skipInvalid'] || false;
+ this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
+ this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
+ this.sortKeys = options['sortKeys'] || false;
+ this.lineWidth = options['lineWidth'] || 80;
+ this.noRefs = options['noRefs'] || false;
+ this.noCompatMode = options['noCompatMode'] || false;
+ this.condenseFlow = options['condenseFlow'] || false;
+ this.quotingType = options['quotingType'] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
+ this.forceQuotes = options['forceQuotes'] || false;
+ this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.explicitTypes = this.schema.compiledExplicit;
+
+ this.tag = null;
+ this.result = '';
+
+ this.duplicates = [];
+ this.usedDuplicates = null;
+}
+
+// Indents every line in a string. Empty lines (\n only) are not indented.
+function indentString(string, spaces) {
+ var ind = common.repeat(' ', spaces),
+ position = 0,
+ next = -1,
+ result = '',
+ line,
+ length = string.length;
+
+ while (position < length) {
+ next = string.indexOf('\n', position);
+ if (next === -1) {
+ line = string.slice(position);
+ position = length;
+ } else {
+ line = string.slice(position, next + 1);
+ position = next + 1;
+ }
+
+ if (line.length && line !== '\n') result += ind;
+
+ result += line;
+ }
+
+ return result;
+}
+
+function generateNextLine(state, level) {
+ return '\n' + common.repeat(' ', state.indent * level);
+}
+
+function testImplicitResolving(state, str) {
+ var index, length, type;
+
+ for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
+ type = state.implicitTypes[index];
+
+ if (type.resolve(str)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// [33] s-white ::= s-space | s-tab
+function isWhitespace(c) {
+ return c === CHAR_SPACE || c === CHAR_TAB;
+}
+
+// Returns true if the character can be printed without escaping.
+// From YAML 1.2: "any allowed characters known to be non-printable
+// should also be escaped. [However,] This isnā€™t mandatory"
+// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
+function isPrintable(c) {
+ return (0x00020 <= c && c <= 0x00007E)
+ || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
+ || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)
+ || (0x10000 <= c && c <= 0x10FFFF);
+}
+
+// [34] ns-char ::= nb-char - s-white
+// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
+// [26] b-char ::= b-line-feed | b-carriage-return
+// Including s-white (for some reason, examples doesn't match specs in this aspect)
+// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark
+function isNsCharOrWhitespace(c) {
+ return isPrintable(c)
+ && c !== CHAR_BOM
+ // - b-char
+ && c !== CHAR_CARRIAGE_RETURN
+ && c !== CHAR_LINE_FEED;
+}
+
+// [127] ns-plain-safe(c) ::= c = flow-out ā‡’ ns-plain-safe-out
+// c = flow-in ā‡’ ns-plain-safe-in
+// c = block-key ā‡’ ns-plain-safe-out
+// c = flow-key ā‡’ ns-plain-safe-in
+// [128] ns-plain-safe-out ::= ns-char
+// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator
+// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - ā€œ:ā€ - ā€œ#ā€ )
+// | ( /* An ns-char preceding */ ā€œ#ā€ )
+// | ( ā€œ:ā€ /* Followed by an ns-plain-safe(c) */ )
+function isPlainSafe(c, prev, inblock) {
+ var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
+ var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
+ return (
+ // ns-plain-safe
+ inblock ? // c = flow-in
+ cIsNsCharOrWhitespace
+ : cIsNsCharOrWhitespace
+ // - c-flow-indicator
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ )
+ // ns-plain-char
+ && c !== CHAR_SHARP // false on '#'
+ && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '
+ || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'
+ || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'
+}
+
+// Simplified test for values allowed as the first character in plain style.
+function isPlainSafeFirst(c) {
+ // Uses a subset of ns-char - c-indicator
+ // where ns-char = nb-char - s-white.
+ // No support of ( ( ā€œ?ā€ | ā€œ:ā€ | ā€œ-ā€ ) /* Followed by an ns-plain-safe(c)) */ ) part
+ return isPrintable(c) && c !== CHAR_BOM
+ && !isWhitespace(c) // - s-white
+ // - (c-indicator ::=
+ // ā€œ-ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ,ā€ | ā€œ[ā€ | ā€œ]ā€ | ā€œ{ā€ | ā€œ}ā€
+ && c !== CHAR_MINUS
+ && c !== CHAR_QUESTION
+ && c !== CHAR_COLON
+ && c !== CHAR_COMMA
+ && c !== CHAR_LEFT_SQUARE_BRACKET
+ && c !== CHAR_RIGHT_SQUARE_BRACKET
+ && c !== CHAR_LEFT_CURLY_BRACKET
+ && c !== CHAR_RIGHT_CURLY_BRACKET
+ // | ā€œ#ā€ | ā€œ&ā€ | ā€œ*ā€ | ā€œ!ā€ | ā€œ|ā€ | ā€œ=ā€ | ā€œ>ā€ | ā€œ'ā€ | ā€œ"ā€
+ && c !== CHAR_SHARP
+ && c !== CHAR_AMPERSAND
+ && c !== CHAR_ASTERISK
+ && c !== CHAR_EXCLAMATION
+ && c !== CHAR_VERTICAL_LINE
+ && c !== CHAR_EQUALS
+ && c !== CHAR_GREATER_THAN
+ && c !== CHAR_SINGLE_QUOTE
+ && c !== CHAR_DOUBLE_QUOTE
+ // | ā€œ%ā€ | ā€œ@ā€ | ā€œ`ā€)
+ && c !== CHAR_PERCENT
+ && c !== CHAR_COMMERCIAL_AT
+ && c !== CHAR_GRAVE_ACCENT;
+}
+
+// Simplified test for values allowed as the last character in plain style.
+function isPlainSafeLast(c) {
+ // just not whitespace or colon, it will be checked to be plain character later
+ return !isWhitespace(c) && c !== CHAR_COLON;
+}
+
+// Same as 'string'.codePointAt(pos), but works in older browsers.
+function codePointAt(string, pos) {
+ var first = string.charCodeAt(pos), second;
+ if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {
+ second = string.charCodeAt(pos + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+ return first;
+}
+
+// Determines whether block indentation indicator is required.
+function needIndentIndicator(string) {
+ var leadingSpaceRe = /^\n* /;
+ return leadingSpaceRe.test(string);
+}
+
+var STYLE_PLAIN = 1,
+ STYLE_SINGLE = 2,
+ STYLE_LITERAL = 3,
+ STYLE_FOLDED = 4,
+ STYLE_DOUBLE = 5;
+
+// Determines which scalar styles are possible and returns the preferred style.
+// lineWidth = -1 => no limit.
+// Pre-conditions: str.length > 0.
+// Post-conditions:
+// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
+// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
+// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
+function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,
+ testAmbiguousType, quotingType, forceQuotes, inblock) {
+
+ var i;
+ var char = 0;
+ var prevChar = null;
+ var hasLineBreak = false;
+ var hasFoldableLine = false; // only checked if shouldTrackWidth
+ var shouldTrackWidth = lineWidth !== -1;
+ var previousLineBreak = -1; // count the first line correctly
+ var plain = isPlainSafeFirst(codePointAt(string, 0))
+ && isPlainSafeLast(codePointAt(string, string.length - 1));
+
+ if (singleLineOnly || forceQuotes) {
+ // Case: no block styles.
+ // Check for disallowed characters to rule out plain and single.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ } else {
+ // Case: block styles permitted.
+ for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ if (char === CHAR_LINE_FEED) {
+ hasLineBreak = true;
+ // Check if any line can be folded.
+ if (shouldTrackWidth) {
+ hasFoldableLine = hasFoldableLine ||
+ // Foldable line = too long, and not more-indented.
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' ');
+ previousLineBreak = i;
+ }
+ } else if (!isPrintable(char)) {
+ return STYLE_DOUBLE;
+ }
+ plain = plain && isPlainSafe(char, prevChar, inblock);
+ prevChar = char;
+ }
+ // in case the end is missing a \n
+ hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
+ (i - previousLineBreak - 1 > lineWidth &&
+ string[previousLineBreak + 1] !== ' '));
+ }
+ // Although every style can represent \n without escaping, prefer block styles
+ // for multiline, since they're more readable and they don't add empty lines.
+ // Also prefer folding a super-long line.
+ if (!hasLineBreak && !hasFoldableLine) {
+ // Strings interpretable as another type have to be quoted;
+ // e.g. the string 'true' vs. the boolean true.
+ if (plain && !forceQuotes && !testAmbiguousType(string)) {
+ return STYLE_PLAIN;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+ }
+ // Edge case: block indentation indicator can only have one digit.
+ if (indentPerLevel > 9 && needIndentIndicator(string)) {
+ return STYLE_DOUBLE;
+ }
+ // At this point we know block styles are valid.
+ // Prefer literal style unless we want to fold.
+ if (!forceQuotes) {
+ return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
+ }
+ return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
+}
+
+// Note: line breaking/folding is implemented for only the folded style.
+// NB. We drop the last trailing newline (if any) of a returned block scalar
+// since the dumper adds its own newline. This always works:
+// ā€¢ No ending newline => unaffected; already using strip "-" chomping.
+// ā€¢ Ending newline => removed then restored.
+// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
+function writeScalar(state, string, level, iskey, inblock) {
+ state.dump = (function () {
+ if (string.length === 0) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
+ }
+ if (!state.noCompatMode) {
+ if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
+ return state.quotingType === QUOTING_TYPE_DOUBLE ? ('"' + string + '"') : ("'" + string + "'");
+ }
+ }
+
+ var indent = state.indent * Math.max(1, level); // no 0-indent scalars
+ // As indentation gets deeper, let the width decrease monotonically
+ // to the lower bound min(state.lineWidth, 40).
+ // Note that this implies
+ // state.lineWidth ā‰¤ 40 + state.indent: width is fixed at the lower bound.
+ // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
+ // This behaves better than a constant minimum width which disallows narrower options,
+ // or an indent threshold which causes the width to suddenly increase.
+ var lineWidth = state.lineWidth === -1
+ ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
+
+ // Without knowing if keys are implicit/explicit, assume implicit for safety.
+ var singleLineOnly = iskey
+ // No block styles in flow mode.
+ || (state.flowLevel > -1 && level >= state.flowLevel);
+ function testAmbiguity(string) {
+ return testImplicitResolving(state, string);
+ }
+
+ switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,
+ testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {
+
+ case STYLE_PLAIN:
+ return string;
+ case STYLE_SINGLE:
+ return "'" + string.replace(/'/g, "''") + "'";
+ case STYLE_LITERAL:
+ return '|' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(string, indent));
+ case STYLE_FOLDED:
+ return '>' + blockHeader(string, state.indent)
+ + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
+ case STYLE_DOUBLE:
+ return '"' + escapeString(string, lineWidth) + '"';
+ default:
+ throw new YAMLException('impossible error: invalid scalar style');
+ }
+ }());
+}
+
+// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
+function blockHeader(string, indentPerLevel) {
+ var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
+
+ // note the special case: the string '\n' counts as a "trailing" empty line.
+ var clip = string[string.length - 1] === '\n';
+ var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
+ var chomp = keep ? '+' : (clip ? '' : '-');
+
+ return indentIndicator + chomp + '\n';
+}
+
+// (See the note for writeScalar.)
+function dropEndingNewline(string) {
+ return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
+}
+
+// Note: a long line without a suitable break point will exceed the width limit.
+// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
+function foldString(string, width) {
+ // In folded style, $k$ consecutive newlines output as $k+1$ newlinesā€”
+ // unless they're before or after a more-indented line, or at the very
+ // beginning or end, in which case $k$ maps to $k$.
+ // Therefore, parse each chunk as newline(s) followed by a content line.
+ var lineRe = /(\n+)([^\n]*)/g;
+
+ // first line (possibly an empty line)
+ var result = (function () {
+ var nextLF = string.indexOf('\n');
+ nextLF = nextLF !== -1 ? nextLF : string.length;
+ lineRe.lastIndex = nextLF;
+ return foldLine(string.slice(0, nextLF), width);
+ }());
+ // If we haven't reached the first content line yet, don't add an extra \n.
+ var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
+ var moreIndented;
+
+ // rest of the lines
+ var match;
+ while ((match = lineRe.exec(string))) {
+ var prefix = match[1], line = match[2];
+ moreIndented = (line[0] === ' ');
+ result += prefix
+ + (!prevMoreIndented && !moreIndented && line !== ''
+ ? '\n' : '')
+ + foldLine(line, width);
+ prevMoreIndented = moreIndented;
+ }
+
+ return result;
+}
+
+// Greedy line breaking.
+// Picks the longest line under the limit each time,
+// otherwise settles for the shortest line over the limit.
+// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
+function foldLine(line, width) {
+ if (line === '' || line[0] === ' ') return line;
+
+ // Since a more-indented line adds a \n, breaks can't be followed by a space.
+ var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
+ var match;
+ // start is an inclusive index. end, curr, and next are exclusive.
+ var start = 0, end, curr = 0, next = 0;
+ var result = '';
+
+ // Invariants: 0 <= start <= length-1.
+ // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
+ // Inside the loop:
+ // A match implies length >= 2, so curr and next are <= length-2.
+ while ((match = breakRe.exec(line))) {
+ next = match.index;
+ // maintain invariant: curr - start <= width
+ if (next - start > width) {
+ end = (curr > start) ? curr : next; // derive end <= length-2
+ result += '\n' + line.slice(start, end);
+ // skip the space that was output as \n
+ start = end + 1; // derive start <= length-1
+ }
+ curr = next;
+ }
+
+ // By the invariants, start <= length-1, so there is something left over.
+ // It is either the whole string or a part starting from non-whitespace.
+ result += '\n';
+ // Insert a break if the remainder is too long and there is a break available.
+ if (line.length - start > width && curr > start) {
+ result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
+ } else {
+ result += line.slice(start);
+ }
+
+ return result.slice(1); // drop extra \n joiner
+}
+
+// Escapes a double-quoted string.
+function escapeString(string) {
+ var result = '';
+ var char = 0;
+ var escapeSeq;
+
+ for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {
+ char = codePointAt(string, i);
+ escapeSeq = ESCAPE_SEQUENCES[char];
+
+ if (!escapeSeq && isPrintable(char)) {
+ result += string[i];
+ if (char >= 0x10000) result += string[i + 1];
+ } else {
+ result += escapeSeq || encodeHex(char);
+ }
+ }
+
+ return result;
+}
+
+function writeFlowSequence(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level, value, false, false) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level, null, false, false))) {
+
+ if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = '[' + _result + ']';
+}
+
+function writeBlockSequence(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ index,
+ length,
+ value;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ value = object[index];
+
+ if (state.replacer) {
+ value = state.replacer.call(object, String(index), value);
+ }
+
+ // Write only valid elements, put null instead of invalid elements.
+ if (writeNode(state, level + 1, value, true, true, false, true) ||
+ (typeof value === 'undefined' &&
+ writeNode(state, level + 1, null, true, true, false, true))) {
+
+ if (!compact || _result !== '') {
+ _result += generateNextLine(state, level);
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ _result += '-';
+ } else {
+ _result += '- ';
+ }
+
+ _result += state.dump;
+ }
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '[]'; // Empty sequence if no valid values.
+}
+
+function writeFlowMapping(state, level, object) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ pairBuffer;
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+
+ pairBuffer = '';
+ if (_result !== '') pairBuffer += ', ';
+
+ if (state.condenseFlow) pairBuffer += '"';
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level, objectKey, false, false)) {
+ continue; // Skip this pair because of invalid key;
+ }
+
+ if (state.dump.length > 1024) pairBuffer += '? ';
+
+ pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
+
+ if (!writeNode(state, level, objectValue, false, false)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = '{' + _result + '}';
+}
+
+function writeBlockMapping(state, level, object, compact) {
+ var _result = '',
+ _tag = state.tag,
+ objectKeyList = Object.keys(object),
+ index,
+ length,
+ objectKey,
+ objectValue,
+ explicitPair,
+ pairBuffer;
+
+ // Allow sorting keys so that the output file is deterministic
+ if (state.sortKeys === true) {
+ // Default sorting
+ objectKeyList.sort();
+ } else if (typeof state.sortKeys === 'function') {
+ // Custom sort function
+ objectKeyList.sort(state.sortKeys);
+ } else if (state.sortKeys) {
+ // Something is wrong
+ throw new YAMLException('sortKeys must be a boolean or a function');
+ }
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ pairBuffer = '';
+
+ if (!compact || _result !== '') {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ objectKey = objectKeyList[index];
+ objectValue = object[objectKey];
+
+ if (state.replacer) {
+ objectValue = state.replacer.call(object, objectKey, objectValue);
+ }
+
+ if (!writeNode(state, level + 1, objectKey, true, true, true)) {
+ continue; // Skip this pair because of invalid key.
+ }
+
+ explicitPair = (state.tag !== null && state.tag !== '?') ||
+ (state.dump && state.dump.length > 1024);
+
+ if (explicitPair) {
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += '?';
+ } else {
+ pairBuffer += '? ';
+ }
+ }
+
+ pairBuffer += state.dump;
+
+ if (explicitPair) {
+ pairBuffer += generateNextLine(state, level);
+ }
+
+ if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
+ continue; // Skip this pair because of invalid value.
+ }
+
+ if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
+ pairBuffer += ':';
+ } else {
+ pairBuffer += ': ';
+ }
+
+ pairBuffer += state.dump;
+
+ // Both key and value are valid.
+ _result += pairBuffer;
+ }
+
+ state.tag = _tag;
+ state.dump = _result || '{}'; // Empty mapping if no valid pairs.
+}
+
+function detectType(state, object, explicit) {
+ var _result, typeList, index, length, type, style;
+
+ typeList = explicit ? state.explicitTypes : state.implicitTypes;
+
+ for (index = 0, length = typeList.length; index < length; index += 1) {
+ type = typeList[index];
+
+ if ((type.instanceOf || type.predicate) &&
+ (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
+ (!type.predicate || type.predicate(object))) {
+
+ if (explicit) {
+ if (type.multi && type.representName) {
+ state.tag = type.representName(object);
+ } else {
+ state.tag = type.tag;
+ }
+ } else {
+ state.tag = '?';
+ }
+
+ if (type.represent) {
+ style = state.styleMap[type.tag] || type.defaultStyle;
+
+ if (_toString.call(type.represent) === '[object Function]') {
+ _result = type.represent(object, style);
+ } else if (_hasOwnProperty.call(type.represent, style)) {
+ _result = type.represent[style](object, style);
+ } else {
+ throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
+ }
+
+ state.dump = _result;
+ }
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Serializes `object` and writes it to global `result`.
+// Returns true on success, or false on invalid object.
+//
+function writeNode(state, level, object, block, compact, iskey, isblockseq) {
+ state.tag = null;
+ state.dump = object;
+
+ if (!detectType(state, object, false)) {
+ detectType(state, object, true);
+ }
+
+ var type = _toString.call(state.dump);
+ var inblock = block;
+ var tagStr;
+
+ if (block) {
+ block = (state.flowLevel < 0 || state.flowLevel > level);
+ }
+
+ var objectOrArray = type === '[object Object]' || type === '[object Array]',
+ duplicateIndex,
+ duplicate;
+
+ if (objectOrArray) {
+ duplicateIndex = state.duplicates.indexOf(object);
+ duplicate = duplicateIndex !== -1;
+ }
+
+ if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
+ compact = false;
+ }
+
+ if (duplicate && state.usedDuplicates[duplicateIndex]) {
+ state.dump = '*ref_' + duplicateIndex;
+ } else {
+ if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
+ state.usedDuplicates[duplicateIndex] = true;
+ }
+ if (type === '[object Object]') {
+ if (block && (Object.keys(state.dump).length !== 0)) {
+ writeBlockMapping(state, level, state.dump, compact);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowMapping(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object Array]') {
+ if (block && (state.dump.length !== 0)) {
+ if (state.noArrayIndent && !isblockseq && level > 0) {
+ writeBlockSequence(state, level - 1, state.dump, compact);
+ } else {
+ writeBlockSequence(state, level, state.dump, compact);
+ }
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + state.dump;
+ }
+ } else {
+ writeFlowSequence(state, level, state.dump);
+ if (duplicate) {
+ state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
+ }
+ }
+ } else if (type === '[object String]') {
+ if (state.tag !== '?') {
+ writeScalar(state, state.dump, level, iskey, inblock);
+ }
+ } else if (type === '[object Undefined]') {
+ return false;
+ } else {
+ if (state.skipInvalid) return false;
+ throw new YAMLException('unacceptable kind of an object to dump ' + type);
+ }
+
+ if (state.tag !== null && state.tag !== '?') {
+ // Need to encode all characters except those allowed by the spec:
+ //
+ // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */
+ // [36] ns-hex-digit ::= ns-dec-digit
+ // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */
+ // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */
+ // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | ā€œ-ā€
+ // [39] ns-uri-char ::= ā€œ%ā€ ns-hex-digit ns-hex-digit | ns-word-char | ā€œ#ā€
+ // | ā€œ;ā€ | ā€œ/ā€ | ā€œ?ā€ | ā€œ:ā€ | ā€œ@ā€ | ā€œ&ā€ | ā€œ=ā€ | ā€œ+ā€ | ā€œ$ā€ | ā€œ,ā€
+ // | ā€œ_ā€ | ā€œ.ā€ | ā€œ!ā€ | ā€œ~ā€ | ā€œ*ā€ | ā€œ'ā€ | ā€œ(ā€ | ā€œ)ā€ | ā€œ[ā€ | ā€œ]ā€
+ //
+ // Also need to encode '!' because it has special meaning (end of tag prefix).
+ //
+ tagStr = encodeURI(
+ state.tag[0] === '!' ? state.tag.slice(1) : state.tag
+ ).replace(/!/g, '%21');
+
+ if (state.tag[0] === '!') {
+ tagStr = '!' + tagStr;
+ } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {
+ tagStr = '!!' + tagStr.slice(18);
+ } else {
+ tagStr = '!<' + tagStr + '>';
+ }
+
+ state.dump = tagStr + ' ' + state.dump;
+ }
+ }
+
+ return true;
+}
+
+function getDuplicateReferences(object, state) {
+ var objects = [],
+ duplicatesIndexes = [],
+ index,
+ length;
+
+ inspectNode(object, objects, duplicatesIndexes);
+
+ for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
+ state.duplicates.push(objects[duplicatesIndexes[index]]);
+ }
+ state.usedDuplicates = new Array(length);
+}
+
+function inspectNode(object, objects, duplicatesIndexes) {
+ var objectKeyList,
+ index,
+ length;
+
+ if (object !== null && typeof object === 'object') {
+ index = objects.indexOf(object);
+ if (index !== -1) {
+ if (duplicatesIndexes.indexOf(index) === -1) {
+ duplicatesIndexes.push(index);
+ }
+ } else {
+ objects.push(object);
+
+ if (Array.isArray(object)) {
+ for (index = 0, length = object.length; index < length; index += 1) {
+ inspectNode(object[index], objects, duplicatesIndexes);
+ }
+ } else {
+ objectKeyList = Object.keys(object);
+
+ for (index = 0, length = objectKeyList.length; index < length; index += 1) {
+ inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
+ }
+ }
+ }
+ }
+}
+
+function dump(input, options) {
+ options = options || {};
+
+ var state = new State(options);
+
+ if (!state.noRefs) getDuplicateReferences(input, state);
+
+ var value = input;
+
+ if (state.replacer) {
+ value = state.replacer.call({ '': value }, '', value);
+ }
+
+ if (writeNode(state, 0, value, true, true)) return state.dump + '\n';
+
+ return '';
+}
+
+module.exports.dump = dump;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/exception.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/exception.js
new file mode 100644
index 00000000000..7f62daaef8b
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/exception.js
@@ -0,0 +1,55 @@
+// YAML error class. http://stackoverflow.com/questions/8458984
+//
+'use strict';
+
+
+function formatError(exception, compact) {
+ var where = '', message = exception.reason || '(unknown reason)';
+
+ if (!exception.mark) return message;
+
+ if (exception.mark.name) {
+ where += 'in "' + exception.mark.name + '" ';
+ }
+
+ where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';
+
+ if (!compact && exception.mark.snippet) {
+ where += '\n\n' + exception.mark.snippet;
+ }
+
+ return message + ' ' + where;
+}
+
+
+function YAMLException(reason, mark) {
+ // Super constructor
+ Error.call(this);
+
+ this.name = 'YAMLException';
+ this.reason = reason;
+ this.mark = mark;
+ this.message = formatError(this, false);
+
+ // Include stack trace in error object
+ if (Error.captureStackTrace) {
+ // Chrome and NodeJS
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ // FF, IE 10+ and Safari 6+. Fallback for others
+ this.stack = (new Error()).stack || '';
+ }
+}
+
+
+// Inherit from Error
+YAMLException.prototype = Object.create(Error.prototype);
+YAMLException.prototype.constructor = YAMLException;
+
+
+YAMLException.prototype.toString = function toString(compact) {
+ return this.name + ': ' + formatError(this, compact);
+};
+
+
+module.exports = YAMLException;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/loader.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/loader.js
new file mode 100644
index 00000000000..39f13f56100
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/loader.js
@@ -0,0 +1,1727 @@
+'use strict';
+
+/*eslint-disable max-len,no-use-before-define*/
+
+var common = require('./common');
+var YAMLException = require('./exception');
+var makeSnippet = require('./snippet');
+var DEFAULT_SCHEMA = require('./schema/default');
+
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+
+var CONTEXT_FLOW_IN = 1;
+var CONTEXT_FLOW_OUT = 2;
+var CONTEXT_BLOCK_IN = 3;
+var CONTEXT_BLOCK_OUT = 4;
+
+
+var CHOMPING_CLIP = 1;
+var CHOMPING_STRIP = 2;
+var CHOMPING_KEEP = 3;
+
+
+var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
+var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
+var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
+var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
+var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
+
+
+function _class(obj) { return Object.prototype.toString.call(obj); }
+
+function is_EOL(c) {
+ return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
+}
+
+function is_WHITE_SPACE(c) {
+ return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
+}
+
+function is_WS_OR_EOL(c) {
+ return (c === 0x09/* Tab */) ||
+ (c === 0x20/* Space */) ||
+ (c === 0x0A/* LF */) ||
+ (c === 0x0D/* CR */);
+}
+
+function is_FLOW_INDICATOR(c) {
+ return c === 0x2C/* , */ ||
+ c === 0x5B/* [ */ ||
+ c === 0x5D/* ] */ ||
+ c === 0x7B/* { */ ||
+ c === 0x7D/* } */;
+}
+
+function fromHexCode(c) {
+ var lc;
+
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ /*eslint-disable no-bitwise*/
+ lc = c | 0x20;
+
+ if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
+ return lc - 0x61 + 10;
+ }
+
+ return -1;
+}
+
+function escapedHexLen(c) {
+ if (c === 0x78/* x */) { return 2; }
+ if (c === 0x75/* u */) { return 4; }
+ if (c === 0x55/* U */) { return 8; }
+ return 0;
+}
+
+function fromDecimalCode(c) {
+ if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
+ return c - 0x30;
+ }
+
+ return -1;
+}
+
+function simpleEscapeSequence(c) {
+ /* eslint-disable indent */
+ return (c === 0x30/* 0 */) ? '\x00' :
+ (c === 0x61/* a */) ? '\x07' :
+ (c === 0x62/* b */) ? '\x08' :
+ (c === 0x74/* t */) ? '\x09' :
+ (c === 0x09/* Tab */) ? '\x09' :
+ (c === 0x6E/* n */) ? '\x0A' :
+ (c === 0x76/* v */) ? '\x0B' :
+ (c === 0x66/* f */) ? '\x0C' :
+ (c === 0x72/* r */) ? '\x0D' :
+ (c === 0x65/* e */) ? '\x1B' :
+ (c === 0x20/* Space */) ? ' ' :
+ (c === 0x22/* " */) ? '\x22' :
+ (c === 0x2F/* / */) ? '/' :
+ (c === 0x5C/* \ */) ? '\x5C' :
+ (c === 0x4E/* N */) ? '\x85' :
+ (c === 0x5F/* _ */) ? '\xA0' :
+ (c === 0x4C/* L */) ? '\u2028' :
+ (c === 0x50/* P */) ? '\u2029' : '';
+}
+
+function charFromCodepoint(c) {
+ if (c <= 0xFFFF) {
+ return String.fromCharCode(c);
+ }
+ // Encode UTF-16 surrogate pair
+ // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
+ return String.fromCharCode(
+ ((c - 0x010000) >> 10) + 0xD800,
+ ((c - 0x010000) & 0x03FF) + 0xDC00
+ );
+}
+
+var simpleEscapeCheck = new Array(256); // integer, for fast access
+var simpleEscapeMap = new Array(256);
+for (var i = 0; i < 256; i++) {
+ simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
+ simpleEscapeMap[i] = simpleEscapeSequence(i);
+}
+
+
+function State(input, options) {
+ this.input = input;
+
+ this.filename = options['filename'] || null;
+ this.schema = options['schema'] || DEFAULT_SCHEMA;
+ this.onWarning = options['onWarning'] || null;
+ // (Hidden) Remove? makes the loader to expect YAML 1.1 documents
+ // if such documents have no explicit %YAML directive
+ this.legacy = options['legacy'] || false;
+
+ this.json = options['json'] || false;
+ this.listener = options['listener'] || null;
+
+ this.implicitTypes = this.schema.compiledImplicit;
+ this.typeMap = this.schema.compiledTypeMap;
+
+ this.length = input.length;
+ this.position = 0;
+ this.line = 0;
+ this.lineStart = 0;
+ this.lineIndent = 0;
+
+ // position of first leading tab in the current line,
+ // used to make sure there are no tabs in the indentation
+ this.firstTabInLine = -1;
+
+ this.documents = [];
+
+ /*
+ this.version;
+ this.checkLineBreaks;
+ this.tagMap;
+ this.anchorMap;
+ this.tag;
+ this.anchor;
+ this.kind;
+ this.result;*/
+
+}
+
+
+function generateError(state, message) {
+ var mark = {
+ name: state.filename,
+ buffer: state.input.slice(0, -1), // omit trailing \0
+ position: state.position,
+ line: state.line,
+ column: state.position - state.lineStart
+ };
+
+ mark.snippet = makeSnippet(mark);
+
+ return new YAMLException(message, mark);
+}
+
+function throwError(state, message) {
+ throw generateError(state, message);
+}
+
+function throwWarning(state, message) {
+ if (state.onWarning) {
+ state.onWarning.call(null, generateError(state, message));
+ }
+}
+
+
+var directiveHandlers = {
+
+ YAML: function handleYamlDirective(state, name, args) {
+
+ var match, major, minor;
+
+ if (state.version !== null) {
+ throwError(state, 'duplication of %YAML directive');
+ }
+
+ if (args.length !== 1) {
+ throwError(state, 'YAML directive accepts exactly one argument');
+ }
+
+ match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
+
+ if (match === null) {
+ throwError(state, 'ill-formed argument of the YAML directive');
+ }
+
+ major = parseInt(match[1], 10);
+ minor = parseInt(match[2], 10);
+
+ if (major !== 1) {
+ throwError(state, 'unacceptable YAML version of the document');
+ }
+
+ state.version = args[0];
+ state.checkLineBreaks = (minor < 2);
+
+ if (minor !== 1 && minor !== 2) {
+ throwWarning(state, 'unsupported YAML version of the document');
+ }
+ },
+
+ TAG: function handleTagDirective(state, name, args) {
+
+ var handle, prefix;
+
+ if (args.length !== 2) {
+ throwError(state, 'TAG directive accepts exactly two arguments');
+ }
+
+ handle = args[0];
+ prefix = args[1];
+
+ if (!PATTERN_TAG_HANDLE.test(handle)) {
+ throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
+ }
+
+ if (_hasOwnProperty.call(state.tagMap, handle)) {
+ throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
+ }
+
+ if (!PATTERN_TAG_URI.test(prefix)) {
+ throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
+ }
+
+ try {
+ prefix = decodeURIComponent(prefix);
+ } catch (err) {
+ throwError(state, 'tag prefix is malformed: ' + prefix);
+ }
+
+ state.tagMap[handle] = prefix;
+ }
+};
+
+
+function captureSegment(state, start, end, checkJson) {
+ var _position, _length, _character, _result;
+
+ if (start < end) {
+ _result = state.input.slice(start, end);
+
+ if (checkJson) {
+ for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
+ _character = _result.charCodeAt(_position);
+ if (!(_character === 0x09 ||
+ (0x20 <= _character && _character <= 0x10FFFF))) {
+ throwError(state, 'expected valid JSON character');
+ }
+ }
+ } else if (PATTERN_NON_PRINTABLE.test(_result)) {
+ throwError(state, 'the stream contains non-printable characters');
+ }
+
+ state.result += _result;
+ }
+}
+
+function mergeMappings(state, destination, source, overridableKeys) {
+ var sourceKeys, key, index, quantity;
+
+ if (!common.isObject(source)) {
+ throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
+ }
+
+ sourceKeys = Object.keys(source);
+
+ for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
+ key = sourceKeys[index];
+
+ if (!_hasOwnProperty.call(destination, key)) {
+ destination[key] = source[key];
+ overridableKeys[key] = true;
+ }
+ }
+}
+
+function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,
+ startLine, startLineStart, startPos) {
+
+ var index, quantity;
+
+ // The output is a plain object here, so keys can only be strings.
+ // We need to convert keyNode to a string, but doing so can hang the process
+ // (deeply nested arrays that explode exponentially using aliases).
+ if (Array.isArray(keyNode)) {
+ keyNode = Array.prototype.slice.call(keyNode);
+
+ for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
+ if (Array.isArray(keyNode[index])) {
+ throwError(state, 'nested arrays are not supported inside keys');
+ }
+
+ if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
+ keyNode[index] = '[object Object]';
+ }
+ }
+ }
+
+ // Avoid code execution in load() via toString property
+ // (still use its own toString for arrays, timestamps,
+ // and whatever user schema extensions happen to have @@toStringTag)
+ if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
+ keyNode = '[object Object]';
+ }
+
+
+ keyNode = String(keyNode);
+
+ if (_result === null) {
+ _result = {};
+ }
+
+ if (keyTag === 'tag:yaml.org,2002:merge') {
+ if (Array.isArray(valueNode)) {
+ for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
+ }
+ } else {
+ mergeMappings(state, _result, valueNode, overridableKeys);
+ }
+ } else {
+ if (!state.json &&
+ !_hasOwnProperty.call(overridableKeys, keyNode) &&
+ _hasOwnProperty.call(_result, keyNode)) {
+ state.line = startLine || state.line;
+ state.lineStart = startLineStart || state.lineStart;
+ state.position = startPos || state.position;
+ throwError(state, 'duplicated mapping key');
+ }
+
+ // used for this specific key only because Object.defineProperty is slow
+ if (keyNode === '__proto__') {
+ Object.defineProperty(_result, keyNode, {
+ configurable: true,
+ enumerable: true,
+ writable: true,
+ value: valueNode
+ });
+ } else {
+ _result[keyNode] = valueNode;
+ }
+ delete overridableKeys[keyNode];
+ }
+
+ return _result;
+}
+
+function readLineBreak(state) {
+ var ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x0A/* LF */) {
+ state.position++;
+ } else if (ch === 0x0D/* CR */) {
+ state.position++;
+ if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
+ state.position++;
+ }
+ } else {
+ throwError(state, 'a line break is expected');
+ }
+
+ state.line += 1;
+ state.lineStart = state.position;
+ state.firstTabInLine = -1;
+}
+
+function skipSeparationSpace(state, allowComments, checkIndent) {
+ var lineBreaks = 0,
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {
+ state.firstTabInLine = state.position;
+ }
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (allowComments && ch === 0x23/* # */) {
+ do {
+ ch = state.input.charCodeAt(++state.position);
+ } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
+ }
+
+ if (is_EOL(ch)) {
+ readLineBreak(state);
+
+ ch = state.input.charCodeAt(state.position);
+ lineBreaks++;
+ state.lineIndent = 0;
+
+ while (ch === 0x20/* Space */) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
+ throwWarning(state, 'deficient indentation');
+ }
+
+ return lineBreaks;
+}
+
+function testDocumentSeparator(state) {
+ var _position = state.position,
+ ch;
+
+ ch = state.input.charCodeAt(_position);
+
+ // Condition state.position === state.lineStart is tested
+ // in parent on each call, for efficiency. No needs to test here again.
+ if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
+ ch === state.input.charCodeAt(_position + 1) &&
+ ch === state.input.charCodeAt(_position + 2)) {
+
+ _position += 3;
+
+ ch = state.input.charCodeAt(_position);
+
+ if (ch === 0 || is_WS_OR_EOL(ch)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function writeFoldedLines(state, count) {
+ if (count === 1) {
+ state.result += ' ';
+ } else if (count > 1) {
+ state.result += common.repeat('\n', count - 1);
+ }
+}
+
+
+function readPlainScalar(state, nodeIndent, withinFlowCollection) {
+ var preceding,
+ following,
+ captureStart,
+ captureEnd,
+ hasPendingContent,
+ _line,
+ _lineStart,
+ _lineIndent,
+ _kind = state.kind,
+ _result = state.result,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (is_WS_OR_EOL(ch) ||
+ is_FLOW_INDICATOR(ch) ||
+ ch === 0x23/* # */ ||
+ ch === 0x26/* & */ ||
+ ch === 0x2A/* * */ ||
+ ch === 0x21/* ! */ ||
+ ch === 0x7C/* | */ ||
+ ch === 0x3E/* > */ ||
+ ch === 0x27/* ' */ ||
+ ch === 0x22/* " */ ||
+ ch === 0x25/* % */ ||
+ ch === 0x40/* @ */ ||
+ ch === 0x60/* ` */) {
+ return false;
+ }
+
+ if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ return false;
+ }
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+
+ while (ch !== 0) {
+ if (ch === 0x3A/* : */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following) ||
+ withinFlowCollection && is_FLOW_INDICATOR(following)) {
+ break;
+ }
+
+ } else if (ch === 0x23/* # */) {
+ preceding = state.input.charCodeAt(state.position - 1);
+
+ if (is_WS_OR_EOL(preceding)) {
+ break;
+ }
+
+ } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
+ withinFlowCollection && is_FLOW_INDICATOR(ch)) {
+ break;
+
+ } else if (is_EOL(ch)) {
+ _line = state.line;
+ _lineStart = state.lineStart;
+ _lineIndent = state.lineIndent;
+ skipSeparationSpace(state, false, -1);
+
+ if (state.lineIndent >= nodeIndent) {
+ hasPendingContent = true;
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ } else {
+ state.position = captureEnd;
+ state.line = _line;
+ state.lineStart = _lineStart;
+ state.lineIndent = _lineIndent;
+ break;
+ }
+ }
+
+ if (hasPendingContent) {
+ captureSegment(state, captureStart, captureEnd, false);
+ writeFoldedLines(state, state.line - _line);
+ captureStart = captureEnd = state.position;
+ hasPendingContent = false;
+ }
+
+ if (!is_WHITE_SPACE(ch)) {
+ captureEnd = state.position + 1;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, captureEnd, false);
+
+ if (state.result) {
+ return true;
+ }
+
+ state.kind = _kind;
+ state.result = _result;
+ return false;
+}
+
+function readSingleQuotedScalar(state, nodeIndent) {
+ var ch,
+ captureStart, captureEnd;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x27/* ' */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x27/* ' */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x27/* ' */) {
+ captureStart = state.position;
+ state.position++;
+ captureEnd = state.position;
+ } else {
+ return true;
+ }
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a single quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a single quoted scalar');
+}
+
+function readDoubleQuotedScalar(state, nodeIndent) {
+ var captureStart,
+ captureEnd,
+ hexLength,
+ hexResult,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x22/* " */) {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+ state.position++;
+ captureStart = captureEnd = state.position;
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ if (ch === 0x22/* " */) {
+ captureSegment(state, captureStart, state.position, true);
+ state.position++;
+ return true;
+
+ } else if (ch === 0x5C/* \ */) {
+ captureSegment(state, captureStart, state.position, true);
+ ch = state.input.charCodeAt(++state.position);
+
+ if (is_EOL(ch)) {
+ skipSeparationSpace(state, false, nodeIndent);
+
+ // TODO: rework to inline fn with no type cast?
+ } else if (ch < 256 && simpleEscapeCheck[ch]) {
+ state.result += simpleEscapeMap[ch];
+ state.position++;
+
+ } else if ((tmp = escapedHexLen(ch)) > 0) {
+ hexLength = tmp;
+ hexResult = 0;
+
+ for (; hexLength > 0; hexLength--) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if ((tmp = fromHexCode(ch)) >= 0) {
+ hexResult = (hexResult << 4) + tmp;
+
+ } else {
+ throwError(state, 'expected hexadecimal character');
+ }
+ }
+
+ state.result += charFromCodepoint(hexResult);
+
+ state.position++;
+
+ } else {
+ throwError(state, 'unknown escape sequence');
+ }
+
+ captureStart = captureEnd = state.position;
+
+ } else if (is_EOL(ch)) {
+ captureSegment(state, captureStart, captureEnd, true);
+ writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
+ captureStart = captureEnd = state.position;
+
+ } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
+ throwError(state, 'unexpected end of the document within a double quoted scalar');
+
+ } else {
+ state.position++;
+ captureEnd = state.position;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a double quoted scalar');
+}
+
+function readFlowCollection(state, nodeIndent) {
+ var readNext = true,
+ _line,
+ _lineStart,
+ _pos,
+ _tag = state.tag,
+ _result,
+ _anchor = state.anchor,
+ following,
+ terminator,
+ isPair,
+ isExplicitPair,
+ isMapping,
+ overridableKeys = Object.create(null),
+ keyNode,
+ keyTag,
+ valueNode,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x5B/* [ */) {
+ terminator = 0x5D;/* ] */
+ isMapping = false;
+ _result = [];
+ } else if (ch === 0x7B/* { */) {
+ terminator = 0x7D;/* } */
+ isMapping = true;
+ _result = {};
+ } else {
+ return false;
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ while (ch !== 0) {
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === terminator) {
+ state.position++;
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = isMapping ? 'mapping' : 'sequence';
+ state.result = _result;
+ return true;
+ } else if (!readNext) {
+ throwError(state, 'missed comma between flow collection entries');
+ } else if (ch === 0x2C/* , */) {
+ // "flow collection entries can never be completely empty", as per YAML 1.2, section 7.4
+ throwError(state, "expected the node content, but found ','");
+ }
+
+ keyTag = keyNode = valueNode = null;
+ isPair = isExplicitPair = false;
+
+ if (ch === 0x3F/* ? */) {
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (is_WS_OR_EOL(following)) {
+ isPair = isExplicitPair = true;
+ state.position++;
+ skipSeparationSpace(state, true, nodeIndent);
+ }
+ }
+
+ _line = state.line; // Save the current line.
+ _lineStart = state.lineStart;
+ _pos = state.position;
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ keyTag = state.tag;
+ keyNode = state.result;
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
+ isPair = true;
+ ch = state.input.charCodeAt(++state.position);
+ skipSeparationSpace(state, true, nodeIndent);
+ composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
+ valueNode = state.result;
+ }
+
+ if (isMapping) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
+ } else if (isPair) {
+ _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
+ } else {
+ _result.push(keyNode);
+ }
+
+ skipSeparationSpace(state, true, nodeIndent);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x2C/* , */) {
+ readNext = true;
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ readNext = false;
+ }
+ }
+
+ throwError(state, 'unexpected end of the stream within a flow collection');
+}
+
+function readBlockScalar(state, nodeIndent) {
+ var captureStart,
+ folding,
+ chomping = CHOMPING_CLIP,
+ didReadContent = false,
+ detectedIndent = false,
+ textIndent = nodeIndent,
+ emptyLines = 0,
+ atMoreIndented = false,
+ tmp,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch === 0x7C/* | */) {
+ folding = false;
+ } else if (ch === 0x3E/* > */) {
+ folding = true;
+ } else {
+ return false;
+ }
+
+ state.kind = 'scalar';
+ state.result = '';
+
+ while (ch !== 0) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
+ if (CHOMPING_CLIP === chomping) {
+ chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
+ } else {
+ throwError(state, 'repeat of a chomping mode identifier');
+ }
+
+ } else if ((tmp = fromDecimalCode(ch)) >= 0) {
+ if (tmp === 0) {
+ throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
+ } else if (!detectedIndent) {
+ textIndent = nodeIndent + tmp - 1;
+ detectedIndent = true;
+ } else {
+ throwError(state, 'repeat of an indentation width identifier');
+ }
+
+ } else {
+ break;
+ }
+ }
+
+ if (is_WHITE_SPACE(ch)) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (is_WHITE_SPACE(ch));
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (!is_EOL(ch) && (ch !== 0));
+ }
+ }
+
+ while (ch !== 0) {
+ readLineBreak(state);
+ state.lineIndent = 0;
+
+ ch = state.input.charCodeAt(state.position);
+
+ while ((!detectedIndent || state.lineIndent < textIndent) &&
+ (ch === 0x20/* Space */)) {
+ state.lineIndent++;
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (!detectedIndent && state.lineIndent > textIndent) {
+ textIndent = state.lineIndent;
+ }
+
+ if (is_EOL(ch)) {
+ emptyLines++;
+ continue;
+ }
+
+ // End of the scalar.
+ if (state.lineIndent < textIndent) {
+
+ // Perform the chomping.
+ if (chomping === CHOMPING_KEEP) {
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ } else if (chomping === CHOMPING_CLIP) {
+ if (didReadContent) { // i.e. only if the scalar is not empty.
+ state.result += '\n';
+ }
+ }
+
+ // Break this `while` cycle and go to the funciton's epilogue.
+ break;
+ }
+
+ // Folded style: use fancy rules to handle line breaks.
+ if (folding) {
+
+ // Lines starting with white space characters (more-indented lines) are not folded.
+ if (is_WHITE_SPACE(ch)) {
+ atMoreIndented = true;
+ // except for the first content line (cf. Example 8.1)
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+
+ // End of more-indented block.
+ } else if (atMoreIndented) {
+ atMoreIndented = false;
+ state.result += common.repeat('\n', emptyLines + 1);
+
+ // Just one line break - perceive as the same line.
+ } else if (emptyLines === 0) {
+ if (didReadContent) { // i.e. only if we have already read some scalar content.
+ state.result += ' ';
+ }
+
+ // Several line breaks - perceive as different lines.
+ } else {
+ state.result += common.repeat('\n', emptyLines);
+ }
+
+ // Literal style: just add exact number of line breaks between content lines.
+ } else {
+ // Keep all line breaks except the header line break.
+ state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
+ }
+
+ didReadContent = true;
+ detectedIndent = true;
+ emptyLines = 0;
+ captureStart = state.position;
+
+ while (!is_EOL(ch) && (ch !== 0)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ captureSegment(state, captureStart, state.position, false);
+ }
+
+ return true;
+}
+
+function readBlockSequence(state, nodeIndent) {
+ var _line,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = [],
+ following,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ if (ch !== 0x2D/* - */) {
+ break;
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+
+ if (!is_WS_OR_EOL(following)) {
+ break;
+ }
+
+ detected = true;
+ state.position++;
+
+ if (skipSeparationSpace(state, true, -1)) {
+ if (state.lineIndent <= nodeIndent) {
+ _result.push(null);
+ ch = state.input.charCodeAt(state.position);
+ continue;
+ }
+ }
+
+ _line = state.line;
+ composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
+ _result.push(state.result);
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a sequence entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'sequence';
+ state.result = _result;
+ return true;
+ }
+ return false;
+}
+
+function readBlockMapping(state, nodeIndent, flowIndent) {
+ var following,
+ allowCompact,
+ _line,
+ _keyLine,
+ _keyLineStart,
+ _keyPos,
+ _tag = state.tag,
+ _anchor = state.anchor,
+ _result = {},
+ overridableKeys = Object.create(null),
+ keyTag = null,
+ keyNode = null,
+ valueNode = null,
+ atExplicitKey = false,
+ detected = false,
+ ch;
+
+ // there is a leading tab before this token, so it can't be a block sequence/mapping;
+ // it can still be flow sequence/mapping or a scalar
+ if (state.firstTabInLine !== -1) return false;
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = _result;
+ }
+
+ ch = state.input.charCodeAt(state.position);
+
+ while (ch !== 0) {
+ if (!atExplicitKey && state.firstTabInLine !== -1) {
+ state.position = state.firstTabInLine;
+ throwError(state, 'tab characters must not be used in indentation');
+ }
+
+ following = state.input.charCodeAt(state.position + 1);
+ _line = state.line; // Save the current line.
+
+ //
+ // Explicit notation case. There are two separate blocks:
+ // first for the key (denoted by "?") and second for the value (denoted by ":")
+ //
+ if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
+
+ if (ch === 0x3F/* ? */) {
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = true;
+ allowCompact = true;
+
+ } else if (atExplicitKey) {
+ // i.e. 0x3A/* : */ === character after the explicit key.
+ atExplicitKey = false;
+ allowCompact = true;
+
+ } else {
+ throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
+ }
+
+ state.position += 1;
+ ch = following;
+
+ //
+ // Implicit notation case. Flow-style node as the key first, then ":", and the value.
+ //
+ } else {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+
+ if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
+ // Neither implicit nor explicit notation.
+ // Reading is done. Go to the epilogue.
+ break;
+ }
+
+ if (state.line === _line) {
+ ch = state.input.charCodeAt(state.position);
+
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x3A/* : */) {
+ ch = state.input.charCodeAt(++state.position);
+
+ if (!is_WS_OR_EOL(ch)) {
+ throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
+ }
+
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ detected = true;
+ atExplicitKey = false;
+ allowCompact = false;
+ keyTag = state.tag;
+ keyNode = state.result;
+
+ } else if (detected) {
+ throwError(state, 'can not read an implicit mapping pair; a colon is missed');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+
+ } else if (detected) {
+ throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
+
+ } else {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ return true; // Keep the result of `composeNode`.
+ }
+ }
+
+ //
+ // Common reading code for both explicit and implicit notations.
+ //
+ if (state.line === _line || state.lineIndent > nodeIndent) {
+ if (atExplicitKey) {
+ _keyLine = state.line;
+ _keyLineStart = state.lineStart;
+ _keyPos = state.position;
+ }
+
+ if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
+ if (atExplicitKey) {
+ keyNode = state.result;
+ } else {
+ valueNode = state.result;
+ }
+ }
+
+ if (!atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
+ keyTag = keyNode = valueNode = null;
+ }
+
+ skipSeparationSpace(state, true, -1);
+ ch = state.input.charCodeAt(state.position);
+ }
+
+ if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
+ throwError(state, 'bad indentation of a mapping entry');
+ } else if (state.lineIndent < nodeIndent) {
+ break;
+ }
+ }
+
+ //
+ // Epilogue.
+ //
+
+ // Special case: last mapping's node contains only the key in explicit notation.
+ if (atExplicitKey) {
+ storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
+ }
+
+ // Expose the resulting mapping.
+ if (detected) {
+ state.tag = _tag;
+ state.anchor = _anchor;
+ state.kind = 'mapping';
+ state.result = _result;
+ }
+
+ return detected;
+}
+
+function readTagProperty(state) {
+ var _position,
+ isVerbatim = false,
+ isNamed = false,
+ tagHandle,
+ tagName,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x21/* ! */) return false;
+
+ if (state.tag !== null) {
+ throwError(state, 'duplication of a tag property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+
+ if (ch === 0x3C/* < */) {
+ isVerbatim = true;
+ ch = state.input.charCodeAt(++state.position);
+
+ } else if (ch === 0x21/* ! */) {
+ isNamed = true;
+ tagHandle = '!!';
+ ch = state.input.charCodeAt(++state.position);
+
+ } else {
+ tagHandle = '!';
+ }
+
+ _position = state.position;
+
+ if (isVerbatim) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && ch !== 0x3E/* > */);
+
+ if (state.position < state.length) {
+ tagName = state.input.slice(_position, state.position);
+ ch = state.input.charCodeAt(++state.position);
+ } else {
+ throwError(state, 'unexpected end of the stream within a verbatim tag');
+ }
+ } else {
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+
+ if (ch === 0x21/* ! */) {
+ if (!isNamed) {
+ tagHandle = state.input.slice(_position - 1, state.position + 1);
+
+ if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
+ throwError(state, 'named tag handle cannot contain such characters');
+ }
+
+ isNamed = true;
+ _position = state.position + 1;
+ } else {
+ throwError(state, 'tag suffix cannot contain exclamation marks');
+ }
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ tagName = state.input.slice(_position, state.position);
+
+ if (PATTERN_FLOW_INDICATORS.test(tagName)) {
+ throwError(state, 'tag suffix cannot contain flow indicator characters');
+ }
+ }
+
+ if (tagName && !PATTERN_TAG_URI.test(tagName)) {
+ throwError(state, 'tag name cannot contain such characters: ' + tagName);
+ }
+
+ try {
+ tagName = decodeURIComponent(tagName);
+ } catch (err) {
+ throwError(state, 'tag name is malformed: ' + tagName);
+ }
+
+ if (isVerbatim) {
+ state.tag = tagName;
+
+ } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
+ state.tag = state.tagMap[tagHandle] + tagName;
+
+ } else if (tagHandle === '!') {
+ state.tag = '!' + tagName;
+
+ } else if (tagHandle === '!!') {
+ state.tag = 'tag:yaml.org,2002:' + tagName;
+
+ } else {
+ throwError(state, 'undeclared tag handle "' + tagHandle + '"');
+ }
+
+ return true;
+}
+
+function readAnchorProperty(state) {
+ var _position,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x26/* & */) return false;
+
+ if (state.anchor !== null) {
+ throwError(state, 'duplication of an anchor property');
+ }
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an anchor node must contain at least one character');
+ }
+
+ state.anchor = state.input.slice(_position, state.position);
+ return true;
+}
+
+function readAlias(state) {
+ var _position, alias,
+ ch;
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (ch !== 0x2A/* * */) return false;
+
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (state.position === _position) {
+ throwError(state, 'name of an alias node must contain at least one character');
+ }
+
+ alias = state.input.slice(_position, state.position);
+
+ if (!_hasOwnProperty.call(state.anchorMap, alias)) {
+ throwError(state, 'unidentified alias "' + alias + '"');
+ }
+
+ state.result = state.anchorMap[alias];
+ skipSeparationSpace(state, true, -1);
+ return true;
+}
+
+function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
+ var allowBlockStyles,
+ allowBlockScalars,
+ allowBlockCollections,
+ indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
+ atNewLine = false,
+ hasContent = false,
+ typeIndex,
+ typeQuantity,
+ typeList,
+ type,
+ flowIndent,
+ blockIndent;
+
+ if (state.listener !== null) {
+ state.listener('open', state);
+ }
+
+ state.tag = null;
+ state.anchor = null;
+ state.kind = null;
+ state.result = null;
+
+ allowBlockStyles = allowBlockScalars = allowBlockCollections =
+ CONTEXT_BLOCK_OUT === nodeContext ||
+ CONTEXT_BLOCK_IN === nodeContext;
+
+ if (allowToSeek) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ }
+ }
+
+ if (indentStatus === 1) {
+ while (readTagProperty(state) || readAnchorProperty(state)) {
+ if (skipSeparationSpace(state, true, -1)) {
+ atNewLine = true;
+ allowBlockCollections = allowBlockStyles;
+
+ if (state.lineIndent > parentIndent) {
+ indentStatus = 1;
+ } else if (state.lineIndent === parentIndent) {
+ indentStatus = 0;
+ } else if (state.lineIndent < parentIndent) {
+ indentStatus = -1;
+ }
+ } else {
+ allowBlockCollections = false;
+ }
+ }
+ }
+
+ if (allowBlockCollections) {
+ allowBlockCollections = atNewLine || allowCompact;
+ }
+
+ if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
+ if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
+ flowIndent = parentIndent;
+ } else {
+ flowIndent = parentIndent + 1;
+ }
+
+ blockIndent = state.position - state.lineStart;
+
+ if (indentStatus === 1) {
+ if (allowBlockCollections &&
+ (readBlockSequence(state, blockIndent) ||
+ readBlockMapping(state, blockIndent, flowIndent)) ||
+ readFlowCollection(state, flowIndent)) {
+ hasContent = true;
+ } else {
+ if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
+ readSingleQuotedScalar(state, flowIndent) ||
+ readDoubleQuotedScalar(state, flowIndent)) {
+ hasContent = true;
+
+ } else if (readAlias(state)) {
+ hasContent = true;
+
+ if (state.tag !== null || state.anchor !== null) {
+ throwError(state, 'alias node should not have any properties');
+ }
+
+ } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
+ hasContent = true;
+
+ if (state.tag === null) {
+ state.tag = '?';
+ }
+ }
+
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ } else if (indentStatus === 0) {
+ // Special case: block sequences are allowed to have same indentation level as the parent.
+ // http://www.yaml.org/spec/1.2/spec.html#id2799784
+ hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
+ }
+ }
+
+ if (state.tag === null) {
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+
+ } else if (state.tag === '?') {
+ // Implicit resolving is not allowed for non-scalar types, and '?'
+ // non-specific tag is only automatically assigned to plain scalars.
+ //
+ // We only need to check kind conformity in case user explicitly assigns '?'
+ // tag, for example like this: "!<?> [0]"
+ //
+ if (state.result !== null && state.kind !== 'scalar') {
+ throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
+ }
+
+ for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
+ type = state.implicitTypes[typeIndex];
+
+ if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
+ state.result = type.construct(state.result);
+ state.tag = type.tag;
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ break;
+ }
+ }
+ } else if (state.tag !== '!') {
+ if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
+ type = state.typeMap[state.kind || 'fallback'][state.tag];
+ } else {
+ // looking for multi type
+ type = null;
+ typeList = state.typeMap.multi[state.kind || 'fallback'];
+
+ for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
+ if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
+ type = typeList[typeIndex];
+ break;
+ }
+ }
+ }
+
+ if (!type) {
+ throwError(state, 'unknown tag !<' + state.tag + '>');
+ }
+
+ if (state.result !== null && type.kind !== state.kind) {
+ throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
+ }
+
+ if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched
+ throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
+ } else {
+ state.result = type.construct(state.result, state.tag);
+ if (state.anchor !== null) {
+ state.anchorMap[state.anchor] = state.result;
+ }
+ }
+ }
+
+ if (state.listener !== null) {
+ state.listener('close', state);
+ }
+ return state.tag !== null || state.anchor !== null || hasContent;
+}
+
+function readDocument(state) {
+ var documentStart = state.position,
+ _position,
+ directiveName,
+ directiveArgs,
+ hasDirectives = false,
+ ch;
+
+ state.version = null;
+ state.checkLineBreaks = state.legacy;
+ state.tagMap = Object.create(null);
+ state.anchorMap = Object.create(null);
+
+ while ((ch = state.input.charCodeAt(state.position)) !== 0) {
+ skipSeparationSpace(state, true, -1);
+
+ ch = state.input.charCodeAt(state.position);
+
+ if (state.lineIndent > 0 || ch !== 0x25/* % */) {
+ break;
+ }
+
+ hasDirectives = true;
+ ch = state.input.charCodeAt(++state.position);
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveName = state.input.slice(_position, state.position);
+ directiveArgs = [];
+
+ if (directiveName.length < 1) {
+ throwError(state, 'directive name must not be less than one character in length');
+ }
+
+ while (ch !== 0) {
+ while (is_WHITE_SPACE(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ if (ch === 0x23/* # */) {
+ do { ch = state.input.charCodeAt(++state.position); }
+ while (ch !== 0 && !is_EOL(ch));
+ break;
+ }
+
+ if (is_EOL(ch)) break;
+
+ _position = state.position;
+
+ while (ch !== 0 && !is_WS_OR_EOL(ch)) {
+ ch = state.input.charCodeAt(++state.position);
+ }
+
+ directiveArgs.push(state.input.slice(_position, state.position));
+ }
+
+ if (ch !== 0) readLineBreak(state);
+
+ if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
+ directiveHandlers[directiveName](state, directiveName, directiveArgs);
+ } else {
+ throwWarning(state, 'unknown document directive "' + directiveName + '"');
+ }
+ }
+
+ skipSeparationSpace(state, true, -1);
+
+ if (state.lineIndent === 0 &&
+ state.input.charCodeAt(state.position) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
+ state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+
+ } else if (hasDirectives) {
+ throwError(state, 'directives end mark is expected');
+ }
+
+ composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
+ skipSeparationSpace(state, true, -1);
+
+ if (state.checkLineBreaks &&
+ PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
+ throwWarning(state, 'non-ASCII line breaks are interpreted as content');
+ }
+
+ state.documents.push(state.result);
+
+ if (state.position === state.lineStart && testDocumentSeparator(state)) {
+
+ if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
+ state.position += 3;
+ skipSeparationSpace(state, true, -1);
+ }
+ return;
+ }
+
+ if (state.position < (state.length - 1)) {
+ throwError(state, 'end of the stream or a document separator is expected');
+ } else {
+ return;
+ }
+}
+
+
+function loadDocuments(input, options) {
+ input = String(input);
+ options = options || {};
+
+ if (input.length !== 0) {
+
+ // Add tailing `\n` if not exists
+ if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
+ input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
+ input += '\n';
+ }
+
+ // Strip BOM
+ if (input.charCodeAt(0) === 0xFEFF) {
+ input = input.slice(1);
+ }
+ }
+
+ var state = new State(input, options);
+
+ var nullpos = input.indexOf('\0');
+
+ if (nullpos !== -1) {
+ state.position = nullpos;
+ throwError(state, 'null byte is not allowed in input');
+ }
+
+ // Use 0 as string terminator. That significantly simplifies bounds check.
+ state.input += '\0';
+
+ while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
+ state.lineIndent += 1;
+ state.position += 1;
+ }
+
+ while (state.position < (state.length - 1)) {
+ readDocument(state);
+ }
+
+ return state.documents;
+}
+
+
+function loadAll(input, iterator, options) {
+ if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
+ options = iterator;
+ iterator = null;
+ }
+
+ var documents = loadDocuments(input, options);
+
+ if (typeof iterator !== 'function') {
+ return documents;
+ }
+
+ for (var index = 0, length = documents.length; index < length; index += 1) {
+ iterator(documents[index]);
+ }
+}
+
+
+function load(input, options) {
+ var documents = loadDocuments(input, options);
+
+ if (documents.length === 0) {
+ /*eslint-disable no-undefined*/
+ return undefined;
+ } else if (documents.length === 1) {
+ return documents[0];
+ }
+ throw new YAMLException('expected a single document in the stream, but found more');
+}
+
+
+module.exports.loadAll = loadAll;
+module.exports.load = load;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/schema.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema.js
new file mode 100644
index 00000000000..65b41f4013d
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema.js
@@ -0,0 +1,121 @@
+'use strict';
+
+/*eslint-disable max-len*/
+
+var YAMLException = require('./exception');
+var Type = require('./type');
+
+
+function compileList(schema, name) {
+ var result = [];
+
+ schema[name].forEach(function (currentType) {
+ var newIndex = result.length;
+
+ result.forEach(function (previousType, previousIndex) {
+ if (previousType.tag === currentType.tag &&
+ previousType.kind === currentType.kind &&
+ previousType.multi === currentType.multi) {
+
+ newIndex = previousIndex;
+ }
+ });
+
+ result[newIndex] = currentType;
+ });
+
+ return result;
+}
+
+
+function compileMap(/* lists... */) {
+ var result = {
+ scalar: {},
+ sequence: {},
+ mapping: {},
+ fallback: {},
+ multi: {
+ scalar: [],
+ sequence: [],
+ mapping: [],
+ fallback: []
+ }
+ }, index, length;
+
+ function collectType(type) {
+ if (type.multi) {
+ result.multi[type.kind].push(type);
+ result.multi['fallback'].push(type);
+ } else {
+ result[type.kind][type.tag] = result['fallback'][type.tag] = type;
+ }
+ }
+
+ for (index = 0, length = arguments.length; index < length; index += 1) {
+ arguments[index].forEach(collectType);
+ }
+ return result;
+}
+
+
+function Schema(definition) {
+ return this.extend(definition);
+}
+
+
+Schema.prototype.extend = function extend(definition) {
+ var implicit = [];
+ var explicit = [];
+
+ if (definition instanceof Type) {
+ // Schema.extend(type)
+ explicit.push(definition);
+
+ } else if (Array.isArray(definition)) {
+ // Schema.extend([ type1, type2, ... ])
+ explicit = explicit.concat(definition);
+
+ } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
+ // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })
+ if (definition.implicit) implicit = implicit.concat(definition.implicit);
+ if (definition.explicit) explicit = explicit.concat(definition.explicit);
+
+ } else {
+ throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +
+ 'or a schema definition ({ implicit: [...], explicit: [...] })');
+ }
+
+ implicit.forEach(function (type) {
+ if (!(type instanceof Type)) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+
+ if (type.loadKind && type.loadKind !== 'scalar') {
+ throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
+ }
+
+ if (type.multi) {
+ throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');
+ }
+ });
+
+ explicit.forEach(function (type) {
+ if (!(type instanceof Type)) {
+ throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
+ }
+ });
+
+ var result = Object.create(Schema.prototype);
+
+ result.implicit = (this.implicit || []).concat(implicit);
+ result.explicit = (this.explicit || []).concat(explicit);
+
+ result.compiledImplicit = compileList(result, 'implicit');
+ result.compiledExplicit = compileList(result, 'explicit');
+ result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
+
+ return result;
+};
+
+
+module.exports = Schema;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js
new file mode 100644
index 00000000000..608b26de2bb
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/core.js
@@ -0,0 +1,11 @@
+// Standard YAML's Core schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2804923
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, Core schema has no distinctions from JSON schema is JS-YAML.
+
+
+'use strict';
+
+
+module.exports = require('./json');
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js
new file mode 100644
index 00000000000..3af0520d5ce
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/default.js
@@ -0,0 +1,22 @@
+// JS-YAML's default schema for `safeLoad` function.
+// It is not described in the YAML specification.
+//
+// This schema is based on standard YAML's Core schema and includes most of
+// extra types described at YAML tag repository. (http://yaml.org/type/)
+
+
+'use strict';
+
+
+module.exports = require('./core').extend({
+ implicit: [
+ require('../type/timestamp'),
+ require('../type/merge')
+ ],
+ explicit: [
+ require('../type/binary'),
+ require('../type/omap'),
+ require('../type/pairs'),
+ require('../type/set')
+ ]
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js
new file mode 100644
index 00000000000..b7a33eb7a1c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/failsafe.js
@@ -0,0 +1,17 @@
+// Standard YAML's Failsafe schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2802346
+
+
+'use strict';
+
+
+var Schema = require('../schema');
+
+
+module.exports = new Schema({
+ explicit: [
+ require('../type/str'),
+ require('../type/seq'),
+ require('../type/map')
+ ]
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js
new file mode 100644
index 00000000000..b73df78e511
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/schema/json.js
@@ -0,0 +1,19 @@
+// Standard YAML's JSON schema.
+// http://www.yaml.org/spec/1.2/spec.html#id2803231
+//
+// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
+// So, this schema is not such strict as defined in the YAML specification.
+// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
+
+
+'use strict';
+
+
+module.exports = require('./failsafe').extend({
+ implicit: [
+ require('../type/null'),
+ require('../type/bool'),
+ require('../type/int'),
+ require('../type/float')
+ ]
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/snippet.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/snippet.js
new file mode 100644
index 00000000000..00e2133c0b6
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/snippet.js
@@ -0,0 +1,101 @@
+'use strict';
+
+
+var common = require('./common');
+
+
+// get snippet for a single line, respecting maxLength
+function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
+ var head = '';
+ var tail = '';
+ var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
+
+ if (position - lineStart > maxHalfLength) {
+ head = ' ... ';
+ lineStart = position - maxHalfLength + head.length;
+ }
+
+ if (lineEnd - position > maxHalfLength) {
+ tail = ' ...';
+ lineEnd = position + maxHalfLength - tail.length;
+ }
+
+ return {
+ str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, 'ā†’') + tail,
+ pos: position - lineStart + head.length // relative position
+ };
+}
+
+
+function padStart(string, max) {
+ return common.repeat(' ', max - string.length) + string;
+}
+
+
+function makeSnippet(mark, options) {
+ options = Object.create(options || null);
+
+ if (!mark.buffer) return null;
+
+ if (!options.maxLength) options.maxLength = 79;
+ if (typeof options.indent !== 'number') options.indent = 1;
+ if (typeof options.linesBefore !== 'number') options.linesBefore = 3;
+ if (typeof options.linesAfter !== 'number') options.linesAfter = 2;
+
+ var re = /\r?\n|\r|\0/g;
+ var lineStarts = [ 0 ];
+ var lineEnds = [];
+ var match;
+ var foundLineNo = -1;
+
+ while ((match = re.exec(mark.buffer))) {
+ lineEnds.push(match.index);
+ lineStarts.push(match.index + match[0].length);
+
+ if (mark.position <= match.index && foundLineNo < 0) {
+ foundLineNo = lineStarts.length - 2;
+ }
+ }
+
+ if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
+
+ var result = '', i, line;
+ var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
+ var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
+
+ for (i = 1; i <= options.linesBefore; i++) {
+ if (foundLineNo - i < 0) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo - i],
+ lineEnds[foundLineNo - i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
+ maxLineLength
+ );
+ result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n' + result;
+ }
+
+ line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
+ result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\n';
+
+ for (i = 1; i <= options.linesAfter; i++) {
+ if (foundLineNo + i >= lineEnds.length) break;
+ line = getLine(
+ mark.buffer,
+ lineStarts[foundLineNo + i],
+ lineEnds[foundLineNo + i],
+ mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
+ maxLineLength
+ );
+ result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +
+ ' | ' + line.str + '\n';
+ }
+
+ return result.replace(/\n$/, '');
+}
+
+
+module.exports = makeSnippet;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type.js
new file mode 100644
index 00000000000..5e57877fead
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type.js
@@ -0,0 +1,66 @@
+'use strict';
+
+var YAMLException = require('./exception');
+
+var TYPE_CONSTRUCTOR_OPTIONS = [
+ 'kind',
+ 'multi',
+ 'resolve',
+ 'construct',
+ 'instanceOf',
+ 'predicate',
+ 'represent',
+ 'representName',
+ 'defaultStyle',
+ 'styleAliases'
+];
+
+var YAML_NODE_KINDS = [
+ 'scalar',
+ 'sequence',
+ 'mapping'
+];
+
+function compileStyleAliases(map) {
+ var result = {};
+
+ if (map !== null) {
+ Object.keys(map).forEach(function (style) {
+ map[style].forEach(function (alias) {
+ result[String(alias)] = style;
+ });
+ });
+ }
+
+ return result;
+}
+
+function Type(tag, options) {
+ options = options || {};
+
+ Object.keys(options).forEach(function (name) {
+ if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
+ throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
+ }
+ });
+
+ // TODO: Add tag format check.
+ this.options = options; // keep original options in case user wants to extend this type later
+ this.tag = tag;
+ this.kind = options['kind'] || null;
+ this.resolve = options['resolve'] || function () { return true; };
+ this.construct = options['construct'] || function (data) { return data; };
+ this.instanceOf = options['instanceOf'] || null;
+ this.predicate = options['predicate'] || null;
+ this.represent = options['represent'] || null;
+ this.representName = options['representName'] || null;
+ this.defaultStyle = options['defaultStyle'] || null;
+ this.multi = options['multi'] || false;
+ this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
+
+ if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
+ throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
+ }
+}
+
+module.exports = Type;
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js
new file mode 100644
index 00000000000..e1523513df1
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/binary.js
@@ -0,0 +1,125 @@
+'use strict';
+
+/*eslint-disable no-bitwise*/
+
+
+var Type = require('../type');
+
+
+// [ 64, 65, 66 ] -> [ padding, CR, LF ]
+var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
+
+
+function resolveYamlBinary(data) {
+ if (data === null) return false;
+
+ var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
+
+ // Convert one by one.
+ for (idx = 0; idx < max; idx++) {
+ code = map.indexOf(data.charAt(idx));
+
+ // Skip CR/LF
+ if (code > 64) continue;
+
+ // Fail on illegal characters
+ if (code < 0) return false;
+
+ bitlen += 6;
+ }
+
+ // If there are any bits left, source was corrupted
+ return (bitlen % 8) === 0;
+}
+
+function constructYamlBinary(data) {
+ var idx, tailbits,
+ input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
+ max = input.length,
+ map = BASE64_MAP,
+ bits = 0,
+ result = [];
+
+ // Collect by 6*4 bits (3 bytes)
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 4 === 0) && idx) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ }
+
+ bits = (bits << 6) | map.indexOf(input.charAt(idx));
+ }
+
+ // Dump tail
+
+ tailbits = (max % 4) * 6;
+
+ if (tailbits === 0) {
+ result.push((bits >> 16) & 0xFF);
+ result.push((bits >> 8) & 0xFF);
+ result.push(bits & 0xFF);
+ } else if (tailbits === 18) {
+ result.push((bits >> 10) & 0xFF);
+ result.push((bits >> 2) & 0xFF);
+ } else if (tailbits === 12) {
+ result.push((bits >> 4) & 0xFF);
+ }
+
+ return new Uint8Array(result);
+}
+
+function representYamlBinary(object /*, style*/) {
+ var result = '', bits = 0, idx, tail,
+ max = object.length,
+ map = BASE64_MAP;
+
+ // Convert every three bytes to 4 ASCII characters.
+
+ for (idx = 0; idx < max; idx++) {
+ if ((idx % 3 === 0) && idx) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ }
+
+ bits = (bits << 8) + object[idx];
+ }
+
+ // Dump tail
+
+ tail = max % 3;
+
+ if (tail === 0) {
+ result += map[(bits >> 18) & 0x3F];
+ result += map[(bits >> 12) & 0x3F];
+ result += map[(bits >> 6) & 0x3F];
+ result += map[bits & 0x3F];
+ } else if (tail === 2) {
+ result += map[(bits >> 10) & 0x3F];
+ result += map[(bits >> 4) & 0x3F];
+ result += map[(bits << 2) & 0x3F];
+ result += map[64];
+ } else if (tail === 1) {
+ result += map[(bits >> 2) & 0x3F];
+ result += map[(bits << 4) & 0x3F];
+ result += map[64];
+ result += map[64];
+ }
+
+ return result;
+}
+
+function isBinary(obj) {
+ return Object.prototype.toString.call(obj) === '[object Uint8Array]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:binary', {
+ kind: 'scalar',
+ resolve: resolveYamlBinary,
+ construct: constructYamlBinary,
+ predicate: isBinary,
+ represent: representYamlBinary
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js
new file mode 100644
index 00000000000..cb7745930a6
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/bool.js
@@ -0,0 +1,35 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlBoolean(data) {
+ if (data === null) return false;
+
+ var max = data.length;
+
+ return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
+ (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
+}
+
+function constructYamlBoolean(data) {
+ return data === 'true' ||
+ data === 'True' ||
+ data === 'TRUE';
+}
+
+function isBoolean(object) {
+ return Object.prototype.toString.call(object) === '[object Boolean]';
+}
+
+module.exports = new Type('tag:yaml.org,2002:bool', {
+ kind: 'scalar',
+ resolve: resolveYamlBoolean,
+ construct: constructYamlBoolean,
+ predicate: isBoolean,
+ represent: {
+ lowercase: function (object) { return object ? 'true' : 'false'; },
+ uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
+ camelcase: function (object) { return object ? 'True' : 'False'; }
+ },
+ defaultStyle: 'lowercase'
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/float.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/float.js
new file mode 100644
index 00000000000..74d77ec2e66
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/float.js
@@ -0,0 +1,97 @@
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+var YAML_FLOAT_PATTERN = new RegExp(
+ // 2.5e4, 2.5 and integers
+ '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
+ // .2e4, .2
+ // special case, seems not from spec
+ '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
+ // .inf
+ '|[-+]?\\.(?:inf|Inf|INF)' +
+ // .nan
+ '|\\.(?:nan|NaN|NAN))$');
+
+function resolveYamlFloat(data) {
+ if (data === null) return false;
+
+ if (!YAML_FLOAT_PATTERN.test(data) ||
+ // Quick hack to not allow integers end with `_`
+ // Probably should update regexp & check speed
+ data[data.length - 1] === '_') {
+ return false;
+ }
+
+ return true;
+}
+
+function constructYamlFloat(data) {
+ var value, sign;
+
+ value = data.replace(/_/g, '').toLowerCase();
+ sign = value[0] === '-' ? -1 : 1;
+
+ if ('+-'.indexOf(value[0]) >= 0) {
+ value = value.slice(1);
+ }
+
+ if (value === '.inf') {
+ return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
+
+ } else if (value === '.nan') {
+ return NaN;
+ }
+ return sign * parseFloat(value, 10);
+}
+
+
+var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
+
+function representYamlFloat(object, style) {
+ var res;
+
+ if (isNaN(object)) {
+ switch (style) {
+ case 'lowercase': return '.nan';
+ case 'uppercase': return '.NAN';
+ case 'camelcase': return '.NaN';
+ }
+ } else if (Number.POSITIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '.inf';
+ case 'uppercase': return '.INF';
+ case 'camelcase': return '.Inf';
+ }
+ } else if (Number.NEGATIVE_INFINITY === object) {
+ switch (style) {
+ case 'lowercase': return '-.inf';
+ case 'uppercase': return '-.INF';
+ case 'camelcase': return '-.Inf';
+ }
+ } else if (common.isNegativeZero(object)) {
+ return '-0.0';
+ }
+
+ res = object.toString(10);
+
+ // JS stringifier can build scientific format without dots: 5e-100,
+ // while YAML requres dot: 5.e-100. Fix it with simple hack
+
+ return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
+}
+
+function isFloat(object) {
+ return (Object.prototype.toString.call(object) === '[object Number]') &&
+ (object % 1 !== 0 || common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:float', {
+ kind: 'scalar',
+ resolve: resolveYamlFloat,
+ construct: constructYamlFloat,
+ predicate: isFloat,
+ represent: representYamlFloat,
+ defaultStyle: 'lowercase'
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/int.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/int.js
new file mode 100644
index 00000000000..3fe3a4437b8
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/int.js
@@ -0,0 +1,156 @@
+'use strict';
+
+var common = require('../common');
+var Type = require('../type');
+
+function isHexCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
+ ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
+ ((0x61/* a */ <= c) && (c <= 0x66/* f */));
+}
+
+function isOctCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
+}
+
+function isDecCode(c) {
+ return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
+}
+
+function resolveYamlInteger(data) {
+ if (data === null) return false;
+
+ var max = data.length,
+ index = 0,
+ hasDigits = false,
+ ch;
+
+ if (!max) return false;
+
+ ch = data[index];
+
+ // sign
+ if (ch === '-' || ch === '+') {
+ ch = data[++index];
+ }
+
+ if (ch === '0') {
+ // 0
+ if (index + 1 === max) return true;
+ ch = data[++index];
+
+ // base 2, base 8, base 16
+
+ if (ch === 'b') {
+ // base 2
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (ch !== '0' && ch !== '1') return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'x') {
+ // base 16
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isHexCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+
+
+ if (ch === 'o') {
+ // base 8
+ index++;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isOctCode(data.charCodeAt(index))) return false;
+ hasDigits = true;
+ }
+ return hasDigits && ch !== '_';
+ }
+ }
+
+ // base 10 (except 0)
+
+ // value should not start with `_`;
+ if (ch === '_') return false;
+
+ for (; index < max; index++) {
+ ch = data[index];
+ if (ch === '_') continue;
+ if (!isDecCode(data.charCodeAt(index))) {
+ return false;
+ }
+ hasDigits = true;
+ }
+
+ // Should have digits and should not end with `_`
+ if (!hasDigits || ch === '_') return false;
+
+ return true;
+}
+
+function constructYamlInteger(data) {
+ var value = data, sign = 1, ch;
+
+ if (value.indexOf('_') !== -1) {
+ value = value.replace(/_/g, '');
+ }
+
+ ch = value[0];
+
+ if (ch === '-' || ch === '+') {
+ if (ch === '-') sign = -1;
+ value = value.slice(1);
+ ch = value[0];
+ }
+
+ if (value === '0') return 0;
+
+ if (ch === '0') {
+ if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
+ if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);
+ if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);
+ }
+
+ return sign * parseInt(value, 10);
+}
+
+function isInteger(object) {
+ return (Object.prototype.toString.call(object)) === '[object Number]' &&
+ (object % 1 === 0 && !common.isNegativeZero(object));
+}
+
+module.exports = new Type('tag:yaml.org,2002:int', {
+ kind: 'scalar',
+ resolve: resolveYamlInteger,
+ construct: constructYamlInteger,
+ predicate: isInteger,
+ represent: {
+ binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
+ octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },
+ decimal: function (obj) { return obj.toString(10); },
+ /* eslint-disable max-len */
+ hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
+ },
+ defaultStyle: 'decimal',
+ styleAliases: {
+ binary: [ 2, 'bin' ],
+ octal: [ 8, 'oct' ],
+ decimal: [ 10, 'dec' ],
+ hexadecimal: [ 16, 'hex' ]
+ }
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/map.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/map.js
new file mode 100644
index 00000000000..f327beebd53
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/map.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:map', {
+ kind: 'mapping',
+ construct: function (data) { return data !== null ? data : {}; }
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/merge.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/merge.js
new file mode 100644
index 00000000000..ae08a86444c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/merge.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlMerge(data) {
+ return data === '<<' || data === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:merge', {
+ kind: 'scalar',
+ resolve: resolveYamlMerge
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/null.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/null.js
new file mode 100644
index 00000000000..315ca4e236d
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/null.js
@@ -0,0 +1,35 @@
+'use strict';
+
+var Type = require('../type');
+
+function resolveYamlNull(data) {
+ if (data === null) return true;
+
+ var max = data.length;
+
+ return (max === 1 && data === '~') ||
+ (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
+}
+
+function constructYamlNull() {
+ return null;
+}
+
+function isNull(object) {
+ return object === null;
+}
+
+module.exports = new Type('tag:yaml.org,2002:null', {
+ kind: 'scalar',
+ resolve: resolveYamlNull,
+ construct: constructYamlNull,
+ predicate: isNull,
+ represent: {
+ canonical: function () { return '~'; },
+ lowercase: function () { return 'null'; },
+ uppercase: function () { return 'NULL'; },
+ camelcase: function () { return 'Null'; },
+ empty: function () { return ''; }
+ },
+ defaultStyle: 'lowercase'
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js
new file mode 100644
index 00000000000..b2b5323bd1c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/omap.js
@@ -0,0 +1,44 @@
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+var _toString = Object.prototype.toString;
+
+function resolveYamlOmap(data) {
+ if (data === null) return true;
+
+ var objectKeys = [], index, length, pair, pairKey, pairHasKey,
+ object = data;
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+ pairHasKey = false;
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ for (pairKey in pair) {
+ if (_hasOwnProperty.call(pair, pairKey)) {
+ if (!pairHasKey) pairHasKey = true;
+ else return false;
+ }
+ }
+
+ if (!pairHasKey) return false;
+
+ if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
+ else return false;
+ }
+
+ return true;
+}
+
+function constructYamlOmap(data) {
+ return data !== null ? data : [];
+}
+
+module.exports = new Type('tag:yaml.org,2002:omap', {
+ kind: 'sequence',
+ resolve: resolveYamlOmap,
+ construct: constructYamlOmap
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js
new file mode 100644
index 00000000000..74b52403fc1
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/pairs.js
@@ -0,0 +1,53 @@
+'use strict';
+
+var Type = require('../type');
+
+var _toString = Object.prototype.toString;
+
+function resolveYamlPairs(data) {
+ if (data === null) return true;
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ if (_toString.call(pair) !== '[object Object]') return false;
+
+ keys = Object.keys(pair);
+
+ if (keys.length !== 1) return false;
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return true;
+}
+
+function constructYamlPairs(data) {
+ if (data === null) return [];
+
+ var index, length, pair, keys, result,
+ object = data;
+
+ result = new Array(object.length);
+
+ for (index = 0, length = object.length; index < length; index += 1) {
+ pair = object[index];
+
+ keys = Object.keys(pair);
+
+ result[index] = [ keys[0], pair[keys[0]] ];
+ }
+
+ return result;
+}
+
+module.exports = new Type('tag:yaml.org,2002:pairs', {
+ kind: 'sequence',
+ resolve: resolveYamlPairs,
+ construct: constructYamlPairs
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/seq.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/seq.js
new file mode 100644
index 00000000000..be8f77f2844
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/seq.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:seq', {
+ kind: 'sequence',
+ construct: function (data) { return data !== null ? data : []; }
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/set.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/set.js
new file mode 100644
index 00000000000..f885a329c2c
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/set.js
@@ -0,0 +1,29 @@
+'use strict';
+
+var Type = require('../type');
+
+var _hasOwnProperty = Object.prototype.hasOwnProperty;
+
+function resolveYamlSet(data) {
+ if (data === null) return true;
+
+ var key, object = data;
+
+ for (key in object) {
+ if (_hasOwnProperty.call(object, key)) {
+ if (object[key] !== null) return false;
+ }
+ }
+
+ return true;
+}
+
+function constructYamlSet(data) {
+ return data !== null ? data : {};
+}
+
+module.exports = new Type('tag:yaml.org,2002:set', {
+ kind: 'mapping',
+ resolve: resolveYamlSet,
+ construct: constructYamlSet
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/str.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/str.js
new file mode 100644
index 00000000000..27acc106caa
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/str.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var Type = require('../type');
+
+module.exports = new Type('tag:yaml.org,2002:str', {
+ kind: 'scalar',
+ construct: function (data) { return data !== null ? data : ''; }
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js
new file mode 100644
index 00000000000..8fa9c586569
--- /dev/null
+++ b/tools/node_modules/eslint/node_modules/js-yaml/lib/type/timestamp.js
@@ -0,0 +1,88 @@
+'use strict';
+
+var Type = require('../type');
+
+var YAML_DATE_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9])' + // [2] month
+ '-([0-9][0-9])$'); // [3] day
+
+var YAML_TIMESTAMP_REGEXP = new RegExp(
+ '^([0-9][0-9][0-9][0-9])' + // [1] year
+ '-([0-9][0-9]?)' + // [2] month
+ '-([0-9][0-9]?)' + // [3] day
+ '(?:[Tt]|[ \\t]+)' + // ...
+ '([0-9][0-9]?)' + // [4] hour
+ ':([0-9][0-9])' + // [5] minute
+ ':([0-9][0-9])' + // [6] second
+ '(?:\\.([0-9]*))?' + // [7] fraction
+ '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
+ '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
+
+function resolveYamlTimestamp(data) {
+ if (data === null) return false;
+ if (YAML_DATE_REGEXP.exec(data) !== null) return true;
+ if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
+ return false;
+}
+
+function constructYamlTimestamp(data) {
+ var match, year, month, day, hour, minute, second, fraction = 0,
+ delta = null, tz_hour, tz_minute, date;
+
+ match = YAML_DATE_REGEXP.exec(data);
+ if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
+
+ if (match === null) throw new Error('Date resolve error');
+
+ // match: [1] year [2] month [3] day
+
+ year = +(match[1]);
+ month = +(match[2]) - 1; // JS month starts with 0
+ day = +(match[3]);
+
+ if (!match[4]) { // no hour
+ return new Date(Date.UTC(year, month, day));
+ }
+
+ // match: [4] hour [5] minute [6] second [7] fraction
+
+ hour = +(match[4]);
+ minute = +(match[5]);
+ second = +(match[6]);
+
+ if (match[7]) {
+ fraction = match[7].slice(0, 3);
+ while (fraction.length < 3) { // milli-seconds
+ fraction += '0';
+ }
+ fraction = +fraction;
+ }
+
+ // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
+
+ if (match[9]) {
+ tz_hour = +(match[10]);
+ tz_minute = +(match[11] || 0);
+ delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
+ if (match[9] === '-') delta = -delta;
+ }
+
+ date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
+
+ if (delta) date.setTime(date.getTime() - delta);
+
+ return date;
+}
+
+function representYamlTimestamp(object /*, style*/) {
+ return object.toISOString();
+}
+
+module.exports = new Type('tag:yaml.org,2002:timestamp', {
+ kind: 'scalar',
+ resolve: resolveYamlTimestamp,
+ construct: constructYamlTimestamp,
+ instanceOf: Date,
+ represent: representYamlTimestamp
+});
diff --git a/tools/node_modules/eslint/node_modules/js-yaml/package.json b/tools/node_modules/eslint/node_modules/js-yaml/package.json
index 0d2366762c5..17574da805a 100644
--- a/tools/node_modules/eslint/node_modules/js-yaml/package.json
+++ b/tools/node_modules/eslint/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 <dervus.grim@gmail.com>",
"contributors": [
"Aleksey V Zapparov <ixti@member.fsf.org> (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/tools/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE b/tools/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE
deleted file mode 100644
index e0c69d56032..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-Copyright jQuery Foundation and other contributors <https://jquery.org/>
-
-Based on Underscore.js, copyright Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
-
-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/tools/node_modules/eslint/node_modules/lodash.clonedeep/README.md b/tools/node_modules/eslint/node_modules/lodash.clonedeep/README.md
deleted file mode 100644
index fee48e4706a..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.clonedeep/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# lodash.clonedeep v4.5.0
-
-The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module.
-
-## Installation
-
-Using npm:
-```bash
-$ {sudo -H} npm i -g npm
-$ npm i --save lodash.clonedeep
-```
-
-In Node.js:
-```js
-var cloneDeep = require('lodash.clonedeep');
-```
-
-See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details.
diff --git a/tools/node_modules/eslint/node_modules/lodash.clonedeep/index.js b/tools/node_modules/eslint/node_modules/lodash.clonedeep/index.js
deleted file mode 100644
index 1b0e5029822..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.clonedeep/index.js
+++ /dev/null
@@ -1,1748 +0,0 @@
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/** Used as the size to enable large array optimizations. */
-var LARGE_ARRAY_SIZE = 200;
-
-/** Used to stand-in for `undefined` hash values. */
-var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
-/** Used as references for various `Number` constants. */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- weakMapTag = '[object WeakMap]';
-
-var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
-/**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
-var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
-
-/** Used to match `RegExp` flags from their coerced string values. */
-var reFlags = /\w*$/;
-
-/** Used to detect host constructors (Safari). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/** Used to detect unsigned integer values. */
-var reIsUint = /^(?:0|[1-9]\d*)$/;
-
-/** Used to identify `toStringTag` values supported by `_.clone`. */
-var cloneableTags = {};
-cloneableTags[argsTag] = cloneableTags[arrayTag] =
-cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
-cloneableTags[boolTag] = cloneableTags[dateTag] =
-cloneableTags[float32Tag] = cloneableTags[float64Tag] =
-cloneableTags[int8Tag] = cloneableTags[int16Tag] =
-cloneableTags[int32Tag] = cloneableTags[mapTag] =
-cloneableTags[numberTag] = cloneableTags[objectTag] =
-cloneableTags[regexpTag] = cloneableTags[setTag] =
-cloneableTags[stringTag] = cloneableTags[symbolTag] =
-cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
-cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
-cloneableTags[errorTag] = cloneableTags[funcTag] =
-cloneableTags[weakMapTag] = false;
-
-/** Detect free variable `global` from Node.js. */
-var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
-/** Detect free variable `self`. */
-var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
-/** Used as a reference to the global object. */
-var root = freeGlobal || freeSelf || Function('return this')();
-
-/** Detect free variable `exports`. */
-var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
-
-/** Detect free variable `module`. */
-var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
-
-/** Detect the popular CommonJS extension `module.exports`. */
-var moduleExports = freeModule && freeModule.exports === freeExports;
-
-/**
- * Adds the key-value `pair` to `map`.
- *
- * @private
- * @param {Object} map The map to modify.
- * @param {Array} pair The key-value pair to add.
- * @returns {Object} Returns `map`.
- */
-function addMapEntry(map, pair) {
- // Don't return `map.set` because it's not chainable in IE 11.
- map.set(pair[0], pair[1]);
- return map;
-}
-
-/**
- * Adds `value` to `set`.
- *
- * @private
- * @param {Object} set The set to modify.
- * @param {*} value The value to add.
- * @returns {Object} Returns `set`.
- */
-function addSetEntry(set, value) {
- // Don't return `set.add` because it's not chainable in IE 11.
- set.add(value);
- return set;
-}
-
-/**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
-function arrayEach(array, iteratee) {
- var index = -1,
- length = array ? array.length : 0;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
-}
-
-/**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
-function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
-}
-
-/**
- * A specialized version of `_.reduce` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
-function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1,
- length = array ? array.length : 0;
-
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
-}
-
-/**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
-function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
-
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
-}
-
-/**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
-function getValue(object, key) {
- return object == null ? undefined : object[key];
-}
-
-/**
- * Checks if `value` is a host object in IE < 9.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
- */
-function isHostObject(value) {
- // Many host objects are `Object` objects that can coerce to strings
- // despite having improperly defined `toString` methods.
- var result = false;
- if (value != null && typeof value.toString != 'function') {
- try {
- result = !!(value + '');
- } catch (e) {}
- }
- return result;
-}
-
-/**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
-function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
-
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
-}
-
-/**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
-function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
-}
-
-/**
- * Converts `set` to an array of its values.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
- */
-function setToArray(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
-}
-
-/** Used for built-in method references. */
-var arrayProto = Array.prototype,
- funcProto = Function.prototype,
- objectProto = Object.prototype;
-
-/** Used to detect overreaching core-js shims. */
-var coreJsData = root['__core-js_shared__'];
-
-/** Used to detect methods masquerading as native. */
-var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
-}());
-
-/** Used to resolve the decompiled source of functions. */
-var funcToString = funcProto.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objectToString = objectProto.toString;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/** Built-in value references. */
-var Buffer = moduleExports ? root.Buffer : undefined,
- Symbol = root.Symbol,
- Uint8Array = root.Uint8Array,
- getPrototype = overArg(Object.getPrototypeOf, Object),
- objectCreate = Object.create,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- splice = arrayProto.splice;
-
-/* Built-in method references for those with the same name as other `lodash` methods. */
-var nativeGetSymbols = Object.getOwnPropertySymbols,
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
- nativeKeys = overArg(Object.keys, Object);
-
-/* Built-in method references that are verified to be native. */
-var DataView = getNative(root, 'DataView'),
- Map = getNative(root, 'Map'),
- Promise = getNative(root, 'Promise'),
- Set = getNative(root, 'Set'),
- WeakMap = getNative(root, 'WeakMap'),
- nativeCreate = getNative(Object, 'create');
-
-/** Used to detect maps, sets, and weakmaps. */
-var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
-
-/** Used to convert symbols to primitives and strings. */
-var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
-
-/**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
-function Hash(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
-}
-
-/**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
-function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
-}
-
-/**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
-function hashDelete(key) {
- return this.has(key) && delete this.__data__[key];
-}
-
-/**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
-function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
-}
-
-/**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
-function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
-}
-
-/**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
-function hashSet(key, value) {
- var data = this.__data__;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
-}
-
-// Add methods to `Hash`.
-Hash.prototype.clear = hashClear;
-Hash.prototype['delete'] = hashDelete;
-Hash.prototype.get = hashGet;
-Hash.prototype.has = hashHas;
-Hash.prototype.set = hashSet;
-
-/**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
-function ListCache(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
-}
-
-/**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
-function listCacheClear() {
- this.__data__ = [];
-}
-
-/**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
-function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- return true;
-}
-
-/**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
-function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- return index < 0 ? undefined : data[index][1];
-}
-
-/**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
-function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
-}
-
-/**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
-function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
-}
-
-// Add methods to `ListCache`.
-ListCache.prototype.clear = listCacheClear;
-ListCache.prototype['delete'] = listCacheDelete;
-ListCache.prototype.get = listCacheGet;
-ListCache.prototype.has = listCacheHas;
-ListCache.prototype.set = listCacheSet;
-
-/**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
-function MapCache(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
-}
-
-/**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
-function mapCacheClear() {
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
-}
-
-/**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
-function mapCacheDelete(key) {
- return getMapData(this, key)['delete'](key);
-}
-
-/**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
-function mapCacheGet(key) {
- return getMapData(this, key).get(key);
-}
-
-/**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
-function mapCacheHas(key) {
- return getMapData(this, key).has(key);
-}
-
-/**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
-function mapCacheSet(key, value) {
- getMapData(this, key).set(key, value);
- return this;
-}
-
-// Add methods to `MapCache`.
-MapCache.prototype.clear = mapCacheClear;
-MapCache.prototype['delete'] = mapCacheDelete;
-MapCache.prototype.get = mapCacheGet;
-MapCache.prototype.has = mapCacheHas;
-MapCache.prototype.set = mapCacheSet;
-
-/**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
-function Stack(entries) {
- this.__data__ = new ListCache(entries);
-}
-
-/**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
-function stackClear() {
- this.__data__ = new ListCache;
-}
-
-/**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
-function stackDelete(key) {
- return this.__data__['delete'](key);
-}
-
-/**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
-function stackGet(key) {
- return this.__data__.get(key);
-}
-
-/**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
-function stackHas(key) {
- return this.__data__.has(key);
-}
-
-/**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
-function stackSet(key, value) {
- var cache = this.__data__;
- if (cache instanceof ListCache) {
- var pairs = cache.__data__;
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- return this;
- }
- cache = this.__data__ = new MapCache(pairs);
- }
- cache.set(key, value);
- return this;
-}
-
-// Add methods to `Stack`.
-Stack.prototype.clear = stackClear;
-Stack.prototype['delete'] = stackDelete;
-Stack.prototype.get = stackGet;
-Stack.prototype.has = stackHas;
-Stack.prototype.set = stackSet;
-
-/**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
-function arrayLikeKeys(value, inherited) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- // Safari 9 makes `arguments.length` enumerable in strict mode.
- var result = (isArray(value) || isArguments(value))
- ? baseTimes(value.length, String)
- : [];
-
- var length = result.length,
- skipIndexes = !!length;
-
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
-function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- object[key] = value;
- }
-}
-
-/**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
-function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
-}
-
-/**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
-function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
-}
-
-/**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @param {boolean} [isFull] Specify a clone including symbols.
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
-function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
- var result;
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value),
- isFunc = tag == funcTag || tag == genTag;
-
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- if (isHostObject(value)) {
- return object ? value : {};
- }
- result = initCloneObject(isFunc ? {} : value);
- if (!isDeep) {
- return copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, baseClone, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new Stack);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
-
- if (!isArr) {
- var props = isFull ? getAllKeys(value) : keys(value);
- }
- arrayEach(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
- });
- return result;
-}
-
-/**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
-function baseCreate(proto) {
- return isObject(proto) ? objectCreate(proto) : {};
-}
-
-/**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
-function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
-}
-
-/**
- * The base implementation of `getTag`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
-function baseGetTag(value) {
- return objectToString.call(value);
-}
-
-/**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
-function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
-}
-
-/**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
-function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var result = new buffer.constructor(buffer.length);
- buffer.copy(result);
- return result;
-}
-
-/**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
-function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
-}
-
-/**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
-function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
-}
-
-/**
- * Creates a clone of `map`.
- *
- * @private
- * @param {Object} map The map to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned map.
- */
-function cloneMap(map, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
- return arrayReduce(array, addMapEntry, new map.constructor);
-}
-
-/**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
-function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
-}
-
-/**
- * Creates a clone of `set`.
- *
- * @private
- * @param {Object} set The set to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned set.
- */
-function cloneSet(set, isDeep, cloneFunc) {
- var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
- return arrayReduce(array, addSetEntry, new set.constructor);
-}
-
-/**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
-function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
-}
-
-/**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
-function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
-}
-
-/**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
-function copyArray(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
-}
-
-/**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
-function copyObject(source, props, object, customizer) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
-
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
-
- assignValue(object, key, newValue === undefined ? source[key] : newValue);
- }
- return object;
-}
-
-/**
- * Copies own symbol properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
-function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
-}
-
-/**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
-function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
-}
-
-/**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
-function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
-}
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
-}
-
-/**
- * Creates an array of the own enumerable symbol properties of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
-var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
-
-/**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
-var getTag = baseGetTag;
-
-// Fallback for data views, maps, sets, and weak maps in IE 11,
-// for data views in Edge < 14, and promises in Node.js.
-if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
- (Map && getTag(new Map) != mapTag) ||
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
- (Set && getTag(new Set) != setTag) ||
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function(value) {
- var result = objectToString.call(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : undefined;
-
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
-}
-
-/**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
-function initCloneArray(array) {
- var length = array.length,
- result = array.constructor(length);
-
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
-}
-
-/**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
-function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !isPrototype(object))
- ? baseCreate(getPrototype(object))
- : {};
-}
-
-/**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {Function} cloneFunc The function to clone values.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
-function initCloneByTag(object, tag, cloneFunc, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case dataViewTag:
- return cloneDataView(object, isDeep);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return cloneTypedArray(object, isDeep);
-
- case mapTag:
- return cloneMap(object, isDeep, cloneFunc);
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- return cloneRegExp(object);
-
- case setTag:
- return cloneSet(object, isDeep, cloneFunc);
-
- case symbolTag:
- return cloneSymbol(object);
- }
-}
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length &&
- (typeof value == 'number' || reIsUint.test(value)) &&
- (value > -1 && value % 1 == 0 && value < length);
-}
-
-/**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
-function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
-}
-
-/**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
-function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
-}
-
-/**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
-function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
- return value === proto;
-}
-
-/**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to process.
- * @returns {string} Returns the source code.
- */
-function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
-}
-
-/**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
-function cloneDeep(value) {
- return baseClone(value, true, true);
-}
-
-/**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
-function eq(value, other) {
- return value === other || (value !== value && other !== other);
-}
-
-/**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-}
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
-var isArray = Array.isArray;
-
-/**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
-function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
-}
-
-/**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
-function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
-}
-
-/**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
-var isBuffer = nativeIsBuffer || stubFalse;
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
-function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
-}
-
-/**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
-function stubArray() {
- return [];
-}
-
-/**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
-function stubFalse() {
- return false;
-}
-
-module.exports = cloneDeep;
diff --git a/tools/node_modules/eslint/node_modules/lodash.clonedeep/package.json b/tools/node_modules/eslint/node_modules/lodash.clonedeep/package.json
deleted file mode 100644
index fb1d626d5c6..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.clonedeep/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name": "lodash.clonedeep",
- "version": "4.5.0",
- "description": "The lodash method `_.cloneDeep` exported as a module.",
- "homepage": "https://lodash.com/",
- "icon": "https://lodash.com/icon.svg",
- "license": "MIT",
- "keywords": "lodash-modularized, clonedeep",
- "author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
- "contributors": [
- "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
- "Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
- "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
- ],
- "repository": "lodash/lodash",
- "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
-}
diff --git a/tools/node_modules/eslint/node_modules/lodash.truncate/LICENSE b/tools/node_modules/eslint/node_modules/lodash.truncate/LICENSE
deleted file mode 100644
index e0c69d56032..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.truncate/LICENSE
+++ /dev/null
@@ -1,47 +0,0 @@
-Copyright jQuery Foundation and other contributors <https://jquery.org/>
-
-Based on Underscore.js, copyright Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
-
-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/tools/node_modules/eslint/node_modules/lodash.truncate/README.md b/tools/node_modules/eslint/node_modules/lodash.truncate/README.md
deleted file mode 100644
index a2936e9afc4..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/lodash.truncate/index.js b/tools/node_modules/eslint/node_modules/lodash.truncate/index.js
deleted file mode 100644
index 4f5449ecc7d..00000000000
--- a/tools/node_modules/eslint/node_modules/lodash.truncate/index.js
+++ /dev/null
@@ -1,632 +0,0 @@
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * 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/tools/node_modules/eslint/node_modules/lodash.truncate/package.json b/tools/node_modules/eslint/node_modules/lodash.truncate/package.json
deleted file mode 100644
index 2e2bd531369..00000000000
--- a/tools/node_modules/eslint/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 <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
- "contributors": [
- "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
- "Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
- "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
- ],
- "repository": "lodash/lodash",
- "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
-}
diff --git a/tools/node_modules/eslint/node_modules/require-from-string/index.js b/tools/node_modules/eslint/node_modules/require-from-string/index.js
deleted file mode 100644
index cb5595fde96..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/require-from-string/license b/tools/node_modules/eslint/node_modules/require-from-string/license
deleted file mode 100644
index 1aeb74fd25e..00000000000
--- a/tools/node_modules/eslint/node_modules/require-from-string/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (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/tools/node_modules/eslint/node_modules/require-from-string/package.json b/tools/node_modules/eslint/node_modules/require-from-string/package.json
deleted file mode 100644
index 800d46efcb0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/require-from-string/readme.md b/tools/node_modules/eslint/node_modules/require-from-string/readme.md
deleted file mode 100644
index 88b3236f895..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/slice-ansi/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/index.js
deleted file mode 100755
index 72d37d9a588..00000000000
--- a/tools/node_modules/eslint/node_modules/slice-ansi/index.js
+++ /dev/null
@@ -1,103 +0,0 @@
-'use strict';
-const isFullwidthCodePoint = require('is-fullwidth-code-point');
-const astralRegex = require('astral-regex');
-const ansiStyles = require('ansi-styles');
-
-const ESCAPES = [
- '\u001B',
- '\u009B'
-];
-
-const wrapAnsi = code => `${ESCAPES[0]}[${code}m`;
-
-const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
- let output = [];
- ansiCodes = [...ansiCodes];
-
- for (let ansiCode of ansiCodes) {
- const ansiCodeOrigin = ansiCode;
- if (ansiCode.includes(';')) {
- ansiCode = ansiCode.split(';')[0][0] + '0';
- }
-
- const item = ansiStyles.codes.get(Number.parseInt(ansiCode, 10));
- if (item) {
- const indexEscape = ansiCodes.indexOf(item.toString());
- if (indexEscape === -1) {
- output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
- } else {
- ansiCodes.splice(indexEscape, 1);
- }
- } else if (isEscapes) {
- output.push(wrapAnsi(0));
- break;
- } else {
- output.push(wrapAnsi(ansiCodeOrigin));
- }
- }
-
- if (isEscapes) {
- output = output.filter((element, index) => output.indexOf(element) === index);
-
- if (endAnsiCode !== undefined) {
- const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(Number.parseInt(endAnsiCode, 10)));
- output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
- }
- }
-
- return output.join('');
-};
-
-module.exports = (string, begin, end) => {
- const characters = [...string];
- const ansiCodes = [];
-
- let stringEnd = typeof end === 'number' ? end : characters.length;
- let isInsideEscape = false;
- let ansiCode;
- let visible = 0;
- let output = '';
-
- for (const [index, character] of characters.entries()) {
- let leftEscape = false;
-
- if (ESCAPES.includes(character)) {
- const code = /\d[^m]*/.exec(string.slice(index, index + 18));
- ansiCode = code && code.length > 0 ? code[0] : undefined;
-
- if (visible < stringEnd) {
- isInsideEscape = true;
-
- if (ansiCode !== undefined) {
- ansiCodes.push(ansiCode);
- }
- }
- } else if (isInsideEscape && character === 'm') {
- isInsideEscape = false;
- leftEscape = true;
- }
-
- if (!isInsideEscape && !leftEscape) {
- visible++;
- }
-
- if (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) {
- visible++;
-
- if (typeof end !== 'number') {
- stringEnd++;
- }
- }
-
- if (visible > begin && visible <= stringEnd) {
- output += character;
- } else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {
- output = checkAnsi(ansiCodes);
- } else if (visible >= stringEnd) {
- output += checkAnsi(ansiCodes, true, ansiCode);
- break;
- }
- }
-
- return output;
-};
diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/license b/tools/node_modules/eslint/node_modules/slice-ansi/license
deleted file mode 100644
index e05b33c5573..00000000000
--- a/tools/node_modules/eslint/node_modules/slice-ansi/license
+++ /dev/null
@@ -1,10 +0,0 @@
-MIT License
-
-Copyright (c) DC <threedeecee@gmail.com>
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/slice-ansi/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/package.json
deleted file mode 100644
index 7d6ea6956dc..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/slice-ansi/readme.md b/tools/node_modules/eslint/node_modules/slice-ansi/readme.md
deleted file mode 100644
index 88d36772ce2..00000000000
--- a/tools/node_modules/eslint/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-)
-
----
-
-<div align="center">
- <b>
- <a href="https://tidelift.com/subscription/pkg/npm-slice_ansi?utm_source=npm-slice-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
- </b>
- <br>
- <sub>
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
- </sub>
-</div>
diff --git a/tools/node_modules/eslint/node_modules/string-width/index.js b/tools/node_modules/eslint/node_modules/string-width/index.js
deleted file mode 100644
index f4d261a96a0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/string-width/license b/tools/node_modules/eslint/node_modules/string-width/license
deleted file mode 100644
index e7af2f77107..00000000000
--- a/tools/node_modules/eslint/node_modules/string-width/license
+++ /dev/null
@@ -1,9 +0,0 @@
-MIT License
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/node_modules/eslint/node_modules/string-width/package.json b/tools/node_modules/eslint/node_modules/string-width/package.json
deleted file mode 100644
index b9b20caaf6f..00000000000
--- a/tools/node_modules/eslint/node_modules/string-width/package.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
- "name": "string-width",
- "version": "4.2.2",
- "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.0"
- },
- "devDependencies": {
- "ava": "^1.4.1",
- "tsd": "^0.7.1",
- "xo": "^0.24.0"
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/string-width/readme.md b/tools/node_modules/eslint/node_modules/string-width/readme.md
deleted file mode 100644
index bdd314129ca..00000000000
--- a/tools/node_modules/eslint/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
-
-
----
-
-<div align="center">
- <b>
- <a href="https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
- </b>
- <br>
- <sub>
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
- </sub>
-</div>
diff --git a/tools/node_modules/eslint/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/strip-ansi/package.json
index 65a6c95161f..1a41108d428 100644
--- a/tools/node_modules/eslint/node_modules/strip-ansi/package.json
+++ b/tools/node_modules/eslint/node_modules/strip-ansi/package.json
@@ -1,6 +1,6 @@
{
"name": "strip-ansi",
- "version": "6.0.0",
+ "version": "6.0.1",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
@@ -44,7 +44,7 @@
"text"
],
"dependencies": {
- "ansi-regex": "^5.0.0"
+ "ansi-regex": "^5.0.1"
},
"devDependencies": {
"ava": "^2.4.0",
diff --git a/tools/node_modules/eslint/node_modules/table/LICENSE b/tools/node_modules/eslint/node_modules/table/LICENSE
deleted file mode 100644
index 6c41d45cd76..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/README.md b/tools/node_modules/eslint/node_modules/table/README.md
deleted file mode 100644
index b96006e54f4..00000000000
--- a/tools/node_modules/eslint/node_modules/table/README.md
+++ /dev/null
@@ -1,759 +0,0 @@
-<a name="table"></a>
-# Table
-
-> Produces a string that represents array data in a text table.
-
-[![Travis build status](http://img.shields.io/travis/gajus/table/master.svg?style=flat-square)](https://travis-ci.org/gajus/table)
-[![Coveralls](https://img.shields.io/coveralls/gajus/table.svg?style=flat-square)](https://coveralls.io/github/gajus/table)
-[![NPM version](http://img.shields.io/npm/v/table.svg?style=flat-square)](https://www.npmjs.org/package/table)
-[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)
-[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social&label=Follow)](https://twitter.com/kuizinas)
-
-* [Table](#table)
- * [Features](#table-features)
- * [Install](#table-install)
- * [Usage](#table-usage)
- * [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)
-
-<a name="table-features"></a>
-## 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.
-
-<a name="table-install"></a>
-## 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)
-
-
-<a name="table-usage"></a>
-## 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 ā•‘
-ā•šā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•
-
-```
-
-
-<a name="table-api"></a>
-## API
-
-<a name="table-api-table-1"></a>
-### 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`
-
-<a name="table-api-table-1-config-border"></a>
-##### 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 ā”‚
-ā””ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”˜
-```
-
-<a name="table-api-table-1-config-drawverticalline"></a>
-##### 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 ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-
-```
-
-<a name="table-api-table-1-config-drawhorizontalline"></a>
-##### 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 ā•‘
-ā•šā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•
-
-```
-
-<a name="table-api-table-1-config-singleline"></a>
-##### 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 ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-```
-
-
-<a name="table-api-table-1-config-columns"></a>
-##### config.columns
-
-Type: `Column[] | { [columnIndex: number]: Column }`
-
-Column specific configurations.
-
-<a name="table-api-table-1-config-columns-config-columns-width"></a>
-###### 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 ā•‘
-ā•šā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•
-```
-
-<a name="table-api-table-1-config-columns-config-columns-alignment"></a>
-###### 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 ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-```
-
-<a name="table-api-table-1-config-columns-config-columns-verticalalignment"></a>
-###### 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 ā•‘
-ā•šā•ā•ā•ā•§ā•ā•ā•ā•§ā•ā•ā•ā•§ā•ā•ā•ā•
-```
-
-<a name="table-api-table-1-config-columns-config-columns-paddingleft"></a>
-###### config.columns[*].paddingLeft
-
-Type: `number`\
-Default: `1`
-
-The number of whitespaces used to pad the content on the left.
-
-<a name="table-api-table-1-config-columns-config-columns-paddingright"></a>
-###### 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 ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•
-```
-
-<a name="table-api-table-1-config-columns-config-columns-truncate"></a>
-###### 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ā€¦ ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-```
-
-<a name="table-api-table-1-config-columns-config-columns-wrapword"></a>
-###### 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. ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-
-```
-
-
-<a name="table-api-table-1-config-columndefault"></a>
-##### config.columnDefault
-
-Type: `Column`\
-Default: `{}`
-
-The default configuration for all columns. Column-specific settings will overwrite the default values.
-
-
-<a name="table-api-table-1-config-header"></a>
-##### config.header
-
-Type: `object`
-
-Header configuration.
-
-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 ā•‘
-ā•šā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•§ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•ā•
-```
-
-
-<a name="table-api-createstream"></a>
-### 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)
-
-
-<a name="table-api-getbordercharacters"></a>
-### 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.
-
-<a name="table-api-getbordercharacters-borderless-table"></a>
-#### 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/tools/node_modules/eslint/node_modules/table/dist/alignString.js b/tools/node_modules/eslint/node_modules/table/dist/alignString.js
deleted file mode 100644
index 61dc552c948..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/alignString.js
+++ /dev/null
@@ -1,59 +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 = utils_1.countSpaceSequence(subject);
- if (spaceSequenceCount === 0) {
- return alignLeft(subject, width);
- }
- const addingSpaces = 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 = 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;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js
deleted file mode 100644
index 5daa581a53d..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js
+++ /dev/null
@@ -1,13 +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) => {
- return row.map((cell, cellIndex) => {
- const { width, alignment } = config.columns[cellIndex];
- return alignString_1.alignString(cell, width, alignment);
- });
- });
-};
-exports.alignTableData = alignTableData;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js
deleted file mode 100644
index 372943ad582..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js
+++ /dev/null
@@ -1,11 +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 wrapCell_1.wrapCell(value, columnWidth, useWrapWord).length;
-};
-exports.calculateCellHeight = calculateCellHeight;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidths.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidths.js
deleted file mode 100644
index 684115dd5cd..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidths.js
+++ /dev/null
@@ -1,16 +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.calculateCellWidths = void 0;
-const string_width_1 = __importDefault(require("string-width"));
-/**
- * Calculates width of each cell contents in a row.
- */
-const calculateCellWidths = (cells) => {
- return cells.map((cell) => {
- return Math.max(...cell.split('\n').map(string_width_1.default));
- });
-};
-exports.calculateCellWidths = calculateCellWidths;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateColumnWidths.js b/tools/node_modules/eslint/node_modules/table/dist/calculateColumnWidths.js
deleted file mode 100644
index b4f80a380a4..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/calculateColumnWidths.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const calculateCellWidths_1 = require("./calculateCellWidths");
-/**
- * Produces an array of values that describe the largest value length (width) in every column.
- */
-exports.default = (rows) => {
- const columnWidths = new Array(rows[0].length).fill(0);
- rows.forEach((row) => {
- const cellWidths = calculateCellWidths_1.calculateCellWidths(row);
- cellWidths.forEach((cellWidth, cellIndex) => {
- columnWidths[cellIndex] = Math.max(columnWidths[cellIndex], cellWidth);
- });
- });
- return columnWidths;
-};
diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeights.js b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeights.js
deleted file mode 100644
index d3411f89baf..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeights.js
+++ /dev/null
@@ -1,18 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.calculateRowHeights = void 0;
-const calculateCellHeight_1 = require("./calculateCellHeight");
-/**
- * Produces an array of values that describe the largest value length (height) in every row.
- */
-const calculateRowHeights = (rows, config) => {
- return rows.map((row) => {
- let rowHeight = 1;
- row.forEach((cell, cellIndex) => {
- const cellHeight = calculateCellHeight_1.calculateCellHeight(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord);
- rowHeight = Math.max(rowHeight, cellHeight);
- });
- return rowHeight;
- });
-};
-exports.calculateRowHeights = calculateRowHeights;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js b/tools/node_modules/eslint/node_modules/table/dist/createStream.js
deleted file mode 100644
index d941b4b6f96..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js
+++ /dev/null
@@ -1,72 +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 prepareData = (data, config) => {
- let rows = stringifyTableData_1.stringifyTableData(data);
- rows = truncateTableData_1.truncateTableData(rows, config);
- const rowHeights = calculateRowHeights_1.calculateRowHeights(rows, config);
- rows = mapDataUsingRowHeights_1.mapDataUsingRowHeights(rows, rowHeights, config);
- rows = alignTableData_1.alignTableData(rows, config);
- rows = padTableData_1.padTableData(rows, config);
- return rows;
-};
-const create = (row, columnWidths, config) => {
- const rows = prepareData([row], config);
- const body = rows.map((literalRow) => {
- return drawRow_1.drawRow(literalRow, config);
- }).join('');
- let output;
- output = '';
- output += drawBorder_1.drawBorderTop(columnWidths, config);
- output += body;
- output += 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 drawRow_1.drawRow(literalRow, config);
- }).join('');
- let output = '';
- const bottom = drawBorder_1.drawBorderBottom(columnWidths, config);
- if (bottom !== '\n') {
- output = '\r\u001B[K';
- }
- output += drawBorder_1.drawBorderJoin(columnWidths, config);
- output += body;
- output += bottom;
- output = output.trimEnd();
- process.stdout.write(output);
-};
-const createStream = (userConfig) => {
- const config = 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;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js
deleted file mode 100644
index 1b158d9667d..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js
+++ /dev/null
@@ -1,100 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = exports.createTableBorderGetter = void 0;
-const drawContent_1 = require("./drawContent");
-const drawBorder = (columnWidths, config) => {
- const { separator, drawVerticalLine } = config;
- const columns = columnWidths.map((size) => {
- return config.separator.body.repeat(size);
- });
- return drawContent_1.drawContent(columns, {
- drawSeparator: drawVerticalLine,
- separatorGetter: (index, columnCount) => {
- if (index === 0) {
- return separator.left;
- }
- if (index === columnCount) {
- return separator.right;
- }
- return separator.join;
- },
- }) + '\n';
-};
-exports.drawBorder = drawBorder;
-const drawBorderTop = (columnWidths, config) => {
- const result = drawBorder(columnWidths, {
- ...config,
- separator: {
- body: config.border.topBody,
- join: config.border.topJoin,
- left: config.border.topLeft,
- right: config.border.topRight,
- },
- });
- if (result === '\n') {
- return '';
- }
- return result;
-};
-exports.drawBorderTop = drawBorderTop;
-const drawBorderJoin = (columnWidths, config) => {
- return drawBorder(columnWidths, {
- ...config,
- separator: {
- body: config.border.joinBody,
- join: config.border.joinJoin,
- left: config.border.joinLeft,
- right: config.border.joinRight,
- },
- });
-};
-exports.drawBorderJoin = drawBorderJoin;
-const drawBorderBottom = (columnWidths, config) => {
- return drawBorder(columnWidths, {
- ...config,
- separator: {
- body: config.border.bottomBody,
- join: config.border.bottomJoin,
- left: config.border.bottomLeft,
- right: config.border.bottomRight,
- },
- });
-};
-exports.drawBorderBottom = drawBorderBottom;
-const createTableBorderGetter = (columnWidths, config) => {
- return (index, size) => {
- if (!config.header) {
- if (index === 0) {
- return drawBorderTop(columnWidths, config);
- }
- if (index === size) {
- return drawBorderBottom(columnWidths, config);
- }
- return drawBorderJoin(columnWidths, config);
- }
- // Deal with the header
- if (index === 0) {
- return drawBorderTop(columnWidths, {
- ...config,
- border: {
- ...config.border,
- topJoin: config.border.topBody,
- },
- });
- }
- if (index === 1) {
- return drawBorderJoin(columnWidths, {
- ...config,
- border: {
- ...config.border,
- joinJoin: config.border.headerJoin,
- },
- });
- }
- if (index === size) {
- return drawBorderBottom(columnWidths, config);
- }
- return drawBorderJoin(columnWidths, config);
- };
-};
-exports.createTableBorderGetter = createTableBorderGetter;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawContent.js b/tools/node_modules/eslint/node_modules/table/dist/drawContent.js
deleted file mode 100644
index ce084dc5303..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/drawContent.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.drawContent = void 0;
-/**
- * Shared function to draw horizontal borders, rows or the entire table
- */
-const drawContent = (contents, separatorConfig) => {
- const { separatorGetter, drawSeparator } = separatorConfig;
- const contentSize = contents.length;
- const result = [];
- if (drawSeparator(0, contentSize)) {
- result.push(separatorGetter(0, contentSize));
- }
- contents.forEach((content, contentIndex) => {
- result.push(content);
- // Only append the middle separator if the content is not the last
- if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) {
- result.push(separatorGetter(contentIndex + 1, contentSize));
- }
- });
- if (drawSeparator(contentSize, contentSize)) {
- result.push(separatorGetter(contentSize, contentSize));
- }
- return result.join('');
-};
-exports.drawContent = drawContent;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawHeader.js b/tools/node_modules/eslint/node_modules/table/dist/drawHeader.js
deleted file mode 100644
index 4ef46e9816a..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/drawHeader.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.drawHeader = void 0;
-const alignString_1 = require("./alignString");
-const drawRow_1 = require("./drawRow");
-const padTableData_1 = require("./padTableData");
-const truncateTableData_1 = require("./truncateTableData");
-const wrapCell_1 = require("./wrapCell");
-const drawHeader = (width, config) => {
- if (!config.header) {
- throw new Error('Can not draw header without header configuration');
- }
- const { alignment, paddingRight, paddingLeft, wrapWord } = config.header;
- let content = config.header.content;
- content = truncateTableData_1.truncateString(content, config.header.truncate);
- const headerLines = wrapCell_1.wrapCell(content, width, wrapWord);
- return headerLines.map((headerLine) => {
- let line = alignString_1.alignString(headerLine, width, alignment);
- line = padTableData_1.padString(line, paddingLeft, paddingRight);
- return drawRow_1.drawRow([line], {
- ...config,
- drawVerticalLine: (index) => {
- const columnCount = config.columns.length;
- return config.drawVerticalLine(index === 0 ? 0 : columnCount, columnCount);
- },
- });
- }).join('');
-};
-exports.drawHeader = drawHeader;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js
deleted file mode 100644
index 7d5756b176f..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js
+++ /dev/null
@@ -1,20 +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 } = config;
- return drawContent_1.drawContent(row, {
- drawSeparator: drawVerticalLine,
- separatorGetter: (index, columnCount) => {
- if (index === 0) {
- return border.bodyLeft;
- }
- if (index === columnCount) {
- return border.bodyRight;
- }
- return border.bodyJoin;
- },
- }) + '\n';
-};
-exports.drawRow = drawRow;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js
deleted file mode 100644
index 60685dd95ba..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js
+++ /dev/null
@@ -1,38 +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.drawTable = void 0;
-const string_width_1 = __importDefault(require("string-width"));
-const drawBorder_1 = require("./drawBorder");
-const drawContent_1 = require("./drawContent");
-const drawHeader_1 = require("./drawHeader");
-const drawRow_1 = require("./drawRow");
-const utils_1 = require("./utils");
-const drawTable = (rows, columnWidths, rowHeights, config) => {
- const { drawHorizontalLine, singleLine, } = config;
- const contents = utils_1.groupBySizes(rows, rowHeights).map((group) => {
- return group.map((row) => {
- return drawRow_1.drawRow(row, config);
- }).join('');
- });
- if (config.header) {
- // assume that topLeft/right border have width = 1
- const headerWidth = string_width_1.default(drawRow_1.drawRow(rows[0], config)) - 2 -
- config.header.paddingLeft - config.header.paddingRight;
- const header = drawHeader_1.drawHeader(headerWidth, config);
- contents.unshift(header);
- }
- return drawContent_1.drawContent(contents, {
- drawSeparator: (index, size) => {
- // Top/bottom border
- if (index === 0 || index === size) {
- return drawHorizontalLine(index, size);
- }
- return !singleLine && drawHorizontalLine(index, size);
- },
- separatorGetter: drawBorder_1.createTableBorderGetter(columnWidths, config),
- });
-};
-exports.drawTable = drawTable;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/generated/validators.js b/tools/node_modules/eslint/node_modules/table/dist/generated/validators.js
deleted file mode 100644
index 6291447bc6c..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/generated/validators.js
+++ /dev/null
@@ -1,2170 +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"
- }
- },
- "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"
- }
- },
- "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;
- }
- }
- }
- 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 validate64(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++;
- }
- validate64.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": {
- "type": "string",
- "enum": ["top", "middle", "bottom"]
- },
- "width": {
- "type": "integer",
- "minimum": 1
- },
- "wrapWord": {
- "type": "boolean"
- },
- "truncate": {
- "type": "integer"
- },
- "paddingLeft": {
- "type": "integer"
- },
- "paddingRight": {
- "type": "integer"
- }
- },
- "additionalProperties": false
-};
-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;
-}
-function validate67(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 (!(validate68(data.alignment, {
- instancePath: instancePath + "/alignment",
- parentData: data,
- parentDataProperty: "alignment",
- rootData
- }))) {
- vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);
- errors = vErrors.length;
- }
- }
- if (data.verticalAlignment !== undefined) {
- let data1 = data.verticalAlignment;
- if (typeof data1 !== "string") {
- const err1 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/type",
- keyword: "type",
- params: {
- type: "string"
- },
- message: "must be string"
- };
- if (vErrors === null) {
- vErrors = [err1];
- }
- else {
- vErrors.push(err1);
- }
- errors++;
- }
- if (!(((data1 === "top") || (data1 === "middle")) || (data1 === "bottom"))) {
- const err2 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/enum",
- keyword: "enum",
- params: {
- allowedValues: schema19.properties.verticalAlignment.enum
- },
- message: "must be equal to one of the allowed values"
- };
- if (vErrors === null) {
- vErrors = [err2];
- }
- else {
- vErrors.push(err2);
- }
- errors++;
- }
- }
- if (data.width !== undefined) {
- let data2 = data.width;
- if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
- const err3 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err3];
- }
- else {
- vErrors.push(err3);
- }
- errors++;
- }
- if ((typeof data2 == "number") && (isFinite(data2))) {
- if (data2 < 1 || isNaN(data2)) {
- const err4 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/minimum",
- keyword: "minimum",
- params: {
- comparison: ">=",
- limit: 1
- },
- message: "must be >= 1"
- };
- if (vErrors === null) {
- vErrors = [err4];
- }
- else {
- vErrors.push(err4);
- }
- errors++;
- }
- }
- }
- if (data.wrapWord !== undefined) {
- if (typeof data.wrapWord !== "boolean") {
- const err5 = {
- instancePath: instancePath + "/wrapWord",
- schemaPath: "#/properties/wrapWord/type",
- keyword: "type",
- params: {
- type: "boolean"
- },
- message: "must be boolean"
- };
- if (vErrors === null) {
- vErrors = [err5];
- }
- else {
- vErrors.push(err5);
- }
- errors++;
- }
- }
- if (data.truncate !== undefined) {
- let data4 = data.truncate;
- if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
- const err6 = {
- instancePath: instancePath + "/truncate",
- schemaPath: "#/properties/truncate/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err6];
- }
- else {
- vErrors.push(err6);
- }
- errors++;
- }
- }
- if (data.paddingLeft !== undefined) {
- let data5 = data.paddingLeft;
- if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) {
- const err7 = {
- instancePath: instancePath + "/paddingLeft",
- schemaPath: "#/properties/paddingLeft/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err7];
- }
- else {
- vErrors.push(err7);
- }
- errors++;
- }
- }
- if (data.paddingRight !== undefined) {
- let data6 = data.paddingRight;
- if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
- const err8 = {
- instancePath: instancePath + "/paddingRight",
- schemaPath: "#/properties/paddingRight/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err8];
- }
- else {
- vErrors.push(err8);
- }
- errors++;
- }
- }
- }
- else {
- const err9 = {
- instancePath,
- schemaPath: "#/type",
- keyword: "type",
- params: {
- type: "object"
- },
- message: "must be object"
- };
- if (vErrors === null) {
- vErrors = [err9];
- }
- else {
- vErrors.push(err9);
- }
- errors++;
- }
- validate67.errors = vErrors;
- return errors === 0;
-}
-function validate66(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 (!(validate67(data[key1], {
- instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
- parentData: data,
- parentDataProperty: key1,
- rootData
- }))) {
- vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.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 (!(validate67(data[i0], {
- instancePath: instancePath + "/" + i0,
- parentData: data,
- parentDataProperty: i0,
- rootData
- }))) {
- vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.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;
- }
- }
- }
- validate66.errors = vErrors;
- return errors === 0;
-}
-function validate73(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 (!(validate68(data.alignment, {
- instancePath: instancePath + "/alignment",
- parentData: data,
- parentDataProperty: "alignment",
- rootData
- }))) {
- vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);
- errors = vErrors.length;
- }
- }
- if (data.verticalAlignment !== undefined) {
- let data1 = data.verticalAlignment;
- if (typeof data1 !== "string") {
- const err1 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/type",
- keyword: "type",
- params: {
- type: "string"
- },
- message: "must be string"
- };
- if (vErrors === null) {
- vErrors = [err1];
- }
- else {
- vErrors.push(err1);
- }
- errors++;
- }
- if (!(((data1 === "top") || (data1 === "middle")) || (data1 === "bottom"))) {
- const err2 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/enum",
- keyword: "enum",
- params: {
- allowedValues: schema19.properties.verticalAlignment.enum
- },
- message: "must be equal to one of the allowed values"
- };
- if (vErrors === null) {
- vErrors = [err2];
- }
- else {
- vErrors.push(err2);
- }
- errors++;
- }
- }
- if (data.width !== undefined) {
- let data2 = data.width;
- if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
- const err3 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err3];
- }
- else {
- vErrors.push(err3);
- }
- errors++;
- }
- if ((typeof data2 == "number") && (isFinite(data2))) {
- if (data2 < 1 || isNaN(data2)) {
- const err4 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/minimum",
- keyword: "minimum",
- params: {
- comparison: ">=",
- limit: 1
- },
- message: "must be >= 1"
- };
- if (vErrors === null) {
- vErrors = [err4];
- }
- else {
- vErrors.push(err4);
- }
- errors++;
- }
- }
- }
- if (data.wrapWord !== undefined) {
- if (typeof data.wrapWord !== "boolean") {
- const err5 = {
- instancePath: instancePath + "/wrapWord",
- schemaPath: "#/properties/wrapWord/type",
- keyword: "type",
- params: {
- type: "boolean"
- },
- message: "must be boolean"
- };
- if (vErrors === null) {
- vErrors = [err5];
- }
- else {
- vErrors.push(err5);
- }
- errors++;
- }
- }
- if (data.truncate !== undefined) {
- let data4 = data.truncate;
- if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
- const err6 = {
- instancePath: instancePath + "/truncate",
- schemaPath: "#/properties/truncate/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err6];
- }
- else {
- vErrors.push(err6);
- }
- errors++;
- }
- }
- if (data.paddingLeft !== undefined) {
- let data5 = data.paddingLeft;
- if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) {
- const err7 = {
- instancePath: instancePath + "/paddingLeft",
- schemaPath: "#/properties/paddingLeft/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err7];
- }
- else {
- vErrors.push(err7);
- }
- errors++;
- }
- }
- if (data.paddingRight !== undefined) {
- let data6 = data.paddingRight;
- if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
- const err8 = {
- instancePath: instancePath + "/paddingRight",
- schemaPath: "#/properties/paddingRight/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err8];
- }
- else {
- vErrors.push(err8);
- }
- errors++;
- }
- }
- }
- else {
- const err9 = {
- instancePath,
- schemaPath: "#/type",
- keyword: "type",
- params: {
- type: "object"
- },
- message: "must be object"
- };
- if (vErrors === null) {
- vErrors = [err9];
- }
- else {
- vErrors.push(err9);
- }
- errors++;
- }
- validate73.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"))) {
- 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 (!(validate64(data1.alignment, {
- instancePath: instancePath + "/header/alignment",
- parentData: data1,
- parentDataProperty: "alignment",
- rootData
- }))) {
- vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.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 (!(validate66(data.columns, {
- instancePath: instancePath + "/columns",
- parentData: data,
- parentDataProperty: "columns",
- rootData
- }))) {
- vErrors = vErrors === null ? validate66.errors : vErrors.concat(validate66.errors);
- errors = vErrors.length;
- }
- }
- if (data.columnDefault !== undefined) {
- if (!(validate73(data.columnDefault, {
- instancePath: instancePath + "/columnDefault",
- parentData: data,
- parentDataProperty: "columnDefault",
- rootData
- }))) {
- vErrors = vErrors === null ? validate73.errors : vErrors.concat(validate73.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: "should 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: "should 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: "should pass \"typeof\" keyword validation"
- };
- if (vErrors === null) {
- vErrors = [err11];
- }
- else {
- vErrors.push(err11);
- }
- errors++;
- }
- }
- }
- else {
- const err12 = {
- instancePath,
- schemaPath: "#/type",
- keyword: "type",
- params: {
- type: "object"
- },
- message: "must be object"
- };
- if (vErrors === null) {
- vErrors = [err12];
- }
- else {
- vErrors.push(err12);
- }
- errors++;
- }
- validate43.errors = vErrors;
- return errors === 0;
-}
-exports["streamConfig.json"] = validate76;
-const schema22 = {
- "$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 validate77(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;
- }
- }
- }
- 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++;
- }
- validate77.errors = vErrors;
- return errors === 0;
-}
-function validate95(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 (!(validate67(data[key1], {
- instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
- parentData: data,
- parentDataProperty: key1,
- rootData
- }))) {
- vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.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 (!(validate67(data[i0], {
- instancePath: instancePath + "/" + i0,
- parentData: data,
- parentDataProperty: i0,
- rootData
- }))) {
- vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.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;
- }
- }
- }
- validate95.errors = vErrors;
- return errors === 0;
-}
-function validate99(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 (!(validate68(data.alignment, {
- instancePath: instancePath + "/alignment",
- parentData: data,
- parentDataProperty: "alignment",
- rootData
- }))) {
- vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);
- errors = vErrors.length;
- }
- }
- if (data.verticalAlignment !== undefined) {
- let data1 = data.verticalAlignment;
- if (typeof data1 !== "string") {
- const err1 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/type",
- keyword: "type",
- params: {
- type: "string"
- },
- message: "must be string"
- };
- if (vErrors === null) {
- vErrors = [err1];
- }
- else {
- vErrors.push(err1);
- }
- errors++;
- }
- if (!(((data1 === "top") || (data1 === "middle")) || (data1 === "bottom"))) {
- const err2 = {
- instancePath: instancePath + "/verticalAlignment",
- schemaPath: "#/properties/verticalAlignment/enum",
- keyword: "enum",
- params: {
- allowedValues: schema19.properties.verticalAlignment.enum
- },
- message: "must be equal to one of the allowed values"
- };
- if (vErrors === null) {
- vErrors = [err2];
- }
- else {
- vErrors.push(err2);
- }
- errors++;
- }
- }
- if (data.width !== undefined) {
- let data2 = data.width;
- if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
- const err3 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err3];
- }
- else {
- vErrors.push(err3);
- }
- errors++;
- }
- if ((typeof data2 == "number") && (isFinite(data2))) {
- if (data2 < 1 || isNaN(data2)) {
- const err4 = {
- instancePath: instancePath + "/width",
- schemaPath: "#/properties/width/minimum",
- keyword: "minimum",
- params: {
- comparison: ">=",
- limit: 1
- },
- message: "must be >= 1"
- };
- if (vErrors === null) {
- vErrors = [err4];
- }
- else {
- vErrors.push(err4);
- }
- errors++;
- }
- }
- }
- if (data.wrapWord !== undefined) {
- if (typeof data.wrapWord !== "boolean") {
- const err5 = {
- instancePath: instancePath + "/wrapWord",
- schemaPath: "#/properties/wrapWord/type",
- keyword: "type",
- params: {
- type: "boolean"
- },
- message: "must be boolean"
- };
- if (vErrors === null) {
- vErrors = [err5];
- }
- else {
- vErrors.push(err5);
- }
- errors++;
- }
- }
- if (data.truncate !== undefined) {
- let data4 = data.truncate;
- if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
- const err6 = {
- instancePath: instancePath + "/truncate",
- schemaPath: "#/properties/truncate/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err6];
- }
- else {
- vErrors.push(err6);
- }
- errors++;
- }
- }
- if (data.paddingLeft !== undefined) {
- let data5 = data.paddingLeft;
- if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) {
- const err7 = {
- instancePath: instancePath + "/paddingLeft",
- schemaPath: "#/properties/paddingLeft/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err7];
- }
- else {
- vErrors.push(err7);
- }
- errors++;
- }
- }
- if (data.paddingRight !== undefined) {
- let data6 = data.paddingRight;
- if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
- const err8 = {
- instancePath: instancePath + "/paddingRight",
- schemaPath: "#/properties/paddingRight/type",
- keyword: "type",
- params: {
- type: "integer"
- },
- message: "must be integer"
- };
- if (vErrors === null) {
- vErrors = [err8];
- }
- else {
- vErrors.push(err8);
- }
- errors++;
- }
- }
- }
- else {
- const err9 = {
- instancePath,
- schemaPath: "#/type",
- keyword: "type",
- params: {
- type: "object"
- },
- message: "must be object"
- };
- if (vErrors === null) {
- vErrors = [err9];
- }
- else {
- vErrors.push(err9);
- }
- errors++;
- }
- validate99.errors = vErrors;
- return errors === 0;
-}
-function validate76(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 (!(validate77(data.border, {
- instancePath: instancePath + "/border",
- parentData: data,
- parentDataProperty: "border",
- rootData
- }))) {
- vErrors = vErrors === null ? validate77.errors : vErrors.concat(validate77.errors);
- errors = vErrors.length;
- }
- }
- if (data.columns !== undefined) {
- if (!(validate95(data.columns, {
- instancePath: instancePath + "/columns",
- parentData: data,
- parentDataProperty: "columns",
- rootData
- }))) {
- vErrors = vErrors === null ? validate95.errors : vErrors.concat(validate95.errors);
- errors = vErrors.length;
- }
- }
- if (data.columnDefault !== undefined) {
- if (!(validate99(data.columnDefault, {
- instancePath: instancePath + "/columnDefault",
- parentData: data,
- parentDataProperty: "columnDefault",
- rootData
- }))) {
- vErrors = vErrors === null ? validate99.errors : vErrors.concat(validate99.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: "should 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++;
- }
- validate76.errors = vErrors;
- return errors === 0;
-}
diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js
deleted file mode 100644
index 3662a8a2ef0..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js
+++ /dev/null
@@ -1,88 +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: 'ā”¼',
- };
- }
- if (name === 'norc') {
- return {
- topBody: 'ā”€',
- topJoin: 'ā”¬',
- topLeft: 'ā”Œ',
- topRight: 'ā”',
- bottomBody: 'ā”€',
- bottomJoin: 'ā”“',
- bottomLeft: 'ā””',
- bottomRight: 'ā”˜',
- bodyLeft: 'ā”‚',
- bodyRight: 'ā”‚',
- bodyJoin: 'ā”‚',
- headerJoin: 'ā”¬',
- joinBody: 'ā”€',
- joinLeft: 'ā”œ',
- joinRight: 'ā”¤',
- joinJoin: 'ā”¼',
- };
- }
- if (name === 'ramac') {
- return {
- topBody: '-',
- topJoin: '+',
- topLeft: '+',
- topRight: '+',
- bottomBody: '-',
- bottomJoin: '+',
- bottomLeft: '+',
- bottomRight: '+',
- bodyLeft: '|',
- bodyRight: '|',
- bodyJoin: '|',
- headerJoin: '+',
- joinBody: '-',
- joinLeft: '|',
- joinRight: '|',
- joinJoin: '|',
- };
- }
- if (name === 'void') {
- return {
- topBody: '',
- topJoin: '',
- topLeft: '',
- topRight: '',
- bottomBody: '',
- bottomJoin: '',
- bottomLeft: '',
- bottomRight: '',
- bodyLeft: '',
- bodyRight: '',
- bodyJoin: '',
- headerJoin: '',
- joinBody: '',
- joinLeft: '',
- joinRight: '',
- joinJoin: '',
- };
- }
- throw new Error('Unknown border template "' + name + '".');
-};
-exports.getBorderCharacters = getBorderCharacters;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js b/tools/node_modules/eslint/node_modules/table/dist/index.js
deleted file mode 100644
index f8f84022f6b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/index.js
+++ /dev/null
@@ -1,20 +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);
diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js
deleted file mode 100644
index b8ae96f40be..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js
+++ /dev/null
@@ -1,47 +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.makeStreamConfig = void 0;
-const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
-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 = (userConfig) => {
- validateConfig_1.validateConfig('streamConfig.json', userConfig);
- const config = lodash_clonedeep_1.default(userConfig);
- if (config.columnDefault.width === undefined) {
- throw new Error('Must provide config.columnDefault.width when creating a stream.');
- }
- return {
- drawVerticalLine: () => {
- return true;
- },
- ...config,
- border: utils_1.makeBorderConfig(config.border),
- columns: makeColumnsConfig(config.columnCount, config.columns, config.columnDefault),
- };
-};
-exports.makeStreamConfig = makeStreamConfig;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeTableConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeTableConfig.js
deleted file mode 100644
index e37dd75836b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/makeTableConfig.js
+++ /dev/null
@@ -1,66 +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.makeTableConfig = void 0;
-const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
-const calculateColumnWidths_1 = __importDefault(require("./calculateColumnWidths"));
-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 = (rows, columns, columnDefault) => {
- const columnWidths = calculateColumnWidths_1.default(rows);
- 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],
- };
- });
-};
-const makeHeaderConfig = (config) => {
- if (!config.header) {
- return undefined;
- }
- return {
- alignment: 'center',
- paddingLeft: 1,
- paddingRight: 1,
- truncate: Number.POSITIVE_INFINITY,
- wrapWord: false,
- ...config.header,
- };
-};
-/**
- * Makes a new configuration object out of the userConfig object
- * using default values for the missing configuration properties.
- */
-const makeTableConfig = (rows, userConfig = {}) => {
- var _a, _b, _c;
- validateConfig_1.validateConfig('config.json', userConfig);
- const config = lodash_clonedeep_1.default(userConfig);
- return {
- ...config,
- border: utils_1.makeBorderConfig(config.border),
- columns: makeColumnsConfig(rows, config.columns, config.columnDefault),
- drawHorizontalLine: (_a = config.drawHorizontalLine) !== null && _a !== void 0 ? _a : (() => {
- return true;
- }),
- drawVerticalLine: (_b = config.drawVerticalLine) !== null && _b !== void 0 ? _b : (() => {
- return true;
- }),
- header: makeHeaderConfig(config),
- singleLine: (_c = config.singleLine) !== null && _c !== void 0 ? _c : false,
- };
-};
-exports.makeTableConfig = makeTableConfig;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeights.js b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeights.js
deleted file mode 100644
index 5727681d4e0..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeights.js
+++ /dev/null
@@ -1,44 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.mapDataUsingRowHeights = void 0;
-const wrapCell_1 = require("./wrapCell");
-const createEmptyStrings = (length) => {
- return new Array(length).fill('');
-};
-const padCellVertically = (lines, rowHeight, columnConfig) => {
- const { verticalAlignment } = columnConfig;
- 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)),
- ];
-};
-const flatten = (array) => {
- return [].concat(...array);
-};
-const mapDataUsingRowHeights = (unmappedRows, rowHeights, config) => {
- const tableWidth = unmappedRows[0].length;
- const mappedRows = unmappedRows.map((unmappedRow, unmappedRowIndex) => {
- const outputRowHeight = rowHeights[unmappedRowIndex];
- const outputRow = Array.from({ length: outputRowHeight }, () => {
- return new Array(tableWidth).fill('');
- });
- unmappedRow.forEach((cell, cellIndex) => {
- const cellLines = wrapCell_1.wrapCell(cell, config.columns[cellIndex].width, config.columns[cellIndex].wrapWord);
- const paddedCellLines = padCellVertically(cellLines, outputRowHeight, config.columns[cellIndex]);
- paddedCellLines.forEach((cellLine, cellLineIndex) => {
- outputRow[cellLineIndex][cellIndex] = cellLine;
- });
- });
- return outputRow;
- });
- return flatten(mappedRows);
-};
-exports.mapDataUsingRowHeights = mapDataUsingRowHeights;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js
deleted file mode 100644
index c0016ab5cde..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js
+++ /dev/null
@@ -1,16 +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) => {
- return cells.map((cell, cellIndex) => {
- const { paddingLeft, paddingRight } = config.columns[cellIndex];
- return exports.padString(cell, paddingLeft, paddingRight);
- });
- });
-};
-exports.padTableData = padTableData;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js
deleted file mode 100644
index 961b78d0bb5..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js
+++ /dev/null
@@ -1,12 +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 utils_1.normalizeString(String(cell));
- });
- });
-};
-exports.stringifyTableData = stringifyTableData;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js b/tools/node_modules/eslint/node_modules/table/dist/table.js
deleted file mode 100644
index 72c879dc418..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/table.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.table = void 0;
-const alignTableData_1 = require("./alignTableData");
-const calculateCellWidths_1 = require("./calculateCellWidths");
-const calculateRowHeights_1 = require("./calculateRowHeights");
-const drawTable_1 = require("./drawTable");
-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 validateTableData_1 = require("./validateTableData");
-const table = (data, userConfig = {}) => {
- validateTableData_1.validateTableData(data);
- let rows = stringifyTableData_1.stringifyTableData(data);
- const config = makeTableConfig_1.makeTableConfig(rows, userConfig);
- rows = truncateTableData_1.truncateTableData(rows, config);
- const rowHeights = calculateRowHeights_1.calculateRowHeights(rows, config);
- rows = mapDataUsingRowHeights_1.mapDataUsingRowHeights(rows, rowHeights, config);
- rows = alignTableData_1.alignTableData(rows, config);
- rows = padTableData_1.padTableData(rows, config);
- const cellWidths = calculateCellWidths_1.calculateCellWidths(rows[0]);
- return drawTable_1.drawTable(rows, cellWidths, rowHeights, config);
-};
-exports.table = table;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js
deleted file mode 100644
index 5810242a3d5..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js
+++ /dev/null
@@ -1,23 +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 lodash_truncate_1.default(input, { length,
- omission: 'ā€¦' });
-};
-exports.truncateString = truncateString;
-/**
- * @todo Make it work with ASCII content.
- */
-const truncateTableData = (rows, config) => {
- return rows.map((cells) => {
- return cells.map((cell, cellIndex) => {
- return exports.truncateString(cell, config.columns[cellIndex].truncate);
- });
- });
-};
-exports.truncateTableData = truncateTableData;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/types/api.js b/tools/node_modules/eslint/node_modules/table/dist/types/api.js
deleted file mode 100644
index c8ad2e549bd..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/types/api.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/node_modules/eslint/node_modules/table/dist/types/internal.js b/tools/node_modules/eslint/node_modules/table/dist/types/internal.js
deleted file mode 100644
index c8ad2e549bd..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/types/internal.js
+++ /dev/null
@@ -1,2 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/node_modules/eslint/node_modules/table/dist/utils.js b/tools/node_modules/eslint/node_modules/table/dist/utils.js
deleted file mode 100644
index 46d15851bfd..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/utils.js
+++ /dev/null
@@ -1,92 +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.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 = strip_ansi_1.default(input).split('\n').map(string_width_1.default);
- const result = [];
- let startIndex = 0;
- lengths.forEach((length) => {
- result.push(length === 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 {
- ...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;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js
deleted file mode 100644
index f1a743bc1dc..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js
+++ /dev/null
@@ -1,25 +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) {
- 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;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js
deleted file mode 100644
index 60ae3074093..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js
+++ /dev/null
@@ -1,31 +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(utils_1.normalizeString(String(cell)))) {
- throw new Error('Table data must not contain control characters.');
- }
- }
- }
-};
-exports.validateTableData = validateTableData;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js
deleted file mode 100644
index 64229d25533..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js
+++ /dev/null
@@ -1,32 +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 = 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 = wrapWord_1.wrapWord(cellLines[lineNr], cellWidth);
- }
- else {
- lineChunks = 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;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js
deleted file mode 100644
index 08fcc3fee5b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js
+++ /dev/null
@@ -1,26 +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(slice_ansi_1.default(subjectSlice, 0, size));
- subjectSlice = slice_ansi_1.default(subjectSlice, size).trim();
- } while (string_width_1.default(subjectSlice));
- return chunks;
-};
-exports.wrapString = wrapString;
diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js
deleted file mode 100644
index 1f2da3c5703..00000000000
--- a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js
+++ /dev/null
@@ -1,41 +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 = strip_ansi_1.default(input);
- const chunks = [];
- // https://regex101.com/r/gY5kZ1/1
- const re = new RegExp('(^.{1,' + String(size) + '}(\\s+|$))|(^.{1,' + String(size - 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(slice_ansi_1.default(input, startIndex, startIndex + length));
- startIndex += length + offset;
- });
- return result;
-};
-exports.wrapWord = wrapWord;
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.runkit_example.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/.runkit_example.js
deleted file mode 100644
index 0d578d5d51e..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/LICENSE
deleted file mode 100644
index 139162ad2c3..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md
deleted file mode 100644
index 25cc428c27f..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/README.md
+++ /dev/null
@@ -1,204 +0,0 @@
-<img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/img/ajv.svg">
-
-&nbsp;
-
-# 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/workflows/build/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild)
-[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)
-[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)
-[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master)
-[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
-[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)
-
-## Platinum sponsors
-
-[<img src="https://ajv.js.org/img/mozilla.svg" width="45%">](https://www.mozilla.org)<img src="https://ajv.js.org/img/gap.svg" width="8%">[<img src="https://ajv.js.org/img/reserved.svg" width="45%">](https://opencollective.com/ajv)
-
-## Ajv online event - May 20, 10am PT / 6pm UK
-
-We will talk about:
-- new features of Ajv version 8.
-- the improvements sponsored by Mozilla's MOSS grant.
-- how Ajv is used in JavaScript applications.
-
-Speakers:
-- [Evgeny Poberezkin](https://github.com/epoberezkin), the creator of Ajv.
-- [Mehan Jayasuriya](https://github.com/mehan), Program Officer at Mozilla Foundation, leading the [MOSS](https://www.mozilla.org/en-US/moss/) and other programs investing in the open source and community ecosystems.
-- [Matteo Collina](https://github.com/mcollina), Technical Director at NearForm and Node.js Technical Steering Committee member, creator of Fastify web framework.
-- [Kin Lane](https://github.com/kinlane), Chief Evangelist at Postman. Studying the tech, business & politics of APIs since 2010. Presidential Innovation Fellow during the Obama administration.
-- [Ulysse Carion](https://github.com/ucarion), the creator of JSON Type Definition specification.
-
-[Gajus Kuizinas](https://github.com/gajus) will host the event.
-
-Please [register here](https://us02web.zoom.us/webinar/register/2716192553618/WN_erJ_t4ICTHOnGC1SOybNnw).
-
-## 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)
-
-## <a name="sponsors"></a>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
-
-<a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a>
-
-<a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a>
-<a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a>
-
-## 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&#x2F;schemasafe|is-my-json-valid|djv|@cfworker&#x2F;json-schema|jsonschema&chd=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
-```
-
-## <a name="usage"></a>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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js
deleted file mode 100644
index 89d78532f13..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2019.js
+++ /dev/null
@@ -1,55 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
-const 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));
- }
-}
-module.exports = exports = 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; } });
-//# sourceMappingURL=2019.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2020.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2020.js
deleted file mode 100644
index bdd1dd69d38..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/2020.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
-const 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));
- }
-}
-module.exports = exports = 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; } });
-//# sourceMappingURL=2020.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js
deleted file mode 100644
index 219bcf0da50..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/ajv.js
+++ /dev/null
@@ -1,44 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
-const 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));
- }
-}
-module.exports = exports = 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; } });
-//# sourceMappingURL=ajv.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js
deleted file mode 100644
index cf3cdb57b35..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/code.js
+++ /dev/null
@@ -1,147 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.regexpCode = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
-class _CodeOrName {
-}
-exports._CodeOrName = _CodeOrName;
-exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
-class Name extends _CodeOrName {
- constructor(s) {
- super();
- if (!exports.IDENTIFIER.test(s))
- throw new Error("CodeGen: name must be a valid identifier");
- this.str = s;
- }
- toString() {
- return this.str;
- }
- emptyStr() {
- return false;
- }
- get names() {
- return { [this.str]: 1 };
- }
-}
-exports.Name = Name;
-class _Code extends _CodeOrName {
- constructor(code) {
- super();
- this._items = typeof code === "string" ? [code] : code;
- }
- toString() {
- return this.str;
- }
- emptyStr() {
- if (this._items.length > 1)
- return false;
- const item = this._items[0];
- return item === "" || item === '""';
- }
- get str() {
- var _a;
- return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
- }
- get names() {
- var _a;
- return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
- if (c instanceof Name)
- names[c.str] = (names[c.str] || 0) + 1;
- return names;
- }, {})));
- }
-}
-exports._Code = _Code;
-exports.nil = new _Code("");
-function _(strs, ...args) {
- const code = [strs[0]];
- let i = 0;
- while (i < args.length) {
- addCodeArg(code, args[i]);
- code.push(strs[++i]);
- }
- return new _Code(code);
-}
-exports._ = _;
-const plus = new _Code("+");
-function str(strs, ...args) {
- const expr = [safeStringify(strs[0])];
- let i = 0;
- while (i < args.length) {
- expr.push(plus);
- addCodeArg(expr, args[i]);
- expr.push(plus, safeStringify(strs[++i]));
- }
- optimize(expr);
- return new _Code(expr);
-}
-exports.str = str;
-function addCodeArg(code, arg) {
- if (arg instanceof _Code)
- code.push(...arg._items);
- else if (arg instanceof Name)
- code.push(arg);
- else
- code.push(interpolate(arg));
-}
-exports.addCodeArg = addCodeArg;
-function optimize(expr) {
- let i = 1;
- while (i < expr.length - 1) {
- if (expr[i] === plus) {
- const res = mergeExprItems(expr[i - 1], expr[i + 1]);
- if (res !== undefined) {
- expr.splice(i - 1, 3, res);
- continue;
- }
- expr[i++] = "+";
- }
- i++;
- }
-}
-function mergeExprItems(a, b) {
- if (b === '""')
- return a;
- if (a === '""')
- return b;
- if (typeof a == "string") {
- if (b instanceof Name || a[a.length - 1] !== '"')
- return;
- if (typeof b != "string")
- return `${a.slice(0, -1)}${b}"`;
- if (b[0] === '"')
- return a.slice(0, -1) + b.slice(1);
- return;
- }
- if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
- return `"${a}${b.slice(1)}`;
- return;
-}
-function strConcat(c1, c2) {
- return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
-}
-exports.strConcat = strConcat;
-// TODO do not allow arrays here
-function interpolate(x) {
- return typeof x == "number" || typeof x == "boolean" || x === null
- ? x
- : safeStringify(Array.isArray(x) ? x.join(",") : x);
-}
-function stringify(x) {
- return new _Code(safeStringify(x));
-}
-exports.stringify = stringify;
-function safeStringify(x) {
- return JSON.stringify(x)
- .replace(/\u2028/g, "\\u2028")
- .replace(/\u2029/g, "\\u2029");
-}
-exports.safeStringify = safeStringify;
-function getProperty(key) {
- return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
-}
-exports.getProperty = getProperty;
-function regexpCode(rx) {
- return new _Code(rx.toString());
-}
-exports.regexpCode = regexpCode;
-//# sourceMappingURL=code.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/index.js
deleted file mode 100644
index 0667fb6e29e..00000000000
--- a/tools/node_modules/eslint/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(":");
- code_1.addCodeArg(code, value);
- }
- }
- code.push("}");
- return new code_1._Code(code);
- }
- // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
- if(condition, thenBody, elseBody) {
- this._blockNode(new If(condition));
- if (thenBody && elseBody) {
- this.code(thenBody).else().code(elseBody).endIf();
- }
- else if (thenBody) {
- this.code(thenBody).endIf();
- }
- else if (elseBody) {
- throw new Error('CodeGen: "else" body without "then" body');
- }
- return this;
- }
- // `else if` clause - invalid without `if` or after `else` clauses
- elseIf(condition) {
- return this._elseNode(new If(condition));
- }
- // `else` clause - only valid after `if` or `else if` clauses
- else() {
- return this._elseNode(new Else());
- }
- // end `if` statement (needed if gen.if was used only with condition)
- endIf() {
- return this._endBlockNode(If, Else);
- }
- _for(node, forBody) {
- this._blockNode(node);
- if (forBody)
- this.code(forBody).endFor();
- return this;
- }
- // a generic `for` clause (or statement if `forBody` is passed)
- for(iteration, forBody) {
- return this._for(new ForLoop(iteration), forBody);
- }
- // `for` statement for a range of values
- forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
- const name = this._scope.toName(nameOrPrefix);
- return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
- }
- // `for-of` statement (in es5 mode replace with a normal for loop)
- forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
- const name = this._scope.toName(nameOrPrefix);
- if (this.opts.es5) {
- const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
- return this.forRange("_i", 0, code_1._ `${arr}.length`, (i) => {
- this.var(name, code_1._ `${arr}[${i}]`);
- forBody(name);
- });
- }
- return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
- }
- // `for-in` statement.
- // With option `ownProperties` replaced with a `for-of` loop for object keys
- forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
- if (this.opts.ownProperties) {
- return this.forOf(nameOrPrefix, code_1._ `Object.keys(${obj})`, forBody);
- }
- const name = this._scope.toName(nameOrPrefix);
- return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
- }
- // end `for` loop
- endFor() {
- return this._endBlockNode(For);
- }
- // `label` statement
- label(label) {
- return this._leafNode(new Label(label));
- }
- // `break` statement
- break(label) {
- return this._leafNode(new Break(label));
- }
- // `return` statement
- return(value) {
- const node = new Return();
- this._blockNode(node);
- this.code(value);
- if (node.nodes.length !== 1)
- throw new Error('CodeGen: "return" should have one node');
- return this._endBlockNode(Return);
- }
- // `try` statement
- try(tryBody, catchCode, finallyCode) {
- if (!catchCode && !finallyCode)
- throw new Error('CodeGen: "try" without "catch" and "finally"');
- const node = new Try();
- this._blockNode(node);
- this.code(tryBody);
- if (catchCode) {
- const error = this.name("e");
- this._currNode = node.catch = new Catch(error);
- catchCode(error);
- }
- if (finallyCode) {
- this._currNode = node.finally = new Finally();
- this.code(finallyCode);
- }
- return this._endBlockNode(Catch, Finally);
- }
- // `throw` statement
- throw(error) {
- return this._leafNode(new Throw(error));
- }
- // start self-balancing block
- block(body, nodeCount) {
- this._blockStarts.push(this._nodes.length);
- if (body)
- this.code(body).endBlock(nodeCount);
- return this;
- }
- // end the current self-balancing block
- endBlock(nodeCount) {
- const len = this._blockStarts.pop();
- if (len === undefined)
- throw new Error("CodeGen: not in self-balancing block");
- const toClose = this._nodes.length - len;
- if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
- throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
- }
- this._nodes.length = len;
- return this;
- }
- // `function` heading (or definition if funcBody is passed)
- func(name, args = code_1.nil, async, funcBody) {
- this._blockNode(new Func(name, args, async));
- if (funcBody)
- this.code(funcBody).endFunc();
- return this;
- }
- // end function definition
- endFunc() {
- return this._endBlockNode(Func);
- }
- optimize(n = 1) {
- while (n-- > 0) {
- this._root.optimizeNodes();
- this._root.optimizeNames(this._root.names, this._constants);
- }
- }
- _leafNode(node) {
- this._currNode.nodes.push(node);
- return this;
- }
- _blockNode(node) {
- this._currNode.nodes.push(node);
- this._nodes.push(node);
- }
- _endBlockNode(N1, N2) {
- const n = this._currNode;
- if (n instanceof N1 || (N2 && n instanceof N2)) {
- this._nodes.pop();
- return this;
- }
- throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
- }
- _elseNode(node) {
- const n = this._currNode;
- if (!(n instanceof If)) {
- throw new Error('CodeGen: "else" without "if"');
- }
- this._currNode = n.else = node;
- return this;
- }
- get _root() {
- return this._nodes[0];
- }
- get _currNode() {
- const ns = this._nodes;
- return ns[ns.length - 1];
- }
- set _currNode(node) {
- const ns = this._nodes;
- ns[ns.length - 1] = node;
- }
-}
-exports.CodeGen = CodeGen;
-function addNames(names, from) {
- for (const n in from)
- names[n] = (names[n] || 0) + (from[n] || 0);
- return names;
-}
-function addExprNames(names, from) {
- return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
-}
-function optimizeExpr(expr, names, constants) {
- if (expr instanceof code_1.Name)
- return replaceName(expr);
- if (!canOptimize(expr))
- return expr;
- return new code_1._Code(expr._items.reduce((items, c) => {
- if (c instanceof code_1.Name)
- c = replaceName(c);
- if (c instanceof code_1._Code)
- items.push(...c._items);
- else
- items.push(c);
- return items;
- }, []));
- function replaceName(n) {
- const c = constants[n.str];
- if (c === undefined || names[n.str] !== 1)
- return n;
- delete names[n.str];
- return c;
- }
- function canOptimize(e) {
- return (e instanceof code_1._Code &&
- e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));
- }
-}
-function subtractNames(names, from) {
- for (const n in from)
- names[n] = (names[n] || 0) - (from[n] || 0);
-}
-function not(x) {
- return typeof x == "boolean" || typeof x == "number" || x === null ? !x : code_1._ `!${par(x)}`;
-}
-exports.not = not;
-const andCode = mappend(exports.operators.AND);
-// boolean AND (&&) expression with the passed arguments
-function and(...args) {
- return args.reduce(andCode);
-}
-exports.and = and;
-const orCode = mappend(exports.operators.OR);
-// boolean OR (||) expression with the passed arguments
-function or(...args) {
- return args.reduce(orCode);
-}
-exports.or = or;
-function mappend(op) {
- return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : code_1._ `${par(x)} ${op} ${par(y)}`);
-}
-function par(x) {
- return x instanceof code_1.Name ? x : code_1._ `(${x})`;
-}
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js
deleted file mode 100644
index 91919e8880b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.js
+++ /dev/null
@@ -1,143 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
-const code_1 = require("./code");
-class ValueError extends Error {
- constructor(name) {
- super(`CodeGen: "code" for ${name} not defined`);
- this.value = name.value;
- }
-}
-var UsedValueState;
-(function (UsedValueState) {
- UsedValueState[UsedValueState["Started"] = 0] = "Started";
- UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
-})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {}));
-exports.varKinds = {
- const: new code_1.Name("const"),
- let: new code_1.Name("let"),
- var: new code_1.Name("var"),
-};
-class Scope {
- constructor({ prefixes, parent } = {}) {
- this._names = {};
- this._prefixes = prefixes;
- this._parent = parent;
- }
- toName(nameOrPrefix) {
- return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
- }
- name(prefix) {
- return new code_1.Name(this._newName(prefix));
- }
- _newName(prefix) {
- const ng = this._names[prefix] || this._nameGroup(prefix);
- return `${prefix}${ng.index++}`;
- }
- _nameGroup(prefix) {
- var _a, _b;
- if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
- throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
- }
- return (this._names[prefix] = { prefix, index: 0 });
- }
-}
-exports.Scope = Scope;
-class ValueScopeName extends code_1.Name {
- constructor(prefix, nameStr) {
- super(nameStr);
- this.prefix = prefix;
- }
- setValue(value, { property, itemIndex }) {
- this.value = value;
- this.scopePath = code_1._ `.${new code_1.Name(property)}[${itemIndex}]`;
- }
-}
-exports.ValueScopeName = ValueScopeName;
-const line = code_1._ `\n`;
-class ValueScope extends Scope {
- constructor(opts) {
- super(opts);
- this._values = {};
- this._scope = opts.scope;
- this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
- }
- get() {
- return this._scope;
- }
- name(prefix) {
- return new ValueScopeName(prefix, this._newName(prefix));
- }
- value(nameOrPrefix, value) {
- var _a;
- if (value.ref === undefined)
- throw new Error("CodeGen: ref must be passed in value");
- const name = this.toName(nameOrPrefix);
- const { prefix } = name;
- const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
- let vs = this._values[prefix];
- if (vs) {
- const _name = vs.get(valueKey);
- if (_name)
- return _name;
- }
- else {
- vs = this._values[prefix] = new Map();
- }
- vs.set(valueKey, name);
- const s = this._scope[prefix] || (this._scope[prefix] = []);
- const itemIndex = s.length;
- s[itemIndex] = value.ref;
- name.setValue(value, { property: prefix, itemIndex });
- return name;
- }
- getValue(prefix, keyOrRef) {
- const vs = this._values[prefix];
- if (!vs)
- return;
- return vs.get(keyOrRef);
- }
- scopeRefs(scopeName, values = this._values) {
- return this._reduceValues(values, (name) => {
- if (name.scopePath === undefined)
- throw new Error(`CodeGen: name "${name}" has no value`);
- return code_1._ `${scopeName}${name.scopePath}`;
- });
- }
- scopeCode(values = this._values, usedValues, getCode) {
- return this._reduceValues(values, (name) => {
- if (name.value === undefined)
- throw new Error(`CodeGen: name "${name}" has no value`);
- return name.value.code;
- }, usedValues, getCode);
- }
- _reduceValues(values, valueCode, usedValues = {}, getCode) {
- let code = code_1.nil;
- for (const prefix in values) {
- const vs = values[prefix];
- if (!vs)
- continue;
- const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
- vs.forEach((name) => {
- if (nameSet.has(name))
- return;
- nameSet.set(name, UsedValueState.Started);
- let c = valueCode(name);
- if (c) {
- const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
- code = code_1._ `${code}${def} ${name} = ${c};${this.opts._n}`;
- }
- else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
- code = code_1._ `${code}${c}${this.opts._n}`;
- }
- else {
- throw new ValueError(name);
- }
- nameSet.set(name, UsedValueState.Completed);
- });
- }
- return code;
- }
-}
-exports.ValueScope = ValueScope;
-//# sourceMappingURL=scope.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/errors.js
deleted file mode 100644
index 27b2091762c..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1.str `must pass "${keyword}" keyword validation`,
-};
-exports.keyword$DataError = {
- message: ({ keyword, schemaType }) => schemaType
- ? codegen_1.str `"${keyword}" keyword must be ${schemaType} ($data)`
- : codegen_1.str `"${keyword}" keyword is invalid ($data)`,
-};
-function reportError(cxt, error = exports.keywordError, 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, 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(codegen_1._ `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign(codegen_1._ `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
-}
-exports.resetErrorsCount = resetErrorsCount;
-function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
- /* istanbul ignore if */
- if (errsCount === undefined)
- throw new Error("ajv implementation error");
- const err = gen.name("err");
- gen.forRange("i", errsCount, names_1.default.errors, (i) => {
- gen.const(err, codegen_1._ `${names_1.default.vErrors}[${i}]`);
- gen.if(codegen_1._ `${err}.instancePath === undefined`, () => gen.assign(codegen_1._ `${err}.instancePath`, codegen_1.strConcat(names_1.default.instancePath, it.errorPath)));
- gen.assign(codegen_1._ `${err}.schemaPath`, codegen_1.str `${it.errSchemaPath}/${keyword}`);
- if (it.opts.verbose) {
- gen.assign(codegen_1._ `${err}.schema`, schemaValue);
- gen.assign(codegen_1._ `${err}.data`, data);
- }
- });
-}
-exports.extendErrors = extendErrors;
-function addError(gen, errObj) {
- const err = gen.const("err", errObj);
- gen.if(codegen_1._ `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, codegen_1._ `[${err}]`), codegen_1._ `${names_1.default.vErrors}.push(${err})`);
- gen.code(codegen_1._ `${names_1.default.errors}++`);
-}
-function returnErrors(it, errs) {
- const { gen, validateName, schemaEnv } = it;
- if (schemaEnv.$async) {
- gen.throw(codegen_1._ `new ${it.ValidationError}(${errs})`);
- }
- else {
- gen.assign(codegen_1._ `${validateName}.errors`, errs);
- gen.return(false);
- }
-}
-const E = {
- keyword: new codegen_1.Name("keyword"),
- schemaPath: new codegen_1.Name("schemaPath"),
- params: new codegen_1.Name("params"),
- propertyName: new codegen_1.Name("propertyName"),
- message: new codegen_1.Name("message"),
- schema: new codegen_1.Name("schema"),
- parentSchema: new codegen_1.Name("parentSchema"),
-};
-function errorObjectCode(cxt, error, errorPaths) {
- const { createErrors } = cxt.it;
- if (createErrors === false)
- return 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
- ? codegen_1.str `${errorPath}${util_1.getErrorPath(instancePath, util_1.Type.Str)}`
- : errorPath;
- return [names_1.default.instancePath, codegen_1.strConcat(names_1.default.instancePath, instPath)];
-}
-function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
- let schPath = parentSchema ? errSchemaPath : codegen_1.str `${errSchemaPath}/${keyword}`;
- if (schemaPath) {
- schPath = codegen_1.str `${schPath}${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 || 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, 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/index.js
deleted file mode 100644
index e612f5363fc..00000000000
--- a/tools/node_modules/eslint/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");
-const URI = require("uri-js");
-class SchemaEnv {
- constructor(env) {
- var _a;
- this.refs = {};
- this.dynamicAnchors = {};
- let schema;
- if (typeof env.schema == "object")
- schema = env.schema;
- this.schema = env.schema;
- this.schemaId = env.schemaId;
- this.root = env.root || this;
- this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : resolve_1.normalizeId(schema === null || schema === void 0 ? void 0 : schema[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 = resolve_1.getFullPath(sch.root.baseId); // TODO if getFullPath removed 1 tests fails
- const { es5, lines } = this.opts.code;
- const { ownProperties } = this.opts;
- const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
- let _ValidationError;
- if (sch.$async) {
- _ValidationError = gen.scopeValue("Error", {
- ref: validation_error_1.default,
- code: 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],
- dataLevel: 0,
- dataTypes: [],
- definedProperties: new Set(),
- topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
- ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) }
- : { ref: sch.schema }),
- validateName,
- ValidationError: _ValidationError,
- schema: sch.schema,
- schemaEnv: sch,
- rootId,
- baseId: sch.baseId || rootId,
- schemaPath: codegen_1.nil,
- errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
- errorPath: codegen_1._ `""`,
- opts: this.opts,
- self: this,
- };
- let sourceCode;
- try {
- this._compilations.add(sch);
- validate_1.validateFunctionCode(schemaCxt);
- gen.optimize(this.opts.code.optimize);
- // gen.optimize(1)
- const validateCode = gen.toString();
- sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
- // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
- if (this.opts.code.process)
- sourceCode = this.opts.code.process(sourceCode, sch);
- // console.log("\n\n\n *** \n", sourceCode)
- const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
- const validate = makeValidate(this, this.scope.get());
- this.scope.value(validateName, { ref: validate });
- validate.errors = null;
- validate.schema = sch.schema;
- validate.schemaEnv = sch;
- if (sch.$async)
- validate.$async = true;
- if (this.opts.code.source === true) {
- validate.source = { validateName, validateCode, scopeValues: gen._values };
- }
- if (this.opts.unevaluated) {
- const { props, items } = schemaCxt;
- validate.evaluated = {
- props: props instanceof codegen_1.Name ? undefined : props,
- items: items instanceof codegen_1.Name ? undefined : items,
- dynamicProps: props instanceof codegen_1.Name,
- dynamicItems: items instanceof codegen_1.Name,
- };
- if (validate.source)
- validate.source.evaluated = codegen_1.stringify(validate.evaluated);
- }
- sch.validate = validate;
- return sch;
- }
- catch (e) {
- delete sch.validate;
- delete sch.validateName;
- if (sourceCode)
- this.logger.error("Error compiling schema, function code:", sourceCode);
- // console.log("\n\n\n *** \n", sourceCode, this.opts)
- throw e;
- }
- finally {
- this._compilations.delete(sch);
- }
-}
-exports.compileSchema = compileSchema;
-function resolveRef(root, baseId, ref) {
- var _a;
- ref = resolve_1.resolveUrl(baseId, ref);
- const schOrFunc = root.refs[ref];
- if (schOrFunc)
- return schOrFunc;
- let _sch = resolve.call(this, root, ref);
- if (_sch === undefined) {
- const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
- 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 (resolve_1.inlineRef(sch.schema, this.opts.inlineRefs))
- return sch.schema;
- return sch.validate ? sch : compileSchema.call(this, sch);
-}
-// Index of schema compilation in the currently compiled list
-function getCompilingSchema(schEnv) {
- for (const sch of this._compilations) {
- if (sameSchemaEnv(sch, schEnv))
- return sch;
- }
-}
-exports.getCompilingSchema = getCompilingSchema;
-function sameSchemaEnv(s1, s2) {
- return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
-}
-// resolve and compile the references ($ref)
-// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
-function resolve(root, // information about the root schema for the current schema
-ref // reference to resolve
-) {
- let sch;
- while (typeof (sch = this.refs[ref]) == "string")
- ref = sch;
- return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
-}
-// Resolve schema, its root and baseId
-function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
-ref // reference to resolve
-) {
- const p = URI.parse(ref);
- const refPath = resolve_1._getFullPath(p);
- let baseId = resolve_1.getFullPath(root.baseId);
- // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
- if (Object.keys(root.schema).length > 0 && refPath === baseId) {
- return getJsonPointer.call(this, p, root);
- }
- const id = resolve_1.normalizeId(refPath);
- const schOrRef = this.refs[id] || this.schemas[id];
- if (typeof schOrRef == "string") {
- const sch = resolveSchema.call(this, root, schOrRef);
- if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
- return;
- return getJsonPointer.call(this, p, sch);
- }
- if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
- return;
- if (!schOrRef.validate)
- compileSchema.call(this, schOrRef);
- if (id === resolve_1.normalizeId(ref)) {
- const { schema } = schOrRef;
- const { schemaId } = this.opts;
- const schId = schema[schemaId];
- if (schId)
- baseId = resolve_1.resolveUrl(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;
- schema = schema[util_1.unescapeFragment(part)];
- if (schema === undefined)
- return;
- // 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 = resolve_1.resolveUrl(baseId, schId);
- }
- }
- let env;
- if (typeof schema != "boolean" && schema.$ref && !util_1.schemaHasRulesButRef(schema, this.RULES)) {
- const $ref = resolve_1.resolveUrl(baseId, schema.$ref);
- env = resolveSchema.call(this, root, $ref);
- }
- // even though resolution failed we need to return SchemaEnv to throw exception
- // so that compileAsync loads missing schema.
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/parse.js
deleted file mode 100644
index 1eeb1be39d9..00000000000
--- a/tools/node_modules/eslint/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 = codegen_1._ `undefined`;
-function parserFunction(cxt) {
- const { gen, parseName, char } = cxt;
- gen.func(parseName, codegen_1._ `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => {
- gen.let(names_1.default.data);
- gen.let(char);
- gen.assign(codegen_1._ `${parseName}.message`, undef);
- gen.assign(codegen_1._ `${parseName}.position`, undef);
- gen.assign(names_1.default.jsonPos, codegen_1._ `${names_1.default.jsonPos} || 0`);
- gen.const(names_1.default.jsonLen, codegen_1._ `${names_1.default.json}.length`);
- parseCode(cxt);
- skipWhitespace(cxt);
- gen.if(names_1.default.jsonPart, () => {
- gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos);
- gen.return(names_1.default.data);
- });
- gen.if(codegen_1._ `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data));
- jsonSyntaxError(cxt);
- });
-}
-function parseCode(cxt) {
- let form;
- for (const key of types_1.jtdForms) {
- if (key in cxt.schema) {
- form = key;
- break;
- }
- }
- if (form)
- parseNullable(cxt, genParse[form]);
- else
- parseEmpty(cxt);
-}
-const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError));
-function parseNullable(cxt, parseForm) {
- const { gen, schema, data } = cxt;
- if (!schema.nullable)
- return parseForm(cxt);
- tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null));
-}
-function parseElements(cxt) {
- const { gen, schema, data } = cxt;
- parseToken(cxt, "[");
- const ix = gen.let("i", 0);
- gen.assign(data, codegen_1._ `[]`);
- parseItems(cxt, "]", () => {
- const el = gen.let("el");
- parseCode({ ...cxt, schema: schema.elements, data: el });
- gen.assign(codegen_1._ `${data}[${ix}++]`, el);
- });
-}
-function parseValues(cxt) {
- const { gen, schema, data } = cxt;
- parseToken(cxt, "{");
- gen.assign(data, codegen_1._ `{}`);
- parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values));
-}
-function parseItems(cxt, endToken, block) {
- tryParseItems(cxt, endToken, block);
- parseToken(cxt, endToken);
-}
-function tryParseItems(cxt, endToken, block) {
- const { gen } = cxt;
- gen.for(codegen_1._ `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => {
- block();
- tryParseToken(cxt, ",", () => gen.break(), hasItem);
- });
- function hasItem() {
- tryParseToken(cxt, endToken, () => { }, jsonSyntaxError);
- }
-}
-function parseKeyValue(cxt, schema) {
- const { gen } = cxt;
- const key = gen.let("key");
- parseString({ ...cxt, data: key });
- parseToken(cxt, ":");
- parsePropertyValue(cxt, key, schema);
-}
-function parseDiscriminator(cxt) {
- const { gen, data, schema } = cxt;
- const { discriminator, mapping } = schema;
- parseToken(cxt, "{");
- gen.assign(data, codegen_1._ `{}`);
- const startPos = gen.const("pos", names_1.default.jsonPos);
- const value = gen.let("value");
- const tag = gen.let("tag");
- tryParseItems(cxt, "}", () => {
- const key = gen.let("key");
- parseString({ ...cxt, data: key });
- parseToken(cxt, ":");
- gen.if(codegen_1._ `${key} === ${discriminator}`, () => {
- parseString({ ...cxt, data: tag });
- gen.assign(codegen_1._ `${data}[${key}]`, tag);
- gen.break();
- }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped
- );
- });
- gen.assign(names_1.default.jsonPos, startPos);
- gen.if(codegen_1._ `${tag} === undefined`);
- parsingError(cxt, codegen_1.str `discriminator tag not found`);
- for (const tagValue in mapping) {
- gen.elseIf(codegen_1._ `${tag} === ${tagValue}`);
- parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator);
- }
- gen.else();
- parsingError(cxt, codegen_1.str `discriminator value not in schema`);
- gen.endIf();
-}
-function parseProperties(cxt) {
- const { gen, data } = cxt;
- parseToken(cxt, "{");
- gen.assign(data, codegen_1._ `{}`);
- parseSchemaProperties(cxt);
-}
-function parseSchemaProperties(cxt, discriminator) {
- const { gen, schema, data } = cxt;
- const { properties, optionalProperties, additionalProperties } = schema;
- parseItems(cxt, "}", () => {
- const key = gen.let("key");
- parseString({ ...cxt, data: key });
- parseToken(cxt, ":");
- gen.if(false);
- parseDefinedProperty(cxt, key, properties);
- parseDefinedProperty(cxt, key, optionalProperties);
- if (discriminator) {
- gen.elseIf(codegen_1._ `${key} === ${discriminator}`);
- const tag = gen.let("tag");
- parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned
- }
- gen.else();
- if (additionalProperties) {
- parseEmpty({ ...cxt, data: codegen_1._ `${data}[${key}]` });
- }
- else {
- parsingError(cxt, codegen_1.str `property ${key} not allowed`);
- }
- gen.endIf();
- });
- if (properties) {
- const hasProp = code_1.hasPropFunc(gen);
- const allProps = codegen_1.and(...Object.keys(properties).map((p) => codegen_1._ `${hasProp}.call(${data}, ${p})`));
- gen.if(codegen_1.not(allProps), () => parsingError(cxt, codegen_1.str `missing required properties`));
- }
-}
-function parseDefinedProperty(cxt, key, schemas = {}) {
- const { gen } = cxt;
- for (const prop in schemas) {
- gen.elseIf(codegen_1._ `${key} === ${prop}`);
- parsePropertyValue(cxt, key, schemas[prop]);
- }
-}
-function parsePropertyValue(cxt, key, schema) {
- parseCode({ ...cxt, schema, data: codegen_1._ `${cxt.data}[${key}]` });
-}
-function parseType(cxt) {
- const { gen, schema, data, self } = cxt;
- switch (schema.type) {
- case "boolean":
- parseBoolean(cxt);
- break;
- case "string":
- parseString(cxt);
- break;
- case "timestamp": {
- parseString(cxt);
- const vts = util_1.useFunc(gen, timestamp_1.default);
- const { allowDate, parseDate } = self.opts;
- const notValid = allowDate ? codegen_1._ `!${vts}(${data}, true)` : codegen_1._ `!${vts}(${data})`;
- const fail = parseDate
- ? codegen_1.or(notValid, codegen_1._ `(${data} = new Date(${data}), false)`, codegen_1._ `isNaN(${data}.valueOf())`)
- : notValid;
- gen.if(fail, () => parsingError(cxt, 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(codegen_1._ `${data} < 0`, () => parsingError(cxt, codegen_1.str `integer out of range`));
- }
- }
- else {
- const [min, max, maxDigits] = type_1.intRange[t];
- parseNumber(cxt, maxDigits);
- gen.if(codegen_1._ `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, codegen_1.str `integer out of range`));
- }
- }
- }
-}
-function parseString(cxt) {
- parseToken(cxt, '"');
- parseWith(cxt, parseJson_1.parseJsonString);
-}
-function parseEnum(cxt) {
- const { gen, data, schema } = cxt;
- const enumSch = schema.enum;
- parseToken(cxt, '"');
- // TODO loopEnum
- gen.if(false);
- for (const value of enumSch) {
- const valueStr = JSON.stringify(value).slice(1); // remove starting quote
- gen.elseIf(codegen_1._ `${jsonSlice(valueStr.length)} === ${valueStr}`);
- gen.assign(data, codegen_1.str `${value}`);
- gen.add(names_1.default.jsonPos, valueStr.length);
- }
- gen.else();
- jsonSyntaxError(cxt);
- gen.endIf();
-}
-function parseNumber(cxt, maxDigits) {
- const { gen } = cxt;
- skipWhitespace(cxt);
- gen.if(codegen_1._ `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits));
-}
-function parseBooleanToken(bool, fail) {
- return (cxt) => {
- const { gen, data } = cxt;
- tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool));
- };
-}
-function parseRef(cxt) {
- const { gen, self, definitions, schema, schemaEnv } = cxt;
- const { ref } = schema;
- const refSchema = definitions[ref];
- if (!refSchema)
- throw new ref_error_1.default("", ref, `No definition ${ref}`);
- if (!ref_1.hasRef(refSchema))
- return parseCode({ ...cxt, schema: refSchema });
- const { root } = schemaEnv;
- const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
- partialParse(cxt, getParser(gen, sch), true);
-}
-function getParser(gen, sch) {
- return sch.parse
- ? gen.scopeValue("parse", { ref: sch.parse })
- : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.parse`;
-}
-function parseEmpty(cxt) {
- parseWith(cxt, parseJson_1.parseJson);
-}
-function parseWith(cxt, parseFunc, args) {
- partialParse(cxt, util_1.useFunc(cxt.gen, parseFunc), args);
-}
-function partialParse(cxt, parseFunc, args) {
- const { gen, data } = cxt;
- gen.assign(data, codegen_1._ `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? codegen_1._ `, ${args}` : codegen_1.nil})`);
- gen.assign(names_1.default.jsonPos, codegen_1._ `${parseFunc}.position`);
- gen.if(codegen_1._ `${data} === undefined`, () => parsingError(cxt, codegen_1._ `${parseFunc}.message`));
-}
-function parseToken(cxt, tok) {
- tryParseToken(cxt, tok, jsonSyntaxError);
-}
-function tryParseToken(cxt, tok, fail, success) {
- const { gen } = cxt;
- const n = tok.length;
- skipWhitespace(cxt);
- gen.if(codegen_1._ `${jsonSlice(n)} === ${tok}`, () => {
- gen.add(names_1.default.jsonPos, n);
- success === null || success === void 0 ? void 0 : success(cxt);
- }, () => fail(cxt));
-}
-function skipWhitespace({ gen, char: c }) {
- gen.code(codegen_1._ `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`);
-}
-function jsonSlice(len) {
- return len === 1
- ? codegen_1._ `${names_1.default.json}[${names_1.default.jsonPos}]`
- : codegen_1._ `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`;
-}
-function jsonSyntaxError(cxt) {
- parsingError(cxt, codegen_1._ `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`);
-}
-function parsingError({ gen, parseName }, msg) {
- gen.assign(codegen_1._ `${parseName}.message`, msg);
- gen.assign(codegen_1._ `${parseName}.position`, names_1.default.jsonPos);
- gen.return(undef);
-}
-//# sourceMappingURL=parse.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js
deleted file mode 100644
index 7ca512d4399..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js
+++ /dev/null
@@ -1,218 +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, codegen_1.str ``);
- serializeCode(cxt);
- gen.return(names_1.default.json);
- });
- gen.optimize(this.opts.code.optimize);
- const serializeFuncCode = gen.toString();
- sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`;
- const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode);
- const serialize = makeSerialize(this.scope.get());
- this.scope.value(serializeName, { ref: serialize });
- sch.serialize = serialize;
- }
- catch (e) {
- if (sourceCode)
- this.logger.error("Error compiling serializer, function code:", sourceCode);
- delete sch.serialize;
- delete sch.serializeName;
- throw e;
- }
- finally {
- this._compilations.delete(sch);
- }
- return sch;
-}
-exports.default = compileSerializer;
-function serializeCode(cxt) {
- let form;
- for (const key of types_1.jtdForms) {
- if (key in cxt.schema) {
- form = key;
- break;
- }
- }
- serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty);
-}
-function serializeNullable(cxt, serializeForm) {
- const { gen, schema, data } = cxt;
- if (!schema.nullable)
- return serializeForm(cxt);
- gen.if(codegen_1._ `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, codegen_1._ `"null"`), () => serializeForm(cxt));
-}
-function serializeElements(cxt) {
- const { gen, schema, data } = cxt;
- gen.add(names_1.default.json, codegen_1.str `[`);
- const first = gen.let("first", true);
- gen.forOf("el", data, (el) => {
- addComma(cxt, first);
- serializeCode({ ...cxt, schema: schema.elements, data: el });
- });
- gen.add(names_1.default.json, codegen_1.str `]`);
-}
-function serializeValues(cxt) {
- const { gen, schema, data } = cxt;
- gen.add(names_1.default.json, codegen_1.str `{`);
- const first = gen.let("first", true);
- gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first));
- gen.add(names_1.default.json, codegen_1.str `}`);
-}
-function serializeKeyValue(cxt, key, schema, first) {
- const { gen, data } = cxt;
- addComma(cxt, first);
- serializeString({ ...cxt, data: key });
- gen.add(names_1.default.json, codegen_1.str `:`);
- const value = gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`);
- serializeCode({ ...cxt, schema, data: value });
-}
-function serializeDiscriminator(cxt) {
- const { gen, schema, data } = cxt;
- const { discriminator } = schema;
- gen.add(names_1.default.json, codegen_1.str `{${JSON.stringify(discriminator)}:`);
- const tag = gen.const("tag", codegen_1._ `${data}${codegen_1.getProperty(discriminator)}`);
- serializeString({ ...cxt, data: tag });
- gen.if(false);
- for (const tagValue in schema.mapping) {
- gen.elseIf(codegen_1._ `${tag} === ${tagValue}`);
- const sch = schema.mapping[tagValue];
- serializeSchemaProperties({ ...cxt, schema: sch }, discriminator);
- }
- gen.endIf();
- gen.add(names_1.default.json, codegen_1.str `}`);
-}
-function serializeProperties(cxt) {
- const { gen } = cxt;
- gen.add(names_1.default.json, codegen_1.str `{`);
- serializeSchemaProperties(cxt);
- gen.add(names_1.default.json, codegen_1.str `}`);
-}
-function serializeSchemaProperties(cxt, discriminator) {
- const { gen, schema, data } = cxt;
- const { properties, optionalProperties } = schema;
- const props = keys(properties);
- const optProps = keys(optionalProperties);
- const allProps = allProperties(props.concat(optProps));
- let first = !discriminator;
- for (const key of props) {
- serializeProperty(key, properties[key], keyValue(key));
- }
- for (const key of optProps) {
- const value = keyValue(key);
- gen.if(codegen_1.and(codegen_1._ `${value} !== undefined`, code_1.isOwnProperty(gen, data, key)), () => serializeProperty(key, optionalProperties[key], value));
- }
- if (schema.additionalProperties) {
- gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, gen.let("first", first))));
- }
- function keys(ps) {
- return ps ? Object.keys(ps) : [];
- }
- function allProperties(ps) {
- if (discriminator)
- ps.push(discriminator);
- if (new Set(ps).size !== ps.length) {
- throw new Error("JTD: properties/optionalProperties/disciminator overlap");
- }
- return ps;
- }
- function keyValue(key) {
- return gen.const("value", codegen_1._ `${data}${codegen_1.getProperty(key)}`);
- }
- function serializeProperty(key, propSchema, value) {
- if (first)
- first = false;
- else
- gen.add(names_1.default.json, codegen_1.str `,`);
- gen.add(names_1.default.json, codegen_1.str `${JSON.stringify(key)}:`);
- serializeCode({ ...cxt, schema: propSchema, data: value });
- }
- function isAdditional(key, ps) {
- return ps.length ? codegen_1.and(...ps.map((p) => codegen_1._ `${key} !== ${p}`)) : true;
- }
-}
-function serializeType(cxt) {
- const { gen, schema, data } = cxt;
- switch (schema.type) {
- case "boolean":
- gen.add(names_1.default.json, codegen_1._ `${data} ? "true" : "false"`);
- break;
- case "string":
- serializeString(cxt);
- break;
- case "timestamp":
- gen.if(codegen_1._ `${data} instanceof Date`, () => gen.add(names_1.default.json, codegen_1._ `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt));
- break;
- default:
- serializeNumber(cxt);
- }
-}
-function serializeString({ gen, data }) {
- gen.add(names_1.default.json, codegen_1._ `${util_1.useFunc(gen, quote_1.default)}(${data})`);
-}
-function serializeNumber({ gen, data }) {
- gen.add(names_1.default.json, codegen_1._ `"" + ${data}`);
-}
-function serializeRef(cxt) {
- const { gen, self, data, definitions, schema, schemaEnv } = cxt;
- const { ref } = schema;
- const refSchema = definitions[ref];
- if (!refSchema)
- throw new ref_error_1.default("", ref, `No definition ${ref}`);
- if (!ref_1.hasRef(refSchema))
- return serializeCode({ ...cxt, schema: refSchema });
- const { root } = schemaEnv;
- const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
- gen.add(names_1.default.json, codegen_1._ `${getSerialize(gen, sch)}(${data})`);
-}
-function getSerialize(gen, sch) {
- return sch.serialize
- ? gen.scopeValue("serialize", { ref: sch.serialize })
- : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.serialize`;
-}
-function serializeEmpty({ gen, data }) {
- gen.add(names_1.default.json, codegen_1._ `JSON.stringify(${data})`);
-}
-function addComma({ gen }, first) {
- gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, codegen_1.str `,`));
-}
-//# sourceMappingURL=serialize.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/jtd/types.js
deleted file mode 100644
index b9c60a90fdd..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js
deleted file mode 100644
index 015334bd598..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/names.js
+++ /dev/null
@@ -1,28 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("./codegen");
-const names = {
- // validation function arguments
- data: new codegen_1.Name("data"),
- // args passed from referencing schema
- valCxt: new codegen_1.Name("valCxt"),
- instancePath: new codegen_1.Name("instancePath"),
- parentData: new codegen_1.Name("parentData"),
- parentDataProperty: new codegen_1.Name("parentDataProperty"),
- rootData: new codegen_1.Name("rootData"),
- dynamicAnchors: new codegen_1.Name("dynamicAnchors"),
- // function scoped variables
- vErrors: new codegen_1.Name("vErrors"),
- errors: new codegen_1.Name("errors"),
- this: new codegen_1.Name("this"),
- // "globals"
- self: new codegen_1.Name("self"),
- scope: new codegen_1.Name("scope"),
- // JTD serialize/parse name for JSON string and position
- json: new codegen_1.Name("json"),
- jsonPos: new codegen_1.Name("jsonPos"),
- jsonLen: new codegen_1.Name("jsonLen"),
- jsonPart: new codegen_1.Name("jsonPart"),
-};
-exports.default = names;
-//# sourceMappingURL=names.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ref_error.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/ref_error.js
deleted file mode 100644
index b4c8cc36021..00000000000
--- a/tools/node_modules/eslint/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(baseId, ref, msg) {
- super(msg || `can't resolve reference ${ref} from id ${baseId}`);
- this.missingRef = resolve_1.resolveUrl(baseId, ref);
- this.missingSchema = resolve_1.normalizeId(resolve_1.getFullPath(this.missingRef));
- }
-}
-exports.default = MissingRefError;
-//# sourceMappingURL=ref_error.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js
deleted file mode 100644
index 6d5f71e0b67..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/resolve.js
+++ /dev/null
@@ -1,153 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
-const util_1 = require("./util");
-const equal = require("fast-deep-equal");
-const traverse = require("json-schema-traverse");
-const URI = require("uri-js");
-// TODO refactor to use keyword definitions
-const SIMPLE_INLINED = new Set([
- "type",
- "format",
- "pattern",
- "maxLength",
- "minLength",
- "maxProperties",
- "minProperties",
- "maxItems",
- "minItems",
- "maximum",
- "minimum",
- "uniqueItems",
- "multipleOf",
- "required",
- "enum",
- "const",
-]);
-function inlineRef(schema, limit = true) {
- if (typeof schema == "boolean")
- return true;
- if (limit === true)
- return !hasRef(schema);
- if (!limit)
- return false;
- return countKeys(schema) <= limit;
-}
-exports.inlineRef = inlineRef;
-const REF_KEYWORDS = new Set([
- "$ref",
- "$recursiveRef",
- "$recursiveAnchor",
- "$dynamicRef",
- "$dynamicAnchor",
-]);
-function hasRef(schema) {
- for (const key in schema) {
- if (REF_KEYWORDS.has(key))
- return true;
- const sch = schema[key];
- if (Array.isArray(sch) && sch.some(hasRef))
- return true;
- if (typeof sch == "object" && hasRef(sch))
- return true;
- }
- return false;
-}
-function countKeys(schema) {
- let count = 0;
- for (const key in schema) {
- if (key === "$ref")
- return Infinity;
- count++;
- if (SIMPLE_INLINED.has(key))
- continue;
- if (typeof schema[key] == "object") {
- util_1.eachItem(schema[key], (sch) => (count += countKeys(sch)));
- }
- if (count === Infinity)
- return Infinity;
- }
- return count;
-}
-function getFullPath(id = "", normalize) {
- if (normalize !== false)
- id = normalizeId(id);
- const p = URI.parse(id);
- return _getFullPath(p);
-}
-exports.getFullPath = getFullPath;
-function _getFullPath(p) {
- return URI.serialize(p).split("#")[0] + "#";
-}
-exports._getFullPath = _getFullPath;
-const TRAILING_SLASH_HASH = /#\/?$/;
-function normalizeId(id) {
- return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
-}
-exports.normalizeId = normalizeId;
-function resolveUrl(baseId, id) {
- id = normalizeId(id);
- return URI.resolve(baseId, id);
-}
-exports.resolveUrl = resolveUrl;
-const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
-function getSchemaRefs(schema) {
- if (typeof schema == "boolean")
- return {};
- const { schemaId } = this.opts;
- const schId = normalizeId(schema[schemaId]);
- const baseIds = { "": schId };
- const pathPrefix = getFullPath(schId, false);
- const localRefs = {};
- const schemaRefs = new Set();
- traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
- if (parentJsonPtr === undefined)
- return;
- const fullPath = pathPrefix + jsonPtr;
- let baseId = baseIds[parentJsonPtr];
- if (typeof sch[schemaId] == "string")
- baseId = addRef.call(this, sch[schemaId]);
- addAnchor.call(this, sch.$anchor);
- addAnchor.call(this, sch.$dynamicAnchor);
- baseIds[jsonPtr] = baseId;
- function addRef(ref) {
- ref = normalizeId(baseId ? URI.resolve(baseId, ref) : ref);
- if (schemaRefs.has(ref))
- throw ambiguos(ref);
- schemaRefs.add(ref);
- let schOrRef = this.refs[ref];
- if (typeof schOrRef == "string")
- schOrRef = this.refs[schOrRef];
- if (typeof schOrRef == "object") {
- checkAmbiguosRef(sch, schOrRef.schema, ref);
- }
- else if (ref !== normalizeId(fullPath)) {
- if (ref[0] === "#") {
- checkAmbiguosRef(sch, localRefs[ref], ref);
- localRefs[ref] = sch;
- }
- else {
- this.refs[ref] = fullPath;
- }
- }
- return ref;
- }
- function addAnchor(anchor) {
- if (typeof anchor == "string") {
- if (!ANCHOR.test(anchor))
- throw new Error(`invalid anchor "${anchor}"`);
- addRef.call(this, `#${anchor}`);
- }
- }
- });
- return localRefs;
- function checkAmbiguosRef(sch1, sch2, ref) {
- if (sch2 !== undefined && !equal(sch1, sch2))
- throw ambiguos(ref);
- }
- function ambiguos(ref) {
- return new Error(`reference "${ref}" resolves to more than one schema`);
- }
-}
-exports.getSchemaRefs = getSchemaRefs;
-//# sourceMappingURL=resolve.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/rules.js
deleted file mode 100644
index 82a591ff4db..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/util.js
deleted file mode 100644
index b877ea746c7..00000000000
--- a/tools/node_modules/eslint/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 codegen_1._ `${schema}`;
- }
- return codegen_1._ `${topSchemaRef}${schemaPath}${codegen_1.getProperty(keyword)}`;
-}
-exports.schemaRefOrVal = schemaRefOrVal;
-function unescapeFragment(str) {
- return unescapeJsonPointer(decodeURIComponent(str));
-}
-exports.unescapeFragment = unescapeFragment;
-function escapeFragment(str) {
- return encodeURIComponent(escapeJsonPointer(str));
-}
-exports.escapeFragment = escapeFragment;
-function escapeJsonPointer(str) {
- if (typeof str == "number")
- return `${str}`;
- return str.replace(/~/g, "~0").replace(/\//g, "~1");
-}
-exports.escapeJsonPointer = escapeJsonPointer;
-function unescapeJsonPointer(str) {
- return str.replace(/~1/g, "/").replace(/~0/g, "~");
-}
-exports.unescapeJsonPointer = unescapeJsonPointer;
-function eachItem(xs, f) {
- if (Array.isArray(xs)) {
- for (const x of xs)
- f(x);
- }
- else {
- f(xs);
- }
-}
-exports.eachItem = eachItem;
-function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
- return (gen, from, to, toName) => {
- const res = to === undefined
- ? from
- : to instanceof codegen_1.Name
- ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
- : from instanceof codegen_1.Name
- ? (mergeToName(gen, to, from), from)
- : mergeValues(from, to);
- return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
- };
-}
-exports.mergeEvaluated = {
- props: makeMergeEvaluated({
- mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => {
- gen.if(codegen_1._ `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, codegen_1._ `${to} || {}`).code(codegen_1._ `Object.assign(${to}, ${from})`));
- }),
- mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => {
- if (from === true) {
- gen.assign(to, true);
- }
- else {
- gen.assign(to, codegen_1._ `${to} || {}`);
- setEvaluated(gen, to, from);
- }
- }),
- mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),
- resultToName: evaluatedPropsToName,
- }),
- items: makeMergeEvaluated({
- mergeNames: (gen, from, to) => gen.if(codegen_1._ `${to} !== true && ${from} !== undefined`, () => gen.assign(to, codegen_1._ `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
- mergeToName: (gen, from, to) => gen.if(codegen_1._ `${to} !== true`, () => gen.assign(to, from === true ? true : codegen_1._ `${to} > ${from} ? ${to} : ${from}`)),
- mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
- resultToName: (gen, items) => gen.var("items", items),
- }),
-};
-function evaluatedPropsToName(gen, ps) {
- if (ps === true)
- return gen.var("props", true);
- const props = gen.var("props", codegen_1._ `{}`);
- if (ps !== undefined)
- setEvaluated(gen, props, ps);
- return props;
-}
-exports.evaluatedPropsToName = evaluatedPropsToName;
-function setEvaluated(gen, props, ps) {
- Object.keys(ps).forEach((p) => gen.assign(codegen_1._ `${props}${codegen_1.getProperty(p)}`, true));
-}
-exports.setEvaluated = setEvaluated;
-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 || (exports.Type = {}));
-function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
- // let path
- if (dataProp instanceof codegen_1.Name) {
- const isNumber = dataPropType === Type.Num;
- return jsPropertySyntax
- ? isNumber
- ? codegen_1._ `"[" + ${dataProp} + "]"`
- : codegen_1._ `"['" + ${dataProp} + "']"`
- : isNumber
- ? codegen_1._ `"/" + ${dataProp}`
- : codegen_1._ `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
- }
- return jsPropertySyntax ? codegen_1.getProperty(dataProp).toString() : "/" + 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/applicability.js
deleted file mode 100644
index 6187dbbeeeb..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js
deleted file mode 100644
index 42fdd1f6a88..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/boolSchema.js
+++ /dev/null
@@ -1,50 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
-const errors_1 = require("../errors");
-const codegen_1 = require("../codegen");
-const names_1 = require("../names");
-const boolError = {
- message: "boolean schema is false",
-};
-function topBoolOrEmptySchema(it) {
- const { gen, schema, validateName } = it;
- if (schema === false) {
- falseSchemaError(it, false);
- }
- else if (typeof schema == "object" && schema.$async === true) {
- gen.return(names_1.default.data);
- }
- else {
- gen.assign(codegen_1._ `${validateName}.errors`, null);
- gen.return(true);
- }
-}
-exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
-function boolOrEmptySchema(it, valid) {
- const { gen, schema } = it;
- if (schema === false) {
- gen.var(valid, false); // TODO var
- falseSchemaError(it);
- }
- else {
- gen.var(valid, true); // TODO var
- }
-}
-exports.boolOrEmptySchema = boolOrEmptySchema;
-function falseSchemaError(it, overrideAllErrors) {
- const { gen, data } = it;
- // TODO maybe some other interface should be used for non-keyword validation errors...
- const cxt = {
- gen,
- keyword: "false schema",
- data,
- schema: false,
- schemaCode: false,
- schemaValue: false,
- params: {},
- it,
- };
- errors_1.reportError(cxt, boolError, undefined, overrideAllErrors);
-}
-//# sourceMappingURL=boolSchema.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js
deleted file mode 100644
index 6319e76c28b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.js
+++ /dev/null
@@ -1,202 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
-const rules_1 = require("../rules");
-const applicability_1 = require("./applicability");
-const errors_1 = require("../errors");
-const codegen_1 = require("../codegen");
-const util_1 = require("../util");
-var DataType;
-(function (DataType) {
- DataType[DataType["Correct"] = 0] = "Correct";
- DataType[DataType["Wrong"] = 1] = "Wrong";
-})(DataType = exports.DataType || (exports.DataType = {}));
-function getSchemaTypes(schema) {
- const types = getJSONTypes(schema.type);
- const hasNull = types.includes("null");
- if (hasNull) {
- if (schema.nullable === false)
- throw new Error("type: null contradicts nullable: false");
- }
- else {
- if (!types.length && schema.nullable !== undefined) {
- throw new Error('"nullable" cannot be used without "type"');
- }
- if (schema.nullable === true)
- types.push("null");
- }
- return types;
-}
-exports.getSchemaTypes = getSchemaTypes;
-function getJSONTypes(ts) {
- const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
- if (types.every(rules_1.isJSONType))
- return types;
- throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
-}
-exports.getJSONTypes = getJSONTypes;
-function coerceAndCheckDataType(it, types) {
- const { gen, data, opts } = it;
- const coerceTo = coerceToTypes(types, opts.coerceTypes);
- const checkTypes = types.length > 0 &&
- !(coerceTo.length === 0 && types.length === 1 && applicability_1.schemaHasRulesForType(it, types[0]));
- if (checkTypes) {
- const wrongType = checkDataTypes(types, data, opts.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", codegen_1._ `typeof ${data}`);
- const coerced = gen.let("coerced", codegen_1._ `undefined`);
- if (opts.coerceTypes === "array") {
- gen.if(codegen_1._ `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
- .assign(data, codegen_1._ `${data}[0]`)
- .assign(dataType, codegen_1._ `typeof ${data}`)
- .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
- }
- gen.if(codegen_1._ `${coerced} !== undefined`);
- for (const t of coerceTo) {
- if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
- coerceSpecificType(t);
- }
- }
- gen.else();
- reportTypeError(it);
- gen.endIf();
- gen.if(codegen_1._ `${coerced} !== undefined`, () => {
- gen.assign(data, coerced);
- assignParentData(it, coerced);
- });
- function coerceSpecificType(t) {
- switch (t) {
- case "string":
- gen
- .elseIf(codegen_1._ `${dataType} == "number" || ${dataType} == "boolean"`)
- .assign(coerced, codegen_1._ `"" + ${data}`)
- .elseIf(codegen_1._ `${data} === null`)
- .assign(coerced, codegen_1._ `""`);
- return;
- case "number":
- gen
- .elseIf(codegen_1._ `${dataType} == "boolean" || ${data} === null
- || (${dataType} == "string" && ${data} && ${data} == +${data})`)
- .assign(coerced, codegen_1._ `+${data}`);
- return;
- case "integer":
- gen
- .elseIf(codegen_1._ `${dataType} === "boolean" || ${data} === null
- || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
- .assign(coerced, codegen_1._ `+${data}`);
- return;
- case "boolean":
- gen
- .elseIf(codegen_1._ `${data} === "false" || ${data} === 0 || ${data} === null`)
- .assign(coerced, false)
- .elseIf(codegen_1._ `${data} === "true" || ${data} === 1`)
- .assign(coerced, true);
- return;
- case "null":
- gen.elseIf(codegen_1._ `${data} === "" || ${data} === 0 || ${data} === false`);
- gen.assign(coerced, null);
- return;
- case "array":
- gen
- .elseIf(codegen_1._ `${dataType} === "string" || ${dataType} === "number"
- || ${dataType} === "boolean" || ${data} === null`)
- .assign(coerced, codegen_1._ `[${data}]`);
- }
- }
-}
-function assignParentData({ gen, parentData, parentDataProperty }, expr) {
- // TODO use gen.property
- gen.if(codegen_1._ `${parentData} !== undefined`, () => gen.assign(codegen_1._ `${parentData}[${parentDataProperty}]`, expr));
-}
-function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
- const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
- let cond;
- switch (dataType) {
- case "null":
- return codegen_1._ `${data} ${EQ} null`;
- case "array":
- cond = codegen_1._ `Array.isArray(${data})`;
- break;
- case "object":
- cond = codegen_1._ `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
- break;
- case "integer":
- cond = numCond(codegen_1._ `!(${data} % 1) && !isNaN(${data})`);
- break;
- case "number":
- cond = numCond();
- break;
- default:
- return codegen_1._ `typeof ${data} ${EQ} ${dataType}`;
- }
- return correct === DataType.Correct ? cond : codegen_1.not(cond);
- function numCond(_cond = codegen_1.nil) {
- return codegen_1.and(codegen_1._ `typeof ${data} == "number"`, _cond, strictNums ? codegen_1._ `isFinite(${data})` : codegen_1.nil);
- }
-}
-exports.checkDataType = checkDataType;
-function checkDataTypes(dataTypes, data, strictNums, correct) {
- if (dataTypes.length === 1) {
- return checkDataType(dataTypes[0], data, strictNums, correct);
- }
- let cond;
- const types = util_1.toHash(dataTypes);
- if (types.array && types.object) {
- const notObj = codegen_1._ `typeof ${data} != "object"`;
- cond = types.null ? notObj : codegen_1._ `!${data} || ${notObj}`;
- delete types.null;
- delete types.array;
- delete types.object;
- }
- else {
- cond = codegen_1.nil;
- }
- if (types.number)
- delete types.integer;
- for (const t in types)
- cond = codegen_1.and(cond, checkDataType(t, data, strictNums, correct));
- return cond;
-}
-exports.checkDataTypes = checkDataTypes;
-const typeError = {
- message: ({ schema }) => `must be ${schema}`,
- params: ({ schema, schemaValue }) => typeof schema == "string" ? codegen_1._ `{type: ${schema}}` : codegen_1._ `{type: ${schemaValue}}`,
-};
-function reportTypeError(it) {
- const cxt = getTypeErrorContext(it);
- errors_1.reportError(cxt, typeError);
-}
-exports.reportTypeError = reportTypeError;
-function getTypeErrorContext(it) {
- const { gen, data, schema } = it;
- const schemaCode = util_1.schemaRefOrVal(it, schema, "type");
- return {
- gen,
- keyword: "type",
- data,
- schema: schema.type,
- schemaCode,
- schemaValue: schemaCode,
- parentSchema: schema,
- params: {},
- it,
- };
-}
-//# sourceMappingURL=dataType.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/defaults.js
deleted file mode 100644
index 41ca3fd94ad..00000000000
--- a/tools/node_modules/eslint/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 = codegen_1._ `${data}${codegen_1.getProperty(prop)}`;
- if (compositeRule) {
- util_1.checkStrictMode(it, `default is ignored for: ${childData}`);
- return;
- }
- let condition = codegen_1._ `${childData} === undefined`;
- if (opts.useDefaults === "empty") {
- condition = codegen_1._ `${condition} || ${childData} === null || ${childData} === ""`;
- }
- // `${childData} === undefined` +
- // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "")
- gen.if(condition, codegen_1._ `${childData} = ${codegen_1.stringify(defaultValue)}`);
-}
-//# sourceMappingURL=defaults.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js
deleted file mode 100644
index a43053e228b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/index.js
+++ /dev/null
@@ -1,510 +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, () => boolSchema_1.topBoolOrEmptySchema(it));
-}
-exports.validateFunctionCode = validateFunctionCode;
-function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
- if (opts.code.es5) {
- gen.func(validateName, codegen_1._ `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
- gen.code(codegen_1._ `"use strict"; ${funcSourceUrl(schema, opts)}`);
- destructureValCxtES5(gen, opts);
- gen.code(body);
- });
- }
- else {
- gen.func(validateName, codegen_1._ `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
- }
-}
-function destructureValCxt(opts) {
- return codegen_1._ `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? codegen_1._ `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
-}
-function destructureValCxtES5(gen, opts) {
- gen.if(names_1.default.valCxt, () => {
- gen.var(names_1.default.instancePath, codegen_1._ `${names_1.default.valCxt}.${names_1.default.instancePath}`);
- gen.var(names_1.default.parentData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentData}`);
- gen.var(names_1.default.parentDataProperty, codegen_1._ `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
- gen.var(names_1.default.rootData, codegen_1._ `${names_1.default.valCxt}.${names_1.default.rootData}`);
- if (opts.dynamicRef)
- gen.var(names_1.default.dynamicAnchors, codegen_1._ `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
- }, () => {
- gen.var(names_1.default.instancePath, codegen_1._ `""`);
- gen.var(names_1.default.parentData, codegen_1._ `undefined`);
- gen.var(names_1.default.parentDataProperty, codegen_1._ `undefined`);
- gen.var(names_1.default.rootData, names_1.default.data);
- if (opts.dynamicRef)
- gen.var(names_1.default.dynamicAnchors, codegen_1._ `{}`);
- });
-}
-function topSchemaObjCode(it) {
- const { schema, opts, gen } = it;
- validateFunction(it, () => {
- if (opts.$comment && schema.$comment)
- commentKeyword(it);
- checkNoDefault(it);
- gen.let(names_1.default.vErrors, null);
- gen.let(names_1.default.errors, 0);
- if (opts.unevaluated)
- resetEvaluated(it);
- typeAndKeywords(it);
- returnResults(it);
- });
- return;
-}
-function resetEvaluated(it) {
- // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated
- const { gen, validateName } = it;
- it.evaluated = gen.const("evaluated", codegen_1._ `${validateName}.evaluated`);
- gen.if(codegen_1._ `${it.evaluated}.dynamicProps`, () => gen.assign(codegen_1._ `${it.evaluated}.props`, codegen_1._ `undefined`));
- gen.if(codegen_1._ `${it.evaluated}.dynamicItems`, () => gen.assign(codegen_1._ `${it.evaluated}.items`, codegen_1._ `undefined`));
-}
-function funcSourceUrl(schema, opts) {
- const schId = typeof schema == "object" && schema[opts.schemaId];
- return schId && (opts.code.source || opts.code.process) ? 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;
- }
- }
- 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, codegen_1._ `${errsCount} === ${names_1.default.errors}`);
-}
-function checkKeywords(it) {
- util_1.checkUnknownRules(it);
- checkRefsAndKeywords(it);
-}
-function typeAndKeywords(it, errsCount) {
- if (it.opts.jtd)
- return schemaKeywords(it, [], false, errsCount);
- const types = dataType_1.getSchemaTypes(it.schema);
- const checkedTypes = dataType_1.coerceAndCheckDataType(it, types);
- schemaKeywords(it, types, !checkedTypes, errsCount);
-}
-function checkRefsAndKeywords(it) {
- const { schema, errSchemaPath, opts, self } = it;
- if (schema.$ref && opts.ignoreKeywordsWithRef && util_1.schemaHasRulesButRef(schema, self.RULES)) {
- self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
- }
-}
-function checkNoDefault(it) {
- const { schema, opts } = it;
- if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {
- 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 = resolve_1.resolveUrl(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(codegen_1._ `${names_1.default.self}.logger.log(${msg})`);
- }
- else if (typeof opts.$comment == "function") {
- const schemaPath = codegen_1.str `${errSchemaPath}/$comment`;
- const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
- gen.code(codegen_1._ `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
- }
-}
-function returnResults(it) {
- const { gen, schemaEnv, validateName, ValidationError, opts } = it;
- if (schemaEnv.$async) {
- // TODO assign unevaluated
- gen.if(codegen_1._ `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw(codegen_1._ `new ${ValidationError}(${names_1.default.vErrors})`));
- }
- else {
- gen.assign(codegen_1._ `${validateName}.errors`, names_1.default.vErrors);
- if (opts.unevaluated)
- assignEvaluated(it);
- gen.return(codegen_1._ `${names_1.default.errors} === 0`);
- }
-}
-function assignEvaluated({ gen, evaluated, props, items }) {
- if (props instanceof codegen_1.Name)
- gen.assign(codegen_1._ `${evaluated}.props`, props);
- if (items instanceof codegen_1.Name)
- gen.assign(codegen_1._ `${evaluated}.items`, items);
-}
-function schemaKeywords(it, types, typeErrors, errsCount) {
- const { gen, schema, data, allErrors, opts, self } = it;
- const { RULES } = self;
- if (schema.$ref && (opts.ignoreKeywordsWithRef || !util_1.schemaHasRulesButRef(schema, RULES))) {
- gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast
- return;
- }
- if (!opts.jtd)
- checkStrictTypes(it, types);
- gen.block(() => {
- for (const group of RULES.rules)
- groupKeywords(group);
- groupKeywords(RULES.post);
- });
- function groupKeywords(group) {
- if (!applicability_1.shouldUseGroup(schema, group))
- return;
- if (group.type) {
- gen.if(dataType_2.checkDataType(group.type, data, opts.strictNumbers));
- iterateKeywords(it, group);
- if (types.length === 1 && types[0] === group.type && typeErrors) {
- gen.else();
- dataType_2.reportTypeError(it);
- }
- gen.endIf();
- }
- else {
- iterateKeywords(it, group);
- }
- // TODO make it "ok" call?
- if (!allErrors)
- gen.if(codegen_1._ `${names_1.default.errors} === ${errsCount || 0}`);
- }
-}
-function iterateKeywords(it, group) {
- const { gen, schema, opts: { useDefaults }, } = it;
- if (useDefaults)
- defaults_1.assignDefaults(it, group.type);
- gen.block(() => {
- for (const rule of group.rules) {
- if (applicability_1.shouldUseRule(schema, rule)) {
- keywordCode(it, rule.keyword, rule.definition, group.type);
- }
- }
- });
-}
-function checkStrictTypes(it, types) {
- if (it.schemaEnv.meta || !it.opts.strictTypes)
- return;
- checkContextTypes(it, types);
- if (!it.opts.allowUnionTypes)
- checkMultipleTypes(it, types);
- checkKeywordTypes(it, it.dataTypes);
-}
-function checkContextTypes(it, types) {
- if (!types.length)
- return;
- if (!it.dataTypes.length) {
- it.dataTypes = types;
- return;
- }
- types.forEach((t) => {
- if (!includesType(it.dataTypes, t)) {
- strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
- }
- });
- it.dataTypes = it.dataTypes.filter((t) => includesType(types, t));
-}
-function checkMultipleTypes(it, ts) {
- if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
- strictTypesError(it, "use allowUnionTypes to allow union type keyword");
- }
-}
-function checkKeywordTypes(it, ts) {
- const rules = it.self.RULES.all;
- for (const keyword in rules) {
- const rule = rules[keyword];
- if (typeof rule == "object" && applicability_1.shouldUseRule(it.schema, rule)) {
- const { type } = rule.definition;
- if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
- strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
- }
- }
- }
-}
-function hasApplicableType(schTs, kwdT) {
- return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer"));
-}
-function includesType(ts, t) {
- return ts.includes(t) || (t === "integer" && ts.includes("number"));
-}
-function strictTypesError(it, msg) {
- const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
- msg += ` at "${schemaPath}" (strictTypes)`;
- util_1.checkStrictMode(it, msg, it.opts.strictTypes);
-}
-class KeywordCxt {
- constructor(it, def, keyword) {
- 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 = 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 (!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(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(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(codegen_1._ `${schemaCode} !== undefined && (${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() {
- errors_1.reportError(this, this.def.$dataError || errors_1.keyword$DataError);
- }
- reset() {
- if (this.errsCount === undefined)
- throw new Error('add "trackErrors" to keyword definition');
- errors_1.resetErrorsCount(this.gen, this.errsCount);
- }
- ok(cond) {
- if (!this.allErrors)
- this.gen.if(cond);
- }
- setParams(obj, assign) {
- if (assign)
- Object.assign(this.params, obj);
- else
- this.params = obj;
- }
- block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
- this.gen.block(() => {
- this.check$data(valid, $dataValid);
- codeBlock();
- });
- }
- check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
- if (!this.$data)
- return;
- const { gen, schemaCode, schemaType, def } = this;
- gen.if(codegen_1.or(codegen_1._ `${schemaCode} === undefined`, $dataValid));
- if (valid !== codegen_1.nil)
- gen.assign(valid, true);
- if (schemaType.length || def.validateSchema) {
- gen.elseIf(this.invalid$data());
- this.$dataError();
- if (valid !== codegen_1.nil)
- gen.assign(valid, false);
- }
- gen.else();
- }
- invalid$data() {
- const { gen, schemaCode, schemaType, def, it } = this;
- return codegen_1.or(wrong$DataType(), invalid$DataSchema());
- function wrong$DataType() {
- if (schemaType.length) {
- /* istanbul ignore if */
- if (!(schemaCode instanceof codegen_1.Name))
- throw new Error("ajv implementation error");
- const st = Array.isArray(schemaType) ? schemaType : [schemaType];
- return codegen_1._ `${dataType_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 codegen_1._ `!${validateSchemaRef}(${schemaCode})`;
- }
- return codegen_1.nil;
- }
- }
- subschema(appl, valid) {
- const subschema = subschema_1.getSubschema(this.it, appl);
- subschema_1.extendSubschemaData(subschema, this.it, appl);
- 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) {
- keyword_1.funcKeywordCode(cxt, def);
- }
- else if ("macro" in def) {
- keyword_1.macroKeywordCode(cxt, def);
- }
- else if (def.compile || def.validate) {
- 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 = codegen_1._ `${data}${codegen_1.getProperty(util_1.unescapeJsonPointer(segment))}`;
- expr = codegen_1._ `${expr} && ${data}`;
- }
- }
- return expr;
- function errorMsg(pointerType, up) {
- return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
- }
-}
-exports.getData = getData;
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js
deleted file mode 100644
index 47f6176b110..00000000000
--- a/tools/node_modules/eslint/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(codegen_1._ `await `), (e) => gen.assign(valid, false).if(codegen_1._ `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, codegen_1._ `${e}.errors`), () => gen.throw(e)));
- return ruleErrs;
- }
- function validateSync() {
- const validateErrs = codegen_1._ `${validateRef}.errors`;
- gen.assign(validateErrs, null);
- assignValid(codegen_1.nil);
- return validateErrs;
- }
- function assignValid(_await = def.async ? codegen_1._ `await ` : codegen_1.nil) {
- const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
- const passSchema = !(("compile" in def && !$data) || def.schema === false);
- gen.assign(valid, codegen_1._ `${_await}${code_1.callValidateCode(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
- }
- function reportErrs(errors) {
- var _a;
- gen.if(codegen_1.not((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);
- }
-}
-exports.funcKeywordCode = funcKeywordCode;
-function modifyData(cxt) {
- const { gen, data, it } = cxt;
- gen.if(it.parentData, () => gen.assign(data, codegen_1._ `${it.parentData}[${it.parentDataProperty}]`));
-}
-function addErrs(cxt, errs) {
- const { gen } = cxt;
- gen.if(codegen_1._ `Array.isArray(${errs})`, () => {
- gen
- .assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)
- .assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`);
- errors_1.extendErrors(cxt);
- }, () => cxt.error());
-}
-function 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: 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.js
deleted file mode 100644
index 5fab01dda0b..00000000000
--- a/tools/node_modules/eslint/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: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}`,
- errSchemaPath: `${it.errSchemaPath}/${keyword}`,
- }
- : {
- schema: sch[schemaProp],
- schemaPath: codegen_1._ `${it.schemaPath}${codegen_1.getProperty(keyword)}${codegen_1.getProperty(schemaProp)}`,
- errSchemaPath: `${it.errSchemaPath}/${keyword}/${util_1.escapeFragment(schemaProp)}`,
- };
- }
- if (schema !== undefined) {
- if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
- throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
- }
- return {
- schema,
- schemaPath,
- topSchemaRef,
- errSchemaPath,
- };
- }
- throw new Error('either "keyword" or "schema" must be passed');
-}
-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", codegen_1._ `${it.data}${codegen_1.getProperty(dataProp)}`, true);
- dataContextProps(nextData);
- subschema.errorPath = codegen_1.str `${errorPath}${util_1.getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`;
- subschema.parentDataProperty = codegen_1._ `${dataProp}`;
- subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
- }
- if (data !== undefined) {
- const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once?
- dataContextProps(nextData);
- if (propertyName !== undefined)
- subschema.propertyName = propertyName;
- // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
- }
- if (dataTypes)
- subschema.dataTypes = dataTypes;
- function dataContextProps(_nextData) {
- subschema.data = _nextData;
- subschema.dataLevel = it.dataLevel + 1;
- subschema.dataTypes = [];
- it.definedProperties = new Set();
- subschema.parentData = it.data;
- subschema.dataNames = [...it.dataNames, _nextData];
- }
-}
-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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js
deleted file mode 100644
index eb1af0979d3..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js
+++ /dev/null
@@ -1,611 +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 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;
- 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;
- return {
- strictSchema: (_c = (_b = o.strictSchema) !== null && _b !== void 0 ? _b : s) !== null && _c !== void 0 ? _c : true,
- strictNumbers: (_e = (_d = o.strictNumbers) !== null && _d !== void 0 ? _d : s) !== null && _e !== void 0 ? _e : true,
- strictTypes: (_g = (_f = o.strictTypes) !== null && _f !== void 0 ? _f : s) !== null && _g !== void 0 ? _g : "log",
- strictTuples: (_j = (_h = o.strictTuples) !== null && _h !== void 0 ? _h : s) !== null && _j !== void 0 ? _j : "log",
- strictRequired: (_l = (_k = o.strictRequired) !== null && _k !== void 0 ? _k : s) !== null && _l !== void 0 ? _l : false,
- code: o.code ? { ...o.code, optimize } : { optimize },
- loopRequired: (_m = o.loopRequired) !== null && _m !== void 0 ? _m : MAX_EXPRESSION,
- loopEnum: (_o = o.loopEnum) !== null && _o !== void 0 ? _o : MAX_EXPRESSION,
- meta: (_p = o.meta) !== null && _p !== void 0 ? _p : true,
- messages: (_q = o.messages) !== null && _q !== void 0 ? _q : true,
- inlineRefs: (_r = o.inlineRefs) !== null && _r !== void 0 ? _r : true,
- schemaId: (_s = o.schemaId) !== null && _s !== void 0 ? _s : "$id",
- addUsedSchema: (_t = o.addUsedSchema) !== null && _t !== void 0 ? _t : true,
- validateSchema: (_u = o.validateSchema) !== null && _u !== void 0 ? _u : true,
- validateFormats: (_v = o.validateFormats) !== null && _v !== void 0 ? _v : true,
- unicodeRegExp: (_w = o.unicodeRegExp) !== null && _w !== void 0 ? _w : true,
- int32range: (_x = o.int32range) !== null && _x !== void 0 ? _x : true,
- };
-}
-class Ajv {
- constructor(opts = {}) {
- this.schemas = {};
- this.refs = {};
- this.formats = {};
- this._compilations = new Set();
- this._loading = {};
- this._cache = new Map();
- opts = this.opts = { ...opts, ...requiredOptions(opts) };
- const { es5, lines } = this.opts.code;
- this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
- this.logger = getLogger(opts.logger);
- const formatOpt = opts.validateFormats;
- opts.validateFormats = false;
- this.RULES = rules_1.getRules();
- checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
- checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
- this._metaOpts = getMetaSchemaOptions.call(this);
- if (opts.formats)
- addInitialFormats.call(this);
- this._addVocabularies();
- this._addDefaultMetaSchema();
- if (opts.keywords)
- addInitialKeywords.call(this, opts.keywords);
- if (typeof opts.meta == "object")
- this.addMetaSchema(opts.meta);
- addInitialSchemas.call(this);
- opts.validateFormats = formatOpt;
- }
- _addVocabularies() {
- this.addKeyword("$async");
- }
- _addDefaultMetaSchema() {
- const { $data, meta, 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
- 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 = 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 = resolve_1.normalizeId(id);
- delete this.schemas[id];
- delete this.refs[id];
- }
- return this;
- }
- default:
- throw new Error("ajv.removeSchema: invalid parameter");
- }
- }
- // add "vocabulary" - a collection of keywords
- addVocabulary(definitions) {
- for (const def of definitions)
- this.addKeyword(def);
- return this;
- }
- addKeyword(kwdOrDef, def // deprecated
- ) {
- let keyword;
- if (typeof kwdOrDef == "string") {
- keyword = kwdOrDef;
- if (typeof def == "object") {
- this.logger.warn("these parameters are deprecated, see docs for addKeyword");
- def.keyword = keyword;
- }
- }
- else if (typeof kwdOrDef == "object" && def === undefined) {
- def = kwdOrDef;
- keyword = def.keyword;
- if (Array.isArray(keyword) && !keyword.length) {
- throw new Error("addKeywords: keyword must be string or non-empty array");
- }
- }
- else {
- throw new Error("invalid addKeywords parameters");
- }
- checkKeyword.call(this, keyword, def);
- if (!def) {
- util_1.eachItem(keyword, (kwd) => addRule.call(this, kwd));
- return this;
- }
- keywordMetaschema.call(this, def);
- const definition = {
- ...def,
- type: dataType_1.getJSONTypes(def.type),
- schemaType: dataType_1.getJSONTypes(def.schemaType),
- };
- util_1.eachItem(keyword, definition.type.length === 0
- ? (k) => addRule.call(this, k, definition)
- : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
- return this;
- }
- getKeyword(keyword) {
- const rule = this.RULES.all[keyword];
- return typeof rule == "object" ? rule.definition : !!rule;
- }
- // Remove keyword
- removeKeyword(keyword) {
- // TODO return type should be Ajv
- const { RULES } = this;
- delete RULES.keywords[keyword];
- delete RULES.all[keyword];
- for (const group of RULES.rules) {
- const i = group.rules.findIndex((rule) => rule.keyword === keyword);
- if (i >= 0)
- group.rules.splice(i, 1);
- }
- return this;
- }
- // Add format
- addFormat(name, format) {
- if (typeof format == "string")
- format = new RegExp(format);
- this.formats[name] = format;
- return this;
- }
- errorsText(errors = this.errors, // optional array of validation errors
- { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar`
- ) {
- if (!errors || errors.length === 0)
- return "No errors";
- return errors
- .map((e) => `${dataVar}${e.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;
- const localRefs = resolve_1.getSchemaRefs.call(this, schema);
- baseId = resolve_1.normalizeId(id || 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;
- }
- }
-}
-exports.default = Ajv;
-Ajv.ValidationError = validation_error_1.default;
-Ajv.MissingRefError = ref_error_1.default;
-function checkOptions(checkOpts, options, msg, log = "error") {
- for (const key in checkOpts) {
- const opt = key;
- if (opt in options)
- this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
- }
-}
-function getSchEnv(keyRef) {
- keyRef = resolve_1.normalizeId(keyRef); // TODO tests fail without this line
- return this.schemas[keyRef] || this.refs[keyRef];
-}
-function addInitialSchemas() {
- const optsSchemas = this.opts.schemas;
- if (!optsSchemas)
- return;
- if (Array.isArray(optsSchemas))
- this.addSchema(optsSchemas);
- else
- for (const key in optsSchemas)
- this.addSchema(optsSchemas[key], key);
-}
-function addInitialFormats() {
- for (const name in this.opts.formats) {
- const format = this.opts.formats[name];
- if (format)
- this.addFormat(name, format);
- }
-}
-function addInitialKeywords(defs) {
- if (Array.isArray(defs)) {
- this.addVocabulary(defs);
- return;
- }
- this.logger.warn("keywords option as map is deprecated, pass array");
- for (const keyword in defs) {
- const def = defs[keyword];
- if (!def.keyword)
- def.keyword = keyword;
- this.addKeyword(def);
- }
-}
-function getMetaSchemaOptions() {
- const metaOpts = { ...this.opts };
- for (const opt of META_IGNORE_OPTIONS)
- delete metaOpts[opt];
- return metaOpts;
-}
-const noLogs = { log() { }, warn() { }, error() { } };
-function getLogger(logger) {
- if (logger === false)
- return noLogs;
- if (logger === undefined)
- return console;
- if (logger.log && logger.warn && logger.error)
- return logger;
- throw new Error("logger must implement log, warn and error methods");
-}
-const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
-function checkKeyword(keyword, def) {
- const { RULES } = this;
- util_1.eachItem(keyword, (kwd) => {
- if (RULES.keywords[kwd])
- throw new Error(`Keyword ${kwd} is already defined`);
- if (!KEYWORD_NAME.test(kwd))
- throw new Error(`Keyword ${kwd} has invalid name`);
- });
- if (!def)
- return;
- if (def.$data && !("code" in def || "validate" in def)) {
- throw new Error('$data keyword must have "code" or "validate" function');
- }
-}
-function addRule(keyword, definition, dataType) {
- var _a;
- const post = definition === null || definition === void 0 ? void 0 : definition.post;
- if (dataType && post)
- throw new Error('keyword with "post" flag cannot have "type"');
- const { RULES } = this;
- let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
- if (!ruleGroup) {
- ruleGroup = { type: dataType, rules: [] };
- RULES.rules.push(ruleGroup);
- }
- RULES.keywords[keyword] = true;
- if (!definition)
- return;
- const rule = {
- keyword,
- definition: {
- ...definition,
- type: dataType_1.getJSONTypes(definition.type),
- schemaType: dataType_1.getJSONTypes(definition.schemaType),
- },
- };
- if (definition.before)
- addBeforeRule.call(this, ruleGroup, rule, definition.before);
- else
- ruleGroup.rules.push(rule);
- RULES.all[keyword] = rule;
- (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
-}
-function addBeforeRule(ruleGroup, rule, before) {
- const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
- if (i >= 0) {
- ruleGroup.rules.splice(i, 0, rule);
- }
- else {
- ruleGroup.rules.push(rule);
- this.logger.warn(`rule ${before} is not defined`);
- }
-}
-function keywordMetaschema(def) {
- let { metaSchema } = def;
- if (metaSchema === undefined)
- return;
- if (def.$data && this.opts.$data)
- metaSchema = schemaOrData(metaSchema);
- def.validateSchema = this.compile(metaSchema, true);
-}
-const $dataRef = {
- $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
-};
-function schemaOrData(schema) {
- return { anyOf: [schema, $dataRef] };
-}
-//# sourceMappingURL=core.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js
deleted file mode 100644
index dfb34ddd5d5..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/jtd.js
+++ /dev/null
@@ -1,66 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
-const 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;
- }
-}
-module.exports = exports = 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; } });
-//# sourceMappingURL=jtd.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/data.json
deleted file mode 100644
index 9ffc9f5ce05..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/index.js
deleted file mode 100644
index e8649628203..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json
deleted file mode 100644
index c5e91cf2ac8..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json
deleted file mode 100644
index b8f63734343..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json
deleted file mode 100644
index f71adbff04f..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json
deleted file mode 100644
index 03ccfce26ef..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json
deleted file mode 100644
index 0e194326fa1..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json
deleted file mode 100644
index 7027a1279a0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json
deleted file mode 100644
index 54eb7157afe..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/index.js
deleted file mode 100644
index d92567564fe..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.json
deleted file mode 100644
index 674c913dab0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.json
deleted file mode 100644
index 2ae23ddb5cc..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.json
deleted file mode 100644
index 4c8e5cb6165..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json
deleted file mode 100644
index 83c26e35f00..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json
deleted file mode 100644
index 11946fb5019..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json
deleted file mode 100644
index 5e4b203b2c2..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
deleted file mode 100644
index e0ae13d9d20..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-2020-12/schema.json
deleted file mode 100644
index 1c68270fdc6..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-06.json
deleted file mode 100644
index 5410064ba8d..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-draft-07.json
deleted file mode 100644
index 6a748510436..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/json-schema-secure.json
deleted file mode 100644
index 3968abd5d97..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/refs/jtd-schema.js
deleted file mode 100644
index 1ee940afb21..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/equal.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/equal.js
deleted file mode 100644
index 774bba05af0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js
deleted file mode 100644
index 2576a6e1775..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/parseJson.js
+++ /dev/null
@@ -1,182 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0;
-const rxParseJson = /position\s(\d+)$/;
-function parseJson(s, pos) {
- let endPos;
- parseJson.message = undefined;
- let matches;
- if (pos)
- s = s.slice(pos);
- try {
- parseJson.position = pos + s.length;
- return JSON.parse(s);
- }
- catch (e) {
- matches = rxParseJson.exec(e.message);
- if (!matches) {
- parseJson.message = "unexpected end";
- return undefined;
- }
- endPos = +matches[1];
- const c = s[endPos];
- s = s.slice(0, endPos);
- parseJson.position = pos + endPos;
- try {
- return JSON.parse(s);
- }
- catch (e1) {
- parseJson.message = `unexpected token ${c}`;
- return undefined;
- }
- }
-}
-exports.parseJson = parseJson;
-parseJson.message = undefined;
-parseJson.position = 0;
-parseJson.code = '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].toLowerCase();
- if (c >= "a" && c <= "f") {
- code += c.charCodeAt(0) - CODE_A + 10;
- }
- else if (c >= "0" && c <= "9") {
- code += c.charCodeAt(0) - CODE_0;
- }
- else if (c === undefined) {
- errorMessage("unexpected end");
- return undefined;
- }
- else {
- errorMessage(`unexpected token ${c}`);
- return undefined;
- }
- pos++;
- }
- str += String.fromCharCode(code);
- }
- else {
- errorMessage(`unexpected token ${c}`);
- return undefined;
- }
- }
- else if (c === undefined) {
- errorMessage("unexpected end");
- return undefined;
- }
- else {
- if (c.charCodeAt(0) >= 0x20) {
- str += c;
- }
- else {
- errorMessage(`unexpected token ${c}`);
- return undefined;
- }
- }
- }
- parseJsonString.position = pos;
- return str;
- function errorMessage(msg) {
- parseJsonString.position = pos;
- parseJsonString.message = msg;
- }
-}
-exports.parseJsonString = parseJsonString;
-parseJsonString.message = undefined;
-parseJsonString.position = 0;
-parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString';
-//# sourceMappingURL=parseJson.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/quote.js
deleted file mode 100644
index ebf78f70d2d..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/timestamp.js
deleted file mode 100644
index 5e0f06564bf..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/ucs2length.js
deleted file mode 100644
index 92ea0c08a2e..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/runtime/validation_error.js
deleted file mode 100644
index 353502c089d..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js
deleted file mode 100644
index f58ebb6977b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/index.js
+++ /dev/null
@@ -1,81 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const scope_1 = require("../compile/codegen/scope");
-const code_1 = require("../compile/codegen/code");
-function standaloneCode(ajv, refsOrFunc) {
- if (!ajv.opts.code.source) {
- throw new Error("moduleCode: ajv instance must have code.source option");
- }
- const { _n } = ajv.scope.opts;
- return typeof refsOrFunc == "function"
- ? funcExportCode(refsOrFunc.source)
- : refsOrFunc !== undefined
- ? multiExportsCode(refsOrFunc, getValidate)
- : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema));
- function getValidate(id) {
- const v = ajv.getSchema(id);
- if (!v)
- throw new Error(`moduleCode: no schema with id ${id}`);
- return v;
- }
- function funcExportCode(source) {
- const usedValues = {};
- const n = source === null || source === void 0 ? void 0 : source.validateName;
- const vCode = validateCode(usedValues, source);
- return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`;
- }
- function multiExportsCode(schemas, getValidateFunc) {
- var _a;
- const usedValues = {};
- let code = code_1._ `"use strict";`;
- for (const name in schemas) {
- const v = getValidateFunc(schemas[name]);
- if (v) {
- const vCode = validateCode(usedValues, v.source);
- code = code_1._ `${code}${_n}exports${code_1.getProperty(name)} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`;
- }
- }
- return `${code}`;
- }
- function validateCode(usedValues, s) {
- if (!s)
- throw new Error('moduleCode: function does not have "source" property');
- if (usedState(s.validateName) === scope_1.UsedValueState.Completed)
- return code_1.nil;
- setUsedState(s.validateName, scope_1.UsedValueState.Started);
- const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode);
- const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`);
- return s.evaluated ? code_1._ `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code;
- function refValidateCode(n) {
- var _a;
- const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref;
- if (n.prefix === "validate" && typeof vRef == "function") {
- const v = vRef;
- return validateCode(usedValues, v.source);
- }
- else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") {
- const { validate, validateName } = vRef;
- if (!validateName)
- throw new Error("ajv internal error");
- const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const;
- const wrapper = code_1._ `${def} ${n} = {validate: ${validateName}};`;
- if (usedState(validateName) === scope_1.UsedValueState.Started)
- return wrapper;
- const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source);
- return code_1._ `${wrapper}${_n}${vCode}`;
- }
- return undefined;
- }
- function usedState(name) {
- var _a;
- return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name);
- }
- function setUsedState(name, state) {
- const { prefix } = name;
- const names = (usedValues[prefix] = usedValues[prefix] || new Map());
- names.set(name, state);
- }
- }
-}
-exports.default = standaloneCode;
-//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js
deleted file mode 100644
index aa43ac5617e..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/standalone/instance.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const core_1 = require("../core");
-const _1 = require(".");
-const requireFromString = require("require-from-string");
-class AjvPack {
- constructor(ajv) {
- this.ajv = ajv;
- }
- validate(schemaKeyRef, data) {
- return core_1.default.prototype.validate.call(this, schemaKeyRef, data);
- }
- compile(schema, meta) {
- return this.getStandalone(this.ajv.compile(schema, meta));
- }
- getSchema(keyRef) {
- const v = this.ajv.getSchema(keyRef);
- if (!v)
- return undefined;
- return this.getStandalone(v);
- }
- getStandalone(v) {
- return requireFromString(_1.default(this.ajv, v));
- }
- addSchema(...args) {
- this.ajv.addSchema.call(this.ajv, ...args);
- return this;
- }
- addKeyword(...args) {
- this.ajv.addKeyword.call(this.ajv, ...args);
- return this;
- }
-}
-exports.default = AjvPack;
-//# sourceMappingURL=instance.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/index.js
deleted file mode 100644
index aa219d8f2aa..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/json-schema.js
deleted file mode 100644
index 2d8f98dc534..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/types/jtd-schema.js
deleted file mode 100644
index 11338aa8a8f..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js
deleted file mode 100644
index 587a8bc7471..00000000000
--- a/tools/node_modules/eslint/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 } }) => codegen_1.str `must NOT have more than ${len} items`,
- params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`,
-};
-const def = {
- keyword: "additionalItems",
- type: "array",
- schemaType: ["boolean", "object"],
- before: "uniqueItems",
- error,
- code(cxt) {
- const { parentSchema, it } = cxt;
- const { items } = parentSchema;
- if (!Array.isArray(items)) {
- 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", codegen_1._ `${data}.length`);
- if (schema === false) {
- cxt.setParams({ len: items.length });
- cxt.pass(codegen_1._ `${len} <= ${items.length}`);
- }
- else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) {
- const valid = gen.var("valid", codegen_1._ `${len} <= ${items.length}`); // TODO var
- gen.if(codegen_1.not(valid), () => validateItems(valid));
- cxt.ok(valid);
- }
- function validateItems(valid) {
- gen.forRange("i", items.length, len, (i) => {
- cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
- if (!it.allErrors)
- gen.if(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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js
deleted file mode 100644
index 09da8547ec7..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1._ `{additionalProperty: ${params.additionalProperty}}`,
-};
-const def = {
- keyword: "additionalProperties",
- type: ["object"],
- schemaType: ["boolean", "object"],
- allowUndefined: true,
- trackErrors: true,
- error,
- code(cxt) {
- const { gen, schema, parentSchema, data, errsCount, it } = cxt;
- /* istanbul ignore if */
- if (!errsCount)
- throw new Error("ajv implementation error");
- const { allErrors, opts } = it;
- it.props = true;
- if (opts.removeAdditional !== "all" && util_1.alwaysValidSchema(it, schema))
- return;
- const props = code_1.allSchemaProperties(parentSchema.properties);
- const patProps = code_1.allSchemaProperties(parentSchema.patternProperties);
- checkAdditionalProperties();
- cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`);
- function checkAdditionalProperties() {
- gen.forIn("key", data, (key) => {
- if (!props.length && !patProps.length)
- additionalPropertyCode(key);
- else
- gen.if(isAdditional(key), () => additionalPropertyCode(key));
- });
- }
- function isAdditional(key) {
- let definedProp;
- if (props.length > 8) {
- // TODO maybe an option instead of hard-coded 8?
- const propsSchema = util_1.schemaRefOrVal(it, parentSchema.properties, "properties");
- definedProp = code_1.isOwnProperty(gen, propsSchema, key);
- }
- else if (props.length) {
- definedProp = codegen_1.or(...props.map((p) => codegen_1._ `${key} === ${p}`));
- }
- else {
- definedProp = codegen_1.nil;
- }
- if (patProps.length) {
- definedProp = codegen_1.or(definedProp, ...patProps.map((p) => codegen_1._ `${code_1.usePattern(cxt, p)}.test(${key})`));
- }
- return codegen_1.not(definedProp);
- }
- function deleteAdditional(key) {
- gen.code(codegen_1._ `delete ${data}[${key}]`);
- }
- function additionalPropertyCode(key) {
- if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
- deleteAdditional(key);
- return;
- }
- if (schema === false) {
- cxt.setParams({ additionalProperty: key });
- cxt.error();
- if (!allErrors)
- gen.break();
- return;
- }
- if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) {
- const valid = gen.name("valid");
- if (opts.removeAdditional === "failing") {
- applyAdditionalSchema(key, valid, false);
- gen.if(codegen_1.not(valid), () => {
- cxt.reset();
- deleteAdditional(key);
- });
- }
- else {
- applyAdditionalSchema(key, valid);
- if (!allErrors)
- gen.if(codegen_1.not(valid), () => gen.break());
- }
- }
- }
- function applyAdditionalSchema(key, valid, errors) {
- const subschema = {
- keyword: "additionalProperties",
- dataProp: key,
- dataPropType: 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js
deleted file mode 100644
index acda3d16b41..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/allOf.js
+++ /dev/null
@@ -1,23 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const util_1 = require("../../compile/util");
-const def = {
- keyword: "allOf",
- schemaType: "array",
- code(cxt) {
- const { gen, schema, it } = cxt;
- /* istanbul ignore if */
- if (!Array.isArray(schema))
- throw new Error("ajv implementation error");
- const valid = gen.name("valid");
- schema.forEach((sch, i) => {
- if (util_1.alwaysValidSchema(it, sch))
- return;
- const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
- cxt.ok(valid);
- cxt.mergeEvaluated(schCxt);
- });
- },
-};
-exports.default = def;
-//# sourceMappingURL=allOf.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.js
deleted file mode 100644
index 66cfce2cc57..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js
deleted file mode 100644
index 4c254a5c924..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.js
+++ /dev/null
@@ -1,87 +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
- ? codegen_1.str `must contain at least ${min} valid item(s)`
- : codegen_1.str `must contain at least ${min} and no more than ${max} valid item(s)`,
- params: ({ params: { min, max } }) => max === undefined ? codegen_1._ `{minContains: ${min}}` : codegen_1._ `{minContains: ${min}, maxContains: ${max}}`,
-};
-const def = {
- keyword: "contains",
- type: "array",
- schemaType: ["object", "boolean"],
- before: "uniqueItems",
- trackErrors: true,
- error,
- code(cxt) {
- const { gen, schema, parentSchema, data, it } = cxt;
- let min;
- let max;
- const { minContains, maxContains } = parentSchema;
- if (it.opts.next) {
- min = minContains === undefined ? 1 : minContains;
- max = maxContains;
- }
- else {
- min = 1;
- }
- const len = gen.const("len", codegen_1._ `${data}.length`);
- cxt.setParams({ min, max });
- if (max === undefined && min === 0) {
- util_1.checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
- return;
- }
- if (max !== undefined && min > max) {
- util_1.checkStrictMode(it, `"minContains" > "maxContains" is always invalid`);
- cxt.fail();
- return;
- }
- if (util_1.alwaysValidSchema(it, schema)) {
- let cond = codegen_1._ `${len} >= ${min}`;
- if (max !== undefined)
- cond = codegen_1._ `${cond} && ${len} <= ${max}`;
- cxt.pass(cond);
- return;
- }
- it.items = true;
- const valid = gen.name("valid");
- if (max === undefined && min === 1) {
- validateItems(valid, () => gen.if(valid, () => gen.break()));
- }
- else {
- gen.let(valid, false);
- const schValid = gen.name("_valid");
- const count = gen.let("count", 0);
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
- }
- cxt.result(valid, () => cxt.reset());
- function validateItems(_valid, block) {
- gen.forRange("i", 0, len, (i) => {
- cxt.subschema({
- keyword: "contains",
- dataProp: i,
- dataPropType: util_1.Type.Num,
- compositeRule: true,
- }, _valid);
- block();
- });
- }
- function checkLimits(count) {
- gen.code(codegen_1._ `${count}++`);
- if (max === undefined) {
- gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true).break());
- }
- else {
- gen.if(codegen_1._ `${count} > ${max}`, () => gen.assign(valid, false).break());
- if (min === 1)
- gen.assign(valid, true);
- else
- gen.if(codegen_1._ `${count} >= ${min}`, () => gen.assign(valid, true));
- }
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=contains.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
deleted file mode 100644
index ba968df1530..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.js
+++ /dev/null
@@ -1,85 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
-const codegen_1 = require("../../compile/codegen");
-const util_1 = require("../../compile/util");
-const code_1 = require("../code");
-exports.error = {
- message: ({ params: { property, depsCount, deps } }) => {
- const property_ies = depsCount === 1 ? "property" : "properties";
- return codegen_1.str `must have ${property_ies} ${deps} when property ${property} is present`;
- },
- params: ({ params: { property, depsCount, deps, missingProperty } }) => codegen_1._ `{property: ${property},
- missingProperty: ${missingProperty},
- depsCount: ${depsCount},
- deps: ${deps}}`, // TODO change to reference
-};
-const def = {
- keyword: "dependencies",
- type: "object",
- schemaType: "object",
- error: exports.error,
- code(cxt) {
- const [propDeps, schDeps] = splitDependencies(cxt);
- validatePropertyDeps(cxt, propDeps);
- validateSchemaDeps(cxt, schDeps);
- },
-};
-function splitDependencies({ schema }) {
- const propertyDeps = {};
- const schemaDeps = {};
- for (const key in schema) {
- if (key === "__proto__")
- continue;
- const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
- deps[key] = schema[key];
- }
- return [propertyDeps, schemaDeps];
-}
-function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
- const { gen, data, it } = cxt;
- if (Object.keys(propertyDeps).length === 0)
- return;
- const missing = gen.let("missing");
- for (const prop in propertyDeps) {
- const deps = propertyDeps[prop];
- if (deps.length === 0)
- continue;
- const hasProperty = code_1.propertyInData(gen, data, prop, it.opts.ownProperties);
- cxt.setParams({
- property: prop,
- depsCount: deps.length,
- deps: deps.join(", "),
- });
- if (it.allErrors) {
- gen.if(hasProperty, () => {
- for (const depProp of deps) {
- code_1.checkReportMissingProp(cxt, depProp);
- }
- });
- }
- else {
- gen.if(codegen_1._ `${hasProperty} && (${code_1.checkMissingProp(cxt, deps, missing)})`);
- code_1.reportMissingProp(cxt, missing);
- gen.else();
- }
- }
-}
-exports.validatePropertyDeps = validatePropertyDeps;
-function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
- const { gen, data, keyword, it } = cxt;
- const valid = gen.name("valid");
- for (const prop in schemaDeps) {
- if (util_1.alwaysValidSchema(it, schemaDeps[prop]))
- continue;
- gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => {
- const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
- cxt.mergeValidEvaluated(schCxt, valid);
- }, () => gen.var(valid, true) // TODO var
- );
- cxt.ok(valid);
- }
-}
-exports.validateSchemaDeps = validateSchemaDeps;
-exports.default = def;
-//# sourceMappingURL=dependencies.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
deleted file mode 100644
index 5801980ae6e..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const dependencies_1 = require("./dependencies");
-const def = {
- keyword: "dependentSchemas",
- type: "object",
- schemaType: "object",
- code: (cxt) => dependencies_1.validateSchemaDeps(cxt),
-};
-exports.default = def;
-//# sourceMappingURL=dependentSchemas.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.js
deleted file mode 100644
index 507686f2231..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1.str `must match "${params.ifClause}" schema`,
- params: ({ params }) => codegen_1._ `{failingKeyword: ${params.ifClause}}`,
-};
-const def = {
- keyword: "if",
- schemaType: ["object", "boolean"],
- trackErrors: true,
- error,
- code(cxt) {
- const { gen, parentSchema, it } = cxt;
- if (parentSchema.then === undefined && parentSchema.else === undefined) {
- 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(codegen_1.not(schValid), validateClause("else"));
- }
- cxt.pass(valid, () => cxt.error(true));
- function validateIf() {
- const schCxt = cxt.subschema({
- keyword: "if",
- compositeRule: true,
- createErrors: false,
- allErrors: false,
- }, schValid);
- cxt.mergeEvaluated(schCxt);
- }
- function validateClause(keyword, ifClause) {
- return () => {
- const schCxt = cxt.subschema({ keyword }, schValid);
- gen.assign(valid, schValid);
- cxt.mergeValidEvaluated(schCxt, valid);
- if (ifClause)
- gen.assign(ifClause, codegen_1._ `${keyword}`);
- else
- cxt.setParams({ ifClause: keyword });
- };
- }
- },
-};
-function hasSchema(it, keyword) {
- const schema = it.schema[keyword];
- return schema !== undefined && !util_1.alwaysValidSchema(it, schema);
-}
-exports.default = def;
-//# sourceMappingURL=if.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.js
deleted file mode 100644
index cf592f2795e..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items.js
deleted file mode 100644
index 3e6af92c6fa..00000000000
--- a/tools/node_modules/eslint/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 (util_1.alwaysValidSchema(it, schema))
- return;
- cxt.ok(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", codegen_1._ `${data}.length`);
- schArr.forEach((sch, i) => {
- if (util_1.alwaysValidSchema(it, sch))
- return;
- gen.if(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}"`;
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.js
deleted file mode 100644
index cd5c5c4bcd9..00000000000
--- a/tools/node_modules/eslint/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 } }) => codegen_1.str `must NOT have more than ${len} items`,
- params: ({ params: { len } }) => 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 (util_1.alwaysValidSchema(it, schema))
- return;
- if (prefixItems)
- additionalItems_1.validateAdditionalItems(cxt, prefixItems);
- else
- cxt.ok(code_1.validateArray(cxt));
- },
-};
-exports.default = def;
-//# sourceMappingURL=items2020.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.js
deleted file mode 100644
index 72f9f85a0ac..00000000000
--- a/tools/node_modules/eslint/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 (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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.js
deleted file mode 100644
index 8fa5b0b18b8..00000000000
--- a/tools/node_modules/eslint/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 }) => 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 (util_1.alwaysValidSchema(it, sch)) {
- gen.var(schValid, true);
- }
- else {
- schCxt = cxt.subschema({
- keyword: "oneOf",
- schemaProp: i,
- compositeRule: true,
- }, schValid);
- }
- if (i > 0) {
- gen
- .if(codegen_1._ `${schValid} && ${valid}`)
- .assign(valid, false)
- .assign(passing, codegen_1._ `[${passing}, ${i}]`)
- .else();
- }
- gen.if(schValid, () => {
- gen.assign(valid, true);
- gen.assign(passing, i);
- if (schCxt)
- cxt.mergeEvaluated(schCxt, codegen_1.Name);
- });
- });
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=oneOf.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js
deleted file mode 100644
index c54747b35bb..00000000000
--- a/tools/node_modules/eslint/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 = code_1.allSchemaProperties(schema);
- const alwaysValidPatterns = patterns.filter((p) => 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 = 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)) {
- util_1.checkStrictMode(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
- }
- }
- }
- function validateProperties(pat) {
- gen.forIn("key", data, (key) => {
- gen.if(codegen_1._ `${code_1.usePattern(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(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(codegen_1.not(valid), () => gen.break());
- }
- });
- });
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=patternProperties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js
deleted file mode 100644
index 4f3b4cbc8ba..00000000000
--- a/tools/node_modules/eslint/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) => items_1.validateTuple(cxt, "items"),
-};
-exports.default = def;
-//# sourceMappingURL=prefixItems.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/properties.js
deleted file mode 100644
index ff934955531..00000000000
--- a/tools/node_modules/eslint/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 = code_1.allSchemaProperties(schema);
- for (const prop of allProps) {
- it.definedProperties.add(prop);
- }
- if (it.opts.unevaluated && allProps.length && it.props !== true) {
- it.props = util_1.mergeEvaluated.props(gen, util_1.toHash(allProps), it.props);
- }
- const properties = allProps.filter((p) => !util_1.alwaysValidSchema(it, schema[p]));
- if (properties.length === 0)
- return;
- const valid = gen.name("valid");
- for (const prop of properties) {
- if (hasDefault(prop)) {
- applyPropertySchema(prop);
- }
- else {
- gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties));
- applyPropertySchema(prop);
- if (!it.allErrors)
- gen.else().var(valid, true);
- gen.endIf();
- }
- cxt.it.definedProperties.add(prop);
- cxt.ok(valid);
- }
- function hasDefault(prop) {
- return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;
- }
- function applyPropertySchema(prop) {
- cxt.subschema({
- keyword: "properties",
- schemaProp: prop,
- dataProp: prop,
- }, valid);
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=properties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js
deleted file mode 100644
index b898253ae3b..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1._ `{propertyName: ${params.propertyName}}`,
-};
-const def = {
- keyword: "propertyNames",
- type: "object",
- schemaType: ["object", "boolean"],
- error,
- code(cxt) {
- const { gen, schema, data, it } = cxt;
- if (util_1.alwaysValidSchema(it, schema))
- return;
- const valid = gen.name("valid");
- gen.forIn("key", data, (key) => {
- cxt.setParams({ propertyName: key });
- cxt.subschema({
- keyword: "propertyNames",
- data: key,
- dataTypes: ["string"],
- propertyName: key,
- compositeRule: true,
- }, valid);
- gen.if(codegen_1.not(valid), () => {
- cxt.error(true);
- if (!it.allErrors)
- gen.break();
- });
- });
- cxt.ok(valid);
- },
-};
-exports.default = def;
-//# sourceMappingURL=propertyNames.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/thenElse.js
deleted file mode 100644
index 8386c7fc2fa..00000000000
--- a/tools/node_modules/eslint/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)
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js
deleted file mode 100644
index c6f852daf91..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js
+++ /dev/null
@@ -1,127 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
-const codegen_1 = require("../compile/codegen");
-const util_1 = require("../compile/util");
-const names_1 = require("../compile/names");
-function checkReportMissingProp(cxt, prop) {
- const { gen, data, it } = cxt;
- gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
- cxt.setParams({ missingProperty: codegen_1._ `${prop}` }, true);
- cxt.error();
- });
-}
-exports.checkReportMissingProp = checkReportMissingProp;
-function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
- return codegen_1.or(...properties.map((prop) => codegen_1.and(noPropertyInData(gen, data, prop, opts.ownProperties), codegen_1._ `${missing} = ${prop}`)));
-}
-exports.checkMissingProp = checkMissingProp;
-function reportMissingProp(cxt, missing) {
- cxt.setParams({ missingProperty: missing }, true);
- cxt.error();
-}
-exports.reportMissingProp = reportMissingProp;
-function hasPropFunc(gen) {
- return gen.scopeValue("func", {
- // eslint-disable-next-line @typescript-eslint/unbound-method
- ref: Object.prototype.hasOwnProperty,
- code: codegen_1._ `Object.prototype.hasOwnProperty`,
- });
-}
-exports.hasPropFunc = hasPropFunc;
-function isOwnProperty(gen, data, property) {
- return codegen_1._ `${hasPropFunc(gen)}.call(${data}, ${property})`;
-}
-exports.isOwnProperty = isOwnProperty;
-function propertyInData(gen, data, property, ownProperties) {
- const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} !== undefined`;
- return ownProperties ? codegen_1._ `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
-}
-exports.propertyInData = propertyInData;
-function noPropertyInData(gen, data, property, ownProperties) {
- const cond = codegen_1._ `${data}${codegen_1.getProperty(property)} === undefined`;
- return ownProperties ? codegen_1.or(cond, codegen_1.not(isOwnProperty(gen, data, property))) : cond;
-}
-exports.noPropertyInData = noPropertyInData;
-function allSchemaProperties(schemaMap) {
- return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
-}
-exports.allSchemaProperties = allSchemaProperties;
-function schemaProperties(it, schemaMap) {
- return allSchemaProperties(schemaMap).filter((p) => !util_1.alwaysValidSchema(it, schemaMap[p]));
-}
-exports.schemaProperties = schemaProperties;
-function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
- const dataAndSchema = passSchema ? codegen_1._ `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
- const valCxt = [
- [names_1.default.instancePath, 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 = codegen_1._ `${dataAndSchema}, ${gen.object(...valCxt)}`;
- return context !== codegen_1.nil ? codegen_1._ `${func}.call(${context}, ${args})` : codegen_1._ `${func}(${args})`;
-}
-exports.callValidateCode = callValidateCode;
-function usePattern({ gen, it: { opts } }, pattern) {
- const u = opts.unicodeRegExp ? "u" : "";
- return gen.scopeValue("pattern", {
- key: pattern,
- ref: new RegExp(pattern, u),
- code: codegen_1._ `new RegExp(${pattern}, ${u})`,
- });
-}
-exports.usePattern = usePattern;
-function validateArray(cxt) {
- const { gen, data, keyword, it } = cxt;
- const valid = gen.name("valid");
- if (it.allErrors) {
- const validArr = gen.let("valid", true);
- validateItems(() => gen.assign(validArr, false));
- return validArr;
- }
- gen.var(valid, true);
- validateItems(() => gen.break());
- return valid;
- function validateItems(notValid) {
- const len = gen.const("len", codegen_1._ `${data}.length`);
- gen.forRange("i", 0, len, (i) => {
- cxt.subschema({
- keyword,
- dataProp: i,
- dataPropType: util_1.Type.Num,
- }, valid);
- gen.if(codegen_1.not(valid), notValid);
- });
- }
-}
-exports.validateArray = validateArray;
-function validateUnion(cxt) {
- const { gen, schema, keyword, it } = cxt;
- /* istanbul ignore if */
- if (!Array.isArray(schema))
- throw new Error("ajv implementation error");
- const alwaysValid = schema.some((sch) => util_1.alwaysValidSchema(it, sch));
- if (alwaysValid && !it.opts.unevaluated)
- return;
- const valid = gen.let("valid", false);
- const schValid = gen.name("_valid");
- gen.block(() => schema.forEach((_sch, i) => {
- const schCxt = cxt.subschema({
- keyword,
- schemaProp: i,
- compositeRule: true,
- }, schValid);
- gen.assign(valid, codegen_1._ `${valid} || ${schValid}`);
- const merged = cxt.mergeValidEvaluated(schCxt, schValid);
- // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
- // or if all properties and items were evaluated (it.props === true && it.items === true)
- if (!merged)
- gen.if(codegen_1.not(valid));
- }));
- cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
-}
-exports.validateUnion = validateUnion;
-//# sourceMappingURL=code.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/id.js
deleted file mode 100644
index 313598aab87..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/index.js
deleted file mode 100644
index 87656d7436f..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/core/ref.js
deleted file mode 100644
index 9b2c87f35ad..00000000000
--- a/tools/node_modules/eslint/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(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, 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: 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 })
- : codegen_1._ `${gen.scopeValue("wrapper", { ref: sch })}.validate`;
-}
-exports.getValidate = getValidate;
-function callRef(cxt, v, sch, $async) {
- const { gen, it } = cxt;
- const { allErrors, schemaEnv: env, opts } = it;
- const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
- if ($async)
- callAsyncRef();
- else
- callSyncRef();
- function callAsyncRef() {
- if (!env.$async)
- throw new Error("async schema referenced by sync schema");
- const valid = gen.let("valid");
- gen.try(() => {
- gen.code(codegen_1._ `await ${code_1.callValidateCode(cxt, v, passCxt)}`);
- addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result
- if (!allErrors)
- gen.assign(valid, true);
- }, (e) => {
- gen.if(codegen_1._ `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
- addErrorsFrom(e);
- if (!allErrors)
- gen.assign(valid, false);
- });
- cxt.ok(valid);
- }
- function callSyncRef() {
- cxt.result(code_1.callValidateCode(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
- }
- function addErrorsFrom(source) {
- const errs = codegen_1._ `${source}.errors`;
- gen.assign(names_1.default.vErrors, codegen_1._ `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged
- gen.assign(names_1.default.errors, codegen_1._ `${names_1.default.vErrors}.length`);
- }
- function addEvaluatedFrom(source) {
- var _a;
- if (!it.opts.unevaluated)
- return;
- const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
- // TODO refactor
- if (it.props !== true) {
- if (schEvaluated && !schEvaluated.dynamicProps) {
- if (schEvaluated.props !== undefined) {
- it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
- }
- }
- else {
- const props = gen.var("props", codegen_1._ `${source}.evaluated.props`);
- it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
- }
- }
- if (it.items !== true) {
- if (schEvaluated && !schEvaluated.dynamicItems) {
- if (schEvaluated.items !== undefined) {
- it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
- }
- }
- else {
- const items = gen.var("items", codegen_1._ `${source}.evaluated.items`);
- it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
- }
- }
- }
-}
-exports.callRef = callRef;
-exports.default = def;
-//# sourceMappingURL=ref.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js
deleted file mode 100644
index b11ea81e667..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.js
+++ /dev/null
@@ -1,93 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("../../compile/codegen");
-const types_1 = require("../discriminator/types");
-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 } }) => 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", codegen_1._ `${data}${codegen_1.getProperty(tagName)}`);
- gen.if(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(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++) {
- const sch = oneOf[i];
- const propSch = (_a = sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
- if (typeof propSch != "object") {
- throw new Error(`discriminator: oneOf 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.js
deleted file mode 100644
index d538f0ceed8..00000000000
--- a/tools/node_modules/eslint/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 || (exports.DiscrError = {}));
-//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft2020.js
deleted file mode 100644
index f94e27fafd4..00000000000
--- a/tools/node_modules/eslint/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,
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js
deleted file mode 100644
index 25552174285..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/draft7.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const core_1 = require("./core");
-const validation_1 = require("./validation");
-const applicator_1 = require("./applicator");
-const format_1 = require("./format");
-const metadata_1 = require("./metadata");
-const draft7Vocabularies = [
- core_1.default,
- validation_1.default,
- applicator_1.default(),
- format_1.default,
- metadata_1.metadataVocabulary,
- metadata_1.contentVocabulary,
-];
-exports.default = draft7Vocabularies;
-//# sourceMappingURL=draft7.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js
deleted file mode 100644
index 218d95bedff..00000000000
--- a/tools/node_modules/eslint/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 = codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`;
- const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
- gen.if(codegen_1._ `!${v}`, () => gen.assign(v, validate));
-}
-exports.dynamicAnchor = dynamicAnchor;
-function _getValidate(cxt) {
- const { schemaEnv, schema, self } = cxt.it;
- const { root, baseId, localRefs, meta } = schemaEnv.root;
- const { schemaId } = self.opts;
- const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
- compile_1.compileSchema.call(self, sch);
- return ref_1.getValidate(cxt, sch);
-}
-exports.default = def;
-//# sourceMappingURL=dynamicAnchor.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
deleted file mode 100644
index 6e67b1cc9b8..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.dynamicRef = void 0;
-const codegen_1 = require("../../compile/codegen");
-const names_1 = require("../../compile/names");
-const ref_1 = require("../core/ref");
-const def = {
- keyword: "$dynamicRef",
- schemaType: "string",
- code: (cxt) => dynamicRef(cxt, cxt.schema),
-};
-function dynamicRef(cxt, ref) {
- const { gen, keyword, it } = cxt;
- if (ref[0] !== "#")
- throw new Error(`"${keyword}" only supports hash fragment reference`);
- const anchor = ref.slice(1);
- if (it.allErrors) {
- _dynamicRef();
- }
- else {
- const valid = gen.let("valid", false);
- _dynamicRef(valid);
- cxt.ok(valid);
- }
- function _dynamicRef(valid) {
- // TODO the assumption here is that `recursiveRef: #` always points to the root
- // of the schema object, which is not correct, because there may be $id that
- // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
- // Because of that 2 tests in recursiveRef.json fail.
- // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
- // (This problem is not tested in JSON-Schema-Test-Suite)
- if (it.schemaEnv.root.dynamicAnchors[anchor]) {
- const v = gen.let("_v", codegen_1._ `${names_1.default.dynamicAnchors}${codegen_1.getProperty(anchor)}`);
- gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
- }
- else {
- _callRef(it.validateName, valid)();
- }
- }
- function _callRef(validate, valid) {
- return valid
- ? () => gen.block(() => {
- ref_1.callRef(cxt, validate);
- gen.let(valid, true);
- })
- : () => ref_1.callRef(cxt, validate);
- }
-}
-exports.dynamicRef = dynamicRef;
-exports.default = def;
-//# sourceMappingURL=dynamicRef.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/index.js
deleted file mode 100644
index f2388a7571c..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js
deleted file mode 100644
index 91970ea9cc7..00000000000
--- a/tools/node_modules/eslint/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)
- dynamicAnchor_1.dynamicAnchor(cxt, "");
- else
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
deleted file mode 100644
index f421c4cbe27..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const dynamicRef_1 = require("./dynamicRef");
-const def = {
- keyword: "$recursiveRef",
- schemaType: "string",
- code: (cxt) => dynamicRef_1.dynamicRef(cxt, cxt.schema),
-};
-exports.default = def;
-//# sourceMappingURL=recursiveRef.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/errors.js
deleted file mode 100644
index d4d3fba0029..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.js
deleted file mode 100644
index 653fe29a961..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1.str `must match format "${schemaCode}"`,
- params: ({ schemaCode }) => codegen_1._ `{format: ${schemaCode}}`,
-};
-const def = {
- keyword: "format",
- type: ["number", "string"],
- schemaType: "string",
- $data: true,
- error,
- code(cxt, ruleType) {
- const { gen, data, $data, schema, schemaCode, it } = cxt;
- const { opts, errSchemaPath, schemaEnv, self } = it;
- if (!opts.validateFormats)
- return;
- if ($data)
- validate$DataFormat();
- else
- validateFormat();
- function validate$DataFormat() {
- const fmts = gen.scopeValue("formats", {
- ref: self.formats,
- code: opts.code.formats,
- });
- const fDef = gen.const("fDef", codegen_1._ `${fmts}[${schemaCode}]`);
- const fType = gen.let("fType");
- const format = gen.let("format");
- // TODO simplify
- gen.if(codegen_1._ `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, codegen_1._ `${fDef}.type || "string"`).assign(format, codegen_1._ `${fDef}.validate`), () => gen.assign(fType, codegen_1._ `"string"`).assign(format, fDef));
- cxt.fail$data(codegen_1.or(unknownFmt(), invalidFmt()));
- function unknownFmt() {
- if (opts.strictSchema === false)
- return codegen_1.nil;
- return codegen_1._ `${schemaCode} && !${format}`;
- }
- function invalidFmt() {
- const callFormat = schemaEnv.$async
- ? codegen_1._ `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
- : codegen_1._ `${format}(${data})`;
- const validData = codegen_1._ `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
- return codegen_1._ `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
- }
- }
- function validateFormat() {
- const formatDef = self.formats[schema];
- if (!formatDef) {
- unknownFormat();
- return;
- }
- if (formatDef === true)
- return;
- const [fmtType, format, fmtRef] = getFormat(formatDef);
- if (fmtType === ruleType)
- cxt.pass(validCondition());
- function unknownFormat() {
- if (opts.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
- ? codegen_1.regexpCode(fmtDef)
- : opts.code.formats
- ? codegen_1._ `${opts.code.formats}${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, codegen_1._ `${fmt}.validate`];
- }
- return ["string", fmtDef, fmt];
- }
- function validCondition() {
- if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
- if (!schemaEnv.$async)
- throw new Error("async format in sync schema");
- return codegen_1._ `await ${fmtRef}(${data})`;
- }
- return typeof format == "function" ? codegen_1._ `${fmtRef}(${data})` : codegen_1._ `${fmtRef}.test(${data})`;
- }
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=format.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/format/index.js
deleted file mode 100644
index d19023d2452..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.js
deleted file mode 100644
index 16dde01757a..00000000000
--- a/tools/node_modules/eslint/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`
- : error_1.typeErrorMessage(cxt, "object");
- },
- params: (cxt) => {
- const { schema, params } = cxt;
- return params.discrError
- ? codegen_1._ `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}`
- : error_1.typeErrorParams(cxt, "object");
- },
-};
-const def = {
- keyword: "discriminator",
- schemaType: "string",
- implements: ["mapping"],
- error,
- code(cxt) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, schema, parentSchema } = cxt;
- const [valid, cond] = nullable_1.checkNullableObject(cxt, data);
- gen.if(cond);
- validateDiscriminator();
- gen.elseIf(codegen_1.not(valid));
- cxt.error();
- gen.endIf();
- cxt.ok(valid);
- function validateDiscriminator() {
- const tag = gen.const("tag", codegen_1._ `${data}${codegen_1.getProperty(schema)}`);
- gen.if(codegen_1._ `${tag} === undefined`);
- cxt.error(false, { discrError: types_1.DiscrError.Tag, tag });
- gen.elseIf(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(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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.js
deleted file mode 100644
index ccfa9a1a6c3..00000000000
--- a/tools/node_modules/eslint/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: error_1.typeError("array"),
- code(cxt) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, schema, it } = cxt;
- if (util_1.alwaysValidSchema(it, schema))
- return;
- const [valid] = nullable_1.checkNullable(cxt);
- gen.if(codegen_1.not(valid), () => gen.if(codegen_1._ `Array.isArray(${data})`, () => gen.assign(valid, 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.js
deleted file mode 100644
index 9e179f8aa6f..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1._ `{allowedValues: ${schemaCode}}`,
-};
-const def = {
- keyword: "enum",
- schemaType: "array",
- error,
- code(cxt) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, schema, schemaValue, parentSchema, it } = cxt;
- if (schema.length === 0)
- throw new Error("enum must have non-empty array");
- if (schema.length !== new Set(schema).size)
- throw new Error("enum items must be unique");
- let valid;
- const isString = codegen_1._ `typeof ${data} == "string"`;
- if (schema.length >= it.opts.loopEnum) {
- let cond;
- [valid, cond] = nullable_1.checkNullable(cxt, isString);
- gen.if(cond, loopEnum);
- }
- else {
- /* istanbul ignore if */
- if (!Array.isArray(schema))
- throw new Error("ajv implementation error");
- valid = codegen_1.and(isString, codegen_1.or(...schema.map((value) => codegen_1._ `${data} === ${value}`)));
- if (parentSchema.nullable)
- valid = codegen_1.or(codegen_1._ `${data} === null`, valid);
- }
- cxt.pass(valid);
- function loopEnum() {
- gen.forOf("v", schemaValue, (v) => gen.if(codegen_1._ `${valid} = ${data} === ${v}`, () => gen.break()));
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=enum.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.js
deleted file mode 100644
index 4988872abfd..00000000000
--- a/tools/node_modules/eslint/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 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.js
deleted file mode 100644
index 18f40ab7a81..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js
deleted file mode 100644
index acd00ffcad7..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/metadata.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.checkMetadata = void 0;
-const util_1 = require("../../compile/util");
-const def = {
- keyword: "metadata",
- schemaType: "object",
- code(cxt) {
- checkMetadata(cxt);
- const { gen, schema, it } = cxt;
- if (util_1.alwaysValidSchema(it, schema))
- return;
- const valid = gen.name("valid");
- cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid);
- cxt.ok(valid);
- },
-};
-function checkMetadata({ it, keyword }, metadata) {
- if (it.jtdMetadata !== metadata) {
- throw new Error(`JTD: "${keyword}" cannot be used in this schema location`);
- }
-}
-exports.checkMetadata = checkMetadata;
-exports.default = def;
-//# sourceMappingURL=metadata.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/nullable.js
deleted file mode 100644
index cb1454ee9a1..00000000000
--- a/tools/node_modules/eslint/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, codegen_1._ `${data} === null`);
- cond = codegen_1.not(valid);
- }
- else {
- gen.let(valid, false);
- }
- return [valid, cond];
-}
-exports.checkNullable = checkNullable;
-function checkNullableObject(cxt, cond) {
- const [valid, cond_] = checkNullable(cxt, cond);
- return [valid, codegen_1._ `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`];
-}
-exports.checkNullableObject = checkNullableObject;
-//# sourceMappingURL=nullable.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js
deleted file mode 100644
index 6cb93a55de7..00000000000
--- a/tools/node_modules/eslint/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;
- properties_1.validateProperties(cxt);
- },
-};
-exports.default = def;
-//# sourceMappingURL=optionalProperties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js
deleted file mode 100644
index c5be1c50b3b..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js
+++ /dev/null
@@ -1,146 +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}'`
- : error_1.typeErrorMessage(cxt, "object");
- },
- params: (cxt) => {
- const { params } = cxt;
- return params.propError
- ? params.propError === PropError.Additional
- ? codegen_1._ `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}`
- : codegen_1._ `{error: ${params.propError}, missingProperty: ${params.missingProperty}}`
- : 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) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, parentSchema, it } = cxt;
- const { additionalProperties, nullable } = parentSchema;
- if (it.jtdDiscriminator && nullable)
- throw new Error("JTD: nullable inside discriminator mapping");
- if (commonProperties()) {
- throw new Error("JTD: properties and optionalProperties have common members");
- }
- const [allProps, properties] = schemaProperties("properties");
- const [allOptProps, optProperties] = schemaProperties("optionalProperties");
- if (properties.length === 0 && optProperties.length === 0 && additionalProperties) {
- return;
- }
- const [valid, cond] = it.jtdDiscriminator === undefined
- ? nullable_1.checkNullableObject(cxt, data)
- : [gen.let("valid", false), true];
- gen.if(cond, () => gen.assign(valid, true).block(() => {
- validateProps(properties, "properties", true);
- validateProps(optProperties, "optionalProperties");
- if (!additionalProperties)
- validateAdditional();
- }));
- cxt.pass(valid);
- function commonProperties() {
- const props = parentSchema.properties;
- const optProps = parentSchema.optionalProperties;
- if (!(props && optProps))
- return false;
- for (const p in props) {
- if (Object.prototype.hasOwnProperty.call(optProps, p))
- return true;
- }
- return false;
- }
- function schemaProperties(keyword) {
- const schema = parentSchema[keyword];
- const allPs = schema ? code_1.allSchemaProperties(schema) : [];
- if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) {
- throw new Error(`JTD: discriminator tag used in ${keyword}`);
- }
- const ps = allPs.filter((p) => !util_1.alwaysValidSchema(it, schema[p]));
- return [allPs, ps];
- }
- function validateProps(props, keyword, required) {
- const _valid = gen.var("valid");
- for (const prop of props) {
- gen.if(code_1.propertyInData(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(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 _allProps = it.jtdDiscriminator === undefined ? allProps : [it.jtdDiscriminator].concat(allProps);
- const addProp = isAdditional(key, _allProps, "properties");
- const addOptProp = isAdditional(key, allOptProps, "optionalProperties");
- const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : codegen_1.and(addProp, addOptProp);
- gen.if(extra, () => {
- if (it.opts.removeAdditional) {
- gen.code(codegen_1._ `delete ${data}[${key}]`);
- }
- else {
- cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true });
- if (!it.opts.allErrors)
- gen.break();
- }
- });
- });
- }
- function isAdditional(key, props, keyword) {
- let additional;
- if (props.length > 8) {
- // TODO maybe an option instead of hard-coded 8?
- const propsSchema = util_1.schemaRefOrVal(it, parentSchema[keyword], keyword);
- additional = codegen_1.not(code_1.isOwnProperty(gen, propsSchema, key));
- }
- else if (props.length) {
- additional = codegen_1.and(...props.map((p) => codegen_1._ `${key} !== ${p}`));
- }
- else {
- additional = true;
- }
- return additional;
- }
-}
-exports.validateProperties = validateProperties;
-exports.default = def;
-//# sourceMappingURL=properties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js
deleted file mode 100644
index 25c9bf4ab1f..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/ref.js
+++ /dev/null
@@ -1,66 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.hasRef = void 0;
-const compile_1 = require("../../compile");
-const codegen_1 = require("../../compile/codegen");
-const 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) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, schema: ref, parentSchema, it } = cxt;
- const { schemaEnv: { root }, } = it;
- const valid = gen.name("valid");
- if (parentSchema.nullable) {
- gen.var(valid, codegen_1._ `${data} === null`);
- gen.if(codegen_1.not(valid), validateJtdRef);
- }
- else {
- gen.var(valid, false);
- validateJtdRef();
- }
- cxt.ok(valid);
- function validateJtdRef() {
- var _a;
- const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref];
- if (!refSchema)
- throw new ref_error_1.default("", 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 = ref_1.getValidate(cxt, sch);
- const errsCount = gen.const("_errs", names_1.default.errors);
- ref_1.callRef(cxt, v, sch, sch.$async);
- gen.assign(valid, codegen_1._ `${errsCount} === ${names_1.default.errors}`);
- }
- function inlineRefSchema(schema) {
- const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: codegen_1.stringify(schema) } : { ref: schema });
- cxt.subschema({
- schema,
- dataTypes: [],
- schemaPath: codegen_1.nil,
- topSchemaRef: schName,
- errSchemaPath: `/definitions/${ref}`,
- }, valid);
- }
- },
-};
-function hasRef(schema) {
- for (const key in schema) {
- let sch;
- if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch)))
- return true;
- }
- return false;
-}
-exports.hasRef = hasRef;
-exports.default = def;
-//# sourceMappingURL=ref.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.js
deleted file mode 100644
index 428bddbc432..00000000000
--- a/tools/node_modules/eslint/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) => error_1.typeErrorMessage(cxt, cxt.schema),
- params: (cxt) => error_1.typeErrorParams(cxt, cxt.schema),
-};
-function timestampCode(cxt) {
- const { gen, data, it } = cxt;
- const { timestamp, allowDate } = it.opts;
- if (timestamp === "date")
- return codegen_1._ `${data} instanceof Date `;
- const vts = util_1.useFunc(gen, timestamp_1.default);
- const allowDateArg = allowDate ? codegen_1._ `, true` : codegen_1.nil;
- const validString = codegen_1._ `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`;
- return timestamp === "string" ? validString : codegen_1.or(codegen_1._ `${data} instanceof Date`, validString);
-}
-const def = {
- keyword: "type",
- schemaType: "string",
- error,
- code(cxt) {
- metadata_1.checkMetadata(cxt);
- const { data, schema, parentSchema, it } = cxt;
- let cond;
- switch (schema) {
- case "boolean":
- case "string":
- cond = codegen_1._ `typeof ${data} == ${schema}`;
- break;
- case "timestamp": {
- cond = timestampCode(cxt);
- break;
- }
- case "float32":
- case "float64":
- cond = codegen_1._ `typeof ${data} == "number"`;
- break;
- default: {
- const sch = schema;
- cond = codegen_1._ `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`;
- if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) {
- if (sch === "uint32")
- cond = codegen_1._ `${cond} && ${data} >= 0`;
- }
- else {
- const [min, max] = exports.intRange[sch];
- cond = codegen_1._ `${cond} && ${data} >= ${min} && ${data} <= ${max}`;
- }
- }
- }
- cxt.pass(parentSchema.nullable ? codegen_1.or(codegen_1._ `${data} === null`, cond) : cond);
- },
-};
-exports.default = def;
-//# sourceMappingURL=type.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/union.js
deleted file mode 100644
index 01a943994a3..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js
deleted file mode 100644
index 4dadc6e67ed..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js
+++ /dev/null
@@ -1,48 +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: error_1.typeError("object"),
- code(cxt) {
- metadata_1.checkMetadata(cxt);
- const { gen, data, schema, it } = cxt;
- if (util_1.alwaysValidSchema(it, schema))
- return;
- const [valid, cond] = nullable_1.checkNullableObject(cxt, data);
- gen.if(cond);
- gen.assign(valid, validateMap());
- gen.elseIf(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(codegen_1.not(_valid), notValid);
- });
- }
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=values.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/metadata.js
deleted file mode 100644
index f07bf28b5a0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/next.js
deleted file mode 100644
index c861b324338..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/index.js
deleted file mode 100644
index 30e316748de..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js
deleted file mode 100644
index f270a278dcc..00000000000
--- a/tools/node_modules/eslint/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 } }) => codegen_1.str `must NOT have more than ${len} items`,
- params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`,
-};
-const def = {
- keyword: "unevaluatedItems",
- type: "array",
- schemaType: ["boolean", "object"],
- error,
- code(cxt) {
- const { gen, schema, data, it } = cxt;
- const items = it.items || 0;
- if (items === true)
- return;
- const len = gen.const("len", codegen_1._ `${data}.length`);
- if (schema === false) {
- cxt.setParams({ len: items });
- cxt.fail(codegen_1._ `${len} > ${items}`);
- }
- else if (typeof schema == "object" && !util_1.alwaysValidSchema(it, schema)) {
- const valid = gen.var("valid", codegen_1._ `${len} <= ${items}`);
- gen.if(codegen_1.not(valid), () => validateItems(valid, items));
- cxt.ok(valid);
- }
- it.items = true;
- function validateItems(valid, from) {
- gen.forRange("i", from, len, (i) => {
- cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
- if (!it.allErrors)
- gen.if(codegen_1.not(valid), () => gen.break());
- });
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=unevaluatedItems.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js
deleted file mode 100644
index 7552ee14b55..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1._ `{unevaluatedProperty: ${params.unevaluatedProperty}}`,
-};
-const def = {
- keyword: "unevaluatedProperties",
- type: "object",
- schemaType: ["boolean", "object"],
- trackErrors: true,
- error,
- code(cxt) {
- const { gen, schema, data, errsCount, it } = cxt;
- /* istanbul ignore if */
- if (!errsCount)
- throw new Error("ajv implementation error");
- const { allErrors, props } = it;
- if (props instanceof codegen_1.Name) {
- gen.if(codegen_1._ `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
- }
- else if (props !== true) {
- gen.forIn("key", data, (key) => props === undefined
- ? unevaluatedPropCode(key)
- : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
- }
- it.props = true;
- cxt.ok(codegen_1._ `${errsCount} === ${names_1.default.errors}`);
- function unevaluatedPropCode(key) {
- if (schema === false) {
- cxt.setParams({ unevaluatedProperty: key });
- cxt.error();
- if (!allErrors)
- gen.break();
- return;
- }
- if (!util_1.alwaysValidSchema(it, schema)) {
- const valid = gen.name("valid");
- cxt.subschema({
- keyword: "unevaluatedProperties",
- dataProp: key,
- dataPropType: util_1.Type.Str,
- }, valid);
- if (!allErrors)
- gen.if(codegen_1.not(valid), () => gen.break());
- }
- }
- function unevaluatedDynamic(evaluatedProps, key) {
- return codegen_1._ `!${evaluatedProps} || !${evaluatedProps}[${key}]`;
- }
- function unevaluatedStatic(evaluatedProps, key) {
- const ps = [];
- for (const p in evaluatedProps) {
- if (evaluatedProps[p] === true)
- ps.push(codegen_1._ `${key} !== ${p}`);
- }
- return codegen_1.and(...ps);
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=unevaluatedProperties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.js
deleted file mode 100644
index 3177f582d2a..00000000000
--- a/tools/node_modules/eslint/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 }) => 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(codegen_1._ `!${util_1.useFunc(gen, equal_1.default)}(${data}, ${schemaCode})`);
- }
- else {
- cxt.fail(codegen_1._ `${schema} !== ${data}`);
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=const.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
deleted file mode 100644
index 27c4eb26050..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const dependencies_1 = require("../applicator/dependencies");
-const def = {
- keyword: "dependentRequired",
- type: "object",
- schemaType: "object",
- error: dependencies_1.error,
- code: (cxt) => dependencies_1.validatePropertyDeps(cxt),
-};
-exports.default = def;
-//# sourceMappingURL=dependentRequired.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js
deleted file mode 100644
index 103bbf114e7..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.js
+++ /dev/null
@@ -1,47 +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 }) => codegen_1._ `{allowedValues: ${schemaCode}}`,
-};
-const def = {
- keyword: "enum",
- schemaType: "array",
- $data: true,
- error,
- code(cxt) {
- const { gen, data, $data, schema, schemaCode, it } = cxt;
- if (!$data && schema.length === 0)
- throw new Error("enum must have non-empty array");
- const useLoop = schema.length >= it.opts.loopEnum;
- const eql = 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 = codegen_1.or(...schema.map((_x, i) => equalCode(vSchema, i)));
- }
- cxt.pass(valid);
- function loopEnum() {
- gen.assign(valid, false);
- gen.forOf("v", schemaCode, (v) => gen.if(codegen_1._ `${eql}(${data}, ${v})`, () => gen.assign(valid, true).break()));
- }
- function equalCode(vSchema, i) {
- const sch = schema[i];
- return typeof sch === "object" && sch !== null
- ? codegen_1._ `${eql}(${data}, ${vSchema}[${i}])`
- : codegen_1._ `${data} === ${sch}`;
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=enum.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.js
deleted file mode 100644
index 7b56b4e4535..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitContains.js
deleted file mode 100644
index f576c5c40bb..00000000000
--- a/tools/node_modules/eslint/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) {
- 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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js
deleted file mode 100644
index d901c867e5c..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitItems.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("../../compile/codegen");
-const error = {
- message({ keyword, schemaCode }) {
- const comp = keyword === "maxItems" ? "more" : "fewer";
- return codegen_1.str `must NOT have ${comp} than ${schemaCode} items`;
- },
- params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`,
-};
-const def = {
- keyword: ["maxItems", "minItems"],
- type: "array",
- schemaType: "number",
- $data: true,
- error,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
- cxt.fail$data(codegen_1._ `${data}.length ${op} ${schemaCode}`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=limitItems.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitLength.js
deleted file mode 100644
index 51daaa5e2b8..00000000000
--- a/tools/node_modules/eslint/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 codegen_1.str `must NOT have ${comp} than ${schemaCode} characters`;
- },
- params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`,
-};
-const def = {
- keyword: ["maxLength", "minLength"],
- type: "string",
- schemaType: "number",
- $data: true,
- error,
- code(cxt) {
- const { keyword, data, schemaCode, it } = cxt;
- const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
- const len = it.opts.unicode === false ? codegen_1._ `${data}.length` : codegen_1._ `${util_1.useFunc(cxt.gen, ucs2length_1.default)}(${data})`;
- cxt.fail$data(codegen_1._ `${len} ${op} ${schemaCode}`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=limitLength.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
deleted file mode 100644
index 504cf252f5f..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.js
+++ /dev/null
@@ -1,27 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("../../compile/codegen");
-const ops = codegen_1.operators;
-const KWDs = {
- maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
- minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
- exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
- exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
-};
-const error = {
- message: ({ keyword, schemaCode }) => codegen_1.str `must be ${KWDs[keyword].okStr} ${schemaCode}`,
- params: ({ keyword, schemaCode }) => codegen_1._ `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
-};
-const def = {
- keyword: Object.keys(KWDs),
- type: "number",
- schemaType: "number",
- $data: true,
- error,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- cxt.fail$data(codegen_1._ `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=limitNumber.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
deleted file mode 100644
index 743b117705d..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitProperties.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("../../compile/codegen");
-const error = {
- message({ keyword, schemaCode }) {
- const comp = keyword === "maxProperties" ? "more" : "fewer";
- return codegen_1.str `must NOT have ${comp} than ${schemaCode} items`;
- },
- params: ({ schemaCode }) => codegen_1._ `{limit: ${schemaCode}}`,
-};
-const def = {
- keyword: ["maxProperties", "minProperties"],
- type: "object",
- schemaType: "number",
- $data: true,
- error,
- code(cxt) {
- const { keyword, data, schemaCode } = cxt;
- const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
- cxt.fail$data(codegen_1._ `Object.keys(${data}).length ${op} ${schemaCode}`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=limitProperties.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
deleted file mode 100644
index 8626ae0f353..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const codegen_1 = require("../../compile/codegen");
-const error = {
- message: ({ schemaCode }) => codegen_1.str `must be multiple of ${schemaCode}`,
- params: ({ schemaCode }) => codegen_1._ `{multipleOf: ${schemaCode}}`,
-};
-const def = {
- keyword: "multipleOf",
- type: "number",
- schemaType: "number",
- $data: true,
- error,
- code(cxt) {
- const { gen, data, schemaCode, it } = cxt;
- // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
- const prec = it.opts.multipleOfPrecision;
- const res = gen.let("res");
- const invalid = prec
- ? codegen_1._ `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
- : codegen_1._ `${res} !== parseInt(${res})`;
- cxt.fail$data(codegen_1._ `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=multipleOf.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js
deleted file mode 100644
index b0862db3422..00000000000
--- a/tools/node_modules/eslint/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 }) => codegen_1.str `must match pattern "${schemaCode}"`,
- params: ({ schemaCode }) => 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 ? codegen_1._ `(new RegExp(${schemaCode}, ${u}))` : code_1.usePattern(cxt, schema);
- cxt.fail$data(codegen_1._ `!${regExp}.test(${data})`);
- },
-};
-exports.default = def;
-//# sourceMappingURL=pattern.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.js
deleted file mode 100644
index 723c22ec9e7..00000000000
--- a/tools/node_modules/eslint/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 } }) => codegen_1.str `must have required property '${missingProperty}'`,
- params: ({ params: { missingProperty } }) => codegen_1._ `{missingProperty: ${missingProperty}}`,
-};
-const def = {
- keyword: "required",
- type: "object",
- schemaType: "array",
- $data: true,
- error,
- code(cxt) {
- const { gen, schema, schemaCode, data, $data, it } = cxt;
- const { opts } = it;
- if (!$data && schema.length === 0)
- return;
- const useLoop = schema.length >= opts.loopRequired;
- if (it.allErrors)
- allErrorsMode();
- else
- exitOnErrorMode();
- if (opts.strictRequired) {
- const props = cxt.parentSchema.properties;
- const { definedProperties } = cxt.it;
- for (const requiredKey of schema) {
- if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {
- const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
- const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
- 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) {
- code_1.checkReportMissingProp(cxt, prop);
- }
- }
- }
- function exitOnErrorMode() {
- const missing = gen.let("missing");
- if (useLoop || $data) {
- const valid = gen.let("valid", true);
- cxt.block$data(valid, () => loopUntilMissing(missing, valid));
- cxt.ok(valid);
- }
- else {
- gen.if(code_1.checkMissingProp(cxt, schema, missing));
- code_1.reportMissingProp(cxt, missing);
- gen.else();
- }
- }
- function loopAllRequired() {
- gen.forOf("prop", schemaCode, (prop) => {
- cxt.setParams({ missingProperty: prop });
- gen.if(code_1.noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error());
- });
- }
- function loopUntilMissing(missing, valid) {
- cxt.setParams({ missingProperty: missing });
- gen.forOf(missing, schemaCode, () => {
- gen.assign(valid, code_1.propertyInData(gen, data, missing, opts.ownProperties));
- gen.if(codegen_1.not(valid), () => {
- cxt.error();
- gen.break();
- });
- }, codegen_1.nil);
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=required.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js
deleted file mode 100644
index aa4abb9f3f5..00000000000
--- a/tools/node_modules/eslint/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 } }) => codegen_1.str `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
- params: ({ params: { i, j } }) => codegen_1._ `{i: ${i}, j: ${j}}`,
-};
-const def = {
- keyword: "uniqueItems",
- type: "array",
- schemaType: "boolean",
- $data: true,
- error,
- code(cxt) {
- const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
- if (!$data && !schema)
- return;
- const valid = gen.let("valid");
- const itemTypes = parentSchema.items ? dataType_1.getSchemaTypes(parentSchema.items) : [];
- cxt.block$data(valid, validateUniqueItems, codegen_1._ `${schemaCode} === false`);
- cxt.ok(valid);
- function validateUniqueItems() {
- const i = gen.let("i", codegen_1._ `${data}.length`);
- const j = gen.let("j");
- cxt.setParams({ i, j });
- gen.assign(valid, true);
- gen.if(codegen_1._ `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
- }
- function canOptimize() {
- return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
- }
- function loopN(i, j) {
- const item = gen.name("item");
- const wrongType = dataType_1.checkDataTypes(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
- const indices = gen.const("indices", codegen_1._ `{}`);
- gen.for(codegen_1._ `;${i}--;`, () => {
- gen.let(item, codegen_1._ `${data}[${i}]`);
- gen.if(wrongType, codegen_1._ `continue`);
- if (itemTypes.length > 1)
- gen.if(codegen_1._ `typeof ${item} == "string"`, codegen_1._ `${item} += "_"`);
- gen
- .if(codegen_1._ `typeof ${indices}[${item}] == "number"`, () => {
- gen.assign(j, codegen_1._ `${indices}[${item}]`);
- cxt.error();
- gen.assign(valid, false).break();
- })
- .code(codegen_1._ `${indices}[${item}] = ${i}`);
- });
- }
- function loopN2(i, j) {
- const eql = util_1.useFunc(gen, equal_1.default);
- const outer = gen.name("outer");
- gen.label(outer).for(codegen_1._ `;${i}--;`, () => gen.for(codegen_1._ `${j} = ${i}; ${j}--;`, () => gen.if(codegen_1._ `${eql}(${data}[${i}], ${data}[${j}])`, () => {
- cxt.error();
- gen.assign(valid, false).break(outer);
- })));
- }
- },
-};
-exports.default = def;
-//# sourceMappingURL=uniqueItems.js.map \ No newline at end of file
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/data.json
deleted file mode 100644
index 9ffc9f5ce05..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json
deleted file mode 100644
index c5e91cf2ac8..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json
deleted file mode 100644
index b8f63734343..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json
deleted file mode 100644
index f71adbff04f..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json
deleted file mode 100644
index 03ccfce26ef..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json
deleted file mode 100644
index 0e194326fa1..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json
deleted file mode 100644
index 7027a1279a0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json
deleted file mode 100644
index 54eb7157afe..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json
deleted file mode 100644
index 674c913dab0..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json
deleted file mode 100644
index 2ae23ddb5cc..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json
deleted file mode 100644
index 4c8e5cb6165..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json
deleted file mode 100644
index 83c26e35f00..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json
deleted file mode 100644
index 11946fb5019..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json
deleted file mode 100644
index 5e4b203b2c2..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json
deleted file mode 100644
index e0ae13d9d20..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json
deleted file mode 100644
index 1c68270fdc6..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-06.json
deleted file mode 100644
index 5410064ba8d..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-draft-07.json
deleted file mode 100644
index 6a748510436..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/lib/refs/json-schema-secure.json
deleted file mode 100644
index 3968abd5d97..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json
deleted file mode 100644
index 6bf862d66f4..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json
+++ /dev/null
@@ -1,123 +0,0 @@
-{
- "name": "ajv",
- "version": "8.6.2",
- "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\" scripts --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 -g \\(.recursiveRef.with.no..recursiveAnchor\\|.dynamicRef.with.no..dynamicAnchor\\).in.the.initial.target.schema.resource -i",
- "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",
- "bundle": "rm -rf bundle && rollup -c",
- "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 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 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.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2",
- "uri-js": "^4.2.2"
- },
- "devDependencies": {
- "@ajv-validator/config": "^0.3.0",
- "@rollup/plugin-commonjs": "^19.0.0",
- "@rollup/plugin-json": "^4.1.0",
- "@rollup/plugin-node-resolve": "^13.0.0",
- "@rollup/plugin-typescript": "^8.2.1",
- "@types/chai": "^4.2.12",
- "@types/mocha": "^8.0.3",
- "@types/node": "^16.3.2",
- "@types/require-from-string": "^1.2.0",
- "@typescript-eslint/eslint-plugin": "^3.8.0",
- "@typescript-eslint/parser": "^3.8.0",
- "@vuepress/shared-utils": "^1.8.2",
- "ajv-formats": "^2.0.0",
- "chai": "^4.0.1",
- "cross-env": "^7.0.2",
- "dayjs": "^1.10.4",
- "dayjs-plugin-utc": "^0.1.2",
- "eslint": "^7.8.1",
- "eslint-config-prettier": "^7.0.0",
- "glob": "^7.0.0",
- "husky": "^7.0.1",
- "if-node-version": "^1.0.0",
- "jimp": "^0.16.1",
- "js-beautify": "^1.7.3",
- "json-schema-test": "^2.0.0",
- "karma": "^6.0.0",
- "karma-chrome-launcher": "^3.0.0",
- "karma-mocha": "^2.0.0",
- "lint-staged": "^11.0.0",
- "mocha": "^8.0.1",
- "node-fetch": "^2.6.1",
- "nyc": "^15.0.0",
- "prettier": "^2.3.1",
- "rollup": "^2.44.0",
- "rollup-plugin-terser": "^7.0.2",
- "ts-node": "^10.0.0",
- "tsify": "^5.0.2",
- "typescript": "^4.2.0",
- "vuepress": "^1.8.2"
- },
- "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/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/LICENSE
deleted file mode 100644
index 7f1543566f6..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/README.md
deleted file mode 100644
index f3e60073a15..00000000000
--- a/tools/node_modules/eslint/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/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/index.js
deleted file mode 100644
index e521bfa858a..00000000000
--- a/tools/node_modules/eslint/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<sch.length; i++)
- _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
- }
- } else if (key in traverse.propsKeywords) {
- if (sch && typeof sch == 'object') {
- for (var prop in sch)
- _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
- }
- } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
- _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
- }
- }
- post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
- }
-}
-
-
-function escapeJsonPtr(str) {
- return str.replace(/~/g, '~0').replace(/\//g, '~1');
-}
diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json
deleted file mode 100644
index e32dfbaeec5..00000000000
--- a/tools/node_modules/eslint/node_modules/table/node_modules/json-schema-traverse/package.json
+++ /dev/null
@@ -1,43 +0,0 @@
-{
- "name": "json-schema-traverse",
- "version": "1.0.0",
- "description": "Traverse JSON Schema passing each schema object to callback",
- "main": "index.js",
- "types": "index.d.ts",
- "scripts": {
- "eslint": "eslint index.js spec",
- "test-spec": "mocha spec -R spec",
- "test": "npm run eslint && nyc npm run test-spec"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/epoberezkin/json-schema-traverse.git"
- },
- "keywords": [
- "JSON-Schema",
- "traverse",
- "iterate"
- ],
- "author": "Evgeny Poberezkin",
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/epoberezkin/json-schema-traverse/issues"
- },
- "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme",
- "devDependencies": {
- "eslint": "^7.3.1",
- "mocha": "^8.0.1",
- "nyc": "^15.0.0",
- "pre-commit": "^1.2.2"
- },
- "nyc": {
- "exclude": [
- "**/spec/**",
- "node_modules"
- ],
- "reporter": [
- "lcov",
- "text-summary"
- ]
- }
-}
diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json
deleted file mode 100644
index ed3ce70e031..00000000000
--- a/tools/node_modules/eslint/node_modules/table/package.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "author": {
- "email": "gajus@gajus.com",
- "name": "Gajus Kuizinas",
- "url": "http://gajus.com"
- },
- "dependencies": {
- "ajv": "^8.0.1",
- "lodash.clonedeep": "^4.5.0",
- "lodash.truncate": "^4.4.2",
- "slice-ansi": "^4.0.0",
- "string-width": "^4.2.0",
- "strip-ansi": "^6.0.0"
- },
- "description": "Formats data into a string table.",
- "devDependencies": {
- "@types/chai": "^4.2.16",
- "@types/lodash.clonedeep": "^4.5.6",
- "@types/lodash.mapvalues": "^4.6.6",
- "@types/lodash.truncate": "^4.4.6",
- "@types/mocha": "^8.2.2",
- "@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.16.0",
- "eslint-config-canonical": "^25.0.0",
- "gitdown": "^3.1.3",
- "husky": "^4.3.6",
- "js-beautify": "^1.13.0",
- "lodash.mapvalues": "^4.6.0",
- "mkdirp": "^1.0.4",
- "mocha": "^8.2.1",
- "nyc": "^15.1.0",
- "semantic-release": "^17.3.1",
- "sinon": "^9.2.2",
- "ts-node": "^9.1.1",
- "typescript": "4.2.4"
- },
- "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/index.js",
- "files": [
- "dist/**/*.js",
- "dist/**/*.d.ts"
- ],
- "name": "table",
- "nyc": {
- "extensions": [
- ".ts"
- ],
- "exclude": [
- "src/generated/validators.js",
- "test/**/*.ts"
- ],
- "reporter": [
- "text-lcov",
- "text"
- ]
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/gajus/table"
- },
- "scripts": {
- "compile": "tsc",
- "prebuild": "rm -fr ./dist && mkdirp dist",
- "build": "npm run create-validators && npm run compile",
- "create-readme": "gitdown ./.README/README.md --output-file ./README.md",
- "create-validators": "rm -fr ./src/generated && mkdirp ./src/generated && 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 --ignore-path .gitignore ./src ./test",
- "test": "npm run create-validators && mocha --require ts-node/register \"./test/**/*.ts\""
- },
- "version": "6.7.1"
-}
diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json
index 1845500824c..89b02acd4cb 100644
--- a/tools/node_modules/eslint/package.json
+++ b/tools/node_modules/eslint/package.json
@@ -1,12 +1,17 @@
{
"name": "eslint",
- "version": "7.32.0",
+ "version": "8.0.0",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"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": {
"test": "node Makefile.js test",
"test:cli": "mocha",
@@ -18,7 +23,6 @@
"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"
@@ -43,32 +47,31 @@
"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",
+ "@eslint/eslintrc": "^1.0.2",
+ "@humanwhocodes/config-array": "^0.6.0",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
- "debug": "^4.0.1",
+ "debug": "^4.3.2",
"doctrine": "^3.0.0",
"enquirer": "^2.3.5",
"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",
+ "eslint-scope": "^6.0.0",
+ "eslint-utils": "^3.0.0",
+ "eslint-visitor-keys": "^3.0.0",
+ "espree": "^9.0.0",
"esquery": "^1.4.0",
"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",
+ "glob-parent": "^6.0.1",
"globals": "^13.6.0",
"ignore": "^4.0.6",
"import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4",
"is-glob": "^4.0.0",
- "js-yaml": "^3.13.1",
+ "js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1",
"lodash.merge": "^4.6.2",
@@ -76,11 +79,10 @@
"natural-compare": "^1.4.0",
"optionator": "^0.9.1",
"progress": "^2.0.0",
- "regexpp": "^3.1.0",
+ "regexpp": "^3.2.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"
},
@@ -92,18 +94,19 @@
"cheerio": "^0.22.0",
"common-tags": "^1.8.0",
"core-js": "^3.1.3",
- "dateformat": "^3.0.3",
+ "dateformat": "^4.5.1",
"ejs": "^3.0.2",
"eslint": "file:.",
"eslint-config-eslint": "file:packages/eslint-config-eslint",
+ "eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^3.5.3",
"eslint-plugin-internal-rules": "file:tools/internal-rules",
- "eslint-plugin-jsdoc": "^25.4.3",
+ "eslint-plugin-jsdoc": "^36.0.6",
"eslint-plugin-node": "^11.1.0",
- "eslint-release": "^2.0.0",
+ "eslint-release": "^3.1.2",
"eslump": "^3.0.0",
"esprima": "^4.0.1",
- "fs-teardown": "0.1.1",
+ "fs-teardown": "^0.1.3",
"glob": "^7.1.6",
"jsdoc": "^3.5.5",
"karma": "^6.1.1",
@@ -111,10 +114,10 @@
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^5.0.0",
- "lint-staged": "^10.1.2",
+ "lint-staged": "^11.0.0",
"load-perf": "^0.2.0",
- "markdownlint": "^0.19.0",
- "markdownlint-cli": "^0.22.0",
+ "markdownlint": "^0.23.1",
+ "markdownlint-cli": "^0.28.1",
"memfs": "^3.0.1",
"mocha": "^8.3.2",
"mocha-junit-reporter": "^2.0.0",
@@ -122,11 +125,11 @@
"npm-license": "^0.3.3",
"nyc": "^15.0.1",
"proxyquire": "^2.0.1",
- "puppeteer": "^7.1.0",
- "recast": "^0.19.0",
+ "puppeteer": "^9.1.1",
+ "recast": "^0.20.4",
"regenerator-runtime": "^0.13.2",
"shelljs": "^0.8.2",
- "sinon": "^9.0.1",
+ "sinon": "^11.0.0",
"temp": "^0.9.0",
"webpack": "^5.23.0",
"webpack-cli": "^4.5.0",
@@ -141,6 +144,6 @@
],
"license": "MIT",
"engines": {
- "node": "^10.12.0 || >=12.0.0"
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
}