From b8b585376eb1f09baee2b62dab64017cbc6c6d25 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 18 Jan 2019 16:09:54 -0500 Subject: [PATCH] tools: update ESLint to 5.12.1 Update ESLint to 5.12.1 PR-URL: https://github.com/nodejs/node/pull/25573 Reviewed-By: Wyatt Preul Reviewed-By: Masashi Hirano --- tools/node_modules/eslint/README.md | 35 ++- .../eslint/lib/built-in-rules-index.js | 277 ++++++++++++++++++ .../node_modules/eslint/lib/formatters/tap.js | 11 +- tools/node_modules/eslint/lib/rules.js | 13 +- .../eslint/lib/rules/global-require.js | 7 +- .../eslint/lib/rules/guard-for-in.js | 7 +- .../eslint/lib/rules/handle-callback-err.js | 7 +- .../eslint/lib/rules/id-blacklist.js | 5 +- .../eslint/lib/rules/id-length.js | 10 +- .../node_modules/eslint/lib/rules/id-match.js | 7 +- .../lib/rules/implicit-arrow-linebreak.js | 10 +- .../eslint/lib/rules/indent-legacy.js | 16 +- tools/node_modules/eslint/lib/rules/indent.js | 16 +- .../eslint/lib/rules/init-declarations.js | 23 +- .../eslint/lib/rules/jsx-quotes.js | 7 +- .../eslint/lib/rules/key-spacing.js | 24 +- .../eslint/lib/rules/keyword-spacing.js | 16 +- .../eslint/lib/rules/line-comment-position.js | 10 +- .../eslint/lib/rules/linebreak-style.js | 12 +- .../eslint/lib/rules/lines-around-comment.js | 10 +- .../lib/rules/lines-around-directive.js | 7 +- .../lib/rules/lines-between-class-members.js | 11 +- .../eslint/lib/rules/max-depth.js | 7 +- .../node_modules/eslint/lib/rules/max-len.js | 10 +- .../lib/rules/max-lines-per-function.js | 7 +- .../eslint/lib/rules/max-lines.js | 7 +- .../eslint/lib/rules/max-nested-callbacks.js | 7 +- .../eslint/lib/rules/max-params.js | 7 +- .../lib/rules/max-statements-per-line.js | 10 +- .../eslint/lib/rules/max-statements.js | 7 +- .../lib/rules/multiline-comment-style.js | 35 +-- .../eslint/lib/rules/multiline-ternary.js | 14 +- .../node_modules/eslint/lib/rules/new-cap.js | 18 +- .../eslint/lib/rules/new-parens.js | 7 +- .../eslint/lib/rules/newline-after-var.js | 14 +- .../eslint/lib/rules/newline-before-return.js | 6 +- .../lib/rules/newline-per-chained-call.js | 7 +- .../lib/rules/no-async-promise-executor.js | 7 +- .../eslint/lib/rules/no-constant-condition.js | 5 +- .../eslint/lib/rules/no-duplicate-imports.js | 25 +- .../eslint/lib/rules/no-fallthrough.js | 9 +- .../eslint/lib/rules/no-floating-decimal.js | 10 +- .../node_modules/eslint/lib/rules/no-undef.js | 7 +- .../lib/rules/no-unexpected-multiline.js | 27 +- .../eslint/lib/rules/no-unsafe-negation.js | 9 +- .../eslint/lib/rules/no-unused-labels.js | 9 +- .../eslint/lib/rules/operator-assignment.js | 12 +- .../eslint/lib/rules/prefer-const.js | 7 +- .../eslint/lib/rules/space-unary-ops.js | 22 +- tools/node_modules/eslint/lib/rules/strict.js | 69 +++-- .../eslint/lib/rules/switch-colon-spacing.js | 15 +- .../eslint/lib/rules/symbol-description.js | 9 +- .../lib/rules/template-curly-spacing.js | 20 +- .../eslint/lib/rules/template-tag-spacing.js | 10 +- .../eslint/lib/rules/unicode-bom.js | 10 +- .../eslint/lib/rules/use-isnan.js | 7 +- .../eslint/lib/rules/valid-jsdoc.js | 44 ++- .../eslint/lib/rules/valid-typeof.js | 10 +- .../eslint/lib/rules/vars-on-top.js | 10 +- .../eslint/lib/rules/wrap-iife.js | 13 +- .../eslint/lib/rules/yield-star-spacing.js | 23 +- tools/node_modules/eslint/lib/rules/yoda.js | 7 +- .../eslint/node_modules/ajv/README.md | 43 +-- .../node_modules/ajv/dist/ajv.bundle.js | 102 +++++-- .../eslint/node_modules/ajv/dist/ajv.min.js | 4 +- .../node_modules/ajv/dist/ajv.min.js.map | 2 +- .../eslint/node_modules/ajv/lib/ajv.d.ts | 60 ++-- .../node_modules/ajv/lib/compile/equal.js | 2 + .../node_modules/ajv/lib/dot/defaults.def | 7 +- .../node_modules/ajv/lib/dotjs/_limit.js | 6 +- .../node_modules/ajv/lib/dotjs/_limitItems.js | 3 +- .../ajv/lib/dotjs/_limitLength.js | 3 +- .../ajv/lib/dotjs/_limitProperties.js | 3 +- .../node_modules/ajv/lib/dotjs/anyOf.js | 3 +- .../node_modules/ajv/lib/dotjs/const.js | 3 +- .../node_modules/ajv/lib/dotjs/contains.js | 3 +- .../node_modules/ajv/lib/dotjs/custom.js | 6 +- .../ajv/lib/dotjs/dependencies.js | 3 +- .../eslint/node_modules/ajv/lib/dotjs/enum.js | 3 +- .../node_modules/ajv/lib/dotjs/format.js | 3 +- .../eslint/node_modules/ajv/lib/dotjs/if.js | 3 +- .../node_modules/ajv/lib/dotjs/items.js | 3 +- .../node_modules/ajv/lib/dotjs/multipleOf.js | 3 +- .../eslint/node_modules/ajv/lib/dotjs/not.js | 3 +- .../node_modules/ajv/lib/dotjs/oneOf.js | 3 +- .../node_modules/ajv/lib/dotjs/pattern.js | 3 +- .../node_modules/ajv/lib/dotjs/properties.js | 6 +- .../ajv/lib/dotjs/propertyNames.js | 3 +- .../eslint/node_modules/ajv/lib/dotjs/ref.js | 3 +- .../node_modules/ajv/lib/dotjs/required.js | 6 +- .../node_modules/ajv/lib/dotjs/uniqueItems.js | 3 +- .../node_modules/ajv/lib/dotjs/validate.js | 24 +- .../eslint/node_modules/ajv/package.json | 4 +- .../eslint/node_modules/chalk/index.js.flow | 2 +- .../eslint/node_modules/chalk/package.json | 2 +- .../eslint/node_modules/globals/globals.json | 80 ++++- .../eslint/node_modules/globals/package.json | 2 +- .../eslint/node_modules/js-yaml/README.md | 3 +- .../node_modules/js-yaml/dist/js-yaml.js | 28 +- .../node_modules/js-yaml/dist/js-yaml.min.js | 2 +- .../js-yaml/lib/js-yaml/dumper.js | 26 +- .../eslint/node_modules/js-yaml/package.json | 2 +- .../eslint/node_modules/rxjs/package.json | 11 +- .../table/dist/calculateCellHeight.js | 10 +- .../table/dist/calculateCellHeight.js.flow | 9 +- .../table/dist/calculateCellHeight.js.map | 2 +- .../table/dist/mapDataUsingRowHeightIndex.js | 17 +- .../dist/mapDataUsingRowHeightIndex.js.flow | 15 +- .../dist/mapDataUsingRowHeightIndex.js.map | 2 +- .../table/dist/validateTableData.js | 6 +- .../table/dist/validateTableData.js.flow | 4 +- .../table/dist/validateTableData.js.map | 2 +- .../node_modules/table/dist/wrapCell.js | 48 +++ .../node_modules/table/dist/wrapCell.js.flow | 35 +++ .../node_modules/table/dist/wrapCell.js.map | 1 + .../eslint/node_modules/table/package.json | 2 +- tools/node_modules/eslint/package.json | 2 +- 117 files changed, 1226 insertions(+), 513 deletions(-) create mode 100644 tools/node_modules/eslint/lib/built-in-rules-index.js create mode 100644 tools/node_modules/eslint/node_modules/table/dist/wrapCell.js create mode 100644 tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow create mode 100644 tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.map diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index 65ee43400d729f..e1855ec3f49b1b 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -133,7 +133,7 @@ If you are trying to run locally: * Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime). * Make sure you have run `npm install` and all your dependencies are installed. -In all cases, make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDepencies` to see what peer dependencies `eslint-plugin-myplugin` has. +In all cases, make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDependencies` to see what peer dependencies `eslint-plugin-myplugin` has. ### Does ESLint support JSX? @@ -195,6 +195,8 @@ These folks keep the project moving and are resources for help. ### Technical Steering Committee (TSC) +The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained. + @@ -247,7 +249,31 @@ These folks keep the project moving and are resources for help.
-### Development Team +### Committers + +The people who review and fix bugs and help triage issues. + + + + + + + + +
+ +
+ 薛定谔的猫
+
+ +
+ Pig Fang
+
+ + +### Alumni + +Former TSC members and committers who previously helped maintain ESLint. @@ -324,11 +350,6 @@ These folks keep the project moving and are resources for help.
Reyad Attiyat -
- -
- 薛定谔的猫
-

diff --git a/tools/node_modules/eslint/lib/built-in-rules-index.js b/tools/node_modules/eslint/lib/built-in-rules-index.js new file mode 100644 index 00000000000000..aaf2f06eccdd41 --- /dev/null +++ b/tools/node_modules/eslint/lib/built-in-rules-index.js @@ -0,0 +1,277 @@ +/** + * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without + * using the file-system directly. + * @author Peter (Somogyvari) Metz + */ + +"use strict"; + +/* eslint sort-keys: ["error", "asc"] */ + +module.exports = { + "accessor-pairs": require("./rules/accessor-pairs"), + "array-bracket-newline": require("./rules/array-bracket-newline"), + "array-bracket-spacing": require("./rules/array-bracket-spacing"), + "array-callback-return": require("./rules/array-callback-return"), + "array-element-newline": require("./rules/array-element-newline"), + "arrow-body-style": require("./rules/arrow-body-style"), + "arrow-parens": require("./rules/arrow-parens"), + "arrow-spacing": require("./rules/arrow-spacing"), + "block-scoped-var": require("./rules/block-scoped-var"), + "block-spacing": require("./rules/block-spacing"), + "brace-style": require("./rules/brace-style"), + "callback-return": require("./rules/callback-return"), + camelcase: require("./rules/camelcase"), + "capitalized-comments": require("./rules/capitalized-comments"), + "class-methods-use-this": require("./rules/class-methods-use-this"), + "comma-dangle": require("./rules/comma-dangle"), + "comma-spacing": require("./rules/comma-spacing"), + "comma-style": require("./rules/comma-style"), + complexity: require("./rules/complexity"), + "computed-property-spacing": require("./rules/computed-property-spacing"), + "consistent-return": require("./rules/consistent-return"), + "consistent-this": require("./rules/consistent-this"), + "constructor-super": require("./rules/constructor-super"), + curly: require("./rules/curly"), + "default-case": require("./rules/default-case"), + "dot-location": require("./rules/dot-location"), + "dot-notation": require("./rules/dot-notation"), + "eol-last": require("./rules/eol-last"), + eqeqeq: require("./rules/eqeqeq"), + "for-direction": require("./rules/for-direction"), + "func-call-spacing": require("./rules/func-call-spacing"), + "func-name-matching": require("./rules/func-name-matching"), + "func-names": require("./rules/func-names"), + "func-style": require("./rules/func-style"), + "function-paren-newline": require("./rules/function-paren-newline"), + "generator-star-spacing": require("./rules/generator-star-spacing"), + "getter-return": require("./rules/getter-return"), + "global-require": require("./rules/global-require"), + "guard-for-in": require("./rules/guard-for-in"), + "handle-callback-err": require("./rules/handle-callback-err"), + "id-blacklist": require("./rules/id-blacklist"), + "id-length": require("./rules/id-length"), + "id-match": require("./rules/id-match"), + "implicit-arrow-linebreak": require("./rules/implicit-arrow-linebreak"), + indent: require("./rules/indent"), + "indent-legacy": require("./rules/indent-legacy"), + "init-declarations": require("./rules/init-declarations"), + "jsx-quotes": require("./rules/jsx-quotes"), + "key-spacing": require("./rules/key-spacing"), + "keyword-spacing": require("./rules/keyword-spacing"), + "line-comment-position": require("./rules/line-comment-position"), + "linebreak-style": require("./rules/linebreak-style"), + "lines-around-comment": require("./rules/lines-around-comment"), + "lines-around-directive": require("./rules/lines-around-directive"), + "lines-between-class-members": require("./rules/lines-between-class-members"), + "max-classes-per-file": require("./rules/max-classes-per-file"), + "max-depth": require("./rules/max-depth"), + "max-len": require("./rules/max-len"), + "max-lines": require("./rules/max-lines"), + "max-lines-per-function": require("./rules/max-lines-per-function"), + "max-nested-callbacks": require("./rules/max-nested-callbacks"), + "max-params": require("./rules/max-params"), + "max-statements": require("./rules/max-statements"), + "max-statements-per-line": require("./rules/max-statements-per-line"), + "multiline-comment-style": require("./rules/multiline-comment-style"), + "multiline-ternary": require("./rules/multiline-ternary"), + "new-cap": require("./rules/new-cap"), + "new-parens": require("./rules/new-parens"), + "newline-after-var": require("./rules/newline-after-var"), + "newline-before-return": require("./rules/newline-before-return"), + "newline-per-chained-call": require("./rules/newline-per-chained-call"), + "no-alert": require("./rules/no-alert"), + "no-array-constructor": require("./rules/no-array-constructor"), + "no-async-promise-executor": require("./rules/no-async-promise-executor"), + "no-await-in-loop": require("./rules/no-await-in-loop"), + "no-bitwise": require("./rules/no-bitwise"), + "no-buffer-constructor": require("./rules/no-buffer-constructor"), + "no-caller": require("./rules/no-caller"), + "no-case-declarations": require("./rules/no-case-declarations"), + "no-catch-shadow": require("./rules/no-catch-shadow"), + "no-class-assign": require("./rules/no-class-assign"), + "no-compare-neg-zero": require("./rules/no-compare-neg-zero"), + "no-cond-assign": require("./rules/no-cond-assign"), + "no-confusing-arrow": require("./rules/no-confusing-arrow"), + "no-console": require("./rules/no-console"), + "no-const-assign": require("./rules/no-const-assign"), + "no-constant-condition": require("./rules/no-constant-condition"), + "no-continue": require("./rules/no-continue"), + "no-control-regex": require("./rules/no-control-regex"), + "no-debugger": require("./rules/no-debugger"), + "no-delete-var": require("./rules/no-delete-var"), + "no-div-regex": require("./rules/no-div-regex"), + "no-dupe-args": require("./rules/no-dupe-args"), + "no-dupe-class-members": require("./rules/no-dupe-class-members"), + "no-dupe-keys": require("./rules/no-dupe-keys"), + "no-duplicate-case": require("./rules/no-duplicate-case"), + "no-duplicate-imports": require("./rules/no-duplicate-imports"), + "no-else-return": require("./rules/no-else-return"), + "no-empty": require("./rules/no-empty"), + "no-empty-character-class": require("./rules/no-empty-character-class"), + "no-empty-function": require("./rules/no-empty-function"), + "no-empty-pattern": require("./rules/no-empty-pattern"), + "no-eq-null": require("./rules/no-eq-null"), + "no-eval": require("./rules/no-eval"), + "no-ex-assign": require("./rules/no-ex-assign"), + "no-extend-native": require("./rules/no-extend-native"), + "no-extra-bind": require("./rules/no-extra-bind"), + "no-extra-boolean-cast": require("./rules/no-extra-boolean-cast"), + "no-extra-label": require("./rules/no-extra-label"), + "no-extra-parens": require("./rules/no-extra-parens"), + "no-extra-semi": require("./rules/no-extra-semi"), + "no-fallthrough": require("./rules/no-fallthrough"), + "no-floating-decimal": require("./rules/no-floating-decimal"), + "no-func-assign": require("./rules/no-func-assign"), + "no-global-assign": require("./rules/no-global-assign"), + "no-implicit-coercion": require("./rules/no-implicit-coercion"), + "no-implicit-globals": require("./rules/no-implicit-globals"), + "no-implied-eval": require("./rules/no-implied-eval"), + "no-inline-comments": require("./rules/no-inline-comments"), + "no-inner-declarations": require("./rules/no-inner-declarations"), + "no-invalid-regexp": require("./rules/no-invalid-regexp"), + "no-invalid-this": require("./rules/no-invalid-this"), + "no-irregular-whitespace": require("./rules/no-irregular-whitespace"), + "no-iterator": require("./rules/no-iterator"), + "no-label-var": require("./rules/no-label-var"), + "no-labels": require("./rules/no-labels"), + "no-lone-blocks": require("./rules/no-lone-blocks"), + "no-lonely-if": require("./rules/no-lonely-if"), + "no-loop-func": require("./rules/no-loop-func"), + "no-magic-numbers": require("./rules/no-magic-numbers"), + "no-misleading-character-class": require("./rules/no-misleading-character-class"), + "no-mixed-operators": require("./rules/no-mixed-operators"), + "no-mixed-requires": require("./rules/no-mixed-requires"), + "no-mixed-spaces-and-tabs": require("./rules/no-mixed-spaces-and-tabs"), + "no-multi-assign": require("./rules/no-multi-assign"), + "no-multi-spaces": require("./rules/no-multi-spaces"), + "no-multi-str": require("./rules/no-multi-str"), + "no-multiple-empty-lines": require("./rules/no-multiple-empty-lines"), + "no-native-reassign": require("./rules/no-native-reassign"), + "no-negated-condition": require("./rules/no-negated-condition"), + "no-negated-in-lhs": require("./rules/no-negated-in-lhs"), + "no-nested-ternary": require("./rules/no-nested-ternary"), + "no-new": require("./rules/no-new"), + "no-new-func": require("./rules/no-new-func"), + "no-new-object": require("./rules/no-new-object"), + "no-new-require": require("./rules/no-new-require"), + "no-new-symbol": require("./rules/no-new-symbol"), + "no-new-wrappers": require("./rules/no-new-wrappers"), + "no-obj-calls": require("./rules/no-obj-calls"), + "no-octal": require("./rules/no-octal"), + "no-octal-escape": require("./rules/no-octal-escape"), + "no-param-reassign": require("./rules/no-param-reassign"), + "no-path-concat": require("./rules/no-path-concat"), + "no-plusplus": require("./rules/no-plusplus"), + "no-process-env": require("./rules/no-process-env"), + "no-process-exit": require("./rules/no-process-exit"), + "no-proto": require("./rules/no-proto"), + "no-prototype-builtins": require("./rules/no-prototype-builtins"), + "no-redeclare": require("./rules/no-redeclare"), + "no-regex-spaces": require("./rules/no-regex-spaces"), + "no-restricted-globals": require("./rules/no-restricted-globals"), + "no-restricted-imports": require("./rules/no-restricted-imports"), + "no-restricted-modules": require("./rules/no-restricted-modules"), + "no-restricted-properties": require("./rules/no-restricted-properties"), + "no-restricted-syntax": require("./rules/no-restricted-syntax"), + "no-return-assign": require("./rules/no-return-assign"), + "no-return-await": require("./rules/no-return-await"), + "no-script-url": require("./rules/no-script-url"), + "no-self-assign": require("./rules/no-self-assign"), + "no-self-compare": require("./rules/no-self-compare"), + "no-sequences": require("./rules/no-sequences"), + "no-shadow": require("./rules/no-shadow"), + "no-shadow-restricted-names": require("./rules/no-shadow-restricted-names"), + "no-spaced-func": require("./rules/no-spaced-func"), + "no-sparse-arrays": require("./rules/no-sparse-arrays"), + "no-sync": require("./rules/no-sync"), + "no-tabs": require("./rules/no-tabs"), + "no-template-curly-in-string": require("./rules/no-template-curly-in-string"), + "no-ternary": require("./rules/no-ternary"), + "no-this-before-super": require("./rules/no-this-before-super"), + "no-throw-literal": require("./rules/no-throw-literal"), + "no-trailing-spaces": require("./rules/no-trailing-spaces"), + "no-undef": require("./rules/no-undef"), + "no-undef-init": require("./rules/no-undef-init"), + "no-undefined": require("./rules/no-undefined"), + "no-underscore-dangle": require("./rules/no-underscore-dangle"), + "no-unexpected-multiline": require("./rules/no-unexpected-multiline"), + "no-unmodified-loop-condition": require("./rules/no-unmodified-loop-condition"), + "no-unneeded-ternary": require("./rules/no-unneeded-ternary"), + "no-unreachable": require("./rules/no-unreachable"), + "no-unsafe-finally": require("./rules/no-unsafe-finally"), + "no-unsafe-negation": require("./rules/no-unsafe-negation"), + "no-unused-expressions": require("./rules/no-unused-expressions"), + "no-unused-labels": require("./rules/no-unused-labels"), + "no-unused-vars": require("./rules/no-unused-vars"), + "no-use-before-define": require("./rules/no-use-before-define"), + "no-useless-call": require("./rules/no-useless-call"), + "no-useless-catch": require("./rules/no-useless-catch"), + "no-useless-computed-key": require("./rules/no-useless-computed-key"), + "no-useless-concat": require("./rules/no-useless-concat"), + "no-useless-constructor": require("./rules/no-useless-constructor"), + "no-useless-escape": require("./rules/no-useless-escape"), + "no-useless-rename": require("./rules/no-useless-rename"), + "no-useless-return": require("./rules/no-useless-return"), + "no-var": require("./rules/no-var"), + "no-void": require("./rules/no-void"), + "no-warning-comments": require("./rules/no-warning-comments"), + "no-whitespace-before-property": require("./rules/no-whitespace-before-property"), + "no-with": require("./rules/no-with"), + "nonblock-statement-body-position": require("./rules/nonblock-statement-body-position"), + "object-curly-newline": require("./rules/object-curly-newline"), + "object-curly-spacing": require("./rules/object-curly-spacing"), + "object-property-newline": require("./rules/object-property-newline"), + "object-shorthand": require("./rules/object-shorthand"), + "one-var": require("./rules/one-var"), + "one-var-declaration-per-line": require("./rules/one-var-declaration-per-line"), + "operator-assignment": require("./rules/operator-assignment"), + "operator-linebreak": require("./rules/operator-linebreak"), + "padded-blocks": require("./rules/padded-blocks"), + "padding-line-between-statements": require("./rules/padding-line-between-statements"), + "prefer-arrow-callback": require("./rules/prefer-arrow-callback"), + "prefer-const": require("./rules/prefer-const"), + "prefer-destructuring": require("./rules/prefer-destructuring"), + "prefer-numeric-literals": require("./rules/prefer-numeric-literals"), + "prefer-object-spread": require("./rules/prefer-object-spread"), + "prefer-promise-reject-errors": require("./rules/prefer-promise-reject-errors"), + "prefer-reflect": require("./rules/prefer-reflect"), + "prefer-rest-params": require("./rules/prefer-rest-params"), + "prefer-spread": require("./rules/prefer-spread"), + "prefer-template": require("./rules/prefer-template"), + "quote-props": require("./rules/quote-props"), + quotes: require("./rules/quotes"), + radix: require("./rules/radix"), + "require-atomic-updates": require("./rules/require-atomic-updates"), + "require-await": require("./rules/require-await"), + "require-jsdoc": require("./rules/require-jsdoc"), + "require-unicode-regexp": require("./rules/require-unicode-regexp"), + "require-yield": require("./rules/require-yield"), + "rest-spread-spacing": require("./rules/rest-spread-spacing"), + semi: require("./rules/semi"), + "semi-spacing": require("./rules/semi-spacing"), + "semi-style": require("./rules/semi-style"), + "sort-imports": require("./rules/sort-imports"), + "sort-keys": require("./rules/sort-keys"), + "sort-vars": require("./rules/sort-vars"), + "space-before-blocks": require("./rules/space-before-blocks"), + "space-before-function-paren": require("./rules/space-before-function-paren"), + "space-in-parens": require("./rules/space-in-parens"), + "space-infix-ops": require("./rules/space-infix-ops"), + "space-unary-ops": require("./rules/space-unary-ops"), + "spaced-comment": require("./rules/spaced-comment"), + strict: require("./rules/strict"), + "switch-colon-spacing": require("./rules/switch-colon-spacing"), + "symbol-description": require("./rules/symbol-description"), + "template-curly-spacing": require("./rules/template-curly-spacing"), + "template-tag-spacing": require("./rules/template-tag-spacing"), + "unicode-bom": require("./rules/unicode-bom"), + "use-isnan": require("./rules/use-isnan"), + "valid-jsdoc": require("./rules/valid-jsdoc"), + "valid-typeof": require("./rules/valid-typeof"), + "vars-on-top": require("./rules/vars-on-top"), + "wrap-iife": require("./rules/wrap-iife"), + "wrap-regex": require("./rules/wrap-regex"), + "yield-star-spacing": require("./rules/yield-star-spacing"), + yoda: require("./rules/yoda") +}; diff --git a/tools/node_modules/eslint/lib/formatters/tap.js b/tools/node_modules/eslint/lib/formatters/tap.js index 9651a2bcf12cee..354872a0c92af3 100644 --- a/tools/node_modules/eslint/lib/formatters/tap.js +++ b/tools/node_modules/eslint/lib/formatters/tap.js @@ -20,7 +20,6 @@ function getMessageType(message) { return "error"; } return "warning"; - } /** @@ -50,12 +49,11 @@ module.exports = function(results) { let diagnostics = {}; if (messages.length > 0) { - testResult = "not ok"; - messages.forEach(message => { + const severity = getMessageType(message); const diagnostic = { message: message.message, - severity: getMessageType(message), + severity, data: { line: message.line || 0, column: message.column || 0, @@ -63,6 +61,11 @@ module.exports = function(results) { } }; + // This ensures a warning message is not flagged as error + if (severity === "error") { + testResult = "not ok"; + } + /* * If we have multiple messages place them under a messages key * The first error will be logged as message key diff --git a/tools/node_modules/eslint/lib/rules.js b/tools/node_modules/eslint/lib/rules.js index 040f9db5059473..ee747311e791cf 100644 --- a/tools/node_modules/eslint/lib/rules.js +++ b/tools/node_modules/eslint/lib/rules.js @@ -12,6 +12,7 @@ const lodash = require("lodash"); const loadRules = require("./load-rules"); const ruleReplacements = require("../conf/replacements").rules; +const builtInRules = require("./built-in-rules-index"); //------------------------------------------------------------------------------ // Helpers @@ -59,8 +60,7 @@ function normalizeRule(rule) { class Rules { constructor() { this._rules = Object.create(null); - - this.load(); + this.defineAll(builtInRules); } /** @@ -82,6 +82,15 @@ class Rules { load(rulesDir, cwd) { const newRules = loadRules(rulesDir, cwd); + this.defineAll(newRules); + } + + /** + * Pulls a Map of new rules to the defined ones of this instance. + * @param {Object} newRules Expects to have an object here that maps the rule ID to the rule definition. + * @returns {void} + */ + defineAll(newRules) { Object.keys(newRules).forEach(ruleId => { this.define(ruleId, newRules[ruleId]); }); diff --git a/tools/node_modules/eslint/lib/rules/global-require.js b/tools/node_modules/eslint/lib/rules/global-require.js index 6576cfb6a1f5ad..4af3a6a4669a79 100644 --- a/tools/node_modules/eslint/lib/rules/global-require.js +++ b/tools/node_modules/eslint/lib/rules/global-require.js @@ -57,7 +57,10 @@ module.exports = { url: "https://eslint.org/docs/rules/global-require" }, - schema: [] + schema: [], + messages: { + unexpected: "Unexpected require()." + } }, create(context) { @@ -69,7 +72,7 @@ module.exports = { const isGoodRequire = context.getAncestors().every(parent => ACCEPTABLE_PARENTS.indexOf(parent.type) > -1); if (!isGoodRequire) { - context.report({ node, message: "Unexpected require()." }); + context.report({ node, messageId: "unexpected" }); } } } 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 6e8452a4844a6e..2c0976d997b601 100644 --- a/tools/node_modules/eslint/lib/rules/guard-for-in.js +++ b/tools/node_modules/eslint/lib/rules/guard-for-in.js @@ -20,7 +20,10 @@ module.exports = { url: "https://eslint.org/docs/rules/guard-for-in" }, - schema: [] + schema: [], + messages: { + wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." + } }, create(context) { @@ -65,7 +68,7 @@ module.exports = { } } - context.report({ node, message: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype." }); + context.report({ node, messageId: "wrap" }); } }; 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 5845aff4bc636c..2966aff2e61fda 100644 --- a/tools/node_modules/eslint/lib/rules/handle-callback-err.js +++ b/tools/node_modules/eslint/lib/rules/handle-callback-err.js @@ -24,7 +24,10 @@ module.exports = { { type: "string" } - ] + ], + messages: { + expected: "Expected error to be handled." + } }, create(context) { @@ -77,7 +80,7 @@ module.exports = { if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { if (firstParameter.references.length === 0) { - context.report({ node, message: "Expected error to be handled." }); + context.report({ node, messageId: "expected" }); } } } diff --git a/tools/node_modules/eslint/lib/rules/id-blacklist.js b/tools/node_modules/eslint/lib/rules/id-blacklist.js index 7b8facbabe0868..53be62e68a3626 100644 --- a/tools/node_modules/eslint/lib/rules/id-blacklist.js +++ b/tools/node_modules/eslint/lib/rules/id-blacklist.js @@ -27,6 +27,9 @@ module.exports = { type: "string" }, uniqueItems: true + }, + messages: { + blacklisted: "Identifier '{{name}}' is blacklisted." } }, @@ -72,7 +75,7 @@ module.exports = { function report(node) { context.report({ node, - message: "Identifier '{{name}}' is blacklisted.", + messageId: "blacklisted", data: { name: node.name } diff --git a/tools/node_modules/eslint/lib/rules/id-length.js b/tools/node_modules/eslint/lib/rules/id-length.js index d72eb08876ab37..1f9c696e2a93b1 100644 --- a/tools/node_modules/eslint/lib/rules/id-length.js +++ b/tools/node_modules/eslint/lib/rules/id-length.js @@ -44,7 +44,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + tooShort: "Identifier name '{{name}}' is too short (< {{min}}).", + tooLong: "Identifier name '{{name}}' is too long (> {{max}})." + } }, create(context) { @@ -107,9 +111,7 @@ module.exports = { if (isValidExpression && (isValidExpression === true || isValidExpression(parent, node))) { context.report({ node, - message: isShort - ? "Identifier name '{{name}}' is too short (< {{min}})." - : "Identifier name '{{name}}' is too long (> {{max}}).", + messageId: isShort ? "tooShort" : "tooLong", 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 4755c779ca96a0..5dc86f8dbfd7ac 100644 --- a/tools/node_modules/eslint/lib/rules/id-match.js +++ b/tools/node_modules/eslint/lib/rules/id-match.js @@ -38,7 +38,10 @@ module.exports = { } } } - ] + ], + messages: { + notMatch: "Identifier '{{name}}' does not match the pattern '{{pattern}}'." + } }, create(context) { @@ -116,7 +119,7 @@ module.exports = { if (!reported.has(node)) { context.report({ node, - message: "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", + messageId: "notMatch", data: { name: node.name, pattern 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 fb7d603a35ad58..ad0d70da66cc76 100644 --- a/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +++ b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -30,7 +30,11 @@ module.exports = { { enum: ["beside", "below"] } - ] + ], + messages: { + expected: "Expected a linebreak before this expression.", + unexpected: "Expected no linebreak before this expression." + } }, create(context) { @@ -210,13 +214,13 @@ module.exports = { if (tokenBefore.loc.end.line === fixerTarget.loc.start.line && option === "below") { context.report({ node: fixerTarget, - message: "Expected a linebreak before this expression.", + messageId: "expected", fix: fixer => fixer.insertTextBefore(fixerTarget, "\n") }); } else if (tokenBefore.loc.end.line !== fixerTarget.loc.start.line && option === "beside") { context.report({ node: fixerTarget, - message: "Expected no linebreak before this expression.", + messageId: "unexpected", fix: autoFixBesides(tokenBefore, fixerTarget, node) }); } diff --git a/tools/node_modules/eslint/lib/rules/indent-legacy.js b/tools/node_modules/eslint/lib/rules/indent-legacy.js index cfb807e34e0ee3..2a712c520a28c0 100644 --- a/tools/node_modules/eslint/lib/rules/indent-legacy.js +++ b/tools/node_modules/eslint/lib/rules/indent-legacy.js @@ -169,7 +169,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + expected: "Expected indentation of {{expected}} but found {{actual}}." + } }, create(context) { @@ -268,7 +271,7 @@ module.exports = { * @param {int} actualTabs The actual number of indentation tabs that were found on this line * @returns {string} An error message for this line */ - function createErrorMessage(expectedAmount, actualSpaces, actualTabs) { + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" @@ -288,8 +291,10 @@ module.exports = { } else { foundStatement = "0"; } - - return `Expected indentation of ${expectedStatement} but found ${foundStatement}.`; + return { + expected: expectedStatement, + actual: foundStatement + }; } /** @@ -318,7 +323,8 @@ module.exports = { context.report({ node, loc, - message: createErrorMessage(needed, gottenSpaces, gottenTabs), + messageId: "expected", + data: createErrorMessageData(needed, gottenSpaces, gottenTabs), fix: fixer => fixer.replaceTextRange(textRange, desiredIndent) }); } diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js index af7e2b147a00ae..c30d1f1e7bccc9 100644 --- a/tools/node_modules/eslint/lib/rules/indent.js +++ b/tools/node_modules/eslint/lib/rules/indent.js @@ -599,7 +599,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + wrongIndentation: "Expected indentation of {{expected}} but found {{actual}}." + } }, create(context) { @@ -671,7 +674,7 @@ module.exports = { * @param {int} actualTabs The actual number of indentation tabs that were found on this line * @returns {string} An error message for this line */ - function createErrorMessage(expectedAmount, actualSpaces, actualTabs) { + function createErrorMessageData(expectedAmount, actualSpaces, actualTabs) { const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs" const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space" const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs" @@ -689,8 +692,10 @@ module.exports = { } else { foundStatement = "0"; } - - return `Expected indentation of ${expectedStatement} but found ${foundStatement}.`; + return { + expected: expectedStatement, + actual: foundStatement + }; } /** @@ -706,7 +711,8 @@ module.exports = { context.report({ node: token, - message: createErrorMessage(neededIndent.length, numSpaces, numTabs), + messageId: "wrongIndentation", + data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), loc: { start: { line: token.loc.start.line, column: 0 }, end: { line: token.loc.start.line, column: token.loc.start.column } diff --git a/tools/node_modules/eslint/lib/rules/init-declarations.js b/tools/node_modules/eslint/lib/rules/init-declarations.js index 755090917f909b..65197358e60df8 100644 --- a/tools/node_modules/eslint/lib/rules/init-declarations.js +++ b/tools/node_modules/eslint/lib/rules/init-declarations.js @@ -85,6 +85,10 @@ module.exports = { maxItems: 2 } ] + }, + messages: { + initialized: "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: "Variable '{{idName}}' should not be initialized on declaration." } }, @@ -111,23 +115,18 @@ module.exports = { id = declaration.id, initialized = isInitialized(declaration), isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); - - if (id.type !== "Identifier") { - continue; - } + let messageId = ""; if (mode === MODE_ALWAYS && !initialized) { - context.report({ - node: declaration, - message: "Variable '{{idName}}' should be initialized on declaration.", - data: { - idName: id.name - } - }); + messageId = "initialized"; } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + messageId = "notInitialized"; + } + + if (id.type === "Identifier" && messageId) { context.report({ node: declaration, - message: "Variable '{{idName}}' should not be initialized on declaration.", + messageId, data: { idName: id.name } diff --git a/tools/node_modules/eslint/lib/rules/jsx-quotes.js b/tools/node_modules/eslint/lib/rules/jsx-quotes.js index 603d55330b536c..372dc2f42e7497 100644 --- a/tools/node_modules/eslint/lib/rules/jsx-quotes.js +++ b/tools/node_modules/eslint/lib/rules/jsx-quotes.js @@ -53,7 +53,10 @@ module.exports = { { enum: ["prefer-single", "prefer-double"] } - ] + ], + messages: { + unexpected: "Unexpected usage of {{description}}." + } }, create(context) { @@ -77,7 +80,7 @@ module.exports = { if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { context.report({ node: attributeValue, - message: "Unexpected usage of {{description}}.", + messageId: "unexpected", data: { description: setting.description }, diff --git a/tools/node_modules/eslint/lib/rules/key-spacing.js b/tools/node_modules/eslint/lib/rules/key-spacing.js index 2d1315fde09271..c52a74d499f9ad 100644 --- a/tools/node_modules/eslint/lib/rules/key-spacing.js +++ b/tools/node_modules/eslint/lib/rules/key-spacing.js @@ -121,11 +121,6 @@ function initOptions(toOptions, fromOptions) { // Rule Definition //------------------------------------------------------------------------------ -const messages = { - key: "{{error}} space after {{computed}}key '{{key}}'.", - value: "{{error}} space before value for {{computed}}key '{{key}}'." -}; - module.exports = { meta: { type: "layout", @@ -297,7 +292,13 @@ module.exports = { additionalProperties: false } ] - }] + }], + messages: { + extraKey: "Extra space after {{computed}}key '{{key}}'.", + extraValue: "Extra space before value for {{computed}}key '{{key}}'.", + missingKey: "Missing space after {{computed}}key '{{key}}'.", + missingValue: "Missing space before value for {{computed}}key '{{key}}'." + } }, create(context) { @@ -460,12 +461,19 @@ module.exports = { } } + let messageId = ""; + + if (isExtra) { + messageId = side === "key" ? "extraKey" : "extraValue"; + } else { + messageId = side === "key" ? "missingKey" : "missingValue"; + } + context.report({ node: property[side], loc: locStart, - message: messages[side], + messageId, data: { - error: isExtra ? "Extra" : "Missing", computed: property.computed ? "computed " : "", key: getKey(property) }, diff --git a/tools/node_modules/eslint/lib/rules/keyword-spacing.js b/tools/node_modules/eslint/lib/rules/keyword-spacing.js index 790d7b031d8ecd..833092e4160c48 100644 --- a/tools/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/tools/node_modules/eslint/lib/rules/keyword-spacing.js @@ -100,7 +100,13 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + expectedBefore: "Expected space(s) before \"{{value}}\".", + expectedAfter: "Expected space(s) after \"{{value}}\".", + unexpectedBefore: "Unexpected space(s) before \"{{value}}\".", + unexpectedAfter: "Unexpected space(s) after \"{{value}}\"." + } }, create(context) { @@ -124,7 +130,7 @@ module.exports = { ) { context.report({ loc: token.loc.start, - message: "Expected space(s) before \"{{value}}\".", + messageId: "expectedBefore", data: token, fix(fixer) { return fixer.insertTextBefore(token, " "); @@ -151,7 +157,7 @@ module.exports = { ) { context.report({ loc: token.loc.start, - message: "Unexpected space(s) before \"{{value}}\".", + messageId: "unexpectedBefore", data: token, fix(fixer) { return fixer.removeRange([prevToken.range[1], token.range[0]]); @@ -178,7 +184,7 @@ module.exports = { ) { context.report({ loc: token.loc.start, - message: "Expected space(s) after \"{{value}}\".", + messageId: "expectedAfter", data: token, fix(fixer) { return fixer.insertTextAfter(token, " "); @@ -205,7 +211,7 @@ module.exports = { ) { context.report({ loc: token.loc.start, - message: "Unexpected space(s) after \"{{value}}\".", + messageId: "unexpectedAfter", data: token, fix(fixer) { return fixer.removeRange([token.range[1], nextToken.range[0]]); 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 7c791d5f2778bd..6d0ac6d2ba8c4e 100644 --- a/tools/node_modules/eslint/lib/rules/line-comment-position.js +++ b/tools/node_modules/eslint/lib/rules/line-comment-position.js @@ -47,7 +47,11 @@ module.exports = { } ] } - ] + ], + messages: { + above: "Expected comment to be above code.", + beside: "Expected comment to be beside code." + } }, create(context) { @@ -100,14 +104,14 @@ module.exports = { if (isOnSameLine) { context.report({ node, - message: "Expected comment to be above code." + messageId: "above" }); } } else { if (!isOnSameLine) { context.report({ node, - message: "Expected comment to be beside code." + messageId: "beside" }); } } diff --git a/tools/node_modules/eslint/lib/rules/linebreak-style.js b/tools/node_modules/eslint/lib/rules/linebreak-style.js index 5345d53f2887f6..4523d6f58a1871 100644 --- a/tools/node_modules/eslint/lib/rules/linebreak-style.js +++ b/tools/node_modules/eslint/lib/rules/linebreak-style.js @@ -32,14 +32,14 @@ module.exports = { { enum: ["unix", "windows"] } - ] + ], + messages: { + expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.", + expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'." + } }, create(context) { - - const EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.", - EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'."; - const sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- @@ -89,7 +89,7 @@ module.exports = { line: i, column: sourceCode.lines[i - 1].length }, - message: expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG, + messageId: expectedLF ? "expectedLF" : "expectedCRLF", fix: createFix(range, expectedLFChars) }); } 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 30175cd3663509..62bef94831d281 100644 --- a/tools/node_modules/eslint/lib/rules/lines-around-comment.js +++ b/tools/node_modules/eslint/lib/rules/lines-around-comment.js @@ -112,7 +112,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + after: "Expected line after comment.", + before: "Expected line before comment." + } }, create(context) { @@ -350,7 +354,7 @@ module.exports = { context.report({ node: token, - message: "Expected line before comment.", + messageId: "before", fix(fixer) { return fixer.insertTextBeforeRange(range, "\n"); } @@ -362,7 +366,7 @@ module.exports = { !(astUtils.isCommentToken(nextTokenOrComment) && astUtils.isTokenOnSameLine(token, nextTokenOrComment))) { context.report({ node: token, - message: "Expected line after comment.", + messageId: "after", fix(fixer) { return fixer.insertTextAfter(token, "\n"); } 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 02bbe13b4fc589..c2e5fd75aaa07d 100644 --- a/tools/node_modules/eslint/lib/rules/lines-around-directive.js +++ b/tools/node_modules/eslint/lib/rules/lines-around-directive.js @@ -45,6 +45,10 @@ module.exports = { }], fixable: "whitespace", + messages: { + expected: "Expected newline {{location}} \"{{value}}\" directive.", + unexpected: "Unexpected newline {{location}} \"{{value}}\" directive." + }, deprecated: true, replacedBy: ["padding-line-between-statements"] }, @@ -109,9 +113,8 @@ module.exports = { function reportError(node, location, expected) { context.report({ node, - message: "{{expected}} newline {{location}} \"{{value}}\" directive.", + messageId: expected ? "expected" : "unexpected", data: { - expected: expected ? "Expected" : "Unexpected", value: node.expression.value, location }, 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 5c1e69277a52f3..2937d24f81f1bc 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 @@ -36,7 +36,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + never: "Unexpected blank line between class members.", + always: "Expected blank line between class members." + } }, create(context) { @@ -46,9 +50,6 @@ module.exports = { options[0] = context.options[0] || "always"; options[1] = context.options[1] || { exceptAfterSingleLine: false }; - const ALWAYS_MESSAGE = "Expected blank line between class members."; - const NEVER_MESSAGE = "Unexpected blank line between class members."; - const sourceCode = context.getSourceCode(); /** @@ -127,7 +128,7 @@ module.exports = { (options[0] === "never" && isPadded)) { context.report({ node: body[i + 1], - message: isPadded ? NEVER_MESSAGE : ALWAYS_MESSAGE, + messageId: isPadded ? "never" : "always", fix(fixer) { return isPadded ? fixer.replaceTextRange([curLast.range[1], nextFirst.range[0]], "\n") diff --git a/tools/node_modules/eslint/lib/rules/max-depth.js b/tools/node_modules/eslint/lib/rules/max-depth.js index 34d58b0d31e10e..500e9318817d41 100644 --- a/tools/node_modules/eslint/lib/rules/max-depth.js +++ b/tools/node_modules/eslint/lib/rules/max-depth.js @@ -43,7 +43,10 @@ module.exports = { } ] } - ] + ], + messages: { + tooDeeply: "Blocks are nested too deeply ({{depth}})." + } }, create(context) { @@ -94,7 +97,7 @@ module.exports = { const len = ++functionStack[functionStack.length - 1]; if (len > maxDepth) { - context.report({ node, message: "Blocks are nested too deeply ({{depth}}).", data: { depth: len } }); + context.report({ node, messageId: "tooDeeply", data: { depth: len } }); } } diff --git a/tools/node_modules/eslint/lib/rules/max-len.js b/tools/node_modules/eslint/lib/rules/max-len.js index 13dd72160cc879..d74373e9ea85e3 100644 --- a/tools/node_modules/eslint/lib/rules/max-len.js +++ b/tools/node_modules/eslint/lib/rules/max-len.js @@ -78,7 +78,11 @@ module.exports = { OPTIONS_OR_INTEGER_SCHEMA, OPTIONS_OR_INTEGER_SCHEMA, OPTIONS_SCHEMA - ] + ], + messages: { + max: "Line {{lineNumber}} exceeds the maximum line length of {{maxLength}}.", + maxComment: "Line {{lineNumber}} exceeds the maximum comment line length of {{maxCommentLength}}." + } }, create(context) { @@ -341,7 +345,7 @@ module.exports = { context.report({ node, loc: { line: lineNumber, column: 0 }, - message: "Line {{lineNumber}} exceeds the maximum comment line length of {{maxCommentLength}}.", + messageId: "maxComment", data: { lineNumber: i + 1, maxCommentLength @@ -352,7 +356,7 @@ module.exports = { context.report({ node, loc: { line: lineNumber, column: 0 }, - message: "Line {{lineNumber}} exceeds the maximum line length of {{maxLength}}.", + messageId: "max", data: { lineNumber: i + 1, maxLength 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 8c64a20bcc34c3..d1e4597a2218b1 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 @@ -80,7 +80,10 @@ module.exports = { schema: [ OPTIONS_OR_INTEGER_SCHEMA - ] + ], + messages: { + exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}." + } }, create(context) { @@ -201,7 +204,7 @@ module.exports = { context.report({ node, - message: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}.", + messageId: "exceed", data: { name, lineCount, maxLines } }); } diff --git a/tools/node_modules/eslint/lib/rules/max-lines.js b/tools/node_modules/eslint/lib/rules/max-lines.js index 730e05ab41cf11..da7ddd8a88fca0 100644 --- a/tools/node_modules/eslint/lib/rules/max-lines.js +++ b/tools/node_modules/eslint/lib/rules/max-lines.js @@ -51,7 +51,10 @@ module.exports = { } ] } - ] + ], + messages: { + exceed: "File must be at most {{max}} lines long. It's {{actual}} lines long." + } }, create(context) { @@ -134,7 +137,7 @@ module.exports = { if (lines.length > max) { context.report({ loc: { line: 1, column: 0 }, - message: "File must be at most {{max}} lines long. It's {{actual}} lines long.", + messageId: "exceed", data: { max, actual: lines.length 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 d4ecb4e2a5c2c3..754fa168d39ab2 100644 --- a/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js +++ b/tools/node_modules/eslint/lib/rules/max-nested-callbacks.js @@ -43,7 +43,10 @@ module.exports = { } ] } - ] + ], + messages: { + exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}." + } }, create(context) { @@ -86,7 +89,7 @@ module.exports = { if (callbackStack.length > THRESHOLD) { const opts = { num: callbackStack.length, max: THRESHOLD }; - context.report({ node, message: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.", data: opts }); + context.report({ node, messageId: "exceed", data: opts }); } } diff --git a/tools/node_modules/eslint/lib/rules/max-params.js b/tools/node_modules/eslint/lib/rules/max-params.js index f678974acf33d2..e082ec8e980cec 100644 --- a/tools/node_modules/eslint/lib/rules/max-params.js +++ b/tools/node_modules/eslint/lib/rules/max-params.js @@ -51,7 +51,10 @@ module.exports = { } ] } - ] + ], + messages: { + exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}." + } }, create(context) { @@ -80,7 +83,7 @@ module.exports = { context.report({ loc: astUtils.getFunctionHeadLoc(node, sourceCode), node, - message: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}.", + messageId: "exceed", data: { name: lodash.upperFirst(astUtils.getFunctionNameWithKind(node)), count: node.params.length, 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 f3fb8e9d5cff3c..b834cedc03f318 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 @@ -36,15 +36,17 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}." + } }, create(context) { const sourceCode = context.getSourceCode(), options = context.options[0] || {}, - maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1, - message = "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}."; + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; let lastStatementLine = 0, numberOfStatementsOnThisLine = 0, @@ -65,7 +67,7 @@ module.exports = { if (firstExtraStatement) { context.report({ node: firstExtraStatement, - message, + messageId: "exceed", data: { numberOfStatementsOnThisLine, maxStatementsPerLine, diff --git a/tools/node_modules/eslint/lib/rules/max-statements.js b/tools/node_modules/eslint/lib/rules/max-statements.js index e32dedad632f3f..b33ca429824e45 100644 --- a/tools/node_modules/eslint/lib/rules/max-statements.js +++ b/tools/node_modules/eslint/lib/rules/max-statements.js @@ -60,7 +60,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}." + } }, create(context) { @@ -99,7 +102,7 @@ module.exports = { context.report({ node, - message: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}.", + messageId: "exceed", data: { name, count, max } }); } 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 73eab7c5741bb6..e262c255869cf2 100644 --- a/tools/node_modules/eslint/lib/rules/multiline-comment-style.js +++ b/tools/node_modules/eslint/lib/rules/multiline-comment-style.js @@ -22,20 +22,21 @@ module.exports = { }, fixable: "whitespace", - schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }] + schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }], + messages: { + expectedBlock: "Expected a block comment instead of consecutive line comments.", + startNewline: "Expected a linebreak after '/*'.", + endNewline: "Expected a linebreak before '*/'.", + missingStar: "Expected a '*' at the start of this line.", + alignment: "Expected this line to be aligned with the start of the comment.", + expectedLines: "Expected multiple line comments instead of a block comment." + } }, create(context) { const sourceCode = context.getSourceCode(); const option = context.options[0] || "starred-block"; - const EXPECTED_BLOCK_ERROR = "Expected a block comment instead of consecutive line comments."; - const START_NEWLINE_ERROR = "Expected a linebreak after '/*'."; - const END_NEWLINE_ERROR = "Expected a linebreak before '*/'."; - const MISSING_STAR_ERROR = "Expected a '*' at the start of this line."; - const ALIGNMENT_ERROR = "Expected this line to be aligned with the start of the comment."; - const EXPECTED_LINES_ERROR = "Expected multiple line comments instead of a block comment."; - //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- @@ -127,7 +128,7 @@ module.exports = { start: commentGroup[0].loc.start, end: commentGroup[commentGroup.length - 1].loc.end }, - message: EXPECTED_BLOCK_ERROR, + messageId: "expectedBlock", fix(fixer) { const range = [commentGroup[0].range[0], commentGroup[commentGroup.length - 1].range[1]]; const starredBlock = `/*${convertToStarredBlock(commentGroup[0], commentLines)}*/`; @@ -150,7 +151,7 @@ module.exports = { start: block.loc.start, end: { line: block.loc.start.line, column: block.loc.start.column + 2 } }, - message: START_NEWLINE_ERROR, + messageId: "startNewline", fix: fixer => fixer.insertTextAfterRange([start, start + 2], `\n${expectedLinePrefix}`) }); } @@ -161,7 +162,7 @@ module.exports = { start: { line: block.loc.end.line, column: block.loc.end.column - 2 }, end: block.loc.end }, - message: END_NEWLINE_ERROR, + messageId: "endNewline", fix: fixer => fixer.replaceTextRange([block.range[1] - 2, block.range[1]], `\n${expectedLinePrefix}/`) }); } @@ -175,9 +176,9 @@ module.exports = { start: { line: lineNumber, column: 0 }, end: { line: lineNumber, column: sourceCode.lines[lineNumber - 1].length } }, - message: /^\s*\*/.test(lineText) - ? ALIGNMENT_ERROR - : MISSING_STAR_ERROR, + messageId: /^\s*\*/.test(lineText) + ? "alignment" + : "missingStar", fix(fixer) { const lineStartIndex = sourceCode.getIndexFromLoc({ line: lineNumber, column: 0 }); const linePrefixLength = lineText.match(/^\s*\*? ?/)[0].length; @@ -209,7 +210,7 @@ module.exports = { start: block.loc.start, end: { line: block.loc.start.line, column: block.loc.start.column + 2 } }, - message: EXPECTED_LINES_ERROR, + messageId: "expectedLines", fix(fixer) { return fixer.replaceText(block, convertToSeparateLines(block, commentLines.filter(line => line))); } @@ -228,7 +229,7 @@ module.exports = { start: commentGroup[0].loc.start, end: commentGroup[commentGroup.length - 1].loc.end }, - message: EXPECTED_BLOCK_ERROR, + messageId: "expectedBlock", fix(fixer) { const range = [commentGroup[0].range[0], commentGroup[commentGroup.length - 1].range[1]]; const block = convertToBlock(commentGroup[0], commentLines.filter(line => line)); @@ -249,7 +250,7 @@ module.exports = { start: block.loc.start, end: { line: block.loc.start.line, column: block.loc.start.column + 2 } }, - message: EXPECTED_BLOCK_ERROR, + messageId: "expectedBlock", fix(fixer) { return fixer.replaceText(block, convertToBlock(block, commentLines.filter(line => line))); } diff --git a/tools/node_modules/eslint/lib/rules/multiline-ternary.js b/tools/node_modules/eslint/lib/rules/multiline-ternary.js index d1d577a4ffaca1..83378dcd86e3e5 100644 --- a/tools/node_modules/eslint/lib/rules/multiline-ternary.js +++ b/tools/node_modules/eslint/lib/rules/multiline-ternary.js @@ -26,7 +26,13 @@ module.exports = { { enum: ["always", "always-multiline", "never"] } - ] + ], + messages: { + expectedTestCons: "Expected newline between test and consequent of ternary expression.", + expectedConsAlt: "Expected newline between consequent and alternate of ternary expression.", + unexpectedTestCons: "Unexpected newline between test and consequent of ternary expression.", + unexpectedConsAlt: "Unexpected newline between consequent and alternate of ternary expression." + } }, create(context) { @@ -49,11 +55,7 @@ module.exports = { function reportError(node, parentNode, expected) { context.report({ node, - message: "{{expected}} newline between {{typeOfError}} of ternary expression.", - data: { - expected: expected ? "Expected" : "Unexpected", - typeOfError: node === parentNode.test ? "test and consequent" : "consequent and alternate" - } + messageId: `${expected ? "expected" : "unexpected"}${node === parentNode.test ? "TestCons" : "ConsAlt"}` }); } diff --git a/tools/node_modules/eslint/lib/rules/new-cap.js b/tools/node_modules/eslint/lib/rules/new-cap.js index 834f4605ed2838..4a01dcfa7f385b 100644 --- a/tools/node_modules/eslint/lib/rules/new-cap.js +++ b/tools/node_modules/eslint/lib/rules/new-cap.js @@ -117,7 +117,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + upper: "A function with a name starting with an uppercase letter should only be used as a constructor.", + lower: "A constructor name should not start with a lowercase letter." + } }, create(context) { @@ -219,19 +223,19 @@ module.exports = { } /** - * Reports the given message for the given node. The location will be the start of the property or the callee. + * Reports the given messageId for the given node. The location will be the start of the property or the callee. * @param {ASTNode} node CallExpression or NewExpression node. - * @param {string} message The message to report. + * @param {string} messageId The messageId to report. * @returns {void} */ - function report(node, message) { + function report(node, messageId) { let callee = node.callee; if (callee.type === "MemberExpression") { callee = callee.property; } - context.report({ node, loc: callee.loc.start, message }); + context.report({ node, loc: callee.loc.start, messageId }); } //-------------------------------------------------------------------------- @@ -248,7 +252,7 @@ module.exports = { const isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName, newIsCapExceptionPattern); if (!isAllowed) { - report(node, "A constructor name should not start with a lowercase letter."); + report(node, "lower"); } } }; @@ -264,7 +268,7 @@ module.exports = { const isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName, capIsNewExceptionPattern); if (!isAllowed) { - report(node, "A function with a name starting with an uppercase letter should only be used as a constructor."); + report(node, "upper"); } } }; diff --git a/tools/node_modules/eslint/lib/rules/new-parens.js b/tools/node_modules/eslint/lib/rules/new-parens.js index 0637a8fbca24c7..edd3c1e1c2ef47 100644 --- a/tools/node_modules/eslint/lib/rules/new-parens.js +++ b/tools/node_modules/eslint/lib/rules/new-parens.js @@ -30,8 +30,11 @@ module.exports = { url: "https://eslint.org/docs/rules/new-parens" }, + fixable: "code", schema: [], - fixable: "code" + messages: { + missing: "Missing '()' invoking a constructor." + } }, create(context) { @@ -50,7 +53,7 @@ module.exports = { if (!hasParens) { context.report({ node, - message: "Missing '()' invoking a constructor.", + messageId: "missing", fix: fixer => fixer.insertTextAfter(node, "()") }); } 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 83fd420d733234..036cefc22cab25 100644 --- a/tools/node_modules/eslint/lib/rules/newline-after-var.js +++ b/tools/node_modules/eslint/lib/rules/newline-after-var.js @@ -26,14 +26,16 @@ module.exports = { recommended: false, url: "https://eslint.org/docs/rules/newline-after-var" }, - schema: [ { enum: ["never", "always"] } ], - fixable: "whitespace", + messages: { + expected: "Expected blank line after variable declarations.", + unexpected: "Unexpected blank line after variable declarations." + }, deprecated: true, @@ -41,10 +43,6 @@ module.exports = { }, create(context) { - - const ALWAYS_MESSAGE = "Expected blank line after variable declarations.", - NEVER_MESSAGE = "Unexpected blank line after variable declarations."; - const sourceCode = context.getSourceCode(); // Default `mode` to "always". @@ -214,7 +212,7 @@ module.exports = { if (mode === "never" && noNextLineToken && !hasNextLineComment) { context.report({ node, - message: NEVER_MESSAGE, + messageId: "unexpected", data: { identifier: node.name }, fix(fixer) { const linesBetween = sourceCode.getText().slice(lastToken.range[1], nextToken.range[0]).split(astUtils.LINEBREAK_MATCHER); @@ -233,7 +231,7 @@ module.exports = { ) { context.report({ node, - message: ALWAYS_MESSAGE, + messageId: "expected", data: { identifier: node.name }, fix(fixer) { if ((noNextLineToken ? getLastCommentLineOfBlock(nextLineNum) : lastToken.loc.end.line) === nextToken.loc.start.line) { 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 6a0ec8d5eb731f..816ddba72b2c5a 100644 --- a/tools/node_modules/eslint/lib/rules/newline-before-return.js +++ b/tools/node_modules/eslint/lib/rules/newline-before-return.js @@ -22,6 +22,10 @@ module.exports = { fixable: "whitespace", schema: [], + messages: { + expected: "Expected newline before return statement." + }, + deprecated: true, replacedBy: ["padding-line-between-statements"] }, @@ -196,7 +200,7 @@ module.exports = { if (!isFirstNode(node) && !hasNewlineBefore(node)) { context.report({ node, - message: "Expected newline before return statement.", + messageId: "expected", fix(fixer) { if (canFix(node)) { const tokenBefore = sourceCode.getTokenBefore(node); 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 9d9931376829a6..0bf2365de5aa11 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 @@ -35,7 +35,10 @@ module.exports = { } }, additionalProperties: false - }] + }], + messages: { + expected: "Expected line break before `{{callee}}`." + } }, create(context) { @@ -91,7 +94,7 @@ module.exports = { context.report({ node: callee.property, loc: callee.property.loc.start, - message: "Expected line break before `{{callee}}`.", + messageId: "expected", data: { callee: getPropertyText(callee) }, 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 fc65f539a3e6aa..af15509ed4d394 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 @@ -20,7 +20,10 @@ module.exports = { }, fixable: null, - schema: [] + schema: [], + messages: { + async: "Promise executor functions should not be async." + } }, create(context) { @@ -28,7 +31,7 @@ module.exports = { "NewExpression[callee.name='Promise'][arguments.0.async=true]"(node) { context.report({ node: context.getSourceCode().getFirstToken(node.arguments[0], token => token.value === "async"), - message: "Promise executor functions should not be async." + messageId: "async" }); } }; 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 8d7934d8a595ba..39c2928eed34b1 100644 --- a/tools/node_modules/eslint/lib/rules/no-constant-condition.js +++ b/tools/node_modules/eslint/lib/rules/no-constant-condition.js @@ -109,7 +109,10 @@ module.exports = { const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator)); const isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator)); - return (isLeftConstant && isRightConstant) || isLeftShortCircuit || isRightShortCircuit; + return (isLeftConstant && isRightConstant) || + (node.operator === "||" && isRightConstant && node.right.value) || // in the case of an "OR", we need to know if the right constant value is truthy + isLeftShortCircuit || + isRightShortCircuit; } case "AssignmentExpression": 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 1d5bdfdc1a2631..7d35b41b4d49ad 100644 --- a/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-duplicate-imports.js @@ -29,18 +29,17 @@ function getValue(node) { * @param {ASTNode} node - A node to get. * @param {string} value - The name of the imported or exported module. * @param {string[]} array - The array containing other imports or exports in the file. - * @param {string} message - A message to be reported after the name of the module + * @param {string} messageId - A messageId to be reported after the name of the module * * @returns {void} No return value */ -function checkAndReport(context, node, value, array, message) { +function checkAndReport(context, node, value, array, messageId) { if (array.indexOf(value) !== -1) { context.report({ node, - message: "'{{module}}' {{message}}", + messageId, data: { - module: value, - message + module: value } }); } @@ -66,10 +65,10 @@ function handleImports(context, includeExports, importsInFile, exportsInFile) { const value = getValue(node); if (value) { - checkAndReport(context, node, value, importsInFile, "import is duplicated."); + checkAndReport(context, node, value, importsInFile, "import"); if (includeExports) { - checkAndReport(context, node, value, exportsInFile, "import is duplicated as export."); + checkAndReport(context, node, value, exportsInFile, "importAs"); } importsInFile.push(value); @@ -91,8 +90,8 @@ function handleExports(context, importsInFile, exportsInFile) { const value = getValue(node); if (value) { - checkAndReport(context, node, value, exportsInFile, "export is duplicated."); - checkAndReport(context, node, value, importsInFile, "export is duplicated as import."); + checkAndReport(context, node, value, exportsInFile, "export"); + checkAndReport(context, node, value, importsInFile, "exportAs"); exportsInFile.push(value); } @@ -118,7 +117,13 @@ module.exports = { } }, additionalProperties: false - }] + }], + messages: { + import: "'{{module}}' import is duplicated.", + importAs: "'{{module}}' import is duplicated as export.", + export: "'{{module}}' export is duplicated.", + exportAs: "'{{module}}' export is duplicated as import." + } }, create(context) { diff --git a/tools/node_modules/eslint/lib/rules/no-fallthrough.js b/tools/node_modules/eslint/lib/rules/no-fallthrough.js index b7fa221050dd94..79cbe81c0bbc8e 100644 --- a/tools/node_modules/eslint/lib/rules/no-fallthrough.js +++ b/tools/node_modules/eslint/lib/rules/no-fallthrough.js @@ -74,7 +74,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + case: "Expected a 'break' statement before 'case'.", + default: "Expected a 'break' statement before 'default'." + } }, create(context) { @@ -111,8 +115,7 @@ module.exports = { */ if (fallthroughCase && !hasFallthroughComment(node, context, fallthroughCommentPattern)) { context.report({ - message: "Expected a 'break' statement before '{{type}}'.", - data: { type: node.test ? "case" : "default" }, + messageId: node.test ? "case" : "default", node }); } 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 c835d6a545fa8e..de5a521525fdaa 100644 --- a/tools/node_modules/eslint/lib/rules/no-floating-decimal.js +++ b/tools/node_modules/eslint/lib/rules/no-floating-decimal.js @@ -27,7 +27,11 @@ module.exports = { }, schema: [], - fixable: "code" + fixable: "code", + messages: { + leading: "A leading decimal point can be confused with a dot.", + trailing: "A trailing decimal point can be confused with a dot." + } }, create(context) { @@ -40,7 +44,7 @@ module.exports = { if (node.raw.startsWith(".")) { context.report({ node, - message: "A leading decimal point can be confused with a dot.", + messageId: "leading", fix(fixer) { const tokenBefore = sourceCode.getTokenBefore(node); const needsSpaceBefore = tokenBefore && @@ -54,7 +58,7 @@ module.exports = { if (node.raw.indexOf(".") === node.raw.length - 1) { context.report({ node, - message: "A trailing decimal point can be confused with a dot.", + messageId: "trailing", fix: fixer => fixer.insertTextAfter(node, "0") }); } diff --git a/tools/node_modules/eslint/lib/rules/no-undef.js b/tools/node_modules/eslint/lib/rules/no-undef.js index f923644eca114e..e6cd152761fca7 100644 --- a/tools/node_modules/eslint/lib/rules/no-undef.js +++ b/tools/node_modules/eslint/lib/rules/no-undef.js @@ -44,7 +44,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + undef: "'{{name}}' is not defined." + } }, create(context) { @@ -64,7 +67,7 @@ module.exports = { context.report({ node: identifier, - message: "'{{name}}' is not defined.", + messageId: "undef", data: identifier }); }); 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 3bed96fc77d069..35c2140bae605b 100644 --- a/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js +++ b/tools/node_modules/eslint/lib/rules/no-unexpected-multiline.js @@ -25,16 +25,17 @@ module.exports = { url: "https://eslint.org/docs/rules/no-unexpected-multiline" }, - schema: [] + schema: [], + messages: { + function: "Unexpected newline between function and ( of function call.", + property: "Unexpected newline between object and [ of property access.", + taggedTemplate: "Unexpected newline between template tag and template literal.", + division: "Unexpected newline between numerator and division operator." + } }, create(context) { - const FUNCTION_MESSAGE = "Unexpected newline between function and ( of function call."; - const PROPERTY_MESSAGE = "Unexpected newline between object and [ of property access."; - const TAGGED_TEMPLATE_MESSAGE = "Unexpected newline between template tag and template literal."; - const DIVISION_MESSAGE = "Unexpected newline between numerator and division operator."; - const REGEX_FLAG_MATCHER = /^[gimsuy]+$/; const sourceCode = context.getSourceCode(); @@ -43,16 +44,16 @@ module.exports = { * Check to see if there is a newline between the node and the following open bracket * line's expression * @param {ASTNode} node The node to check. - * @param {string} msg The error message to use. + * @param {string} messageId The error messageId to use. * @returns {void} * @private */ - function checkForBreakAfter(node, msg) { + function checkForBreakAfter(node, messageId) { const openParen = sourceCode.getTokenAfter(node, astUtils.isNotClosingParenToken); const nodeExpressionEnd = sourceCode.getTokenBefore(openParen); if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { - context.report({ node, loc: openParen.loc.start, message: msg, data: { char: openParen.value } }); + context.report({ node, loc: openParen.loc.start, messageId, data: { char: openParen.value } }); } } @@ -66,21 +67,21 @@ module.exports = { if (!node.computed) { return; } - checkForBreakAfter(node.object, PROPERTY_MESSAGE); + checkForBreakAfter(node.object, "property"); }, TaggedTemplateExpression(node) { if (node.tag.loc.end.line === node.quasi.loc.start.line) { return; } - context.report({ node, loc: node.loc.start, message: TAGGED_TEMPLATE_MESSAGE }); + context.report({ node, loc: node.loc.start, messageId: "taggedTemplate" }); }, CallExpression(node) { if (node.arguments.length === 0) { return; } - checkForBreakAfter(node.callee, FUNCTION_MESSAGE); + checkForBreakAfter(node.callee, "function"); }, "BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(node) { @@ -92,7 +93,7 @@ module.exports = { REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) && secondSlash.range[1] === tokenAfterOperator.range[0] ) { - checkForBreakAfter(node.left, DIVISION_MESSAGE); + checkForBreakAfter(node.left, "division"); } } }; 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 3a0402eb0d5d34..3b5b367e42e1ad 100644 --- a/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js +++ b/tools/node_modules/eslint/lib/rules/no-unsafe-negation.js @@ -51,7 +51,10 @@ module.exports = { }, schema: [], - fixable: "code" + fixable: "code", + messages: { + unexpected: "Unexpected negating the left operand of '{{operator}}' operator." + } }, create(context) { @@ -66,8 +69,8 @@ module.exports = { context.report({ node, loc: node.left.loc, - message: "Unexpected negating the left operand of '{{operator}}' operator.", - data: node, + messageId: "unexpected", + data: { operator: node.operator }, fix(fixer) { const negationToken = sourceCode.getFirstToken(node.left); 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 c9e097df458ba4..1ba1d05d5c6ae7 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-labels.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-labels.js @@ -21,7 +21,12 @@ module.exports = { }, schema: [], - fixable: "code" + + fixable: "code", + + messages: { + unused: "'{{name}}:' is defined but never used." + } }, create(context) { @@ -53,7 +58,7 @@ module.exports = { if (!scopeInfo.used) { context.report({ node: node.label, - message: "'{{name}}:' is defined but never used.", + messageId: "unused", data: node.label, fix(fixer) { diff --git a/tools/node_modules/eslint/lib/rules/operator-assignment.js b/tools/node_modules/eslint/lib/rules/operator-assignment.js index 8bb01737dd62cd..94e85927344ce1 100644 --- a/tools/node_modules/eslint/lib/rules/operator-assignment.js +++ b/tools/node_modules/eslint/lib/rules/operator-assignment.js @@ -104,7 +104,11 @@ module.exports = { } ], - fixable: "code" + fixable: "code", + messages: { + replaced: "Assignment can be replaced with operator assignment.", + unexpected: "Unexpected operator assignment shorthand." + } }, create(context) { @@ -138,7 +142,7 @@ module.exports = { if (same(left, expr.left)) { context.report({ node, - message: "Assignment can be replaced with operator assignment.", + messageId: "replaced", fix(fixer) { if (canBeFixed(left)) { const equalsToken = getOperatorToken(node); @@ -160,7 +164,7 @@ module.exports = { */ context.report({ node, - message: "Assignment can be replaced with operator assignment." + messageId: "replaced" }); } } @@ -175,7 +179,7 @@ module.exports = { if (node.operator !== "=") { context.report({ node, - message: "Unexpected operator assignment shorthand.", + messageId: "unexpected", fix(fixer) { if (canBeFixed(node.left)) { const operatorToken = getOperatorToken(node); diff --git a/tools/node_modules/eslint/lib/rules/prefer-const.js b/tools/node_modules/eslint/lib/rules/prefer-const.js index a40ad353950df0..5f75376c95c343 100644 --- a/tools/node_modules/eslint/lib/rules/prefer-const.js +++ b/tools/node_modules/eslint/lib/rules/prefer-const.js @@ -350,7 +350,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + useConst: "'{{name}}' is never reassigned. Use 'const' instead." + } }, create(context) { @@ -445,7 +448,7 @@ module.exports = { nodesToReport.forEach(node => { context.report({ node, - message: "'{{name}}' is never reassigned. Use 'const' instead.", + messageId: "useConst", data: node, fix: shouldFix ? fixer => fixer.replaceText(sourceCode.getFirstToken(varDeclParent), "const") : null }); 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 b56fa4f2fac396..046be22bec8644 100644 --- a/tools/node_modules/eslint/lib/rules/space-unary-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-unary-ops.js @@ -46,7 +46,15 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + unexpectedBefore: "Unexpected space before unary operator '{{operator}}'.", + unexpectedAfter: "Unexpected space after unary operator '{{operator}}'.", + unexpectedAfterWord: "Unexpected space after unary word operator '{{word}}'.", + wordOperator: "Unary word operator '{{word}}' must be followed by whitespace.", + operator: "Unary operator '{{operator}}' must be followed by whitespace.", + beforeUnaryExpressions: "Space is required before unary expressions '{{token}}'." + } }, create(context) { @@ -98,7 +106,7 @@ module.exports = { if (secondToken.range[0] === firstToken.range[1]) { context.report({ node, - message: "Unary word operator '{{word}}' must be followed by whitespace.", + messageId: "wordOperator", data: { word }, @@ -122,7 +130,7 @@ module.exports = { if (secondToken.range[0] > firstToken.range[1]) { context.report({ node, - message: "Unexpected space after unary word operator '{{word}}'.", + messageId: "unexpectedAfterWord", data: { word }, @@ -198,7 +206,7 @@ module.exports = { if (firstToken.range[1] === secondToken.range[0]) { context.report({ node, - message: "Unary operator '{{operator}}' must be followed by whitespace.", + messageId: "operator", data: { operator: firstToken.value }, @@ -211,7 +219,7 @@ module.exports = { if (firstToken.range[1] === secondToken.range[0]) { context.report({ node, - message: "Space is required before unary expressions '{{token}}'.", + messageId: "beforeUnaryExpressions", data: { token: secondToken.value }, @@ -235,7 +243,7 @@ module.exports = { if (secondToken.range[0] > firstToken.range[1]) { context.report({ node, - message: "Unexpected space after unary operator '{{operator}}'.", + messageId: "unexpectedAfter", data: { operator: firstToken.value }, @@ -251,7 +259,7 @@ module.exports = { if (secondToken.range[0] > firstToken.range[1]) { context.report({ node, - message: "Unexpected space before unary operator '{{operator}}'.", + messageId: "unexpectedBefore", data: { operator: secondToken.value }, diff --git a/tools/node_modules/eslint/lib/rules/strict.js b/tools/node_modules/eslint/lib/rules/strict.js index bec1baf4653961..a826731260b376 100644 --- a/tools/node_modules/eslint/lib/rules/strict.js +++ b/tools/node_modules/eslint/lib/rules/strict.js @@ -15,19 +15,6 @@ const astUtils = require("../util/ast-utils"); // Helpers //------------------------------------------------------------------------------ -const messages = { - function: "Use the function form of 'use strict'.", - global: "Use the global form of 'use strict'.", - multiple: "Multiple 'use strict' directives.", - never: "Strict mode is not permitted.", - unnecessary: "Unnecessary 'use strict' directive.", - module: "'use strict' is unnecessary inside of modules.", - implied: "'use strict' is unnecessary when implied strict mode is enabled.", - unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", - nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", - wrap: "Wrap {{name}} in a function with 'use strict' directive." -}; - /** * Gets all of the Use Strict Directives in the Directive Prologue of a group of * statements. @@ -95,7 +82,19 @@ module.exports = { } ], - fixable: "code" + fixable: "code", + messages: { + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", + never: "Strict mode is not permitted.", + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes.", + nonSimpleParameterList: "'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.", + wrap: "Wrap {{name}} in a function with 'use strict' directive." + } }, create(context) { @@ -134,36 +133,36 @@ module.exports = { * @param {ASTNode[]} nodes Nodes. * @param {string} start Index to start from. * @param {string} end Index to end before. - * @param {string} message Message to display. + * @param {string} messageId Message to display. * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) * @returns {void} */ - function reportSlice(nodes, start, end, message, fix) { + function reportSlice(nodes, start, end, messageId, fix) { nodes.slice(start, end).forEach(node => { - context.report({ node, message, fix: fix ? getFixFunction(node) : null }); + context.report({ node, messageId, fix: fix ? getFixFunction(node) : null }); }); } /** * Report all nodes in an array with a given message. * @param {ASTNode[]} nodes Nodes. - * @param {string} message Message to display. + * @param {string} messageId Message id to display. * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) * @returns {void} */ - function reportAll(nodes, message, fix) { - reportSlice(nodes, 0, nodes.length, message, fix); + function reportAll(nodes, messageId, fix) { + reportSlice(nodes, 0, nodes.length, messageId, fix); } /** * Report all nodes in an array, except the first, with a given message. * @param {ASTNode[]} nodes Nodes. - * @param {string} message Message to display. + * @param {string} messageId Message id to display. * @param {boolean} fix `true` if the directive should be fixed (i.e. removed) * @returns {void} */ - function reportAllExceptFirst(nodes, message, fix) { - reportSlice(nodes, 1, nodes.length, message, fix); + function reportAllExceptFirst(nodes, messageId, fix) { + reportSlice(nodes, 1, nodes.length, messageId, fix); } /** @@ -181,21 +180,21 @@ module.exports = { if (isStrict) { if (!isSimpleParameterList(node.params)) { - context.report({ node: useStrictDirectives[0], message: messages.nonSimpleParameterList }); + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); } else if (isParentStrict) { - context.report({ node: useStrictDirectives[0], message: messages.unnecessary, fix: getFixFunction(useStrictDirectives[0]) }); + context.report({ node: useStrictDirectives[0], messageId: "unnecessary", fix: getFixFunction(useStrictDirectives[0]) }); } else if (isInClass) { - context.report({ node: useStrictDirectives[0], message: messages.unnecessaryInClasses, fix: getFixFunction(useStrictDirectives[0]) }); + context.report({ node: useStrictDirectives[0], messageId: "unnecessaryInClasses", fix: getFixFunction(useStrictDirectives[0]) }); } - reportAllExceptFirst(useStrictDirectives, messages.multiple, true); + reportAllExceptFirst(useStrictDirectives, "multiple", true); } else if (isParentGlobal) { if (isSimpleParameterList(node.params)) { - context.report({ node, message: messages.function }); + context.report({ node, messageId: "function" }); } else { context.report({ node, - message: messages.wrap, + messageId: "wrap", data: { name: astUtils.getFunctionNameWithKind(node) } }); } @@ -228,10 +227,10 @@ module.exports = { enterFunctionInFunctionMode(node, useStrictDirectives); } else if (useStrictDirectives.length > 0) { if (isSimpleParameterList(node.params)) { - reportAll(useStrictDirectives, messages[mode], shouldFix(mode)); + reportAll(useStrictDirectives, mode, shouldFix(mode)); } else { - context.report({ node: useStrictDirectives[0], message: messages.nonSimpleParameterList }); - reportAllExceptFirst(useStrictDirectives, messages.multiple, true); + context.report({ node: useStrictDirectives[0], messageId: "nonSimpleParameterList" }); + reportAllExceptFirst(useStrictDirectives, "multiple", true); } } } @@ -246,11 +245,11 @@ module.exports = { if (mode === "global") { if (node.body.length > 0 && useStrictDirectives.length === 0) { - context.report({ node, message: messages.global }); + context.report({ node, messageId: "global" }); } - reportAllExceptFirst(useStrictDirectives, messages.multiple, true); + reportAllExceptFirst(useStrictDirectives, "multiple", true); } else { - reportAll(useStrictDirectives, messages[mode], shouldFix(mode)); + reportAll(useStrictDirectives, mode, shouldFix(mode)); } }, FunctionDeclaration: enterFunction, 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 e94b3292106ddf..9c7c0d589e0552 100644 --- a/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js +++ b/tools/node_modules/eslint/lib/rules/switch-colon-spacing.js @@ -36,8 +36,13 @@ module.exports = { additionalProperties: false } ], - - fixable: "whitespace" + fixable: "whitespace", + messages: { + expectedBefore: "Expected space(s) before this colon.", + expectedAfter: "Expected space(s) after this colon.", + unexpectedBefore: "Unexpected space(s) before this colon.", + unexpectedAfter: "Unexpected space(s) after this colon." + } }, create(context) { @@ -118,8 +123,7 @@ module.exports = { context.report({ node, loc: colonToken.loc, - message: "{{verb}} space(s) before this colon.", - data: { verb: beforeSpacing ? "Expected" : "Unexpected" }, + messageId: beforeSpacing ? "expectedBefore" : "unexpectedBefore", fix: fixer => fix(fixer, beforeToken, colonToken, beforeSpacing) }); } @@ -127,8 +131,7 @@ module.exports = { context.report({ node, loc: colonToken.loc, - message: "{{verb}} space(s) after this colon.", - data: { verb: afterSpacing ? "Expected" : "Unexpected" }, + messageId: afterSpacing ? "expectedAfter" : "unexpectedAfter", fix: fixer => fix(fixer, colonToken, afterToken, afterSpacing) }); } diff --git a/tools/node_modules/eslint/lib/rules/symbol-description.js b/tools/node_modules/eslint/lib/rules/symbol-description.js index 7bb4e2dec699d4..f2e7e16b7a5874 100644 --- a/tools/node_modules/eslint/lib/rules/symbol-description.js +++ b/tools/node_modules/eslint/lib/rules/symbol-description.js @@ -26,8 +26,11 @@ module.exports = { recommended: false, url: "https://eslint.org/docs/rules/symbol-description" }, - - schema: [] + fixable: null, + schema: [], + messages: { + expected: "Expected Symbol to have a description." + } }, create(context) { @@ -43,7 +46,7 @@ module.exports = { if (node.arguments.length === 0) { context.report({ node, - message: "Expected Symbol to have a description." + messageId: "expected" }); } } 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 ea801cbe5d2ea9..84957d475941bf 100644 --- a/tools/node_modules/eslint/lib/rules/template-curly-spacing.js +++ b/tools/node_modules/eslint/lib/rules/template-curly-spacing.js @@ -37,13 +37,19 @@ module.exports = { schema: [ { enum: ["always", "never"] } - ] + ], + messages: { + expectedBefore: "Expected space(s) before '}'.", + expectedAfter: "Expected space(s) after '${'.", + unexpectedBefore: "Unexpected space(s) before '}'.", + unexpectedAfter: "Unexpected space(s) after '${'." + } }, create(context) { const sourceCode = context.getSourceCode(); const always = context.options[0] === "always"; - const prefix = always ? "Expected" : "Unexpected"; + const prefix = always ? "expected" : "unexpected"; /** * Checks spacing before `}` of a given token. @@ -60,10 +66,7 @@ module.exports = { ) { context.report({ loc: token.loc.start, - message: "{{prefix}} space(s) before '}'.", - data: { - prefix - }, + messageId: `${prefix}Before`, fix(fixer) { if (always) { return fixer.insertTextBefore(token, " "); @@ -95,10 +98,7 @@ module.exports = { line: token.loc.end.line, column: token.loc.end.column - 2 }, - message: "{{prefix}} space(s) after '${'.", - data: { - prefix - }, + messageId: `${prefix}After`, fix(fixer) { if (always) { return fixer.insertTextAfter(token, " "); 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 f258cde3d88e09..9eb6d86077da36 100644 --- a/tools/node_modules/eslint/lib/rules/template-tag-spacing.js +++ b/tools/node_modules/eslint/lib/rules/template-tag-spacing.js @@ -24,7 +24,11 @@ module.exports = { schema: [ { enum: ["always", "never"] } - ] + ], + messages: { + unexpected: "Unexpected space between template tag and template literal.", + missing: "Missing space between template tag and template literal." + } }, create(context) { @@ -46,7 +50,7 @@ module.exports = { context.report({ node, loc: tagToken.loc.start, - message: "Unexpected space between template tag and template literal.", + messageId: "unexpected", fix(fixer) { const comments = sourceCode.getCommentsBefore(node.quasi); @@ -65,7 +69,7 @@ module.exports = { context.report({ node, loc: tagToken.loc.start, - message: "Missing space between template tag and template literal.", + messageId: "missing", fix(fixer) { return fixer.insertTextAfter(tagToken, " "); } diff --git a/tools/node_modules/eslint/lib/rules/unicode-bom.js b/tools/node_modules/eslint/lib/rules/unicode-bom.js index 20f48e22b3c6b2..39642f85193e90 100644 --- a/tools/node_modules/eslint/lib/rules/unicode-bom.js +++ b/tools/node_modules/eslint/lib/rules/unicode-bom.js @@ -25,7 +25,11 @@ module.exports = { { enum: ["always", "never"] } - ] + ], + messages: { + expected: "Expected Unicode BOM (Byte Order Mark).", + unexpected: "Unexpected Unicode BOM (Byte Order Mark)." + } }, create(context) { @@ -46,7 +50,7 @@ module.exports = { context.report({ node, loc: location, - message: "Expected Unicode BOM (Byte Order Mark).", + messageId: "expected", fix(fixer) { return fixer.insertTextBeforeRange([0, 1], "\uFEFF"); } @@ -55,7 +59,7 @@ module.exports = { context.report({ node, loc: location, - message: "Unexpected Unicode BOM (Byte Order Mark).", + messageId: "unexpected", fix(fixer) { return fixer.removeRange([-1, 0]); } diff --git a/tools/node_modules/eslint/lib/rules/use-isnan.js b/tools/node_modules/eslint/lib/rules/use-isnan.js index 343ca0454441e4..c8adefd608a751 100644 --- a/tools/node_modules/eslint/lib/rules/use-isnan.js +++ b/tools/node_modules/eslint/lib/rules/use-isnan.js @@ -20,7 +20,10 @@ module.exports = { url: "https://eslint.org/docs/rules/use-isnan" }, - schema: [] + schema: [], + messages: { + useIsNaN: "Use the isNaN function to compare with NaN." + } }, create(context) { @@ -28,7 +31,7 @@ module.exports = { return { BinaryExpression(node) { if (/^(?:[<>]|[!=]=)=?$/.test(node.operator) && (node.left.name === "NaN" || node.right.name === "NaN")) { - context.report({ node, message: "Use the isNaN function to compare with NaN." }); + context.report({ node, messageId: "useIsNaN" }); } } }; diff --git a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js index b40a20f6b4b3ab..515ba78b1d4fcf 100644 --- a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js +++ b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -65,6 +65,22 @@ module.exports = { ], fixable: "code", + messages: { + unexpectedTag: "Unexpected @{{title}} tag; function has no return statement.", + expected: "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", + use: "Use @{{name}} instead.", + useType: "Use '{{expectedTypeName}}' instead of '{{currentTypeName}}'.", + syntaxError: "JSDoc syntax error.", + missingBrace: "JSDoc type missing brace.", + missingParamDesc: "Missing JSDoc parameter description for '{{name}}'.", + missingParamType: "Missing JSDoc parameter type for '{{name}}'.", + missingReturnType: "Missing JSDoc return type.", + missingReturnDesc: "Missing JSDoc return description.", + missingReturn: "Missing JSDoc @{{returns}} for function.", + missingParam: "Missing JSDoc for parameter '{{name}}'.", + duplicateParam: "Duplicate JSDoc parameter '{{name}}'.", + unsatisfiedDesc: "JSDoc description does not satisfy the regex pattern." + }, deprecated: true, replacedBy: [] @@ -231,7 +247,7 @@ module.exports = { typeToCheck.expectedTypeName !== typeToCheck.currentType.name) { context.report({ node: jsdocNode, - message: "Use '{{expectedTypeName}}' instead of '{{currentTypeName}}'.", + messageId: "useType", loc: getAbsoluteRange(jsdocNode, typeToCheck.currentType), data: { currentTypeName: typeToCheck.currentType.name, @@ -280,9 +296,9 @@ module.exports = { } catch (ex) { if (/braces/i.test(ex.message)) { - context.report({ node: jsdocNode, message: "JSDoc type missing brace." }); + context.report({ node: jsdocNode, messageId: "missingBrace" }); } else { - context.report({ node: jsdocNode, message: "JSDoc syntax error." }); + context.report({ node: jsdocNode, messageId: "syntaxError" }); } return; @@ -332,7 +348,7 @@ module.exports = { context.report({ node: jsdocNode, - message: "Use @{{name}} instead.", + messageId: "use", loc: { start: entireTagRange.start, end: { @@ -363,7 +379,7 @@ module.exports = { if (requireParamType && !param.type) { context.report({ node: jsdocNode, - message: "Missing JSDoc parameter type for '{{name}}'.", + messageId: "missingParamType", loc: getAbsoluteRange(jsdocNode, param), data: { name: param.name } }); @@ -371,7 +387,7 @@ module.exports = { if (!param.description && requireParamDescription) { context.report({ node: jsdocNode, - message: "Missing JSDoc parameter description for '{{name}}'.", + messageId: "missingParamDesc", loc: getAbsoluteRange(jsdocNode, param), data: { name: param.name } }); @@ -379,7 +395,7 @@ module.exports = { if (paramTagsByName[param.name]) { context.report({ node: jsdocNode, - message: "Duplicate JSDoc parameter '{{name}}'.", + messageId: "duplicateParam", loc: getAbsoluteRange(jsdocNode, param), data: { name: param.name } }); @@ -392,7 +408,7 @@ module.exports = { if (!requireReturn && !functionData.returnPresent && (returnsTag.type === null || !isValidReturnType(returnsTag)) && !isAbstract) { context.report({ node: jsdocNode, - message: "Unexpected @{{title}} tag; function has no return statement.", + messageId: "unexpectedTag", loc: getAbsoluteRange(jsdocNode, returnsTag), data: { title: returnsTag.title @@ -400,11 +416,11 @@ module.exports = { }); } else { if (requireReturnType && !returnsTag.type) { - context.report({ node: jsdocNode, message: "Missing JSDoc return type." }); + context.report({ node: jsdocNode, messageId: "missingReturnType" }); } if (!isValidReturnType(returnsTag) && !returnsTag.description && requireReturnDescription) { - context.report({ node: jsdocNode, message: "Missing JSDoc return description." }); + context.report({ node: jsdocNode, messageId: "missingReturnDesc" }); } } } @@ -416,7 +432,7 @@ module.exports = { if (requireReturn || (functionData.returnPresent && !node.async)) { context.report({ node: jsdocNode, - message: "Missing JSDoc @{{returns}} for function.", + messageId: "missingReturn", data: { returns: prefer.returns || "returns" } @@ -440,7 +456,7 @@ module.exports = { if (jsdocParamNames[paramsIndex] && (name !== jsdocParamNames[paramsIndex])) { context.report({ node: jsdocNode, - message: "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", + messageId: "expected", loc: getAbsoluteRange(jsdocNode, paramTagsByName[jsdocParamNames[paramsIndex]]), data: { name, @@ -450,7 +466,7 @@ module.exports = { } else if (!paramTagsByName[name] && !isOverride) { context.report({ node: jsdocNode, - message: "Missing JSDoc for parameter '{{name}}'.", + messageId: "missingParam", data: { name } @@ -464,7 +480,7 @@ module.exports = { const regex = new RegExp(options.matchDescription); if (!regex.test(jsdoc.description)) { - context.report({ node: jsdocNode, message: "JSDoc description does not satisfy the regex pattern." }); + context.report({ node: jsdocNode, messageId: "unsatisfiedDesc" }); } } diff --git a/tools/node_modules/eslint/lib/rules/valid-typeof.js b/tools/node_modules/eslint/lib/rules/valid-typeof.js index e3245e8f306ca9..7fa2b89bd051a5 100644 --- a/tools/node_modules/eslint/lib/rules/valid-typeof.js +++ b/tools/node_modules/eslint/lib/rules/valid-typeof.js @@ -29,7 +29,11 @@ module.exports = { }, additionalProperties: false } - ] + ], + messages: { + invalidValue: "Invalid typeof comparison value.", + notString: "Typeof comparisons should be to string literals." + } }, create(context) { @@ -65,10 +69,10 @@ module.exports = { const value = sibling.type === "Literal" ? sibling.value : sibling.quasis[0].value.cooked; if (VALID_TYPES.indexOf(value) === -1) { - context.report({ node: sibling, message: "Invalid typeof comparison value." }); + context.report({ node: sibling, messageId: "invalidValue" }); } } else if (requireStringLiterals && !isTypeofExpression(sibling)) { - context.report({ node: sibling, message: "Typeof comparisons should be to string literals." }); + context.report({ node: sibling, messageId: "notString" }); } } } 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 d69c223388f05f..92d483b6ecc7e1 100644 --- a/tools/node_modules/eslint/lib/rules/vars-on-top.js +++ b/tools/node_modules/eslint/lib/rules/vars-on-top.js @@ -20,11 +20,13 @@ module.exports = { url: "https://eslint.org/docs/rules/vars-on-top" }, - schema: [] + schema: [], + messages: { + top: "All 'var' declarations must be at the top of the function scope." + } }, create(context) { - const errorMessage = "All 'var' declarations must be at the top of the function scope."; //-------------------------------------------------------------------------- // Helpers @@ -103,7 +105,7 @@ module.exports = { */ function globalVarCheck(node, parent) { if (!isVarOnTop(node, parent.body)) { - context.report({ node, message: errorMessage }); + context.report({ node, messageId: "top" }); } } @@ -118,7 +120,7 @@ module.exports = { if (!(/Function/.test(grandParent.type) && parent.type === "BlockStatement" && isVarOnTop(node, parent.body))) { - context.report({ node, message: errorMessage }); + context.report({ node, messageId: "top" }); } } diff --git a/tools/node_modules/eslint/lib/rules/wrap-iife.js b/tools/node_modules/eslint/lib/rules/wrap-iife.js index ce272235b4f035..628ebf532e0254 100644 --- a/tools/node_modules/eslint/lib/rules/wrap-iife.js +++ b/tools/node_modules/eslint/lib/rules/wrap-iife.js @@ -41,7 +41,12 @@ module.exports = { } ], - fixable: "code" + fixable: "code", + messages: { + wrapInvocation: "Wrap an immediate function invocation in parentheses.", + wrapExpression: "Wrap only the function expression in parens.", + moveInvocation: "Move the invocation into the parens that contain the function." + } }, create(context) { @@ -99,7 +104,7 @@ module.exports = { if (!callExpressionWrapped && !functionExpressionWrapped) { context.report({ node, - message: "Wrap an immediate function invocation in parentheses.", + messageId: "wrapInvocation", fix(fixer) { const nodeToSurround = style === "inside" ? innerNode : node; @@ -109,7 +114,7 @@ module.exports = { } else if (style === "inside" && !functionExpressionWrapped) { context.report({ node, - message: "Wrap only the function expression in parens.", + messageId: "wrapExpression", fix(fixer) { /* @@ -129,7 +134,7 @@ module.exports = { } else if (style === "outside" && !callExpressionWrapped) { context.report({ node, - message: "Move the invocation into the parens that contain the function.", + messageId: "moveInvocation", fix(fixer) { /* 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 e7712a51dbf7e7..20b8e9ea91eb2e 100644 --- a/tools/node_modules/eslint/lib/rules/yield-star-spacing.js +++ b/tools/node_modules/eslint/lib/rules/yield-star-spacing.js @@ -38,7 +38,13 @@ module.exports = { } ] } - ] + ], + messages: { + missingBefore: "Missing space before *.", + missingAfter: "Missing space after *.", + unexpectedBefore: "Unexpected space before *.", + unexpectedAfter: "Unexpected space after *." + } }, create(context) { @@ -70,16 +76,17 @@ module.exports = { const after = leftToken.value === "*"; const spaceRequired = mode[side]; const node = after ? leftToken : rightToken; - const type = spaceRequired ? "Missing" : "Unexpected"; - const message = "{{type}} space {{side}} *."; + let messageId = ""; + + if (spaceRequired) { + messageId = side === "before" ? "missingBefore" : "missingAfter"; + } else { + messageId = side === "before" ? "unexpectedBefore" : "unexpectedAfter"; + } context.report({ node, - message, - data: { - type, - side - }, + messageId, fix(fixer) { if (spaceRequired) { if (after) { diff --git a/tools/node_modules/eslint/lib/rules/yoda.js b/tools/node_modules/eslint/lib/rules/yoda.js index 8789c001ef933e..83c435a4f74c3a 100644 --- a/tools/node_modules/eslint/lib/rules/yoda.js +++ b/tools/node_modules/eslint/lib/rules/yoda.js @@ -179,7 +179,10 @@ module.exports = { } ], - fixable: "code" + fixable: "code", + messages: { + expected: "Expected literal to be on the {{expectedSide}} side of {{operator}}." + } }, create(context) { @@ -297,7 +300,7 @@ module.exports = { ) { context.report({ node, - message: "Expected literal to be on the {{expectedSide}} side of {{operator}}.", + messageId: "expected", data: { operator: node.operator, expectedSide: always ? "left" : "right" diff --git a/tools/node_modules/eslint/node_modules/ajv/README.md b/tools/node_modules/eslint/node_modules/ajv/README.md index 15b1e6a18e04a1..af9b83782812aa 100644 --- a/tools/node_modules/eslint/node_modules/ajv/README.md +++ b/tools/node_modules/eslint/node_modules/ajv/README.md @@ -63,7 +63,7 @@ ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); - [Validation errors](#validation-errors) - [Plugins](#plugins) - [Related packages](#related-packages) -- [Packages using Ajv](#some-packages-using-ajv) +- [Some packages using Ajv](#some-packages-using-ajv) - [Tests, Contributing, History, License](#tests) @@ -699,13 +699,11 @@ The schema above is also more efficient - it will compile into a faster function With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. -This option modifies original data. - -__Please note__: by default the default value is inserted in the generated validation code as a literal (starting from v4.0), so the value inserted in the data will be the deep clone of the default in the schema. +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. -If you need to insert the default value in the data by reference pass the option `useDefaults: "shared"`. +This option modifies original data. -Inserting defaults by reference can be faster (in case you have an object in `default`) and it allows to have dynamic values in defaults, e.g. timestamp, without recompiling the schema. The side effect is that modifying the default value in any validated data instance will change the default in the schema and in other validated data instances. See example 3 below. +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. Example 1 (`default` in `properties`): @@ -748,32 +746,6 @@ console.log(validate(data)); // true console.log(data); // [ 1, "foo" ] ``` -Example 3 (inserting "defaults" by reference): - -```javascript -var ajv = new Ajv({ useDefaults: 'shared' }); - -var schema = { - properties: { - foo: { - default: { bar: 1 } - } - } -} - -var validate = ajv.compile(schema); - -var data = {}; -console.log(validate(data)); // true -console.log(data); // { foo: { bar: 1 } } - -data.foo.bar = 2; - -var data2 = {}; -console.log(validate(data2)); // true -console.log(data2); // { foo: { bar: 2 } } -``` - `default` keywords in other cases are ignored: - not in `properties` or `items` subschemas @@ -1115,8 +1087,9 @@ Defaults: - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). - _useDefaults_: replace missing properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: - `false` (default) - do not use defaults - - `true` - insert defaults by value (safer and slower, object literal is used). - - `"shared"` - insert defaults by reference (faster). If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. + - `true` - insert defaults by value (object literal is used). + - `"empty"` - use defaults for properties and items that are present and equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. - _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md). Option values: - `false` (default) - no type coercion. - `true` - coerce scalar data types. @@ -1228,7 +1201,7 @@ If you have published a useful plugin please submit a PR to add it to the next s - [ajv-errors](https://github.com/epoberezkin/ajv-errors) - plugin for custom error messages - [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) - internationalised error messages - [ajv-istanbul](https://github.com/epoberezkin/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas -- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - plugin with custom validation keywords (if/then/else, select, typeof, etc.) +- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) - [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - plugin with keywords $merge and $patch - [ajv-pack](https://github.com/epoberezkin/ajv-pack) - produces a compact module exporting validation functions diff --git a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.bundle.js b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.bundle.js index 6b281fa8b05493..6b810ae26ab5bb 100644 --- a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.bundle.js +++ b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.bundle.js @@ -1434,7 +1434,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1520,7 +1521,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1598,7 +1600,8 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1681,7 +1684,8 @@ module.exports = function generate__limitLength(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1759,7 +1763,8 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -1875,7 +1880,8 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -1952,7 +1958,8 @@ module.exports = function generate_const(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2031,7 +2038,8 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2207,7 +2215,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2253,7 +2262,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -2362,7 +2372,8 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2499,7 +2510,8 @@ module.exports = function generate_enum(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2650,7 +2662,8 @@ module.exports = function generate_format(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -2751,7 +2764,8 @@ module.exports = function generate_if(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -2852,7 +2866,8 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3010,7 +3025,8 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3076,7 +3092,8 @@ module.exports = function generate_not(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3171,7 +3188,8 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -3245,7 +3263,8 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3373,7 +3392,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3503,7 +3523,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3655,7 +3676,8 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { @@ -3717,7 +3739,8 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3891,7 +3914,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -3950,7 +3974,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4135,7 +4160,8 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4208,7 +4234,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4364,7 +4391,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4411,7 +4439,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -4460,7 +4489,11 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { @@ -4479,7 +4512,11 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { @@ -4547,7 +4584,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js index f421f8df1a6c94..91d0ee93f8efc5 100644 --- a/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js +++ b/tools/node_modules/eslint/node_modules/ajv/dist/ajv.min.js @@ -1,3 +1,3 @@ -/* ajv 6.6.2: Another JSON Schema Validator */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Ajv=e()}}(function(){return function o(i,n,l){function u(r,e){if(!n[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(c)return c(r,!0);var a=new Error("Cannot find module '"+r+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[r]={exports:{}};i[r][0].call(s.exports,function(e){return u(i[r][1][e]||e)},s,s.exports,o,i,n,l)}return n[r].exports}for(var c="function"==typeof require&&require,e=0;e%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function g(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var r=e.split(y);return 2==r.length&&v(r[0])&&g(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&s.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p};var y=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var $=e("./resolve"),D=e("./util"),j=e("./error_classes"),l=e("fast-json-stable-stringify"),O=e("../dotjs/validate"),I=D.ucs2length,A=e("fast-deep-equal"),C=j.Validation;function k(e,r,t){for(var a=0;a",y=f?">":"<",P=void 0;if(v){var E=e.util.getData(m.$data,i,e.dataPathArr),w="exclusive"+o,S="exclType"+o,b="exclIsNumber"+o,_="' + "+(R="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+E+"; ";var F;P=p;(F=F||[]).push(s+=" var "+w+"; var "+S+" = typeof "+(E="schemaExcl"+o)+"; if ("+S+" != 'boolean' && "+S+" != 'undefined' && "+S+" != 'number') { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;s=F.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+S+" == 'number' ? ( ("+w+" = "+a+" === undefined || "+E+" "+g+"= "+a+") ? "+h+" "+y+"= "+E+" : "+h+" "+y+" "+a+" ) : ( ("+w+" = "+E+" === true) ? "+h+" "+y+"= "+a+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { var op"+o+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===n&&(u=e.errSchemaPath+"/"+(P=p),a=E,d=v)}else{_=g;if((b="number"==typeof m)&&d){var R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+h+" "+y+"= "+m+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { "}else{b&&void 0===n?(w=!0,u=e.errSchemaPath+"/"+(P=p),a=m,y+="="):(b&&(a=Math[f?"min":"max"](m,n)),m===(!b||a)?(w=!0,u=e.errSchemaPath+"/"+(P=p),y+="="):(w=!1,_+="="));R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+h+" "+y+" "+a+" || "+h+" !== "+h+") { "}}P=P||r,(F=F||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+R+", limit: "+a+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+_+" ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";x=s;return s=F.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c&&(s+=" else { "),s}},{}],13:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" "+h+".length "+("maxItems"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=!1===e.opts.unicode?" "+h+".length ":" ucs2length("+h+") ";var f=r,p=p||[];p.push(s+=" "+("maxLength"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" Object.keys("+h+").length "+("maxProperties"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,h=l.baseId,d=!0,f=s;if(f)for(var p,m=-1,v=f.length-1;m "+x+") { ";var $=c+"["+x+"]";f.schema=F,f.schemaPath=n+"["+x+"]",f.errSchemaPath=l+"/"+x,f.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),f.dataPathArr[g]=x;var D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof E&&e.util.schemaHasRules(E,e.RULES.all)){f.schema=E,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+c+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=c+"["+v+"]";f.dataPathArr[g]=v;D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.util.schemaHasRules(i,e.RULES.all)){f.schema=i,f.schemaPath=n,f.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=c+"["+v+"]";f.dataPathArr[g]=v;D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],28:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="var division"+o+";if (",d&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+o+" = "+h+" / "+a+", ",s+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+o+" !== parseInt(division"+o+") ",s+=" ) ",d&&(s+=" ) ");var f=f||[];f.push(s+=" ) { "),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var p=s;return s=f.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],29:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(o||""),h="errs__"+s,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=n,d.errSchemaPath=l,a+=" var "+h+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m;var v=v||[];v.push(a+=" if ("+f+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),a+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+g+"]); ":" validate.errors = ["+g+"]; return false; ":" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(o||""),h="valid"+s,d="errs__"+s,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,v=f.baseId,g="prevValid"+s,y="passingSchemas"+s;a+="var "+d+" = errors , "+g+" = false , "+h+" = false , "+y+" = null; ";var P=e.compositeRule;e.compositeRule=f.compositeRule=!0;var E=i;if(E)for(var w,S=-1,b=E.length-1;S 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(0<=p.indexOf("object")||0<=p.indexOf("array")))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ";else s+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ",s+=" if ("+e.util["checkDataType"+(m?"s":"")](p,"item",!0)+") continue; ",m&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";s+=" } ",f&&(s+=" } ");var v=v||[];v.push(s+=" if (!"+d+") { "),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var g=s;s=v.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+g+"]); ":" validate.errors = ["+g+"]; return false; ":" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c&&(s+=" else { ")}else c&&(s+=" if (true) { ");return s}},{}],37:[function(e,r,t){"use strict";r.exports=function(a,e,r){var t="",s=!0===a.schema.$async,o=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),i=a.self._getId(a.schema);if(a.isTop&&(t+=" var validate = ",s&&(a.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(a.opts.sourceCode||a.opts.processCode)&&(t+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof a.schema||!o&&!a.schema.$ref){var n=a.level,l=a.dataLevel,u=a.schema[e="false schema"],c=a.schemaPath+a.util.getProperty(e),h=a.errSchemaPath+"/"+e,d=!a.opts.allErrors,f="data"+(l||""),p="valid"+n;if(!1===a.schema){a.isTop?d=!0:t+=" var "+p+" = false; ",(B=B||[]).push(t),t="",!1!==a.createErrors?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(h)+" , params: {} ",!1!==a.opts.messages&&(t+=" , message: 'boolean schema is false' "),a.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),t+=" } "):t+=" {} ";var m=t;t=B.pop(),t+=!a.compositeRule&&d?a.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t+=a.isTop?s?" return data; ":" validate.errors = null; return true; ":" var "+p+" = true; ";return a.isTop&&(t+=" }; return validate; "),t}if(a.isTop){var v=a.isTop;n=a.level=0,l=a.dataLevel=0,f="data";a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{n=a.level,f="data"+((l=a.dataLevel)||"");if(i&&(a.baseId=a.resolve.url(a.baseId,i)),s&&!a.async)throw new Error("async schema in sync schema");t+=" var errs_"+n+" = errors;"}p="valid"+n,d=!a.opts.allErrors;var g="",y="",P=a.schema.type,E=Array.isArray(P);if(P&&a.opts.nullable&&!0===a.schema.nullable&&(E?-1==P.indexOf("null")&&(P=P.concat("null")):"null"!=P&&(P=[P,"null"],E=!0)),E&&1==P.length&&(P=P[0],E=!1),a.schema.$ref&&o){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(o=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(t+=" "+a.RULES.all.$comment.code(a,"$comment")),P){if(a.opts.coerceTypes)var w=a.util.coerceToTypes(a.opts.coerceTypes,P);var S=a.RULES.types[P];if(w||E||!0===S||S&&!J(S)){c=a.schemaPath+".type",h=a.errSchemaPath+"/type",c=a.schemaPath+".type",h=a.errSchemaPath+"/type";if(t+=" if ("+a.util[E?"checkDataTypes":"checkDataType"](P,f,!0)+") { ",w){var b="dataType"+n,_="coerced"+n;t+=" var "+b+" = typeof "+f+"; ","array"==a.opts.coerceTypes&&(t+=" if ("+b+" == 'object' && Array.isArray("+f+")) "+b+" = 'array'; "),t+=" var "+_+" = undefined; ";var F="",x=w;if(x)for(var R,$=-1,D=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=Math.floor,z=String.fromCharCode;function T(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=L(e/r);455L((A-s)/h))&&T("overflow"),s+=f*h;var p=d<=i?1:i+26<=d?26:d-i;if(fL(A/m)&&T("overflow"),h*=m}var v=t.length+1;i=Q(s-c,v,0==c),L(s/v)>A-o&&T("overflow"),o+=L(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)},u=function(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var u,c=e[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;h<128&&r.push(z(h))}}catch(e){n=!0,l=e}finally{try{!i&&c.return&&c.return()}finally{if(n)throw l}}var d=r.length,f=d;for(d&&r.push("-");fL((A-s)/w)&&T("overflow"),s+=(p-a)*w,a=p;var S=!0,b=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(S=(F=x.next()).done);S=!0){var R=F.value;if(RA&&T("overflow"),R==a){for(var $=s,D=36;;D+=36){var j=D<=o?1:o+26<=D?26:D-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function f(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(M,"g"),G=new RegExp(B,"g"),Y=new RegExp(C("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',J),"g"),W=new RegExp(C("[^]",M,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),X=W;function ee(e){var r=f(e);return r.match(Z)?r:e}var re={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,h=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,f=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return a.copy(m[e="full"==e?"full":"fast"])}function v(e){var r=e.match(o);if(!r)return!1;var t,a=+r[2],s=+r[3];return 1<=a&&a<=12&&1<=s&&s<=(2!=a||((t=+r[1])%4!=0||t%100==0&&t%400!=0)?i[a]:29)}function g(e,r){var t=e.match(n);if(!t)return!1;var a=t[1],s=t[2],o=t[3];return(a<=23&&s<=59&&o<=59||23==a&&59==s&&60==o)&&(!r||t[5])}(r.exports=m).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var r=e.split(y);return 2==r.length&&v(r[0])&&g(r[1],!0)},uri:function(e){return P.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:function(e){return e.length<=255&&s.test(e)},ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:w,uuid:h,"json-pointer":d,"json-pointer-uri-fragment":f,"relative-json-pointer":p};var y=/t|\s/i;var P=/\/|:/;var E=/[^\\]\\Z/;function w(e){if(E.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){"use strict";var $=e("./resolve"),D=e("./util"),j=e("./error_classes"),O=e("fast-json-stable-stringify"),I=e("../dotjs/validate"),A=D.ucs2length,C=e("fast-deep-equal"),k=j.Validation;function L(e,r,t){var a=s.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:{index:a=this._compilations.length,compiling:!(this._compilations[a]={schema:e,root:r,baseId:t})}}function z(e,r,t){var a=s.call(this,e,r,t);0<=a&&this._compilations.splice(a,1)}function s(e,r,t){for(var a=0;a",y=f?">":"<",P=void 0;if(v){var E=e.util.getData(m.$data,i,e.dataPathArr),w="exclusive"+o,S="exclType"+o,b="exclIsNumber"+o,_="' + "+(R="op"+o)+" + '";s+=" var schemaExcl"+o+" = "+E+"; ";var F;P=p;(F=F||[]).push(s+=" var "+w+"; var "+S+" = typeof "+(E="schemaExcl"+o)+"; if ("+S+" != 'boolean' && "+S+" != 'undefined' && "+S+" != 'number') { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var x=s;s=F.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+S+" == 'number' ? ( ("+w+" = "+a+" === undefined || "+E+" "+g+"= "+a+") ? "+h+" "+y+"= "+E+" : "+h+" "+y+" "+a+" ) : ( ("+w+" = "+E+" === true) ? "+h+" "+y+"= "+a+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { var op"+o+" = "+w+" ? '"+g+"' : '"+g+"='; ",void 0===n&&(u=e.errSchemaPath+"/"+(P=p),a=E,d=v)}else{_=g;if((b="number"==typeof m)&&d){var R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+h+" "+y+"= "+m+" : "+h+" "+y+" "+a+" ) || "+h+" !== "+h+") { "}else{b&&void 0===n?(w=!0,u=e.errSchemaPath+"/"+(P=p),a=m,y+="="):(b&&(a=Math[f?"min":"max"](m,n)),m===(!b||a)?(w=!0,u=e.errSchemaPath+"/"+(P=p),y+="="):(w=!1,_+="="));R="'"+_+"'";s+=" if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+h+" "+y+" "+a+" || "+h+" !== "+h+") { "}}P=P||r,(F=F||[]).push(s),s="",!1!==e.createErrors?(s+=" { keyword: '"+(P||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+R+", limit: "+a+", exclusive: "+w+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be "+_+" ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";x=s;return s=F.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c&&(s+=" else { "),s}},{}],13:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" "+h+".length "+("maxItems"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=!1===e.opts.unicode?" "+h+".length ":" ucs2length("+h+") ";var f=r,p=p||[];p.push(s+=" "+("maxLength"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="if ( ",d&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || ");var f=r,p=p||[];p.push(s+=" Object.keys("+h+").length "+("maxProperties"==r?">":"<")+" "+a+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"fewer",s+=" than ",s+=d?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,h=l.baseId,d=!0,f=s;if(f)for(var p,m=-1,v=f.length-1;m "+x+") { ";var $=c+"["+x+"]";f.schema=F,f.schemaPath=n+"["+x+"]",f.errSchemaPath=l+"/"+x,f.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),f.dataPathArr[g]=x;var D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof E&&e.util.schemaHasRules(E,e.RULES.all)){f.schema=E,f.schemaPath=e.schemaPath+".additionalItems",f.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+c+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=c+"["+v+"]";f.dataPathArr[g]=v;D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.util.schemaHasRules(i,e.RULES.all)){f.schema=i,f.schemaPath=n,f.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=c+"["+v+"]";f.dataPathArr[g]=v;D=e.validate(f);f.baseId=P,e.util.varOccurences(D,y)<2?a+=" "+e.util.varReplace(D,y,$)+" ":a+=" var "+y+" = "+$+"; "+D+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],28:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data;a=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n,s+="var division"+o+";if (",d&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+o+" = "+h+" / "+a+", ",s+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+o+" !== parseInt(division"+o+") ",s+=" ) ",d&&(s+=" ) ");var f=f||[];f.push(s+=" ) { "),s="",!1!==e.createErrors?(s+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should be multiple of ",s+=d?"' + "+a:a+"'"),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var p=s;return s=f.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",c&&(s+=" else { "),s}},{}],29:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(o||""),h="errs__"+s,d=e.util.copy(e);d.level++;var f="valid"+d.level;if(e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=n,d.errSchemaPath=l,a+=" var "+h+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m;var v=v||[];v.push(a+=" if ("+f+") { "),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),a+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+g+"]); ":" validate.errors = ["+g+"]; return false; ":" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},{}],30:[function(e,r,t){"use strict";r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,c="data"+(o||""),h="valid"+s,d="errs__"+s,f=e.util.copy(e),p="";f.level++;var m="valid"+f.level,v=f.baseId,g="prevValid"+s,y="passingSchemas"+s;a+="var "+d+" = errors , "+g+" = false , "+h+" = false , "+y+" = null; ";var P=e.compositeRule;e.compositeRule=f.compositeRule=!0;var E=i;if(E)for(var w,S=-1,b=E.length-1;S 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(0<=p.indexOf("object")||0<=p.indexOf("array")))s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+d+" = false; break outer; } } } ";else s+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ",s+=" if ("+e.util["checkDataType"+(m?"s":"")](p,"item",!0)+") continue; ",m&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ";s+=" } ",f&&(s+=" } ");var v=v||[];v.push(s+=" if (!"+d+") { "),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ";var g=s;s=v.pop(),s+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+g+"]); ":" validate.errors = ["+g+"]; return false; ":" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",c&&(s+=" else { ")}else c&&(s+=" if (true) { ");return s}},{}],37:[function(e,r,t){"use strict";r.exports=function(a,e,r){var t="",s=!0===a.schema.$async,o=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),i=a.self._getId(a.schema);if(a.isTop&&(t+=" var validate = ",s&&(a.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",i&&(a.opts.sourceCode||a.opts.processCode)&&(t+=" /*# sourceURL="+i+" */ ")),"boolean"==typeof a.schema||!o&&!a.schema.$ref){var n=a.level,l=a.dataLevel,u=a.schema[e="false schema"],c=a.schemaPath+a.util.getProperty(e),h=a.errSchemaPath+"/"+e,d=!a.opts.allErrors,f="data"+(l||""),p="valid"+n;if(!1===a.schema){a.isTop?d=!0:t+=" var "+p+" = false; ",(B=B||[]).push(t),t="",!1!==a.createErrors?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(h)+" , params: {} ",!1!==a.opts.messages&&(t+=" , message: 'boolean schema is false' "),a.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+f+" "),t+=" } "):t+=" {} ";var m=t;t=B.pop(),t+=!a.compositeRule&&d?a.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else t+=a.isTop?s?" return data; ":" validate.errors = null; return true; ":" var "+p+" = true; ";return a.isTop&&(t+=" }; return validate; "),t}if(a.isTop){var v=a.isTop;n=a.level=0,l=a.dataLevel=0,f="data";a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[void 0],t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{n=a.level,f="data"+((l=a.dataLevel)||"");if(i&&(a.baseId=a.resolve.url(a.baseId,i)),s&&!a.async)throw new Error("async schema in sync schema");t+=" var errs_"+n+" = errors;"}p="valid"+n,d=!a.opts.allErrors;var g="",y="",P=a.schema.type,E=Array.isArray(P);if(P&&a.opts.nullable&&!0===a.schema.nullable&&(E?-1==P.indexOf("null")&&(P=P.concat("null")):"null"!=P&&(P=[P,"null"],E=!0)),E&&1==P.length&&(P=P[0],E=!1),a.schema.$ref&&o){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(o=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(t+=" "+a.RULES.all.$comment.code(a,"$comment")),P){if(a.opts.coerceTypes)var w=a.util.coerceToTypes(a.opts.coerceTypes,P);var S=a.RULES.types[P];if(w||E||!0===S||S&&!J(S)){c=a.schemaPath+".type",h=a.errSchemaPath+"/type",c=a.schemaPath+".type",h=a.errSchemaPath+"/type";if(t+=" if ("+a.util[E?"checkDataTypes":"checkDataType"](P,f,!0)+") { ",w){var b="dataType"+n,_="coerced"+n;t+=" var "+b+" = typeof "+f+"; ","array"==a.opts.coerceTypes&&(t+=" if ("+b+" == 'object' && Array.isArray("+f+")) "+b+" = 'array'; "),t+=" var "+_+" = undefined; ";var F="",x=w;if(x)for(var R,$=-1,D=x.length-1;$= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=Math.floor,z=String.fromCharCode;function T(e){throw new RangeError(i[e])}function n(e,r){var t=e.split("@"),a="";return 1>1,e+=L(e/r);455L((A-s)/h))&&T("overflow"),s+=f*h;var p=d<=i?1:i+26<=d?26:d-i;if(fL(A/m)&&T("overflow"),h*=m}var v=t.length+1;i=Q(s-c,v,0==c),L(s/v)>A-o&&T("overflow"),o+=L(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)},u=function(e){var r=[],t=(e=N(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var u,c=e[Symbol.iterator]();!(i=(u=c.next()).done);i=!0){var h=u.value;h<128&&r.push(z(h))}}catch(e){n=!0,l=e}finally{try{!i&&c.return&&c.return()}finally{if(n)throw l}}var d=r.length,f=d;for(d&&r.push("-");fL((A-s)/w)&&T("overflow"),s+=(p-a)*w,a=p;var S=!0,b=!1,_=void 0;try{for(var F,x=e[Symbol.iterator]();!(S=(F=x.next()).done);S=!0){var R=F.value;if(RA&&T("overflow"),R==a){for(var $=s,D=36;;D+=36){var j=D<=o?1:o+26<=D?26:D-o;if($>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function f(e){for(var r="",t=0,a=e.length;tA-Z\\x5E-\\x7E]",'[\\"\\\\]'),Z=new RegExp(M,"g"),G=new RegExp(B,"g"),Y=new RegExp(C("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',J),"g"),W=new RegExp(C("[^]",M,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),X=W;function ee(e){var r=f(e);return r.match(Z)?r:e}var re={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n); + + message: string; + errors: Array; + ajv: true; + validation: true; + } + + class MissingRefError extends Error { + constructor(baseId: string, ref: string, message?: string); + static message: (baseId: string, ref: string) => string; + + message: string; + missingRef: string; + missingSchema: string; + } +} + declare namespace ajv { + type ValidationError = AjvErrors.ValidationError; + + type MissingRefError = AjvErrors.MissingRefError; + interface Ajv { /** * Validate data using schema @@ -268,11 +292,11 @@ declare namespace ajv { } type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | - DependenciesParams | FormatParams | ComparisonParams | - MultipleOfParams | PatternParams | RequiredParams | - TypeParams | UniqueItemsParams | CustomParams | - PatternRequiredParams | PropertyNamesParams | - IfParams | SwitchParams | NoParams | EnumParams; + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternRequiredParams | PropertyNamesParams | + IfParams | SwitchParams | NoParams | EnumParams; interface RefParams { ref: string; @@ -344,29 +368,11 @@ declare namespace ajv { caseIndex: number; } - interface NoParams {} + interface NoParams { } interface EnumParams { allowedValues: Array; } } -declare class ValidationError extends Error { - constructor(errors: Array); - - message: string; - errors: Array; - ajv: true; - validation: true; -} - -declare class MissingRefError extends Error { - constructor(baseId: string, ref: string, message?: string); - static message: (baseId: string, ref: string) => string; - - message: string; - missingRef: string; - missingSchema: string; -} - export = ajv; diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/compile/equal.js b/tools/node_modules/eslint/node_modules/ajv/lib/compile/equal.js index 911774c8551adb..4b271d54366882 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/compile/equal.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/compile/equal.js @@ -1,3 +1,5 @@ 'use strict'; +// do NOT remove this file - it would break pre-compiled schemas +// https://github.com/epoberezkin/ajv/issues/889 module.exports = require('fast-deep-equal'); diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dot/defaults.def b/tools/node_modules/eslint/node_modules/ajv/lib/dot/defaults.def index 5ad8d1d2d208d7..f100cc4bf49d0d 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dot/defaults.def +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dot/defaults.def @@ -1,5 +1,10 @@ {{## def.assignDefault: - if ({{=$passData}} === undefined) + if ({{=$passData}} === undefined + {{? it.opts.useDefaults == 'empty' }} + || {{=$passData}} === null + || {{=$passData}} === '' + {{?}} + ) {{=$passData}} = {{? it.opts.useDefaults == 'shared' }} {{= it.useDefault($sch.default) }} {{??}} diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limit.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limit.js index 20485c8d07fb69..f02a76014491ae 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limit.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limit.js @@ -52,7 +52,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -138,7 +139,8 @@ module.exports = function generate__limit(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitItems.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitItems.js index 2f6f6ce8f2991f..a27d11886e9af6 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitItems.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitItems.js @@ -59,7 +59,8 @@ module.exports = function generate__limitItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitLength.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitLength.js index e6927f39c6d32a..789f3741ed1b50 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitLength.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitLength.js @@ -64,7 +64,8 @@ module.exports = function generate__limitLength(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitProperties.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitProperties.js index cd8c62a873efbc..11dc939314a89c 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitProperties.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -59,7 +59,8 @@ module.exports = function generate__limitProperties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/anyOf.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/anyOf.js index 994b091230e2e2..819c6f8a4bf901 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/anyOf.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/anyOf.js @@ -52,7 +52,8 @@ module.exports = function generate_anyOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/const.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/const.js index acad86f79f8479..15b7c619fff050 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/const.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/const.js @@ -38,7 +38,8 @@ module.exports = function generate_const(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/contains.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/contains.js index 04c6e936f7286a..8899ce5930530d 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/contains.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/contains.js @@ -60,7 +60,8 @@ module.exports = function generate_contains(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/custom.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/custom.js index 0623e2440301a0..f3e641e701709c 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/custom.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/custom.js @@ -153,7 +153,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -199,7 +200,8 @@ module.exports = function generate_custom(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/dependencies.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/dependencies.js index 58814c61297592..fe4dc091ae9a40 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/dependencies.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/dependencies.js @@ -80,7 +80,8 @@ module.exports = function generate_dependencies(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/enum.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/enum.js index 03f3a8caaedd59..90580b9ff7940f 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/enum.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/enum.js @@ -48,7 +48,8 @@ module.exports = function generate_enum(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/format.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/format.js index 20a467ee299425..cd9a5693e70e90 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/format.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/format.js @@ -132,7 +132,8 @@ module.exports = function generate_format(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/if.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/if.js index 6f0ea6446df903..eff9090b81ae61 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/if.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/if.js @@ -82,7 +82,8 @@ module.exports = function generate_if(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/items.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/items.js index 77be5e214a85fd..99ce7385440641 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/items.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/items.js @@ -43,7 +43,8 @@ module.exports = function generate_items(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/multipleOf.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/multipleOf.js index df5a315444130a..af087d2c3ae4bd 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/multipleOf.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/multipleOf.js @@ -59,7 +59,8 @@ module.exports = function generate_multipleOf(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/not.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/not.js index 67add9f672f58a..c8f8af7f04ed29 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/not.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/not.js @@ -47,7 +47,8 @@ module.exports = function generate_not(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/oneOf.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/oneOf.js index b6be640923cdb1..e9df4532c8fe49 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/oneOf.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/oneOf.js @@ -57,7 +57,8 @@ module.exports = function generate_oneOf(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/pattern.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/pattern.js index 76b7794e0e800e..1d74d6b04be0ac 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/pattern.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/pattern.js @@ -57,7 +57,8 @@ module.exports = function generate_pattern(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/properties.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/properties.js index 409692fce2f472..7d2ea869b9949d 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/properties.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/properties.js @@ -109,7 +109,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -239,7 +240,8 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/propertyNames.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/propertyNames.js index 547d5dd0ad1508..c86a8cb69c75a7 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/propertyNames.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/propertyNames.js @@ -61,7 +61,8 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/ref.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/ref.js index cac481186baf26..8042a4788250a1 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/ref.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/ref.js @@ -40,7 +40,8 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/required.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/required.js index 15b36bb7a71bd9..68cedb3f1c6f97 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/required.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/required.js @@ -89,7 +89,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -148,7 +149,8 @@ module.exports = function generate_required(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/uniqueItems.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/uniqueItems.js index d2dedf5a7cef5f..c4f6536b472ee1 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/uniqueItems.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -63,7 +63,8 @@ module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/validate.js b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/validate.js index 019c193ac148b0..1402b6a15a4567 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/validate.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dotjs/validate.js @@ -49,7 +49,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -205,7 +206,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -252,7 +254,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { @@ -301,7 +304,11 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { @@ -320,7 +327,11 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + out += ' if (' + ($passData) + ' === undefined '; + if (it.opts.useDefaults == 'empty') { + out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' '; + } + out += ' ) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { @@ -388,7 +399,8 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { } var __err = out; out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { diff --git a/tools/node_modules/eslint/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/ajv/package.json index 4c215a2778841b..85c7b9fce1ee3f 100644 --- a/tools/node_modules/eslint/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/ajv/package.json @@ -91,10 +91,10 @@ "test-fast": "AJV_FAST_TEST=true npm run test-spec", "test-karma": "karma start", "test-spec": "mocha spec/*.spec.js -R spec", - "test-ts": "tsc --target ES5 --noImplicitAny lib/ajv.d.ts", + "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts", "watch": "watch 'npm run build' ./lib/dot" }, "tonicExampleFilename": ".tonic_example.js", "typings": "lib/ajv.d.ts", - "version": "6.6.2" + "version": "6.7.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/chalk/index.js.flow b/tools/node_modules/eslint/node_modules/chalk/index.js.flow index 872a156285b362..622caaa2e803f3 100644 --- a/tools/node_modules/eslint/node_modules/chalk/index.js.flow +++ b/tools/node_modules/eslint/node_modules/chalk/index.js.flow @@ -1,4 +1,4 @@ -// @flow +// @flow strict type TemplateStringsArray = $ReadOnlyArray; diff --git a/tools/node_modules/eslint/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/chalk/package.json index 224bf8d87a9c09..270fecdc347d42 100644 --- a/tools/node_modules/eslint/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/package.json @@ -67,7 +67,7 @@ "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava" }, "types": "types/index.d.ts", - "version": "2.4.1", + "version": "2.4.2", "xo": { "envs": [ "node", diff --git a/tools/node_modules/eslint/node_modules/globals/globals.json b/tools/node_modules/eslint/node_modules/globals/globals.json index 2619096e68b7c4..b1f7a2972f5318 100644 --- a/tools/node_modules/eslint/node_modules/globals/globals.json +++ b/tools/node_modules/eslint/node_modules/globals/globals.json @@ -485,7 +485,7 @@ "KeyframeEffectReadOnly": false, "length": false, "localStorage": false, - "location": false, + "location": true, "Location": false, "locationbar": false, "matchMedia": false, @@ -931,6 +931,7 @@ "XSLTProcessor": false }, "worker": { + "addEventListener": false, "applicationCache": false, "atob": false, "Blob": false, @@ -986,6 +987,7 @@ "postMessage": true, "Promise": false, "queueMicrotask": false, + "removeEventListener": false, "Request": false, "Response": false, "self": true, @@ -1363,25 +1365,99 @@ "Ref": false }, "serviceworker": { + "addEventListener": false, + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, "Cache": false, "caches": false, "CacheStorage": false, + "clearInterval": false, + "clearTimeout": false, "Client": false, "clients": false, "Clients": false, + "close": true, + "console": false, "ExtendableEvent": false, "ExtendableMessageEvent": false, + "fetch": false, "FetchEvent": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, "importScripts": false, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onfetch": true, + "oninstall": true, + "onlanguagechange": true, + "onmessage": true, + "onmessageerror": true, + "onnotificationclick": true, + "onnotificationclose": true, + "onoffline": true, + "ononline": true, + "onpush": true, + "onpushsubscriptionchange": true, + "onrejectionhandled": true, + "onsync": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "postMessage": true, + "Promise": false, + "queueMicrotask": false, "registration": false, + "removeEventListener": false, + "Request": false, + "Response": false, "self": false, "ServiceWorker": false, "ServiceWorkerContainer": false, "ServiceWorkerGlobalScope": false, "ServiceWorkerMessageEvent": false, "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, "skipWaiting": false, - "WindowClient": false + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "WindowClient": false, + "Worker": false, + "WorkerGlobalScope": false, + "XMLHttpRequest": false }, "atomtest": { "advanceClock": false, diff --git a/tools/node_modules/eslint/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/globals/package.json index 958e4c737e64e6..b590fd24905bba 100644 --- a/tools/node_modules/eslint/node_modules/globals/package.json +++ b/tools/node_modules/eslint/node_modules/globals/package.json @@ -41,7 +41,7 @@ "scripts": { "test": "xo && ava" }, - "version": "11.9.0", + "version": "11.10.0", "xo": { "ignores": [ "get-browser-globals.js" 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 c165c3576a19b5..03a9e5ae7f8266 100644 --- a/tools/node_modules/eslint/node_modules/js-yaml/README.md +++ b/tools/node_modules/eslint/node_modules/js-yaml/README.md @@ -104,7 +104,7 @@ 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 throw on warnings if this function is not provided. + 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 @@ -170,6 +170,7 @@ 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 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 0c9e648bd07ca5..0f8df899c918bc 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,4 +1,4 @@ -/* js-yaml 3.12.0 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=i.flowLevel;switch(H(r,n,i.indent,t,function(e){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+V(r,i.indent)+Z(L(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(s=e.indexOf("\n"),s=-1!==s?s:e.length,r.lastIndex=s,z(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;i=r.exec(e);){var c=i[1],u=i[2];n=" "===u[0],o+=c+(a||n||""===u?"":"\n")+z(u,t),a=n}return o}(r,t),e));case $:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function Q(e,t,n,i,r,o){e.tag=null,e.dump=n,J(e,n,!1)||J(e,n,!0);var a=l.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return!0}function X(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;ot)&&0!==i)_(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(K(e,t,b,!0,r)&&(m?d=e.result:h=e.result),m||(D(e,l,p,f,d,h,o,a),f=d=h=null),q(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)_(e,"bad indentation of a mapping entry");else if(e.lineIndentl&&(l=e.lineIndent),j(o))p++;else{if(e.lineIndent>10),56320+(c-65536&1023)),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else j(s)?(T(e,n,i,!0),R(e,q(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Y(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!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&&!I(i)&&!E(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],q(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,s,c,u,l,p=e.kind,f=e.result;if(I(l=e.input.charCodeAt(e.position))||E(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(I(i=e.input.charCodeAt(e.position+1))||n&&E(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==l;){if(58===l){if(I(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===l){if(I(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Y(e)||n&&E(l))break;if(j(l)){if(s=e.line,c=e.lineStart,u=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(T(e,r,o,!1),R(e,e.line-s),r=o=e.position,a=!1),S(l)||(o=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,p,x===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||_(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=s&&B(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):_(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}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))&&(q(e,!0,-1),r=e.input.charCodeAt(e.position),!(0t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var i=e("./common"),r=e("./exception"),o=e("./type");function a(e,t,i){var r=[];return e.include.forEach(function(e){i=a(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 s(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 r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0==(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),c?c.from?c.from(s):new c(s):s},predicate:function(e){return c&&c.isBuffer(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},{"../type":13}],15:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("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"),r=e("../type"),o=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 a=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,i,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;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 n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type");t.exports=new r("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=i.flowLevel;switch(H(r,n,i.indent,t,function(e){return function(e,t){var n,i;for(n=0,i=e.implicitTypes.length;n"+V(r,i.indent)+Z(L(function(e,t){var n,i,r=/(\n+)([^\n]*)/g,o=(s=e.indexOf("\n"),s=-1!==s?s:e.length,r.lastIndex=s,z(e.slice(0,s),t)),a="\n"===e[0]||" "===e[0];var s;for(;i=r.exec(e);){var c=i[1],u=i[2];n=" "===u[0],o+=c+(a||n||""===u?"":"\n")+z(u,t),a=n}return o}(r,t),e));case $:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function Q(e,t,n,i,r,o){e.tag=null,e.dump=n,J(e,n,!1)||J(e,n,!0);var a=p.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return!0}function X(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;ot)&&0!==i)_(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(K(e,t,b,!0,r)&&(m?d=e.result:h=e.result),m||(D(e,l,p,f,d,h,o,a),f=d=h=null),q(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)_(e,"bad indentation of a mapping entry");else if(e.lineIndentl&&(l=e.lineIndent),j(o))p++;else{if(e.lineIndent>10),56320+(c-65536&1023)),e.position++}else _(e,"unknown escape sequence");n=i=e.position}else j(s)?(T(e,n,i,!0),R(e,q(e,!1,t)),n=i=e.position):e.position===e.lineStart&&Y(e)?_(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}_(e,"unexpected end of the stream within a double quoted scalar")}(e,p)?m=!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&&!S(i)&&!E(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&_(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||_(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],q(e,!0,-1),!0}(e)?function(e,t,n){var i,r,o,a,s,c,u,l,p=e.kind,f=e.result;if(S(l=e.input.charCodeAt(e.position))||E(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(S(i=e.input.charCodeAt(e.position+1))||n&&E(i)))return!1;for(e.kind="scalar",e.result="",r=o=e.position,a=!1;0!==l;){if(58===l){if(S(i=e.input.charCodeAt(e.position+1))||n&&E(i))break}else if(35===l){if(S(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&Y(e)||n&&E(l))break;if(j(l)){if(s=e.line,c=e.lineStart,u=e.lineIndent,q(e,!1,-1),e.lineIndent>=t){a=!0,l=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(T(e,r,o,!1),R(e,e.line-s),r=o=e.position,a=!1),I(l)||(o=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,r,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,p,x===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||_(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=s&&B(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):_(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):_(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}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))&&(q(e,!0,-1),r=e.input.charCodeAt(e.position),!(0t/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var i=e("./common"),r=e("./exception"),o=e("./type");function a(e,t,i){var r=[];return e.include.forEach(function(e){i=a(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 s(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 r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=a(this,"implicit",[]),this.compiledExplicit=a(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return 0==(n=r%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),c?c.from?c.from(s):new c(s):s},predicate:function(e){return c&&c.isBuffer(e)},represent:function(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;t>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return 0==(n=o%3)?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}})},{"../type":13}],15:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("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"),r=e("../type"),o=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 a=/^[-+]?[0-9]+e/;t.exports=new r("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,i,r;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,r=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;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 n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),r=e("../type");t.exports=new r("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=2.0.0" + }, + "pkgid": "rxjs@6.3.3" + } + ] } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js index 2725ee009ea43d..99b8100cf7e372 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js @@ -7,9 +7,7 @@ exports.default = void 0; var _lodash = _interopRequireDefault(require("lodash")); -var _stringWidth = _interopRequireDefault(require("string-width")); - -var _wrapWord = _interopRequireDefault(require("./wrapWord")); +var _wrapCell = _interopRequireDefault(require("./wrapCell")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -32,11 +30,7 @@ const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { throw new Error('Column width must be greater than 0.'); } - if (useWrapWord) { - return (0, _wrapWord.default)(value, columnWidth).length; - } - - return Math.ceil((0, _stringWidth.default)(value) / columnWidth); + return (0, _wrapCell.default)(value, columnWidth, useWrapWord).length; }; var _default = calculateCellHeight; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow index 94afd3742140e1..3eca8d7ff25728 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow @@ -1,6 +1,5 @@ import _ from 'lodash'; -import stringWidth from 'string-width'; -import wrapWord from './wrapWord'; +import wrapCell from './wrapCell'; /** * @param {string} value @@ -21,9 +20,5 @@ export default (value, columnWidth, useWrapWord = false) => { throw new Error('Column width must be greater than 0.'); } - if (useWrapWord) { - return wrapWord(value, columnWidth).length; - } - - return Math.ceil(stringWidth(value) / columnWidth); + return wrapCell(value, columnWidth, useWrapWord).length; }; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map index 43ec44038f1408..f7574e1ab2d878 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","_","isString","TypeError","Number","isInteger","Error","length","Math","ceil"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;;;;;;6BAMgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAACC,gBAAEC,QAAF,CAAWJ,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIK,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBN,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAII,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIJ,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIO,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,MAAIN,WAAJ,EAAiB;AACf,WAAO,uBAASF,KAAT,EAAgBC,WAAhB,EAA6BQ,MAApC;AACD;;AAED,SAAOC,IAAI,CAACC,IAAL,CAAU,0BAAYX,KAAZ,IAAqBC,WAA/B,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\nimport wrapWord from './wrapWord';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n if (useWrapWord) {\n return wrapWord(value, columnWidth).length;\n }\n\n return Math.ceil(stringWidth(value) / columnWidth);\n};\n"],"file":"calculateCellHeight.js"} \ No newline at end of file +{"version":3,"sources":["../src/calculateCellHeight.js"],"names":["value","columnWidth","useWrapWord","_","isString","TypeError","Number","isInteger","Error","length"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;6BAMgBA,K,EAAOC,W,EAAaC,WAAW,GAAG,K,KAAU;AAC1D,MAAI,CAACC,gBAAEC,QAAF,CAAWJ,KAAX,CAAL,EAAwB;AACtB,UAAM,IAAIK,SAAJ,CAAc,yBAAd,CAAN;AACD;;AAED,MAAI,CAACC,MAAM,CAACC,SAAP,CAAiBN,WAAjB,CAAL,EAAoC;AAClC,UAAM,IAAII,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,MAAIJ,WAAW,GAAG,CAAlB,EAAqB;AACnB,UAAM,IAAIO,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAED,SAAO,uBAASR,KAAT,EAAgBC,WAAhB,EAA6BC,WAA7B,EAA0CO,MAAjD;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {string} value\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {number}\n */\nexport default (value, columnWidth, useWrapWord = false) => {\n if (!_.isString(value)) {\n throw new TypeError('Value must be a string.');\n }\n\n if (!Number.isInteger(columnWidth)) {\n throw new TypeError('Column width must be an integer.');\n }\n\n if (columnWidth < 1) {\n throw new Error('Column width must be greater than 0.');\n }\n\n return wrapCell(value, columnWidth, useWrapWord).length;\n};\n"],"file":"calculateCellHeight.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js index 8a7a16e2ce2f22..ce65717a78f0d0 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -7,9 +7,7 @@ exports.default = void 0; var _lodash = _interopRequireDefault(require("lodash")); -var _wrapString = _interopRequireDefault(require("./wrapString")); - -var _wrapWord = _interopRequireDefault(require("./wrapWord")); +var _wrapCell = _interopRequireDefault(require("./wrapCell")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -30,16 +28,9 @@ const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { cells.forEach((value, index1) => { - let chunkedValue; - - if (config.columns[index1].wrapWord) { - chunkedValue = (0, _wrapWord.default)(value, config.columns[index1].width); - } else { - chunkedValue = (0, _wrapString.default)(value, config.columns[index1].width); - } - - chunkedValue.forEach((part, index2) => { - rowHeight[index2][index1] = part; + const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; }); }); return rowHeight; diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow index 89f1869b5daa8a..6562bdfd1bad96 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow @@ -1,6 +1,5 @@ import _ from 'lodash'; -import wrapString from './wrapString'; -import wrapWord from './wrapWord'; +import wrapCell from './wrapCell'; /** * @param {Array} unmappedRows @@ -21,16 +20,10 @@ export default (unmappedRows, rowHeightIndex, config) => { // [{cell index within a virtual row; index1}] cells.forEach((value, index1) => { - let chunkedValue; + const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord); - if (config.columns[index1].wrapWord) { - chunkedValue = wrapWord(value, config.columns[index1].width); - } else { - chunkedValue = wrapString(value, config.columns[index1].width); - } - - chunkedValue.forEach((part, index2) => { - rowHeight[index2][index1] = part; + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; }); }); diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map index 3c1cd9844899ed..36e40b5ad83ceb 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","_","times","Array","fill","forEach","value","index1","chunkedValue","columns","wrapWord","width","part","index2","flatten"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAEA;;;;;;oCAMgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,gBAAEC,KAAF,CAAQV,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAII,KAAJ,CAAUT,UAAV,EAAsBU,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;;AAEAN,IAAAA,KAAK,CAACO,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,UAAIC,YAAJ;;AAEA,UAAIf,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBG,QAA3B,EAAqC;AACnCF,QAAAA,YAAY,GAAG,uBAASF,KAAT,EAAgBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,KAAvC,CAAf;AACD,OAFD,MAEO;AACLH,QAAAA,YAAY,GAAG,yBAAWF,KAAX,EAAkBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,KAAzC,CAAf;AACD;;AAEDH,MAAAA,YAAY,CAACH,OAAb,CAAqB,CAACO,IAAD,EAAOC,MAAP,KAAkB;AACrCb,QAAAA,SAAS,CAACa,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,IAA5B;AACD,OAFD;AAGD,KAZD;AAcA,WAAOZ,SAAP;AACD,GAxBkB,CAAnB;AA0BA,SAAOC,gBAAEa,OAAF,CAAUlB,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapString from './wrapString';\nimport wrapWord from './wrapWord';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {Object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n let chunkedValue;\n\n if (config.columns[index1].wrapWord) {\n chunkedValue = wrapWord(value, config.columns[index1].width);\n } else {\n chunkedValue = wrapString(value, config.columns[index1].width);\n }\n\n chunkedValue.forEach((part, index2) => {\n rowHeight[index2][index1] = part;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"} \ No newline at end of file +{"version":3,"sources":["../src/mapDataUsingRowHeightIndex.js"],"names":["unmappedRows","rowHeightIndex","config","tableWidth","length","mappedRows","map","cells","index0","rowHeight","_","times","Array","fill","forEach","value","index1","cellLines","columns","width","wrapWord","cellLine","index2","flatten"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;oCAMgBA,Y,EAAcC,c,EAAgBC,M,KAAW;AACvD,QAAMC,UAAU,GAAGH,YAAY,CAAC,CAAD,CAAZ,CAAgBI,MAAnC;AAEA,QAAMC,UAAU,GAAGL,YAAY,CAACM,GAAb,CAAiB,CAACC,KAAD,EAAQC,MAAR,KAAmB;AACrD,UAAMC,SAAS,GAAGC,gBAAEC,KAAF,CAAQV,cAAc,CAACO,MAAD,CAAtB,EAAgC,MAAM;AACtD,aAAO,IAAII,KAAJ,CAAUT,UAAV,EAAsBU,IAAtB,CAA2B,EAA3B,CAAP;AACD,KAFiB,CAAlB,CADqD,CAKrD;AACA;AACA;;;AAEAN,IAAAA,KAAK,CAACO,OAAN,CAAc,CAACC,KAAD,EAAQC,MAAR,KAAmB;AAC/B,YAAMC,SAAS,GAAG,uBAASF,KAAT,EAAgBb,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBG,KAAvC,EAA8CjB,MAAM,CAACgB,OAAP,CAAeF,MAAf,EAAuBI,QAArE,CAAlB;AAEAH,MAAAA,SAAS,CAACH,OAAV,CAAkB,CAACO,QAAD,EAAWC,MAAX,KAAsB;AACtCb,QAAAA,SAAS,CAACa,MAAD,CAAT,CAAkBN,MAAlB,IAA4BK,QAA5B;AACD,OAFD;AAGD,KAND;AAQA,WAAOZ,SAAP;AACD,GAlBkB,CAAnB;AAoBA,SAAOC,gBAAEa,OAAF,CAAUlB,UAAV,CAAP;AACD,C","sourcesContent":["import _ from 'lodash';\nimport wrapCell from './wrapCell';\n\n/**\n * @param {Array} unmappedRows\n * @param {number[]} rowHeightIndex\n * @param {Object} config\n * @returns {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n const tableWidth = unmappedRows[0].length;\n\n const mappedRows = unmappedRows.map((cells, index0) => {\n const rowHeight = _.times(rowHeightIndex[index0], () => {\n return new Array(tableWidth).fill('');\n });\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n cells.forEach((value, index1) => {\n const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord);\n\n cellLines.forEach((cellLine, index2) => {\n rowHeight[index2][index1] = cellLine;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"file":"mapDataUsingRowHeightIndex.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js index 124335cbfe794c..7fbd5ec1f561ae 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js @@ -45,9 +45,7 @@ const validateTableData = rows => { if (cells.length !== columnNumber) { throw new Error('Table must have a consistent number of cells.'); - } // @todo Make an exception for newline characters. - // @see https://github.com/gajus/table/issues/9 - + } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; @@ -58,7 +56,7 @@ const validateTableData = rows => { const cell = _step2.value; // eslint-disable-next-line no-control-regex - if (/[\u0001-\u001A]/.test(cell)) { + if (/[\u0001-\u0009\u000B-\u001A]/.test(cell)) { throw new Error('Table data must not contain control characters.'); } } diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow index 075eaf09249a45..4100f3773c5af7 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow @@ -34,11 +34,9 @@ export default (rows) => { throw new Error('Table must have a consistent number of cells.'); } - // @todo Make an exception for newline characters. - // @see https://github.com/gajus/table/issues/9 for (const cell of cells) { // eslint-disable-next-line no-control-regex - if (/[\u0001-\u001A]/.test(cell)) { + if (/[\u0001-\u0009\u000B-\u001A]/.test(cell)) { throw new Error('Table data must not contain control characters.'); } } diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map index bd892651ceb068..82b7b440259fce 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/validateTableData.js"],"names":["rows","Array","isArray","TypeError","length","Error","columnNumber","cells","cell","test"],"mappings":";;;;;;;AAAA;;;;AAIA;;;;AAIA;;;;0BAIgBA,I,IAAS;AACvB,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,IAAd,CAAL,EAA0B;AACxB,UAAM,IAAIG,SAAJ,CAAc,8BAAd,CAAN;AACD;;AAED,MAAIH,IAAI,CAACI,MAAL,KAAgB,CAApB,EAAuB;AACrB,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIL,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAR,KAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;AACD;;AAED,QAAMC,YAAY,GAAGN,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAA7B;AAbuB;AAAA;AAAA;;AAAA;AAevB,yBAAoBJ,IAApB,8HAA0B;AAAA,YAAfO,KAAe;;AACxB,UAAI,CAACN,KAAK,CAACC,OAAN,CAAcK,KAAd,CAAL,EAA2B;AACzB,cAAM,IAAIJ,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,UAAII,KAAK,CAACH,MAAN,KAAiBE,YAArB,EAAmC;AACjC,cAAM,IAAID,KAAJ,CAAU,+CAAV,CAAN;AACD,OAPuB,CASxB;AACA;;;AAVwB;AAAA;AAAA;;AAAA;AAWxB,8BAAmBE,KAAnB,mIAA0B;AAAA,gBAAfC,IAAe;;AACxB;AACA,cAAI,kBAAkBC,IAAlB,CAAuBD,IAAvB,CAAJ,EAAkC;AAChC,kBAAM,IAAIH,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF;AAhBuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBzB;AAhCsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCxB,C","sourcesContent":["/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {column[]} rows\n * @returns {undefined}\n */\nexport default (rows) => {\n if (!Array.isArray(rows)) {\n throw new TypeError('Table data must be an array.');\n }\n\n if (rows.length === 0) {\n throw new Error('Table must define at least one row.');\n }\n\n if (rows[0].length === 0) {\n throw new Error('Table must define at least one column.');\n }\n\n const columnNumber = rows[0].length;\n\n for (const cells of rows) {\n if (!Array.isArray(cells)) {\n throw new TypeError('Table row data must be an array.');\n }\n\n if (cells.length !== columnNumber) {\n throw new Error('Table must have a consistent number of cells.');\n }\n\n // @todo Make an exception for newline characters.\n // @see https://github.com/gajus/table/issues/9\n for (const cell of cells) {\n // eslint-disable-next-line no-control-regex\n if (/[\\u0001-\\u001A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n }\n }\n};\n"],"file":"validateTableData.js"} \ No newline at end of file +{"version":3,"sources":["../src/validateTableData.js"],"names":["rows","Array","isArray","TypeError","length","Error","columnNumber","cells","cell","test"],"mappings":";;;;;;;AAAA;;;;AAIA;;;;AAIA;;;;0BAIgBA,I,IAAS;AACvB,MAAI,CAACC,KAAK,CAACC,OAAN,CAAcF,IAAd,CAAL,EAA0B;AACxB,UAAM,IAAIG,SAAJ,CAAc,8BAAd,CAAN;AACD;;AAED,MAAIH,IAAI,CAACI,MAAL,KAAgB,CAApB,EAAuB;AACrB,UAAM,IAAIC,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,MAAIL,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAAR,KAAmB,CAAvB,EAA0B;AACxB,UAAM,IAAIC,KAAJ,CAAU,wCAAV,CAAN;AACD;;AAED,QAAMC,YAAY,GAAGN,IAAI,CAAC,CAAD,CAAJ,CAAQI,MAA7B;AAbuB;AAAA;AAAA;;AAAA;AAevB,yBAAoBJ,IAApB,8HAA0B;AAAA,YAAfO,KAAe;;AACxB,UAAI,CAACN,KAAK,CAACC,OAAN,CAAcK,KAAd,CAAL,EAA2B;AACzB,cAAM,IAAIJ,SAAJ,CAAc,kCAAd,CAAN;AACD;;AAED,UAAII,KAAK,CAACH,MAAN,KAAiBE,YAArB,EAAmC;AACjC,cAAM,IAAID,KAAJ,CAAU,+CAAV,CAAN;AACD;;AAPuB;AAAA;AAAA;;AAAA;AASxB,8BAAmBE,KAAnB,mIAA0B;AAAA,gBAAfC,IAAe;;AACxB;AACA,cAAI,+BAA+BC,IAA/B,CAAoCD,IAApC,CAAJ,EAA+C;AAC7C,kBAAM,IAAIH,KAAJ,CAAU,iDAAV,CAAN;AACD;AACF;AAduB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAezB;AA9BsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BxB,C","sourcesContent":["/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {column[]} rows\n * @returns {undefined}\n */\nexport default (rows) => {\n if (!Array.isArray(rows)) {\n throw new TypeError('Table data must be an array.');\n }\n\n if (rows.length === 0) {\n throw new Error('Table must define at least one row.');\n }\n\n if (rows[0].length === 0) {\n throw new Error('Table must define at least one column.');\n }\n\n const columnNumber = rows[0].length;\n\n for (const cells of rows) {\n if (!Array.isArray(cells)) {\n throw new TypeError('Table row data must be an array.');\n }\n\n if (cells.length !== columnNumber) {\n throw new Error('Table must have a consistent number of cells.');\n }\n\n for (const cell of cells) {\n // eslint-disable-next-line no-control-regex\n if (/[\\u0001-\\u0009\\u000B-\\u001A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n }\n }\n};\n"],"file":"validateTableData.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js new file mode 100644 index 00000000000000..3bddc4cbf05f9e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js @@ -0,0 +1,48 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _wrapString = _interopRequireDefault(require("./wrapString")); + +var _wrapWord = _interopRequireDefault(require("./wrapWord")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + * @param {string} cellValue + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {Array} + */ +const wrapCell = (cellValue, columnWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = cellValue.split('\n'); // Then iterate over the list and word-wrap every remaining line if necessary. + + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + + if (useWrapWord) { + lineChunks = (0, _wrapWord.default)(cellLines[lineNr], columnWidth); + } else { + lineChunks = (0, _wrapString.default)(cellLines[lineNr], columnWidth); + } // Replace our original array element with whatever the wrapping returned + + + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + + return cellLines; +}; + +var _default = wrapCell; +exports.default = _default; +//# sourceMappingURL=wrapCell.js.map \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow new file mode 100644 index 00000000000000..0c66260e2599f9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow @@ -0,0 +1,35 @@ +import wrapString from './wrapString'; +import wrapWord from './wrapWord'; + +/** + * Wrap a single cell value into a list of lines + * + * Always wraps on newlines, for the remainder uses either word or string wrapping + * depending on user configuration. + * + * @param {string} cellValue + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {Array} + */ +export default (cellValue, columnWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = cellValue.split('\n'); + + // Then iterate over the list and word-wrap every remaining line if necessary. + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + + if (useWrapWord) { + lineChunks = wrapWord(cellLines[lineNr], columnWidth); + } else { + lineChunks = wrapString(cellLines[lineNr], columnWidth); + } + + // Replace our original array element with whatever the wrapping returned + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + + return cellLines; +}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.map b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.map new file mode 100644 index 00000000000000..79b36d1d285023 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/wrapCell.js"],"names":["cellValue","columnWidth","useWrapWord","cellLines","split","lineNr","length","lineChunks","splice"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;;;;;kBAWgBA,S,EAAWC,W,EAAaC,W,KAAgB;AACtD;AACA,QAAMC,SAAS,GAAGH,SAAS,CAACI,KAAV,CAAgB,IAAhB,CAAlB,CAFsD,CAItD;;AACA,OAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,SAAS,CAACG,MAAxC,GAAiD;AAC/C,QAAIC,UAAJ;;AAEA,QAAIL,WAAJ,EAAiB;AACfK,MAAAA,UAAU,GAAG,uBAASJ,SAAS,CAACE,MAAD,CAAlB,EAA4BJ,WAA5B,CAAb;AACD,KAFD,MAEO;AACLM,MAAAA,UAAU,GAAG,yBAAWJ,SAAS,CAACE,MAAD,CAApB,EAA8BJ,WAA9B,CAAb;AACD,KAP8C,CAS/C;;;AACAE,IAAAA,SAAS,CAACK,MAAV,CAAiBH,MAAjB,EAAyB,CAAzB,EAA4B,GAAGE,UAA/B;AACAF,IAAAA,MAAM,IAAIE,UAAU,CAACD,MAArB;AACD;;AAED,SAAOH,SAAP;AACD,C","sourcesContent":["import wrapString from './wrapString';\nimport wrapWord from './wrapWord';\n\n/**\n * Wrap a single cell value into a list of lines\n *\n * Always wraps on newlines, for the remainder uses either word or string wrapping\n * depending on user configuration.\n *\n * @param {string} cellValue\n * @param {number} columnWidth\n * @param {boolean} useWrapWord\n * @returns {Array}\n */\nexport default (cellValue, columnWidth, useWrapWord) => {\n // First split on literal newlines\n const cellLines = cellValue.split('\\n');\n\n // Then iterate over the list and word-wrap every remaining line if necessary.\n for (let lineNr = 0; lineNr < cellLines.length;) {\n let lineChunks;\n\n if (useWrapWord) {\n lineChunks = wrapWord(cellLines[lineNr], columnWidth);\n } else {\n lineChunks = wrapString(cellLines[lineNr], columnWidth);\n }\n\n // Replace our original array element with whatever the wrapping returned\n cellLines.splice(lineNr, 1, ...lineChunks);\n lineNr += lineChunks.length;\n }\n\n return cellLines;\n};\n"],"file":"wrapCell.js"} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index ea3580ca152692..0a2b3fd45ebd72 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -85,5 +85,5 @@ "lint": "npm run build && eslint ./src ./test && flow", "test": "mocha --require @babel/register" }, - "version": "5.1.1" + "version": "5.2.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index fe0f39cd1a59a8..0543d07cb85888 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -134,5 +134,5 @@ "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test" }, - "version": "5.12.0" + "version": "5.12.1" } \ No newline at end of file