From 34212b531fea833b608469113260406f376e5417 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 8 Dec 2018 08:42:29 -0500 Subject: [PATCH] tools: update ESLint to 5.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update ESLint to 5.10.0. PR-URL: https://github.com/nodejs/node/pull/24903 Reviewed-By: Ruben Bridgewater Reviewed-By: Michaël Zasso Reviewed-By: Franziska Hinkelmann --- tools/node_modules/eslint/README.md | 4 +- tools/node_modules/eslint/lib/cli-engine.js | 2 +- tools/node_modules/eslint/lib/config.js | 17 +- .../eslint/lib/config/autoconfig.js | 1 - .../eslint/lib/config/config-rule.js | 8 +- .../eslint/lib/config/config-validator.js | 4 +- tools/node_modules/eslint/lib/linter.js | 128 +----- .../eslint/lib/rules/array-element-newline.js | 1 - .../eslint/lib/rules/camelcase.js | 19 +- .../eslint/lib/rules/comma-style.js | 9 +- tools/node_modules/eslint/lib/rules/eqeqeq.js | 1 - .../eslint/lib/rules/handle-callback-err.js | 2 +- .../lib/rules/implicit-arrow-linebreak.js | 1 - .../eslint/lib/rules/indent-legacy.js | 3 - tools/node_modules/eslint/lib/rules/indent.js | 6 +- .../eslint/lib/rules/keyword-spacing.js | 6 +- .../eslint/lib/rules/newline-before-return.js | 2 +- .../eslint/lib/rules/no-constant-condition.js | 1 - .../eslint/lib/rules/no-else-return.js | 1 - .../eslint/lib/rules/no-implied-eval.js | 2 +- .../eslint/lib/rules/no-restricted-imports.js | 2 +- .../eslint/lib/rules/no-this-before-super.js | 1 - .../eslint/lib/rules/object-curly-newline.js | 1 - .../node_modules/eslint/lib/rules/one-var.js | 1 - .../rules/padding-line-between-statements.js | 37 ++ tools/node_modules/eslint/lib/rules/quotes.js | 73 +-- .../eslint/lib/rules/require-jsdoc.js | 5 +- .../eslint/lib/rules/space-in-parens.js | 1 - .../eslint/lib/rules/space-infix-ops.js | 5 +- .../eslint/lib/rules/valid-jsdoc.js | 5 +- .../eslint/lib/util/config-comment-parser.js | 144 ++++++ .../eslint/lib/util/glob-utils.js | 2 +- .../eslint/lib/{ => util}/ignored-paths.js | 8 +- .../lib/{ => util}/report-translator.js | 4 +- .../eslint/lib/util/source-code.js | 3 +- .../eslint/messages/all-files-ignored.txt | 2 +- .../eslint/node_modules/acorn-jsx/index.js | 22 +- .../node_modules/acorn-jsx/package.json | 2 +- .../eslint/node_modules/ajv/README.md | 2 + .../node_modules/ajv/dist/ajv.bundle.js | 97 ++-- .../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 | 6 +- .../eslint/node_modules/ajv/lib/ajv.js | 5 +- .../node_modules/ajv/lib/dot/validate.jst | 10 + .../node_modules/ajv/lib/dotjs/validate.js | 8 + .../eslint/node_modules/ajv/package.json | 4 +- .../eslint/node_modules/array-union/index.js | 6 - .../eslint/node_modules/array-union/license | 21 - .../node_modules/array-union/package.json | 49 -- .../eslint/node_modules/array-union/readme.md | 28 -- .../eslint/node_modules/array-uniq/index.js | 62 --- .../eslint/node_modules/array-uniq/license | 21 - .../node_modules/array-uniq/package.json | 46 -- .../eslint/node_modules/array-uniq/readme.md | 30 -- .../eslint/node_modules/astral-regex/index.js | 4 + .../{pify => astral-regex}/license | 2 +- .../node_modules/astral-regex/package.json | 41 ++ .../node_modules/astral-regex/readme.md | 43 ++ .../eslint/node_modules/del/index.js | 70 --- .../eslint/node_modules/del/package.json | 70 --- .../eslint/node_modules/del/readme.md | 121 ----- .../eslint/node_modules/espree/README.md | 13 +- .../eslint/node_modules/espree/espree.js | 7 +- .../espree/lib/comment-attachment.js | 175 -------- .../eslint/node_modules/espree/lib/espree.js | 35 +- .../espree/lib/token-translator.js | 28 +- .../node_modules/espree/lib/visitor-keys.js | 123 +++++ .../eslint/node_modules/espree/package.json | 7 +- .../eslint/node_modules/flat-cache/cache.js | 14 +- .../node_modules/flat-cache/changelog.md | 177 ++++---- .../eslint/node_modules/flat-cache/del.js | 13 + .../node_modules/flat-cache/package.json | 11 +- .../eslint/node_modules/flat-cache/utils.js | 4 +- .../eslint/node_modules/globals/globals.json | 5 + .../eslint/node_modules/globals/package.json | 2 +- .../eslint/node_modules/globby/index.js | 88 ---- .../eslint/node_modules/globby/license | 21 - .../globby/node_modules/pify/index.js | 68 --- .../globby/node_modules/pify/license | 21 - .../globby/node_modules/pify/package.json | 57 --- .../globby/node_modules/pify/readme.md | 119 ----- .../eslint/node_modules/globby/package.json | 78 ---- .../eslint/node_modules/globby/readme.md | 88 ---- .../eslint/node_modules/inquirer/README.md | 424 ++++++++++++++++++ .../inquirer/lib/prompts/checkbox.js | 4 +- .../inquirer/lib/prompts/password.js | 8 +- .../inquirer/lib/prompts/rawlist.js | 32 ++ .../inquirer/node_modules/ansi-regex/index.js | 14 + .../node_modules/ansi-regex}/license | 0 .../node_modules/ansi-regex/package.json | 62 +++ .../node_modules/ansi-regex/readme.md | 65 +++ .../inquirer/node_modules/strip-ansi/index.js | 4 + .../node_modules/strip-ansi}/license | 0 .../node_modules/strip-ansi/package.json | 61 +++ .../node_modules/strip-ansi/readme.md | 53 +++ .../eslint/node_modules/inquirer/package.json | 17 +- .../eslint/node_modules/is-path-cwd/index.js | 6 - .../node_modules/is-path-cwd/package.json | 42 -- .../eslint/node_modules/is-path-cwd/readme.md | 28 -- .../node_modules/is-path-in-cwd/index.js | 6 - .../node_modules/is-path-in-cwd/license | 21 - .../node_modules/is-path-in-cwd/package.json | 47 -- .../node_modules/is-path-in-cwd/readme.md | 31 -- .../node_modules/is-path-inside/index.js | 14 - .../node_modules/is-path-inside/license | 21 - .../node_modules/is-path-inside/package.json | 46 -- .../node_modules/is-path-inside/readme.md | 34 -- .../eslint/node_modules/is-resolvable/LICENSE | 6 - .../node_modules/is-resolvable/README.md | 73 --- .../node_modules/is-resolvable/index.js | 16 - .../node_modules/is-resolvable/package.json | 49 -- .../eslint/node_modules/p-map/index.js | 67 --- .../eslint/node_modules/p-map/package.json | 56 --- .../eslint/node_modules/p-map/readme.md | 81 ---- .../eslint/node_modules/pify/index.js | 84 ---- .../eslint/node_modules/pify/package.json | 60 --- .../eslint/node_modules/pify/readme.md | 131 ------ .../node_modules/pinkie-promise/index.js | 3 - .../node_modules/pinkie-promise/license | 21 - .../node_modules/pinkie-promise/package.json | 44 -- .../node_modules/pinkie-promise/readme.md | 28 -- .../eslint/node_modules/pinkie/index.js | 292 ------------ .../eslint/node_modules/pinkie/license | 21 - .../eslint/node_modules/pinkie/package.json | 45 -- .../eslint/node_modules/pinkie/readme.md | 83 ---- .../progress/lib/node-progress.js | 7 +- .../eslint/node_modules/progress/package.json | 2 +- .../eslint/node_modules/slice-ansi/index.js | 50 +-- .../node_modules/slice-ansi/package.json | 16 +- .../eslint/node_modules/slice-ansi/readme.md | 2 +- .../eslint/node_modules/table/package.json | 28 +- .../node_modules/vfile-location/index.js | 19 +- .../node_modules/vfile-location/package.json | 20 +- .../node_modules/vfile-location/readme.md | 27 +- .../node_modules/vfile-message/index.js | 20 +- .../node_modules/vfile-message/package.json | 18 +- .../node_modules/vfile-message/readme.md | 27 +- tools/node_modules/eslint/package.json | 7 +- 139 files changed, 1655 insertions(+), 3230 deletions(-) create mode 100644 tools/node_modules/eslint/lib/util/config-comment-parser.js rename tools/node_modules/eslint/lib/{ => util}/ignored-paths.js (98%) rename tools/node_modules/eslint/lib/{ => util}/report-translator.js (99%) delete mode 100644 tools/node_modules/eslint/node_modules/array-union/index.js delete mode 100644 tools/node_modules/eslint/node_modules/array-union/license delete mode 100644 tools/node_modules/eslint/node_modules/array-union/package.json delete mode 100644 tools/node_modules/eslint/node_modules/array-union/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/array-uniq/index.js delete mode 100644 tools/node_modules/eslint/node_modules/array-uniq/license delete mode 100644 tools/node_modules/eslint/node_modules/array-uniq/package.json delete mode 100644 tools/node_modules/eslint/node_modules/array-uniq/readme.md create mode 100644 tools/node_modules/eslint/node_modules/astral-regex/index.js rename tools/node_modules/eslint/node_modules/{pify => astral-regex}/license (92%) create mode 100644 tools/node_modules/eslint/node_modules/astral-regex/package.json create mode 100644 tools/node_modules/eslint/node_modules/astral-regex/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/del/index.js delete mode 100644 tools/node_modules/eslint/node_modules/del/package.json delete mode 100644 tools/node_modules/eslint/node_modules/del/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/espree/lib/comment-attachment.js create mode 100644 tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js create mode 100644 tools/node_modules/eslint/node_modules/flat-cache/del.js delete mode 100644 tools/node_modules/eslint/node_modules/globby/index.js delete mode 100644 tools/node_modules/eslint/node_modules/globby/license delete mode 100644 tools/node_modules/eslint/node_modules/globby/node_modules/pify/index.js delete mode 100644 tools/node_modules/eslint/node_modules/globby/node_modules/pify/license delete mode 100644 tools/node_modules/eslint/node_modules/globby/node_modules/pify/package.json delete mode 100644 tools/node_modules/eslint/node_modules/globby/node_modules/pify/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/globby/package.json delete mode 100644 tools/node_modules/eslint/node_modules/globby/readme.md create mode 100644 tools/node_modules/eslint/node_modules/inquirer/README.md create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js rename tools/node_modules/eslint/node_modules/{del => inquirer/node_modules/ansi-regex}/license (100%) create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js rename tools/node_modules/eslint/node_modules/{p-map => inquirer/node_modules/strip-ansi}/license (100%) create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json create mode 100644 tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/is-path-cwd/index.js delete mode 100644 tools/node_modules/eslint/node_modules/is-path-cwd/package.json delete mode 100644 tools/node_modules/eslint/node_modules/is-path-cwd/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/is-path-in-cwd/index.js delete mode 100644 tools/node_modules/eslint/node_modules/is-path-in-cwd/license delete mode 100644 tools/node_modules/eslint/node_modules/is-path-in-cwd/package.json delete mode 100644 tools/node_modules/eslint/node_modules/is-path-in-cwd/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/is-path-inside/index.js delete mode 100644 tools/node_modules/eslint/node_modules/is-path-inside/license delete mode 100644 tools/node_modules/eslint/node_modules/is-path-inside/package.json delete mode 100644 tools/node_modules/eslint/node_modules/is-path-inside/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/is-resolvable/LICENSE delete mode 100644 tools/node_modules/eslint/node_modules/is-resolvable/README.md delete mode 100644 tools/node_modules/eslint/node_modules/is-resolvable/index.js delete mode 100644 tools/node_modules/eslint/node_modules/is-resolvable/package.json delete mode 100644 tools/node_modules/eslint/node_modules/p-map/index.js delete mode 100644 tools/node_modules/eslint/node_modules/p-map/package.json delete mode 100644 tools/node_modules/eslint/node_modules/p-map/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/pify/index.js delete mode 100644 tools/node_modules/eslint/node_modules/pify/package.json delete mode 100644 tools/node_modules/eslint/node_modules/pify/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/pinkie-promise/index.js delete mode 100644 tools/node_modules/eslint/node_modules/pinkie-promise/license delete mode 100644 tools/node_modules/eslint/node_modules/pinkie-promise/package.json delete mode 100644 tools/node_modules/eslint/node_modules/pinkie-promise/readme.md delete mode 100644 tools/node_modules/eslint/node_modules/pinkie/index.js delete mode 100644 tools/node_modules/eslint/node_modules/pinkie/license delete mode 100644 tools/node_modules/eslint/node_modules/pinkie/package.json delete mode 100644 tools/node_modules/eslint/node_modules/pinkie/readme.md diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index 572cd8a07af831..65ee43400d729f 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -38,7 +38,7 @@ If you want to include ESLint as part of your project's build system, we recomme $ npm install eslint --save-dev ``` -You should then setup a configuration file: +You should then set up a configuration file: ``` $ ./node_modules/.bin/eslint --init @@ -60,7 +60,7 @@ If you want to make ESLint available to tools that run across all of your projec $ npm install -g eslint ``` -You should then setup a configuration file: +You should then set up a configuration file: ``` $ eslint --init diff --git a/tools/node_modules/eslint/lib/cli-engine.js b/tools/node_modules/eslint/lib/cli-engine.js index 652d68b59b4953..ce9fe289b8c626 100644 --- a/tools/node_modules/eslint/lib/cli-engine.js +++ b/tools/node_modules/eslint/lib/cli-engine.js @@ -20,7 +20,7 @@ const fs = require("fs"), defaultOptions = require("../conf/default-cli-options"), Linter = require("./linter"), lodash = require("lodash"), - IgnoredPaths = require("./ignored-paths"), + IgnoredPaths = require("./util/ignored-paths"), Config = require("./config"), ConfigOps = require("./config/config-ops"), LintResultCache = require("./util/lint-result-cache"), diff --git a/tools/node_modules/eslint/lib/config.js b/tools/node_modules/eslint/lib/config.js index 8ea9aeb6f377b9..abcb38b50d5338 100644 --- a/tools/node_modules/eslint/lib/config.js +++ b/tools/node_modules/eslint/lib/config.js @@ -15,8 +15,7 @@ const path = require("path"), ConfigFile = require("./config/config-file"), ConfigCache = require("./config/config-cache"), Plugins = require("./config/plugins"), - FileFinder = require("./util/file-finder"), - isResolvable = require("is-resolvable"); + FileFinder = require("./util/file-finder"); const debug = require("debug")("eslint:config"); @@ -41,6 +40,20 @@ function hasRules(options) { return options.rules && Object.keys(options.rules).length > 0; } +/** + * Determines if a module is can be resolved. + * @param {string} moduleId The ID (name) of the module + * @returns {boolean} True if it is resolvable; False otherwise. + */ +function isResolvable(moduleId) { + try { + require.resolve(moduleId); + return true; + } catch (err) { + return false; + } +} + //------------------------------------------------------------------------------ // API //------------------------------------------------------------------------------ diff --git a/tools/node_modules/eslint/lib/config/autoconfig.js b/tools/node_modules/eslint/lib/config/autoconfig.js index 8536fdc55ad733..f2c707be843876 100644 --- a/tools/node_modules/eslint/lib/config/autoconfig.js +++ b/tools/node_modules/eslint/lib/config/autoconfig.js @@ -102,7 +102,6 @@ class Registry { * * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS. * - * @param {Object} registry The autoconfig registry * @returns {Object[]} "rules" configurations to use for linting */ buildRuleSets() { diff --git a/tools/node_modules/eslint/lib/config/config-rule.js b/tools/node_modules/eslint/lib/config/config-rule.js index 27d29446dbb39c..e4221406df12c5 100644 --- a/tools/node_modules/eslint/lib/config/config-rule.js +++ b/tools/node_modules/eslint/lib/config/config-rule.js @@ -37,9 +37,9 @@ function explodeArray(xs) { * For example: * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]] * - * @param {array} arr1 The first array to combine. - * @param {array} arr2 The second array to combine. - * @returns {array} A mixture of the elements of the first and second arrays. + * @param {Array} arr1 The first array to combine. + * @param {Array} arr2 The second array to combine. + * @returns {Array} A mixture of the elements of the first and second arrays. */ function combineArrays(arr1, arr2) { const res = []; @@ -268,7 +268,7 @@ class RuleConfigSet { /** * Generate valid rule configurations based on a schema object * @param {Object} schema A rule's schema object - * @returns {array[]} Valid rule configurations + * @returns {Array[]} Valid rule configurations */ function generateConfigsFromSchema(schema) { const configSet = new RuleConfigSet(); diff --git a/tools/node_modules/eslint/lib/config/config-validator.js b/tools/node_modules/eslint/lib/config/config-validator.js index 6b151f46a496cc..0c63b68f76c943 100644 --- a/tools/node_modules/eslint/lib/config/config-validator.js +++ b/tools/node_modules/eslint/lib/config/config-validator.js @@ -83,7 +83,7 @@ function validateRuleSeverity(options) { /** * Validates the non-severity options passed to a rule, based on its schema. * @param {{create: Function}} rule The rule to validate - * @param {array} localOptions The options for the rule, excluding severity + * @param {Array} localOptions The options for the rule, excluding severity * @returns {void} */ function validateRuleSchema(rule, localOptions) { @@ -111,7 +111,7 @@ function validateRuleSchema(rule, localOptions) { * Validates a rule's options against its schema. * @param {{create: Function}|null} rule The rule that the config is being validated for * @param {string} ruleId The rule's unique name. - * @param {array|number} options The given options for the rule. + * @param {Array|number} options The given options for the rule. * @param {string|null} source The name of the configuration source to report in any errors. If null or undefined, * no source is prepended to the message. * @returns {void} diff --git a/tools/node_modules/eslint/lib/linter.js b/tools/node_modules/eslint/lib/linter.js index b47e6eb1fcfb6a..d6d635f9f47d79 100644 --- a/tools/node_modules/eslint/lib/linter.js +++ b/tools/node_modules/eslint/lib/linter.js @@ -11,7 +11,6 @@ const eslintScope = require("eslint-scope"), evk = require("eslint-visitor-keys"), - levn = require("levn"), lodash = require("lodash"), CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer"), ConfigOps = require("./config/config-ops"), @@ -22,9 +21,10 @@ const eslintScope = require("eslint-scope"), NodeEventGenerator = require("./util/node-event-generator"), SourceCode = require("./util/source-code"), Traverser = require("./util/traverser"), - createReportTranslator = require("./report-translator"), + createReportTranslator = require("./util/report-translator"), Rules = require("./rules"), timing = require("./util/timing"), + ConfigCommentParser = require("./util/config-comment-parser"), astUtils = require("./util/ast-utils"), pkg = require("../package.json"), SourceCodeFixer = require("./util/source-code-fixer"); @@ -32,6 +32,7 @@ const eslintScope = require("eslint-scope"), const debug = require("debug")("eslint:linter"); const MAX_AUTOFIX_PASSES = 10; const DEFAULT_PARSER_NAME = "espree"; +const commentParser = new ConfigCommentParser(); //------------------------------------------------------------------------------ // Typedefs @@ -59,117 +60,6 @@ const DEFAULT_PARSER_NAME = "espree"; // Helpers //------------------------------------------------------------------------------ -/** - * Parses a list of "name:boolean_value" or/and "name" options divided by comma or - * whitespace. - * @param {string} string The string to parse. - * @param {Comment} comment The comment node which has the string. - * @returns {Object} Result map object of names and boolean values - */ -function parseBooleanConfig(string, comment) { - const items = {}; - - // Collapse whitespace around `:` and `,` to make parsing easier - const trimmedString = string.replace(/\s*([:,])\s*/g, "$1"); - - trimmedString.split(/\s|,+/).forEach(name => { - if (!name) { - return; - } - const pos = name.indexOf(":"); - - if (pos === -1) { - items[name] = { - value: false, - comment - }; - } else { - items[name.slice(0, pos)] = { - value: name.slice(pos + 1) === "true", - comment - }; - } - }); - return items; -} - -/** - * Parses a JSON-like config. - * @param {string} string The string to parse. - * @param {Object} location Start line and column of comments for potential error message. - * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object - */ -function parseJsonConfig(string, location) { - let items = {}; - - // Parses a JSON-like comment by the same way as parsing CLI option. - try { - items = levn.parse("Object", string) || {}; - - // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. - // Also, commaless notations have invalid severity: - // "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"} - // Should ignore that case as well. - if (ConfigOps.isEverySeverityValid(items)) { - return { - success: true, - config: items - }; - } - } catch (ex) { - - // ignore to parse the string by a fallback. - } - - /* - * Optionator cannot parse commaless notations. - * But we are supporting that. So this is a fallback for that. - */ - items = {}; - const normalizedString = string.replace(/([a-zA-Z0-9\-/]+):/g, "\"$1\":").replace(/(]|[0-9])\s+(?=")/, "$1,"); - - try { - items = JSON.parse(`{${normalizedString}}`); - } catch (ex) { - return { - success: false, - error: { - ruleId: null, - fatal: true, - severity: 2, - message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, - line: location.start.line, - column: location.start.column + 1 - } - }; - - } - - return { - success: true, - config: items - }; -} - -/** - * Parses a config of values separated by comma. - * @param {string} string The string to parse. - * @returns {Object} Result map of values and true values - */ -function parseListConfig(string) { - const items = {}; - - // Collapse whitespace around , - string.replace(/\s*,\s*/g, ",").split(/,+/).forEach(name => { - const trimmedName = name.trim(); - - if (trimmedName) { - items[trimmedName] = true; - } - }); - return items; -} - /** * Ensures that variables representing built-in properties of the Global Object, * and any globals declared by special block comments, are present in the global @@ -248,7 +138,7 @@ function addDeclaredGlobals(globalScope, configGlobals, commentDirectives) { * @returns {DisableDirective[]} Directives from the comment */ function createDisableDirectives(type, loc, value) { - const ruleIds = Object.keys(parseListConfig(value)); + const ruleIds = Object.keys(commentParser.parseListConfig(value)); const directiveRules = ruleIds.length ? ruleIds : [null]; return directiveRules.map(ruleId => ({ type, line: loc.line, column: loc.column + 1, ruleId })); @@ -301,12 +191,12 @@ function getDirectiveComments(filename, ast, ruleMapper) { } else if (comment.type === "Block") { switch (match[1]) { case "exported": - Object.assign(exportedVariables, parseBooleanConfig(directiveValue, comment)); + Object.assign(exportedVariables, commentParser.parseBooleanConfig(directiveValue, comment)); break; case "globals": case "global": - Object.assign(enabledGlobals, parseBooleanConfig(directiveValue, comment)); + Object.assign(enabledGlobals, commentParser.parseBooleanConfig(directiveValue, comment)); break; case "eslint-disable": @@ -318,7 +208,7 @@ function getDirectiveComments(filename, ast, ruleMapper) { break; case "eslint": { - const parseResult = parseJsonConfig(directiveValue, comment.loc); + const parseResult = commentParser.parseJsonConfig(directiveValue, comment.loc); if (parseResult.success) { Object.keys(parseResult.config).forEach(name => { @@ -398,7 +288,7 @@ function findEslintEnv(text) { eslintEnvPattern.lastIndex = 0; while ((match = eslintEnvPattern.exec(text))) { - retv = Object.assign(retv || {}, parseListConfig(match[1])); + retv = Object.assign(retv || {}, commentParser.parseListConfig(match[1])); } return retv; @@ -1032,8 +922,6 @@ module.exports = class Linter { * @param {(string|Object)} [filenameOrOptions] The optional filename of the file being checked. * If this is not set, the filename will default to '' in the rule context. If * an object, then it has "filename", "saveState", and "allowInlineConfig" properties. - * @param {boolean} [saveState] Indicates if the state from the last run should be saved. - * Mostly useful for testing purposes. * @param {boolean} [filenameOrOptions.allowInlineConfig] Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied. * Useful if you want to validate JS without comments overriding rules. * @param {function(string): string[]} [filenameOrOptions.preprocess] preprocessor for source text. If provided, diff --git a/tools/node_modules/eslint/lib/rules/array-element-newline.js b/tools/node_modules/eslint/lib/rules/array-element-newline.js index 440290917d39b0..dadb26fdd226de 100644 --- a/tools/node_modules/eslint/lib/rules/array-element-newline.js +++ b/tools/node_modules/eslint/lib/rules/array-element-newline.js @@ -173,7 +173,6 @@ module.exports = { * Reports a given node if it violated this rule. * * @param {ASTNode} node - A node to check. This is an ObjectExpression node or an ObjectPattern node. - * @param {{multiline: boolean, minItems: number}} options - An option object. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/camelcase.js b/tools/node_modules/eslint/lib/rules/camelcase.js index 8aeb4b5bd0df92..6fb8760f105346 100644 --- a/tools/node_modules/eslint/lib/rules/camelcase.js +++ b/tools/node_modules/eslint/lib/rules/camelcase.js @@ -132,9 +132,10 @@ module.exports = { /* * Leading and trailing underscores are commonly used to flag - * private/protected identifiers, strip them + * private/protected identifiers, strip them before checking if underscored */ - const name = node.name.replace(/^_+|_+$/g, ""), + const name = node.name, + nameIsUnderscored = isUnderscored(name.replace(/^_+|_+$/g, "")), effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; // First, we ignore the node if it match the ignore list @@ -151,11 +152,11 @@ module.exports = { } // Always report underscored object names - if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && isUnderscored(name)) { + if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && nameIsUnderscored) { report(node); // Report AssignmentExpressions only if they are the left side of the assignment - } else if (effectiveParent.type === "AssignmentExpression" && isUnderscored(name) && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { + } else if (effectiveParent.type === "AssignmentExpression" && nameIsUnderscored && (effectiveParent.right.type !== "MemberExpression" || effectiveParent.left.type === "MemberExpression" && effectiveParent.left.property.name === node.name)) { report(node); } @@ -167,7 +168,7 @@ module.exports = { } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { - if (node.parent.shorthand && node.parent.value.left && isUnderscored(name)) { + if (node.parent.shorthand && node.parent.value.left && nameIsUnderscored) { report(node); } @@ -179,7 +180,7 @@ module.exports = { return; } - const valueIsUnderscored = node.parent.value.name && isUnderscored(name); + const valueIsUnderscored = node.parent.value.name && nameIsUnderscored; // ignore destructuring if the option is set, unless a new identifier is created if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { @@ -193,7 +194,7 @@ module.exports = { } // don't check right hand side of AssignmentExpression to prevent duplicate warnings - if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { report(node); } @@ -201,12 +202,12 @@ module.exports = { } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].indexOf(node.parent.type) >= 0) { // Report only if the local imported identifier is underscored - if (node.parent.local && node.parent.local.name === node.name && isUnderscored(name)) { + if (node.parent.local && node.parent.local.name === node.name && nameIsUnderscored) { report(node); } // Report anything that is underscored that isn't a CallExpression - } else if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + } else if (nameIsUnderscored && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { report(node); } } diff --git a/tools/node_modules/eslint/lib/rules/comma-style.js b/tools/node_modules/eslint/lib/rules/comma-style.js index 2586cf66e9226b..78438a858dbb12 100644 --- a/tools/node_modules/eslint/lib/rules/comma-style.js +++ b/tools/node_modules/eslint/lib/rules/comma-style.js @@ -85,7 +85,7 @@ module.exports = { function getReplacedText(styleType, text) { switch (styleType) { case "between": - return `,${text.replace("\n", "")}`; + return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`; case "first": return `${text},`; @@ -138,6 +138,11 @@ module.exports = { } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { + const comment = sourceCode.getCommentsAfter(commaToken)[0]; + const styleType = comment && comment.type === "Block" && astUtils.isTokenOnSameLine(commaToken, comment) + ? style + : "between"; + // lone comma context.report({ node: reportItem, @@ -146,7 +151,7 @@ module.exports = { column: commaToken.loc.start.column }, messageId: "unexpectedLineBeforeAndAfterComma", - fix: getFixerFunction("between", previousItemToken, commaToken, currentItemToken) + fix: getFixerFunction(styleType, previousItemToken, commaToken, currentItemToken) }); } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { diff --git a/tools/node_modules/eslint/lib/rules/eqeqeq.js b/tools/node_modules/eslint/lib/rules/eqeqeq.js index 715c5ce7c027c7..3e8a392cf6983e 100644 --- a/tools/node_modules/eslint/lib/rules/eqeqeq.js +++ b/tools/node_modules/eslint/lib/rules/eqeqeq.js @@ -119,7 +119,6 @@ module.exports = { /** * Gets the location (line and column) of the binary expression's operator * @param {ASTNode} node The binary expression node to check - * @param {string} operator The operator to find * @returns {Object} { line, column } location of operator * @private */ 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 c62016d5895dcc..5845aff4bc636c 100644 --- a/tools/node_modules/eslint/lib/rules/handle-callback-err.js +++ b/tools/node_modules/eslint/lib/rules/handle-callback-err.js @@ -59,7 +59,7 @@ module.exports = { /** * Get the parameters of a given function scope. * @param {Object} scope The function scope. - * @returns {array} All parameters of the given scope. + * @returns {Array} All parameters of the given scope. */ function getParameters(scope) { return scope.variables.filter(variable => variable.defs[0] && variable.defs[0].type === "Parameter"); 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 cd729f8ad931ee..a883b2264714f2 100644 --- a/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js +++ b/tools/node_modules/eslint/lib/rules/implicit-arrow-linebreak.js @@ -44,7 +44,6 @@ module.exports = { /** * Validates the location of an arrow function body * @param {ASTNode} node The arrow function body - * @param {string} keywordName The applicable keyword name for the arrow function body * @returns {void} */ function validateExpression(node) { diff --git a/tools/node_modules/eslint/lib/rules/indent-legacy.js b/tools/node_modules/eslint/lib/rules/indent-legacy.js index 16687b521ed31a..cfb807e34e0ee3 100644 --- a/tools/node_modules/eslint/lib/rules/indent-legacy.js +++ b/tools/node_modules/eslint/lib/rules/indent-legacy.js @@ -300,7 +300,6 @@ module.exports = { * @param {int} gottenTabs Indentation tab count in the actual node/code * @param {Object=} loc Error line and column location * @param {boolean} isLastNodeCheck Is the error for last node check - * @param {int} lastNodeCheckEndOffset Number of charecters to skip from the end * @returns {void} */ function report(node, needed, gottenSpaces, gottenTabs, loc, isLastNodeCheck) { @@ -365,7 +364,6 @@ module.exports = { * Check indent for node * @param {ASTNode} node Node to check * @param {int} neededIndent needed indent - * @param {boolean} [excludeCommas=false] skip comma on start of line * @returns {void} */ function checkNodeIndent(node, neededIndent) { @@ -413,7 +411,6 @@ module.exports = { * Check indent for nodes list * @param {ASTNode[]} nodes list of node objects * @param {int} indent needed indent - * @param {boolean} [excludeCommas=false] skip comma on start of line * @returns {void} */ function checkNodesIndent(nodes, indent) { diff --git a/tools/node_modules/eslint/lib/rules/indent.js b/tools/node_modules/eslint/lib/rules/indent.js index dc9fbaf908b815..0b87412c8fcb6b 100644 --- a/tools/node_modules/eslint/lib/rules/indent.js +++ b/tools/node_modules/eslint/lib/rules/indent.js @@ -1229,9 +1229,13 @@ module.exports = { } const fromToken = sourceCode.getLastToken(node, token => token.type === "Identifier" && token.value === "from"); + const sourceToken = sourceCode.getLastToken(node, token => token.type === "String"); + const semiToken = sourceCode.getLastToken(node, token => token.type === "Punctuator" && token.value === ";"); if (fromToken) { - offsets.setDesiredOffsets([fromToken.range[0], node.range[1]], sourceCode.getFirstToken(node), 1); + const end = semiToken && semiToken.range[1] === sourceToken.range[1] ? node.range[1] : sourceToken.range[1]; + + offsets.setDesiredOffsets([fromToken.range[0], end], sourceCode.getFirstToken(node), 1); } }, diff --git a/tools/node_modules/eslint/lib/rules/keyword-spacing.js b/tools/node_modules/eslint/lib/rules/keyword-spacing.js index 66ce2cb34c0e2b..790d7b031d8ecd 100644 --- a/tools/node_modules/eslint/lib/rules/keyword-spacing.js +++ b/tools/node_modules/eslint/lib/rules/keyword-spacing.js @@ -453,6 +453,10 @@ module.exports = { checkSpacingBefore(firstToken, PREV_TOKEN_M); checkSpacingAfter(firstToken, NEXT_TOKEN_M); + if (node.type === "ExportDefaultDeclaration") { + checkSpacingAround(sourceCode.getTokenAfter(firstToken)); + } + if (node.source) { const fromToken = sourceCode.getTokenBefore(node.source); @@ -554,7 +558,7 @@ module.exports = { // Statements - Declarations ClassDeclaration: checkSpacingForClass, ExportNamedDeclaration: checkSpacingForModuleDeclaration, - ExportDefaultDeclaration: checkSpacingAroundFirstToken, + ExportDefaultDeclaration: checkSpacingForModuleDeclaration, ExportAllDeclaration: checkSpacingForModuleDeclaration, FunctionDeclaration: checkSpacingForFunction, ImportDeclaration: checkSpacingForModuleDeclaration, 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 2743bf7a8bea34..6a0ec8d5eb731f 100644 --- a/tools/node_modules/eslint/lib/rules/newline-before-return.js +++ b/tools/node_modules/eslint/lib/rules/newline-before-return.js @@ -36,7 +36,7 @@ module.exports = { /** * Tests whether node is preceded by supplied tokens * @param {ASTNode} node - node to check - * @param {array} testTokens - array of tokens to test against + * @param {Array} testTokens - array of tokens to test against * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens * @private */ 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 88984c36e7f70f..8d7934d8a595ba 100644 --- a/tools/node_modules/eslint/lib/rules/no-constant-condition.js +++ b/tools/node_modules/eslint/lib/rules/no-constant-condition.js @@ -173,7 +173,6 @@ module.exports = { /** * Reports when the set still contains stored constant conditions - * @param {ASTNode} node The AST node to check. * @returns {void} * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-else-return.js b/tools/node_modules/eslint/lib/rules/no-else-return.js index eebdec76e0e7d4..5ba02de29136f8 100644 --- a/tools/node_modules/eslint/lib/rules/no-else-return.js +++ b/tools/node_modules/eslint/lib/rules/no-else-return.js @@ -183,7 +183,6 @@ module.exports = { * code paths. * * @param {Node} node The consequent or body node - * @param {Node} alternate The alternate node * @returns {boolean} `true` if it is a Return/If node that always returns. */ function checkForReturnOrIf(node) { diff --git a/tools/node_modules/eslint/lib/rules/no-implied-eval.js b/tools/node_modules/eslint/lib/rules/no-implied-eval.js index d31b5dfee8041f..afa24ab8efda75 100644 --- a/tools/node_modules/eslint/lib/rules/no-implied-eval.js +++ b/tools/node_modules/eslint/lib/rules/no-implied-eval.js @@ -38,7 +38,7 @@ module.exports = { /** * Get the last element of an array, without modifying arr, like pop(), but non-destructive. - * @param {array} arr What to inspect + * @param {Array} arr What to inspect * @returns {*} The last element of arr * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js index b8fcca1aaf8b6f..b8917ee9c563d1 100644 --- a/tools/node_modules/eslint/lib/rules/no-restricted-imports.js +++ b/tools/node_modules/eslint/lib/rules/no-restricted-imports.js @@ -195,7 +195,7 @@ module.exports = { /** * Check if the given importNames are restricted given a list of restrictedImportNames. * @param {Set.} importNames - Set of import names that are being imported - * @param {[string]} restrictedImportNames - array of import names that are restricted for this import + * @param {string[]} restrictedImportNames - array of import names that are restricted for this import * @returns {boolean} whether the objectName is restricted * @private */ diff --git a/tools/node_modules/eslint/lib/rules/no-this-before-super.js b/tools/node_modules/eslint/lib/rules/no-this-before-super.js index 93fb094e9bc139..bca379bf971b80 100644 --- a/tools/node_modules/eslint/lib/rules/no-this-before-super.js +++ b/tools/node_modules/eslint/lib/rules/no-this-before-super.js @@ -171,7 +171,6 @@ module.exports = { * invalid node. * * @param {CodePath} codePath - A code path which was ended. - * @param {ASTNode} node - The current node. * @returns {void} */ onCodePathEnd(codePath) { diff --git a/tools/node_modules/eslint/lib/rules/object-curly-newline.js b/tools/node_modules/eslint/lib/rules/object-curly-newline.js index c460ea56bc3128..d1a6bc20f6361e 100644 --- a/tools/node_modules/eslint/lib/rules/object-curly-newline.js +++ b/tools/node_modules/eslint/lib/rules/object-curly-newline.js @@ -172,7 +172,6 @@ module.exports = { /** * Reports a given node if it violated this rule. * @param {ASTNode} node - A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node. - * @param {{multiline: boolean, minProperties: number, consistent: boolean}} options - An option object. * @returns {void} */ function check(node) { diff --git a/tools/node_modules/eslint/lib/rules/one-var.js b/tools/node_modules/eslint/lib/rules/one-var.js index 44f05fb700a0d6..0e9dff416588f7 100644 --- a/tools/node_modules/eslint/lib/rules/one-var.js +++ b/tools/node_modules/eslint/lib/rules/one-var.js @@ -310,7 +310,6 @@ module.exports = { /** * Fixer to split a VariableDeclaration into individual declarations * @param {VariableDeclaration} declaration The `VariableDeclaration` to split - * @param {?Function} filter Function to filter the declarations * @returns {Function} The fixer function */ function splitDeclarations(declaration) { diff --git a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js index 3e55a2516d0156..c9995885442f2f 100644 --- a/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js +++ b/tools/node_modules/eslint/lib/rules/padding-line-between-statements.js @@ -36,6 +36,36 @@ function newKeywordTester(keyword) { }; } +/** + * Creates tester which check if a node starts with specific keyword and spans a single line. + * + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newSinglelineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line === node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + +/** + * Creates tester which check if a node starts with specific keyword and spans multiple lines. + * + * @param {string} keyword The keyword to test. + * @returns {Object} the created tester. + * @private + */ +function newMultilineKeywordTester(keyword) { + return { + test: (node, sourceCode) => + node.loc.start.line !== node.loc.end.line && + sourceCode.getFirstToken(node).value === keyword + }; +} + /** * Creates tester which check if a node is specific type. * @@ -368,6 +398,13 @@ const StatementTypes = { !isDirectivePrologue(node, sourceCode) }, + "multiline-const": newMultilineKeywordTester("const"), + "multiline-let": newMultilineKeywordTester("let"), + "multiline-var": newMultilineKeywordTester("var"), + "singleline-const": newSinglelineKeywordTester("const"), + "singleline-let": newSinglelineKeywordTester("let"), + "singleline-var": newSinglelineKeywordTester("var"), + block: newNodeTypeTester("BlockStatement"), empty: newNodeTypeTester("EmptyStatement"), function: newNodeTypeTester("FunctionDeclaration"), diff --git a/tools/node_modules/eslint/lib/rules/quotes.js b/tools/node_modules/eslint/lib/rules/quotes.js index e0db17fcb7c45f..c3c077822462b8 100644 --- a/tools/node_modules/eslint/lib/rules/quotes.js +++ b/tools/node_modules/eslint/lib/rules/quotes.js @@ -228,6 +228,34 @@ module.exports = { } } + /** + * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings. + * @param {ASTNode} node - A TemplateLiteral node to check. + * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings. + * @private + */ + function isUsingFeatureOfTemplateLiteral(node) { + const hasTag = node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi; + + if (hasTag) { + return true; + } + + const hasStringInterpolation = node.expressions.length > 0; + + if (hasStringInterpolation) { + return true; + } + + const isMultilineString = node.quasis.length >= 1 && UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); + + if (isMultilineString) { + return true; + } + + return false; + } + return { Literal(node) { @@ -260,39 +288,34 @@ module.exports = { TemplateLiteral(node) { - // If backticks are expected or it's a tagged template, then this shouldn't throw an errors + // Don't throw an error if backticks are expected or a template literal feature is in use. if ( allowTemplateLiterals || quoteOption === "backtick" || - node.parent.type === "TaggedTemplateExpression" && node === node.parent.quasi + isUsingFeatureOfTemplateLiteral(node) ) { return; } - // A warning should be produced if the template literal only has one TemplateElement, and has no unescaped newlines. - const shouldWarn = node.quasis.length === 1 && !UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw); - - if (shouldWarn) { - context.report({ - node, - message: "Strings must use {{description}}.", - data: { - description: settings.description - }, - fix(fixer) { - if (isPartOfDirectivePrologue(node)) { - - /* - * TemplateLiterals in a directive prologue aren't actually directives, but if they're - * in the directive prologue, then fixing them might turn them into directives and change - * the behavior of the code. - */ - return null; - } - return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + context.report({ + node, + message: "Strings must use {{description}}.", + data: { + description: settings.description + }, + fix(fixer) { + if (isPartOfDirectivePrologue(node)) { + + /* + * TemplateLiterals in a directive prologue aren't actually directives, but if they're + * in the directive prologue, then fixing them might turn them into directives and change + * the behavior of the code. + */ + return null; } - }); - } + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); } }; diff --git a/tools/node_modules/eslint/lib/rules/require-jsdoc.js b/tools/node_modules/eslint/lib/rules/require-jsdoc.js index 949314993b64fb..389bfb692bbae8 100644 --- a/tools/node_modules/eslint/lib/rules/require-jsdoc.js +++ b/tools/node_modules/eslint/lib/rules/require-jsdoc.js @@ -43,7 +43,10 @@ module.exports = { }, additionalProperties: false } - ] + ], + + deprecated: true, + replacedBy: [] }, create(context) { diff --git a/tools/node_modules/eslint/lib/rules/space-in-parens.js b/tools/node_modules/eslint/lib/rules/space-in-parens.js index 88f4f0b50e150d..3068662632172e 100644 --- a/tools/node_modules/eslint/lib/rules/space-in-parens.js +++ b/tools/node_modules/eslint/lib/rules/space-in-parens.js @@ -61,7 +61,6 @@ module.exports = { /** * Produces an object with the opener and closer exception values - * @param {Object} opts The exception options * @returns {Object} `openers` and `closers` exception values * @private */ diff --git a/tools/node_modules/eslint/lib/rules/space-infix-ops.js b/tools/node_modules/eslint/lib/rules/space-infix-ops.js index 45b76795eae14e..254616d998d40d 100644 --- a/tools/node_modules/eslint/lib/rules/space-infix-ops.js +++ b/tools/node_modules/eslint/lib/rules/space-infix-ops.js @@ -69,7 +69,10 @@ module.exports = { context.report({ node: mainNode, loc: culpritToken.loc.start, - message: "Infix operators must be spaced.", + message: "Operator '{{operator}}' must be spaced.", + data: { + operator: culpritToken.value + }, fix(fixer) { const previousToken = sourceCode.getTokenBefore(culpritToken); const afterToken = sourceCode.getTokenAfter(culpritToken); diff --git a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js index b434491bfad873..b40a20f6b4b3ab 100644 --- a/tools/node_modules/eslint/lib/rules/valid-jsdoc.js +++ b/tools/node_modules/eslint/lib/rules/valid-jsdoc.js @@ -64,7 +64,10 @@ module.exports = { } ], - fixable: "code" + fixable: "code", + + deprecated: true, + replacedBy: [] }, create(context) { diff --git a/tools/node_modules/eslint/lib/util/config-comment-parser.js b/tools/node_modules/eslint/lib/util/config-comment-parser.js new file mode 100644 index 00000000000000..88504caf1ca8bf --- /dev/null +++ b/tools/node_modules/eslint/lib/util/config-comment-parser.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Config Comment Parser + * @author Nicholas C. Zakas + */ + +/* eslint-disable class-methods-use-this*/ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const levn = require("levn"), + ConfigOps = require("../config/config-ops"); + +const debug = require("debug")("eslint:config-comment-parser"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Object to parse ESLint configuration comments inside JavaScript files. + * @name ConfigCommentParser + */ +module.exports = class ConfigCommentParser { + + /** + * Parses a list of "name:boolean_value" or/and "name" options divided by comma or + * whitespace. Used for "global" and "exported" comments. + * @param {string} string The string to parse. + * @param {Comment} comment The comment node which has the string. + * @returns {Object} Result map object of names and boolean values + */ + parseBooleanConfig(string, comment) { + debug("Parsing Boolean config"); + + const items = {}; + + // Collapse whitespace around `:` and `,` to make parsing easier + const trimmedString = string.replace(/\s*([:,])\s*/g, "$1"); + + trimmedString.split(/\s|,+/).forEach(name => { + if (!name) { + return; + } + + // value defaults to "false" (if not provided), e.g: "foo" => ["foo", "false"] + const [key, value = "false"] = name.split(":"); + + items[key] = { + value: value === "true", + comment + }; + }); + return items; + } + + /** + * Parses a JSON-like config. + * @param {string} string The string to parse. + * @param {Object} location Start line and column of comments for potential error message. + * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object + */ + parseJsonConfig(string, location) { + debug("Parsing JSON config"); + + let items = {}; + + // Parses a JSON-like comment by the same way as parsing CLI option. + try { + items = levn.parse("Object", string) || {}; + + // Some tests say that it should ignore invalid comments such as `/*eslint no-alert:abc*/`. + // Also, commaless notations have invalid severity: + // "no-alert: 2 no-console: 2" --> {"no-alert": "2 no-console: 2"} + // Should ignore that case as well. + if (ConfigOps.isEverySeverityValid(items)) { + return { + success: true, + config: items + }; + } + } catch (ex) { + + debug("Levn parsing failed; falling back to manual parsing."); + + // ignore to parse the string by a fallback. + } + + /* + * Optionator cannot parse commaless notations. + * But we are supporting that. So this is a fallback for that. + */ + items = {}; + const normalizedString = string.replace(/([a-zA-Z0-9\-/]+):/g, "\"$1\":").replace(/(]|[0-9])\s+(?=")/, "$1,"); + + try { + items = JSON.parse(`{${normalizedString}}`); + } catch (ex) { + debug("Manual parsing failed."); + + return { + success: false, + error: { + ruleId: null, + fatal: true, + severity: 2, + message: `Failed to parse JSON from '${normalizedString}': ${ex.message}`, + line: location.start.line, + column: location.start.column + 1 + } + }; + + } + + return { + success: true, + config: items + }; + } + + /** + * Parses a config of values separated by comma. + * @param {string} string The string to parse. + * @returns {Object} Result map of values and true values + */ + parseListConfig(string) { + debug("Parsing list config"); + + const items = {}; + + // Collapse whitespace around commas + string.replace(/\s*,\s*/g, ",").split(/,+/).forEach(name => { + const trimmedName = name.trim(); + + if (trimmedName) { + items[trimmedName] = true; + } + }); + return items; + } + +}; diff --git a/tools/node_modules/eslint/lib/util/glob-utils.js b/tools/node_modules/eslint/lib/util/glob-utils.js index a2be0f0425cf67..fd4cfa00851d05 100644 --- a/tools/node_modules/eslint/lib/util/glob-utils.js +++ b/tools/node_modules/eslint/lib/util/glob-utils.js @@ -14,7 +14,7 @@ const lodash = require("lodash"), GlobSync = require("./glob"), pathUtils = require("./path-utils"), - IgnoredPaths = require("../ignored-paths"); + IgnoredPaths = require("./ignored-paths"); const debug = require("debug")("eslint:glob-utils"); diff --git a/tools/node_modules/eslint/lib/ignored-paths.js b/tools/node_modules/eslint/lib/util/ignored-paths.js similarity index 98% rename from tools/node_modules/eslint/lib/ignored-paths.js rename to tools/node_modules/eslint/lib/util/ignored-paths.js index 8520090af52a97..de4a79cde336a1 100644 --- a/tools/node_modules/eslint/lib/ignored-paths.js +++ b/tools/node_modules/eslint/lib/util/ignored-paths.js @@ -12,7 +12,7 @@ const fs = require("fs"), path = require("path"), ignore = require("ignore"), - pathUtils = require("./util/path-utils"); + pathUtils = require("./path-utils"); const debug = require("debug")("eslint:ignored-paths"); @@ -296,7 +296,7 @@ class IgnoredPaths { /** * read ignore filepath * @param {string} filePath, file to add to ig - * @returns {array} raw ignore rules + * @returns {Array} raw ignore rules */ readIgnoreFile(filePath) { if (typeof this.cache[filePath] === "undefined") { @@ -307,8 +307,8 @@ class IgnoredPaths { /** * add ignore file to node-ignore instance - * @param {Object} ig, instance of node-ignore - * @param {string} filePath, file to add to ig + * @param {Object} ig instance of node-ignore + * @param {string} filePath file to add to ig * @returns {void} */ addIgnoreFile(ig, filePath) { diff --git a/tools/node_modules/eslint/lib/report-translator.js b/tools/node_modules/eslint/lib/util/report-translator.js similarity index 99% rename from tools/node_modules/eslint/lib/report-translator.js rename to tools/node_modules/eslint/lib/util/report-translator.js index f828305860f6f3..3dfdca0e4944d3 100644 --- a/tools/node_modules/eslint/lib/report-translator.js +++ b/tools/node_modules/eslint/lib/util/report-translator.js @@ -10,8 +10,8 @@ //------------------------------------------------------------------------------ const assert = require("assert"); -const ruleFixer = require("./util/rule-fixer"); -const interpolate = require("./util/interpolate"); +const ruleFixer = require("./rule-fixer"); +const interpolate = require("./interpolate"); //------------------------------------------------------------------------------ // Typedefs diff --git a/tools/node_modules/eslint/lib/util/source-code.js b/tools/node_modules/eslint/lib/util/source-code.js index dd45f6112ad4f2..4e90ac1aa92721 100644 --- a/tools/node_modules/eslint/lib/util/source-code.js +++ b/tools/node_modules/eslint/lib/util/source-code.js @@ -87,7 +87,7 @@ class SourceCode extends TokenStore { * @param {string|Object} textOrConfig - The source code text or config object. * @param {string} textOrConfig.text - The source code text. * @param {ASTNode} textOrConfig.ast - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. - * @param {Object|null} textOrConfig.parserServices - The parser srevices. + * @param {Object|null} textOrConfig.parserServices - The parser services. * @param {ScopeManager|null} textOrConfig.scopeManager - The scope of this source code. * @param {Object|null} textOrConfig.visitorKeys - The visitor keys to traverse AST. * @param {ASTNode} [astIfNoConfig] - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. @@ -316,6 +316,7 @@ class SourceCode extends TokenStore { * @returns {Token|null} The Block comment token containing the JSDoc comment * for the given node or null if not found. * @public + * @deprecated */ getJSDocComment(node) { diff --git a/tools/node_modules/eslint/messages/all-files-ignored.txt b/tools/node_modules/eslint/messages/all-files-ignored.txt index 3b741a03e373da..3f4c8ced4c9ada 100644 --- a/tools/node_modules/eslint/messages/all-files-ignored.txt +++ b/tools/node_modules/eslint/messages/all-files-ignored.txt @@ -1,4 +1,4 @@ -All of the files matching the glob pattern "<%= pattern %>" are ignored. +You are linting "<%= pattern %>", but all of the files matching the glob pattern "<%= pattern %>" are ignored. If you don't want to lint these files, remove the pattern "<%= pattern %>" from the list of arguments passed to ESLint. diff --git a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js index 292315f65bfc90..460e7933992122 100644 --- a/tools/node_modules/eslint/node_modules/acorn-jsx/index.js +++ b/tools/node_modules/eslint/node_modules/acorn-jsx/index.js @@ -1,9 +1,18 @@ +'use strict'; + const XHTMLEntities = require('./xhtml'); const hexNumber = /^[\da-fA-F]+$/; const decimalNumber = /^\d+$/; -const {tokTypes: tt, TokContext, tokContexts, TokenType, isNewLine, isIdentifierStart, isIdentifierChar} = require("acorn"); +const acorn = require("acorn"); +const tt = acorn.tokTypes; +const TokContext = acorn.TokContext; +const tokContexts = acorn.tokContexts; +const TokenType = acorn.TokenType; +const isNewLine = acorn.isNewLine; +const isIdentifierStart = acorn.isIdentifierStart; +const isIdentifierChar = acorn.isIdentifierChar; const tc_oTag = new TokContext('Gary Court - * @see http://github.com/garycourt/uri-js +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js */ -/** - * Copyright 2011 Gary Court. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of Gary Court. +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. */ var SCHEMES = {}; function pctEncChar(chr) { @@ -6594,8 +6610,9 @@ function Ajv(opts) { this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); - addDraft6MetaSchema(this); + addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {const: true}}); addInitialSchemas(this); } @@ -6967,7 +6984,7 @@ function addFormat(name, format) { } -function addDraft6MetaSchema(self) { +function addDefaultMetaSchema(self) { var $dataSchema; if (self._opts.$data) { $dataSchema = require('./refs/data.json'); 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 3fbafcc4a7d900..57e3eb05509f2c 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.5.5: 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 c(r,e){if(!n[r]){if(!i[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(u)return u(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 c(i[r][1][e]||e)},s,s.exports,o,i,n,l)}return n[r].exports}for(var u="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,u=/^(?:(?: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":c,url:u,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":c,url:u,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(c)+" , 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&&u?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&&(c=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,c=e.errSchemaPath+"/"+(P=p),a=m,y+="="):(b&&(a=Math[f?"min":"max"](m,n)),m===(!b||a)?(w=!0,c=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(c)+" , 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&&u?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+=" } ",u&&(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),c=e.errSchemaPath+"/"+r,u=!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(c)+" , 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&&u?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+="} ",u&&(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),c=e.errSchemaPath+"/"+r,u=!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(c)+" , 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&&u?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+="} ",u&&(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),c=e.errSchemaPath+"/"+r,u=!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(c)+" , 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&&u?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+="} ",u&&(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),c="";l.level++;var u="valid"+l.level,h=l.baseId,d=!0,f=s;if(f)for(var p,m=-1,v=f.length-1;m "+x+") { ";var $=u+"["+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+=" } ",c&&(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 ("+u+".length > "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+u+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=u+"["+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+" ",c&&(a+=" if (!"+m+") break; "),a+=" } } ",c&&(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+" < "+u+".length; "+v+"++) { ",f.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);$=u+"["+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+" ",c&&(a+=" if (!"+m+") break; "),a+=" }"}return c&&(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),c=e.errSchemaPath+"/"+r,u=!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(c)+" , 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&&u?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+="} ",u&&(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,c=!e.opts.allErrors,u="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: "+u+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),a+=!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++; ",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: "+u+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(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,c=!e.opts.allErrors,u="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(c)+" , 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&&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++; ",s+=" } ",u&&(s+=" else { ")}else u&&(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,c=a.schema[e="false schema"],u=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; ",(K=K||[]).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=K.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(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)){u=a.schemaPath+".type",h=a.errSchemaPath+"/type",u=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=U(s-u,v,0==u),L(s/v)>A-o&&T("overflow"),o+=L(s/v),s%=v,t.splice(s++,0,o)}return String.fromCodePoint.apply(String,t)},c=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 c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(z(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.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(K,"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"),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=U(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 | null, options?: ErrorsTextOptions): string; - errors?: Array; + errors?: Array | null; } interface CustomLogger { @@ -163,7 +163,9 @@ declare namespace ajv { sourceCode?: boolean; processCode?: (code: string) => string; cache?: object; - logger?: CustomLogger | false + logger?: CustomLogger | false; + nullable?: boolean; + serialize?: ((schema: object | boolean) => any) | false; } type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike); diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/ajv.js b/tools/node_modules/eslint/node_modules/ajv/lib/ajv.js index 4740eb6a7db4b3..9f16723aa80774 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/ajv.js +++ b/tools/node_modules/eslint/node_modules/ajv/lib/ajv.js @@ -70,8 +70,9 @@ function Ajv(opts) { this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); - addDraft6MetaSchema(this); + addDefaultMetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); + if (opts.nullable) this.addKeyword('nullable', {metaSchema: {const: true}}); addInitialSchemas(this); } @@ -443,7 +444,7 @@ function addFormat(name, format) { } -function addDraft6MetaSchema(self) { +function addDefaultMetaSchema(self) { var $dataSchema; if (self._opts.$data) { $dataSchema = require('./refs/data.json'); diff --git a/tools/node_modules/eslint/node_modules/ajv/lib/dot/validate.jst b/tools/node_modules/eslint/node_modules/ajv/lib/dot/validate.jst index 27393cf300c03e..89a5b3b49f0f59 100644 --- a/tools/node_modules/eslint/node_modules/ajv/lib/dot/validate.jst +++ b/tools/node_modules/eslint/node_modules/ajv/lib/dot/validate.jst @@ -100,6 +100,16 @@ var $typeSchema = it.schema.type , $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) + $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } + if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; 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 9f9e1ae4079b83..019c193ac148b0 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 @@ -101,6 +101,14 @@ module.exports = function generate_validate(it, $keyword, $ruleType) { var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.nullable && it.schema.nullable === true) { + if ($typeIsArray) { + if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null'); + } else if ($typeSchema != 'null') { + $typeSchema = [$typeSchema, 'null']; + $typeIsArray = true; + } + } if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; diff --git a/tools/node_modules/eslint/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/ajv/package.json index 426998a4f7b59b..e508c3a61cdab7 100644 --- a/tools/node_modules/eslint/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/ajv/package.json @@ -16,7 +16,7 @@ "description": "Another JSON Schema Validator", "devDependencies": { "ajv-async": "^1.0.0", - "bluebird": "3.5.1", + "bluebird": "^3.5.3", "brfs": "^2.0.0", "browserify": "^16.2.0", "chai": "^4.0.1", @@ -96,5 +96,5 @@ }, "tonicExampleFilename": ".tonic_example.js", "typings": "lib/ajv.d.ts", - "version": "6.5.5" + "version": "6.6.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/array-union/index.js b/tools/node_modules/eslint/node_modules/array-union/index.js deleted file mode 100644 index e33f38a1eb4acd..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-union/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var arrayUniq = require('array-uniq'); - -module.exports = function () { - return arrayUniq([].concat.apply([], arguments)); -}; diff --git a/tools/node_modules/eslint/node_modules/array-union/license b/tools/node_modules/eslint/node_modules/array-union/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-union/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/array-union/package.json b/tools/node_modules/eslint/node_modules/array-union/package.json deleted file mode 100644 index abfa223ebe3321..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-union/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/array-union/issues" - }, - "bundleDependencies": false, - "dependencies": { - "array-uniq": "^1.0.1" - }, - "deprecated": false, - "description": "Create an array of unique values, in order, from the input arrays", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/array-union#readme", - "keywords": [ - "array", - "arr", - "set", - "uniq", - "unique", - "duplicate", - "remove", - "union", - "combine", - "merge" - ], - "license": "MIT", - "name": "array-union", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/array-union.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.2" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/array-union/readme.md b/tools/node_modules/eslint/node_modules/array-union/readme.md deleted file mode 100644 index ea472dd079613b..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-union/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) - -> Create an array of unique values, in order, from the input arrays - - -## Install - -``` -$ npm install --save array-union -``` - - -## Usage - -```js -const arrayUnion = require('array-union'); - -arrayUnion([1, 1, 2, 3], [2, 3]); -//=> [1, 2, 3] - -arrayUnion(['foo', 'foo', 'bar'], ['foo']); -//=> ['foo', 'bar'] -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/array-uniq/index.js b/tools/node_modules/eslint/node_modules/array-uniq/index.js deleted file mode 100644 index edd09f8114b1a0..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-uniq/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -// there's 3 implementations written in increasing order of efficiency - -// 1 - no Set type is defined -function uniqNoSet(arr) { - var ret = []; - - for (var i = 0; i < arr.length; i++) { - if (ret.indexOf(arr[i]) === -1) { - ret.push(arr[i]); - } - } - - return ret; -} - -// 2 - a simple Set type is defined -function uniqSet(arr) { - var seen = new Set(); - return arr.filter(function (el) { - if (!seen.has(el)) { - seen.add(el); - return true; - } - - return false; - }); -} - -// 3 - a standard Set type is defined and it has a forEach method -function uniqSetWithForEach(arr) { - var ret = []; - - (new Set(arr)).forEach(function (el) { - ret.push(el); - }); - - return ret; -} - -// V8 currently has a broken implementation -// https://github.com/joyent/node/issues/8449 -function doesForEachActuallyWork() { - var ret = false; - - (new Set([true])).forEach(function (el) { - ret = el; - }); - - return ret === true; -} - -if ('Set' in global) { - if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { - module.exports = uniqSetWithForEach; - } else { - module.exports = uniqSet; - } -} else { - module.exports = uniqNoSet; -} diff --git a/tools/node_modules/eslint/node_modules/array-uniq/license b/tools/node_modules/eslint/node_modules/array-uniq/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-uniq/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/array-uniq/package.json b/tools/node_modules/eslint/node_modules/array-uniq/package.json deleted file mode 100644 index 6b878a386c74a7..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-uniq/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/array-uniq/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Create an array without duplicates", - "devDependencies": { - "ava": "*", - "es6-set": "^0.1.0", - "require-uncached": "^1.0.2", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/array-uniq#readme", - "keywords": [ - "array", - "arr", - "set", - "uniq", - "unique", - "es6", - "duplicate", - "remove" - ], - "license": "MIT", - "name": "array-uniq", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/array-uniq.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.3" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/array-uniq/readme.md b/tools/node_modules/eslint/node_modules/array-uniq/readme.md deleted file mode 100644 index f0bd98c4f053c9..00000000000000 --- a/tools/node_modules/eslint/node_modules/array-uniq/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq) - -> Create an array without duplicates - -It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays). - - -## Install - -``` -$ npm install --save array-uniq -``` - - -## Usage - -```js -const arrayUniq = require('array-uniq'); - -arrayUniq([1, 1, 2, 3, 3]); -//=> [1, 2, 3] - -arrayUniq(['foo', 'foo', 'bar', 'foo']); -//=> ['foo', 'bar'] -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/astral-regex/index.js b/tools/node_modules/eslint/node_modules/astral-regex/index.js new file mode 100644 index 00000000000000..f90e6a225c40ca --- /dev/null +++ b/tools/node_modules/eslint/node_modules/astral-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +const regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]'; + +module.exports = opts => opts && opts.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g'); diff --git a/tools/node_modules/eslint/node_modules/pify/license b/tools/node_modules/eslint/node_modules/astral-regex/license similarity index 92% rename from tools/node_modules/eslint/node_modules/pify/license rename to tools/node_modules/eslint/node_modules/astral-regex/license index e7af2f77107d73..db6bc32cc7c44e 100644 --- a/tools/node_modules/eslint/node_modules/pify/license +++ b/tools/node_modules/eslint/node_modules/astral-regex/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Kevin Mårtensson (github.com/kevva) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/tools/node_modules/eslint/node_modules/astral-regex/package.json b/tools/node_modules/eslint/node_modules/astral-regex/package.json new file mode 100644 index 00000000000000..61089098b382bc --- /dev/null +++ b/tools/node_modules/eslint/node_modules/astral-regex/package.json @@ -0,0 +1,41 @@ +{ + "author": { + "name": "Kevin Mårtensson", + "email": "kevinmartensson@gmail.com", + "url": "github.com/kevva" + }, + "bugs": { + "url": "https://github.com/kevva/astral-regex/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Regular expression for matching astral symbols", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/kevva/astral-regex#readme", + "keywords": [ + "astral", + "emoji", + "regex", + "surrogate" + ], + "license": "MIT", + "name": "astral-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/kevva/astral-regex.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/astral-regex/readme.md b/tools/node_modules/eslint/node_modules/astral-regex/readme.md new file mode 100644 index 00000000000000..cde44f7bc0cc83 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/astral-regex/readme.md @@ -0,0 +1,43 @@ +# astral-regex [![Build Status](https://travis-ci.org/kevva/astral-regex.svg?branch=master)](https://travis-ci.org/kevva/astral-regex) + +> Regular expression for matching astral symbols + + +## Install + +``` +$ npm install astral-regex +``` + + +## Usage + +```js +const astralRegex = require('astral-regex'); + +astralRegex({exact: true}).test(''); +//=> true +``` + + +## API + +### astralRegex([options]) + +Returns a `RegExp` for matching astral symbols. + +#### options + +Type: `Object` + +##### exact + +Type: `boolean`
+Default: `false` *(Matches any astral symbols in a string)* + +Only match an exact string. Useful with `RegExp#test()` to check if a string is a astral symbol. + + +## License + +MIT © [Kevin Mårtensson](https://github.com/kevva) diff --git a/tools/node_modules/eslint/node_modules/del/index.js b/tools/node_modules/eslint/node_modules/del/index.js deleted file mode 100644 index 3b602af374f9e7..00000000000000 --- a/tools/node_modules/eslint/node_modules/del/index.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; -const path = require('path'); -const globby = require('globby'); -const isPathCwd = require('is-path-cwd'); -const isPathInCwd = require('is-path-in-cwd'); -const pify = require('pify'); -const rimraf = require('rimraf'); -const pMap = require('p-map'); - -const rimrafP = pify(rimraf); - -function safeCheck(file) { - if (isPathCwd(file)) { - throw new Error('Cannot delete the current working directory. Can be overriden with the `force` option.'); - } - - if (!isPathInCwd(file)) { - throw new Error('Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.'); - } -} - -module.exports = (patterns, opts) => { - opts = Object.assign({}, opts); - - const force = opts.force; - delete opts.force; - - const dryRun = opts.dryRun; - delete opts.dryRun; - - const mapper = file => { - if (!force) { - safeCheck(file); - } - - file = path.resolve(opts.cwd || '', file); - - if (dryRun) { - return file; - } - - return rimrafP(file, {glob: false}).then(() => file); - }; - - return globby(patterns, opts).then(files => pMap(files, mapper, opts)); -}; - -module.exports.sync = (patterns, opts) => { - opts = Object.assign({}, opts); - - const force = opts.force; - delete opts.force; - - const dryRun = opts.dryRun; - delete opts.dryRun; - - return globby.sync(patterns, opts).map(file => { - if (!force) { - safeCheck(file); - } - - file = path.resolve(opts.cwd || '', file); - - if (!dryRun) { - rimraf.sync(file, {glob: false}); - } - - return file; - }); -}; diff --git a/tools/node_modules/eslint/node_modules/del/package.json b/tools/node_modules/eslint/node_modules/del/package.json deleted file mode 100644 index ce3433dce6550e..00000000000000 --- a/tools/node_modules/eslint/node_modules/del/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/del/issues" - }, - "bundleDependencies": false, - "dependencies": { - "globby": "^6.1.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "p-map": "^1.1.1", - "pify": "^3.0.0", - "rimraf": "^2.2.8" - }, - "deprecated": false, - "description": "Delete files and folders", - "devDependencies": { - "ava": "*", - "make-dir": "^1.0.0", - "tempy": "^0.1.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/del#readme", - "keywords": [ - "delete", - "files", - "folders", - "directories", - "del", - "remove", - "destroy", - "trash", - "unlink", - "clean", - "cleaning", - "cleanup", - "rm", - "rmrf", - "rimraf", - "rmdir", - "glob", - "gulpfriendly", - "file", - "folder", - "directory", - "dir", - "fs", - "filesystem" - ], - "license": "MIT", - "name": "del", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/del.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.0.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/del/readme.md b/tools/node_modules/eslint/node_modules/del/readme.md deleted file mode 100644 index 664aa0f67fb06c..00000000000000 --- a/tools/node_modules/eslint/node_modules/del/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# del [![Build Status](https://travis-ci.org/sindresorhus/del.svg?branch=master)](https://travis-ci.org/sindresorhus/del) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) - -> Delete files and folders using [globs](https://github.com/isaacs/minimatch#usage) - -Similar to [rimraf](https://github.com/isaacs/rimraf), but with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above. - ---- - -

🐶

-

Support this project and improve your JavaScript skills with this great ES6 course by Wes Bos.
Try his free JavaScript 30 course for a taste of what to expect. You might also like his React and Sublime course.

- ---- - - -## Install - -``` -$ npm install --save del -``` - - -## Usage - -```js -const del = require('del'); - -del(['tmp/*.js', '!tmp/unicorn.js']).then(paths => { - console.log('Deleted files and folders:\n', paths.join('\n')); -}); -``` - - -## Beware - -The glob pattern `**` matches all children and *the parent*. - -So this won't work: - -```js -del.sync(['public/assets/**', '!public/assets/goat.png']); -``` - -You have to explicitly ignore the parent directories too: - -```js -del.sync(['public/assets/**', '!public/assets', '!public/assets/goat.png']); -``` - -Suggestions on how to improve this welcome! - - -## API - -### del(patterns, [options]) - -Returns a promise for an array of deleted paths. - -### del.sync(patterns, [options]) - -Returns an array of deleted paths. - -#### patterns - -Type: `string` `Array` - -See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage). - -- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js) -- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns) - -#### options - -Type: `Object` - -See the [`glob` options](https://github.com/isaacs/node-glob#options). - -##### force - -Type: `boolean`
-Default: `false` - -Allow deleting the current working directory and outside. - -##### dryRun - -Type: `boolean`
-Default: `false` - -See what would be deleted. - -```js -const del = require('del'); - -del(['tmp/*.js'], {dryRun: true}).then(paths => { - console.log('Files and folders that would be deleted:\n', paths.join('\n')); -}); -``` - -##### concurrency - -Type: `number`
-Default: `Infinity`
-Minimum: `1` - -Concurrency limit. - - -## CLI - -See [del-cli](https://github.com/sindresorhus/del-cli) for a CLI for this module and [trash-cli](https://github.com/sindresorhus/trash-cli) for a safe version that is suitable for running by hand. - - -## Related - -- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed -- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/espree/README.md b/tools/node_modules/eslint/node_modules/espree/README.md index 16fb93f85607e2..7e496f661987a7 100644 --- a/tools/node_modules/eslint/node_modules/espree/README.md +++ b/tools/node_modules/eslint/node_modules/espree/README.md @@ -12,24 +12,24 @@ Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last s Install: ``` -npm i espree --save +npm i espree ``` And in your Node.js code: ```javascript -var espree = require("espree"); +const espree = require("espree"); -var ast = espree.parse(code); +const ast = espree.parse(code); ``` There is a second argument to `parse()` that allows you to specify various options: ```javascript -var espree = require("espree"); +const espree = require("espree"); // Optional second options argument with the following default settings -var ast = espree.parse(code, { +const ast = espree.parse(code, { // attach range information to each node range: false, @@ -40,9 +40,6 @@ var ast = espree.parse(code, { // create a top-level comments array containing all comments comment: false, - // attach comments to the closest relevant node as leadingComments and trailingComments - attachComment: false, - // create a top-level tokens array containing all tokens tokens: false, diff --git a/tools/node_modules/eslint/node_modules/espree/espree.js b/tools/node_modules/eslint/node_modules/espree/espree.js index dea35ef083db54..7c16b696563656 100644 --- a/tools/node_modules/eslint/node_modules/espree/espree.js +++ b/tools/node_modules/eslint/node_modules/espree/espree.js @@ -88,6 +88,7 @@ const parsers = { options.ecmaFeatures && options.ecmaFeatures.jsx ); + return useJsx ? this.jsx : this.regular; } }; @@ -109,7 +110,7 @@ function tokenize(code, options) { // Ensure to collect tokens. if (!options || options.tokens !== true) { - options = Object.assign({}, options, { tokens: true }); + options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign } return new Parser(options, code).tokenize(); @@ -128,6 +129,7 @@ function tokenize(code, options) { */ function parse(code, options) { const Parser = parsers.get(options); + return new Parser(options, code).parse(); } @@ -144,7 +146,8 @@ exports.parse = parse; // Deep copy. /* istanbul ignore next */ exports.Syntax = (function() { - var name, types = {}; + let name, + types = {}; if (typeof Object.create === "function") { types = Object.create(null); diff --git a/tools/node_modules/eslint/node_modules/espree/lib/comment-attachment.js b/tools/node_modules/eslint/node_modules/espree/lib/comment-attachment.js deleted file mode 100644 index b82b5f1cd39cdd..00000000000000 --- a/tools/node_modules/eslint/node_modules/espree/lib/comment-attachment.js +++ /dev/null @@ -1,175 +0,0 @@ -/** - * @fileoverview Attaches comments to the AST. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astNodeTypes = require("./ast-node-types"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -var extra = { - trailingComments: [], - leadingComments: [], - bottomRightStack: [], - previousNode: null -}; - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - - reset: function() { - extra.trailingComments = []; - extra.leadingComments = []; - extra.bottomRightStack = []; - extra.previousNode = null; - }, - - addComment: function(comment) { - extra.trailingComments.push(comment); - extra.leadingComments.push(comment); - }, - - processComment: function(node) { - var lastChild, - trailingComments, - i, - j; - - if (node.type === astNodeTypes.Program) { - if (node.body.length > 0) { - return; - } - } - - if (extra.trailingComments.length > 0) { - - /* - * If the first comment in trailingComments comes after the - * current node, then we're good - all comments in the array will - * come after the node and so it's safe to add then as official - * trailingComments. - */ - if (extra.trailingComments[0].range[0] >= node.range[1]) { - trailingComments = extra.trailingComments; - extra.trailingComments = []; - } else { - - /* - * Otherwise, if the first comment doesn't come after the - * current node, that means we have a mix of leading and trailing - * comments in the array and that leadingComments contains the - * same items as trailingComments. Reset trailingComments to - * zero items and we'll handle this by evaluating leadingComments - * later. - */ - extra.trailingComments.length = 0; - } - } else { - if (extra.bottomRightStack.length > 0 && - extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments && - extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) { - trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments; - delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments; - } - } - - // Eating the stack. - while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) { - lastChild = extra.bottomRightStack.pop(); - } - - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { - node.leadingComments = lastChild.leadingComments; - delete lastChild.leadingComments; - } else { - // A leading comment for an anonymous class had been stolen by its first MethodDefinition, - // so this takes back the leading comment. - // See Also: https://github.com/eslint/espree/issues/158 - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].range[1] <= node.range[0]) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; - } - } - } - } - } else if (extra.leadingComments.length > 0) { - if (extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) { - if (extra.previousNode) { - for (j = 0; j < extra.leadingComments.length; j++) { - if (extra.leadingComments[j].end < extra.previousNode.end) { - extra.leadingComments.splice(j, 1); - j--; - } - } - } - if (extra.leadingComments.length > 0) { - node.leadingComments = extra.leadingComments; - extra.leadingComments = []; - } - } else { - - // https://github.com/eslint/espree/issues/2 - - /* - * In special cases, such as return (without a value) and - * debugger, all comments will end up as leadingComments and - * will otherwise be eliminated. This extra step runs when the - * bottomRightStack is empty and there are comments left - * in leadingComments. - * - * This loop figures out the stopping point between the actual - * leading and trailing comments by finding the location of the - * first comment that comes after the given node. - */ - for (i = 0; i < extra.leadingComments.length; i++) { - if (extra.leadingComments[i].range[1] > node.range[0]) { - break; - } - } - - /* - * Split the array based on the location of the first comment - * that comes after the node. Keep in mind that this could - * result in an empty array, and if so, the array must be - * deleted. - */ - node.leadingComments = extra.leadingComments.slice(0, i); - if (node.leadingComments.length === 0) { - delete node.leadingComments; - } - - /* - * Similarly, trailing comments are attached later. The variable - * must be reset to null if there are no trailing comments. - */ - trailingComments = extra.leadingComments.slice(i); - if (trailingComments.length === 0) { - trailingComments = null; - } - } - } - - extra.previousNode = node; - - if (trailingComments) { - node.trailingComments = trailingComments; - } - - extra.bottomRightStack.push(node); - } - -}; diff --git a/tools/node_modules/eslint/node_modules/espree/lib/espree.js b/tools/node_modules/eslint/node_modules/espree/lib/espree.js index 3b4d1eab65d379..107affd1d6ca26 100644 --- a/tools/node_modules/eslint/node_modules/espree/lib/espree.js +++ b/tools/node_modules/eslint/node_modules/espree/lib/espree.js @@ -1,8 +1,8 @@ "use strict"; +/* eslint-disable no-param-reassign*/ const acorn = require("acorn"); const jsx = require("acorn-jsx"); -const commentAttachment = require("./comment-attachment"); const TokenTranslator = require("./token-translator"); const DEFAULT_ECMA_VERSION = 5; @@ -89,23 +89,24 @@ module.exports = () => Parser => class Espree extends Parser { const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion); const isModule = options.sourceType === "module"; const tokenTranslator = - options.tokens === true ? - new TokenTranslator(tokTypes, code) : - null; + options.tokens === true + ? new TokenTranslator(tokTypes, code) + : null; // Initialize acorn parser. super({ ecmaVersion: isModule ? Math.max(6, ecmaVersion) : ecmaVersion, sourceType: isModule ? "module" : "script", - ranges: options.range === true || options.attachComment === true, + ranges: options.range === true, locations: options.loc === true, // Truthy value is true for backward compatibility. allowReturnOutsideFunction: Boolean(ecmaFeatures.globalReturn), // Collect tokens - onToken: (token) => { + onToken: token => { if (tokenTranslator) { + // Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state. tokenTranslator.onToken(token, this[STATE]); } @@ -118,23 +119,16 @@ module.exports = () => Parser => class Espree extends Parser { onComment: (block, text, start, end, startLoc, endLoc) => { if (this[STATE].comments) { const comment = convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc); - this[STATE].comments.push(comment); - if (options.attachComment === true) { - commentAttachment.addComment(comment); - } + this[STATE].comments.push(comment); } } }, code); - // TODO: remove global state. - commentAttachment.reset(); - // Initialize internal state. this[STATE] = { tokens: tokenTranslator ? [] : null, - comments: options.comment === true || options.attachComment === true ? [] : null, - attachComment: options.attachComment === true, + comments: options.comment === true ? [] : null, impliedStrict: ecmaFeatures.impliedStrict === true && this.options.ecmaVersion >= 5, ecmaVersion: this.options.ecmaVersion, jsxAttrValueToken: false, @@ -159,11 +153,13 @@ module.exports = () => Parser => class Espree extends Parser { finishNode(...args) { const result = super.finishNode(...args); + return this[ESPRIMA_FINISH_NODE](result); } finishNodeAt(...args) { const result = super.finishNodeAt(...args); + return this[ESPRIMA_FINISH_NODE](result); } @@ -216,6 +212,7 @@ module.exports = () => Parser => class Espree extends Parser { raise(pos, message) { const loc = acorn.getLineInfo(this.input, pos); const err = new SyntaxError(message); + err.index = pos; err.lineNumber = loc.line; err.column = loc.column + 1; // acorn uses 0-based columns @@ -256,7 +253,7 @@ module.exports = () => Parser => class Espree extends Parser { } if (this.end > this.start) { - message += " " + this.input.slice(this.start, this.end); + message += ` ${this.input.slice(this.start, this.end)}`; } this.raise(this.start, message); @@ -271,6 +268,7 @@ module.exports = () => Parser => class Espree extends Parser { */ jsx_readString(quote) { // eslint-disable-line camelcase const result = super.jsx_readString(quote); + if (this.type === tokTypes.string) { this[STATE].jsxAttrValueToken = true; } @@ -283,6 +281,7 @@ module.exports = () => Parser => class Espree extends Parser { * @returns {ASTNode} The finished node. */ [ESPRIMA_FINISH_NODE](result) { + // Acorn doesn't count the opening and closing backticks as part of templates // so we have to adjust ranges/locations appropriately. if (result.type === "TemplateElement") { @@ -301,10 +300,6 @@ module.exports = () => Parser => class Espree extends Parser { } } - if (this[STATE].attachComment) { - commentAttachment.processComment(result); - } - if (result.type.indexOf("Function") > -1 && !result.generator) { result.generator = false; } diff --git a/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js b/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js index f47b3621beb269..9919e1af236476 100644 --- a/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js +++ b/tools/node_modules/eslint/node_modules/espree/lib/token-translator.js @@ -18,7 +18,7 @@ // Esprima Token Types -var Token = { +const Token = { Boolean: "Boolean", EOF: "", Identifier: "Identifier", @@ -41,10 +41,10 @@ var Token = { * @private */ function convertTemplatePart(tokens, code) { - var firstToken = tokens[0], + const firstToken = tokens[0], lastTemplateToken = tokens[tokens.length - 1]; - var token = { + const token = { type: Token.Template, value: code.slice(firstToken.start, lastTemplateToken.end) }; @@ -99,9 +99,9 @@ TokenTranslator.prototype = { * @param {Object} extra Espree extra object. * @returns {EsprimaToken} The Esprima version of the token. */ - translate: function(token, extra) { + translate(token, extra) { - var type = token.type, + const type = token.type, tt = this._acornTokTypes; if (type === tt.name) { @@ -157,12 +157,13 @@ TokenTranslator.prototype = { token.value = this._code.slice(token.start, token.end); } else if (type === tt.regexp) { token.type = Token.RegularExpression; - var value = token.value; + const value = token.value; + token.regex = { flags: value.flags, pattern: value.pattern }; - token.value = "/" + value.pattern + "/" + value.flags; + token.value = `/${value.pattern}/${value.flags}`; } return token; @@ -174,9 +175,9 @@ TokenTranslator.prototype = { * @param {Object} extra The Espree extra object. * @returns {void} */ - onToken: function(token, extra) { + onToken(token, extra) { - var that = this, + const that = this, tt = this._acornTokTypes, tokens = extra.tokens, templateTokens = this._tokens; @@ -218,11 +219,13 @@ TokenTranslator.prototype = { } return; - } else if (token.type === tt.dollarBraceL) { + } + if (token.type === tt.dollarBraceL) { templateTokens.push(token); translateTemplateTokens(); return; - } else if (token.type === tt.braceR) { + } + if (token.type === tt.braceR) { // if there's already a curly, it's not part of the template if (this._curlyBrace) { @@ -232,7 +235,8 @@ TokenTranslator.prototype = { // store new curly for later this._curlyBrace = token; return; - } else if (token.type === tt.template || token.type === tt.invalidTemplate) { + } + if (token.type === tt.template || token.type === tt.invalidTemplate) { if (this._curlyBrace) { templateTokens.push(this._curlyBrace); this._curlyBrace = null; diff --git a/tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js b/tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js new file mode 100644 index 00000000000000..4216864f1c27c9 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/espree/lib/visitor-keys.js @@ -0,0 +1,123 @@ +/** + * @fileoverview The visitor keys for the node types Espree supports + * @author Nicholas C. Zakas + * + * This file contains code from estraverse-fb. + * + * The MIT license. Copyright (c) 2014 Ingvar Stepanyan + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // ECMAScript + AssignmentExpression: ["left", "right"], + AssignmentPattern: ["left", "right"], + ArrayExpression: ["elements"], + ArrayPattern: ["elements"], + ArrowFunctionExpression: ["params", "body"], + BlockStatement: ["body"], + BinaryExpression: ["left", "right"], + BreakStatement: ["label"], + CallExpression: ["callee", "arguments"], + CatchClause: ["param", "body"], + ClassBody: ["body"], + ClassDeclaration: ["id", "superClass", "body"], + ClassExpression: ["id", "superClass", "body"], + ConditionalExpression: ["test", "consequent", "alternate"], + ContinueStatement: ["label"], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ["body", "test"], + EmptyStatement: [], + ExportAllDeclaration: ["source"], + ExportDefaultDeclaration: ["declaration"], + ExportNamedDeclaration: ["declaration", "specifiers", "source"], + ExportSpecifier: ["exported", "local"], + ExpressionStatement: ["expression"], + ForStatement: ["init", "test", "update", "body"], + ForInStatement: ["left", "right", "body"], + ForOfStatement: ["left", "right", "body"], + FunctionDeclaration: ["id", "params", "body"], + FunctionExpression: ["id", "params", "body"], + Identifier: [], + IfStatement: ["test", "consequent", "alternate"], + ImportDeclaration: ["specifiers", "source"], + ImportDefaultSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportSpecifier: ["imported", "local"], + Literal: [], + LabeledStatement: ["label", "body"], + LogicalExpression: ["left", "right"], + MemberExpression: ["object", "property"], + MetaProperty: ["meta", "property"], + MethodDefinition: ["key", "value"], + ModuleSpecifier: [], + NewExpression: ["callee", "arguments"], + ObjectExpression: ["properties"], + ObjectPattern: ["properties"], + Program: ["body"], + Property: ["key", "value"], + RestElement: ["argument"], + ReturnStatement: ["argument"], + SequenceExpression: ["expressions"], + SpreadElement: ["argument"], + Super: [], + SwitchStatement: ["discriminant", "cases"], + SwitchCase: ["test", "consequent"], + TaggedTemplateExpression: ["tag", "quasi"], + TemplateElement: [], + TemplateLiteral: ["quasis", "expressions"], + ThisExpression: [], + ThrowStatement: ["argument"], + TryStatement: ["block", "handler", "finalizer"], + UnaryExpression: ["argument"], + UpdateExpression: ["argument"], + VariableDeclaration: ["declarations"], + VariableDeclarator: ["id", "init"], + WhileStatement: ["test", "body"], + WithStatement: ["object", "body"], + YieldExpression: ["argument"], + + // JSX + JSXIdentifier: [], + JSXNamespacedName: ["namespace", "name"], + JSXMemberExpression: ["object", "property"], + JSXEmptyExpression: [], + JSXExpressionContainer: ["expression"], + JSXElement: ["openingElement", "closingElement", "children"], + JSXClosingElement: ["name"], + JSXOpeningElement: ["name", "attributes"], + JSXAttribute: ["name", "value"], + JSXText: null, + JSXSpreadAttribute: ["argument"] +}; diff --git a/tools/node_modules/eslint/node_modules/espree/package.json b/tools/node_modules/eslint/node_modules/espree/package.json index 91e99e4b2136c0..273d2c5bda0d7c 100644 --- a/tools/node_modules/eslint/node_modules/espree/package.json +++ b/tools/node_modules/eslint/node_modules/espree/package.json @@ -17,8 +17,9 @@ "devDependencies": { "browserify": "^7.0.0", "chai": "^1.10.0", - "eslint": "^2.13.1", - "eslint-config-eslint": "^3.0.0", + "eslint": "^5.7.0", + "eslint-config-eslint": "^5.0.1", + "eslint-plugin-node": "^8.0.0", "eslint-release": "^1.0.0", "esprima": "latest", "esprima-fb": "^8001.2001.0-dev-harmony-fb", @@ -65,5 +66,5 @@ "publish-release": "eslint-publish-release", "test": "npm run-script lint && node Makefile.js test" }, - "version": "4.1.0" + "version": "5.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/flat-cache/cache.js b/tools/node_modules/eslint/node_modules/flat-cache/cache.js index 799e09eb7cb0fe..29219c86b1700d 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/cache.js +++ b/tools/node_modules/eslint/node_modules/flat-cache/cache.js @@ -1,7 +1,7 @@ var path = require( 'path' ); var fs = require( 'graceful-fs' ); -var del = require( 'del' ).sync; var utils = require( './utils' ); +var del = require( './del' ); var writeJSON = utils.writeJSON; var cache = { @@ -125,9 +125,7 @@ var cache = { * @return {Boolean} true or false if the file was successfully deleted */ removeCacheFile: function () { - return del( this._pathToFile, { - force: true - } ); + return del( this._pathToFile ); }, /** * Destroy the file cache and cache content. @@ -185,9 +183,7 @@ module.exports = { */ clearCacheById: function ( docId, cacheDir ) { var filePath = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId ); - return del( filePath, { - force: true - } ).length > 0; + return del( filePath ); }, /** * Remove all cache stored in the cache directory @@ -196,8 +192,6 @@ module.exports = { */ clearAll: function ( cacheDir ) { var filePath = cacheDir ? path.resolve( cacheDir ) : path.resolve( __dirname, './.cache/' ); - return del( filePath, { - force: true - } ).length > 0; + return del( filePath ); } }; diff --git a/tools/node_modules/eslint/node_modules/flat-cache/changelog.md b/tools/node_modules/eslint/node_modules/flat-cache/changelog.md index f35f6da4bfeb07..037a08ba17fbb8 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/changelog.md +++ b/tools/node_modules/eslint/node_modules/flat-cache/changelog.md @@ -1,31 +1,56 @@ # flat-cache - Changelog -## v1.3.2 +## v1.3.4 +- **Refactoring** + - Add del.js and utils.js to the list of files to be beautified - [9d0ca9b]( https://github.com/royriojas/flat-cache/commit/9d0ca9b ), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 12:19:02 + + +## v1.3.3 - **Refactoring** - - remove yarn.lock file - [704c6c4]( https://github.com/royriojas/flat-cache/commit/704c6c4 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 18:41:08 + - Make sure package-lock.json is up to date - [a7d2598]( https://github.com/royriojas/flat-cache/commit/a7d2598 ), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 11:36:08 + + +- **Other changes** + - Removed the need for del ([#33](https://github.com/royriojas/flat-cache/issues/33)) - [c429012]( https://github.com/royriojas/flat-cache/commit/c429012 ), [S. Gilroy](https://github.com/S. Gilroy), 13/11/2018 13:56:37 + * Removed the need for del + + Removed the need for del as newer versions have broken backwards + compatibility. del mainly uses rimraf for deleting folders + and files, replaceing it with rimraf only is a minimal change. + + * Disable glob on rimraf calls + + * Added glob disable to wrong call + + * Wrapped rimraf to simplify solution + +## v1.3.2 +- **Refactoring** + - remove yarn.lock file - [704c6c4]( https://github.com/royriojas/flat-cache/commit/704c6c4 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:41:08 + - **undefined** - - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74]( https://github.com/royriojas/flat-cache/commit/db12d74 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 18:40:39 + - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74]( https://github.com/royriojas/flat-cache/commit/db12d74 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:40:39 This reverts commit 00f689277a75e85fef28e6a048fad227afc525e6. - + ## v1.3.1 - **Refactoring** - - upgrade deps to remove some security warnings - [f405719]( https://github.com/royriojas/flat-cache/commit/f405719 ), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 15:07:31 - + - upgrade deps to remove some security warnings - [f405719]( https://github.com/royriojas/flat-cache/commit/f405719 ), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 12:07:31 + - **Bug Fixes** - - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892]( https://github.com/royriojas/flat-cache/commit/00f6892 ), [Terry](https://github.com/Terry), 05/11/2018 21:44:16 - + - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892]( https://github.com/royriojas/flat-cache/commit/00f6892 ), [Terry](https://github.com/Terry), 05/11/2018 18:44:16 + - **undefined** - - update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f]( https://github.com/royriojas/flat-cache/commit/d42883f ), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 03:00:44 + - update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f]( https://github.com/royriojas/flat-cache/commit/d42883f ), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 01:00:44 Closes #25 ## v1.3.0 - **Other changes** - - Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be]( https://github.com/royriojas/flat-cache/commit/12293be ), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 16:46:38 + - Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be]( https://github.com/royriojas/flat-cache/commit/12293be ), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 14:46:38 * Added #all method @@ -39,12 +64,12 @@ * Beautified file - - fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a]( https://github.com/royriojas/flat-cache/commit/af8338a ), [前端小武](https://github.com/前端小武), 19/12/2016 23:34:48 + - fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a]( https://github.com/royriojas/flat-cache/commit/af8338a ), [前端小武](https://github.com/前端小武), 19/12/2016 20:34:48 ## v1.2.2 - **Bug Fixes** - - Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6]( https://github.com/royriojas/flat-cache/commit/87beaa6 ), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 21:03:35 + - Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6]( https://github.com/royriojas/flat-cache/commit/87beaa6 ), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 18:03:35 Fixes #12 @@ -55,186 +80,186 @@ If the cache is somehow not valid the cache will be discarded an a a new cache will be stored instead - **Other changes** - - Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7]( https://github.com/royriojas/flat-cache/commit/1c2b1f7 ), [Amila Welihinda](https://github.com/Amila Welihinda), 11/11/2016 02:47:52 + - Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7]( https://github.com/royriojas/flat-cache/commit/1c2b1f7 ), [Amila Welihinda](https://github.com/Amila Welihinda), 10/11/2016 23:47:52 - - Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861]( https://github.com/royriojas/flat-cache/commit/4d5e861 ), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 09:13:52 + - Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861]( https://github.com/royriojas/flat-cache/commit/4d5e861 ), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 07:13:52 As mentioned in https://github.com/WebReflection/circular-json/issues/25 `circular-json` wan't rightly implementing the license field. Latest version bump changed only that bit so that ESLint should now be happy. ## v1.2.1 - **Bug Fixes** - - Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2]( https://github.com/royriojas/flat-cache/commit/ec10cf2 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:18:57 + - Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2]( https://github.com/royriojas/flat-cache/commit/ec10cf2 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:18:57 ## v1.2.0 - **Documentation** - - Add documentation about noPrune option - [23e11f9]( https://github.com/royriojas/flat-cache/commit/23e11f9 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:06:49 + - Add documentation about noPrune option - [23e11f9]( https://github.com/royriojas/flat-cache/commit/23e11f9 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:06:49 ## v1.1.0 - **Features** - - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:00:29 + - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:00:29 - - Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:58:17 + - Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:58:17 - **Bug Fixes** - - Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:18:06 + - Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:18:06 Since we control both writing and reading of JSON stream, there no needs to handle unicode BOM. - - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 13:11:59 + - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 11:11:59 - **Tests Related fixes** - - Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:15:51 + - Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:15:51 - - Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:36 + - Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:36 - **Refactoring** - - Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:18 + - Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:18 - **Build Scripts Changes** - - travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 17:34:40 + - travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 14:34:40 - - add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08 + - add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 15:04:08 - - make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48 + - make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 11:54:48 - **Other changes** - - add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18 + - add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21:02:18 ## v1.0.9 - **Bug Fixes** - - wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30 + - wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 15:59:30 ## v1.0.8 - **Build Scripts Changes** - - test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39 + - test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 15:51:39 ## v1.0.7 - **Other changes** - - Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57 + - Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:10:57 - **Documentation** - - Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05 + - Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 14:48:05 ## v1.0.6 - **Build Scripts Changes** - - Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31 + - Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 14:44:31 ## v1.0.5 - **Documentation** - - better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33 + - better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 14:35:33 - **Other changes** - - Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41 + - Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 13:47:41 ## v1.0.11 - **Features** - - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:00:29 - - - - Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:58:17 + - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:00:29 + + - Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:58:17 + - **Bug Fixes** - - Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:18:06 + - Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:18:06 - Since we control both writing and reading of JSON stream, there no needs + Since we control both writing and reading of JSON stream, there no needs to handle unicode BOM. - - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 13:11:59 - + - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 11:11:59 + - **Tests Related fixes** - - Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:15:51 - - - - Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:36 + - Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:15:51 + + - Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:36 + - **Refactoring** - - Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:18 - + - Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:18 + - **Build Scripts Changes** - - travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 17:34:40 - + - travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 14:34:40 + ## v1.0.10 - **Build Scripts Changes** - - add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08 - - - - make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48 - - - - test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39 + - add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 15:04:08 + + - make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 11:54:48 - - Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31 + + - test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 15:51:39 + + - Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 14:44:31 + - **Other changes** - - add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18 - - - - Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57 + - add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21:02:18 + + - Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:10:57 - - Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41 - + + - Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 13:47:41 + - **Bug Fixes** - - wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30 + - wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 15:59:30 - **Documentation** - - Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05 - - - - better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33 + - Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 14:48:05 + + - better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 14:35:33 - - Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:44:05 + + - Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:44:05 - **Refactoring** - - load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:19:14 - + - load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 04:19:14 + - **Features** - - Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:39:27 + - Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:39:27 ## v1.0.1 - **Other changes** - - Update README.md - [c2b6805]( https://github.com/royriojas/flat-cache/commit/c2b6805 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:28:07 + - Update README.md - [c2b6805]( https://github.com/royriojas/flat-cache/commit/c2b6805 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:28:07 ## v1.0.0 - **Refactoring** - - flat-cache v.1.0.0 - [c984274]( https://github.com/royriojas/flat-cache/commit/c984274 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:11:50 + - flat-cache v.1.0.0 - [c984274]( https://github.com/royriojas/flat-cache/commit/c984274 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:11:50 - **Other changes** - - Initial commit - [d43cccf]( https://github.com/royriojas/flat-cache/commit/d43cccf ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:12:16 + - Initial commit - [d43cccf]( https://github.com/royriojas/flat-cache/commit/d43cccf ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 01:12:16 diff --git a/tools/node_modules/eslint/node_modules/flat-cache/del.js b/tools/node_modules/eslint/node_modules/flat-cache/del.js new file mode 100644 index 00000000000000..542baac70a0c78 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/flat-cache/del.js @@ -0,0 +1,13 @@ +var rimraf = require( 'rimraf' ).sync; +var fs = require( 'graceful-fs' ); + +module.exports = function del( file ) { + if ( fs.existsSync( file ) ) { + //if rimraf doesn't throw then the file has been deleted or didn't exist + rimraf( file, { + glob: false + } ); + return true; + } + return false; +}; diff --git a/tools/node_modules/eslint/node_modules/flat-cache/package.json b/tools/node_modules/eslint/node_modules/flat-cache/package.json index 5e7f5f3acabcfa..66290b456afaee 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/package.json +++ b/tools/node_modules/eslint/node_modules/flat-cache/package.json @@ -21,8 +21,8 @@ }, "dependencies": { "circular-json": "^0.3.1", - "del": "^3.0.0", "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", "write": "^0.2.1" }, "deprecated": false, @@ -47,7 +47,8 @@ }, "files": [ "cache.js", - "utils.js" + "utils.js", + "del.js" ], "homepage": "https://github.com/royriojas/flat-cache#readme", "keywords": [ @@ -73,7 +74,7 @@ }, "scripts": { "autofix": "npm run beautify && npm run eslint-fix", - "beautify": "esbeautifier 'cache.js' 'test/specs/**/*.js'", + "beautify": "esbeautifier 'cache.js' 'utils.js' 'del.js' 'test/specs/**/*.js'", "beautify-check": "npm run beautify -- -k", "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", @@ -82,7 +83,7 @@ "check": "npm run beautify-check && npm run eslint", "cover": "istanbul cover test/runner.js html text-summary", "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", - "eslint": "eslinter 'cache.js' 'utils.js' 'specs/**/*.js'", + "eslint": "eslinter 'cache.js' 'utils.js' 'del.js' 'specs/**/*.js'", "eslint-fix": "npm run eslint -- --fix", "install-hooks": "prepush install && changelogx install-hook && precommit install", "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", @@ -92,5 +93,5 @@ "verify": "npm run check && npm run test:cache", "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" }, - "version": "1.3.2" + "version": "1.3.4" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/flat-cache/utils.js b/tools/node_modules/eslint/node_modules/flat-cache/utils.js index e3654d23fa3d87..11b41f437027b5 100644 --- a/tools/node_modules/eslint/node_modules/flat-cache/utils.js +++ b/tools/node_modules/eslint/node_modules/flat-cache/utils.js @@ -4,7 +4,7 @@ var circularJson = require( 'circular-json' ); module.exports = { - tryParse: function ( filePath, defaultValue) { + tryParse: function ( filePath, defaultValue ) { var result; try { result = this.readJSON( filePath ); @@ -32,7 +32,7 @@ module.exports = { * @param {String} filePath Json filepath * @param {*} data Object to serialize */ - writeJSON: function (filePath, data ) { + writeJSON: function ( filePath, data ) { write.sync( filePath, circularJson.stringify( data ) ); } diff --git a/tools/node_modules/eslint/node_modules/globals/globals.json b/tools/node_modules/eslint/node_modules/globals/globals.json index d805cdd73c6bdb..2619096e68b7c4 100644 --- a/tools/node_modules/eslint/node_modules/globals/globals.json +++ b/tools/node_modules/eslint/node_modules/globals/globals.json @@ -698,6 +698,7 @@ "PushManager": false, "PushSubscription": false, "PushSubscriptionOptions": false, + "queueMicrotask": false, "RadioNodeList": false, "Range": false, "ReadableStream": false, @@ -984,6 +985,7 @@ "PerformanceTiming": false, "postMessage": true, "Promise": false, + "queueMicrotask": false, "Request": false, "Response": false, "self": true, @@ -1012,10 +1014,13 @@ "Intl": false, "module": false, "process": false, + "queueMicrotask": false, "require": false, "setImmediate": false, "setInterval": false, "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, "URL": false, "URLSearchParams": false }, diff --git a/tools/node_modules/eslint/node_modules/globals/package.json b/tools/node_modules/eslint/node_modules/globals/package.json index ef0bf02ac857ab..958e4c737e64e6 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.8.0", + "version": "11.9.0", "xo": { "ignores": [ "get-browser-globals.js" diff --git a/tools/node_modules/eslint/node_modules/globby/index.js b/tools/node_modules/eslint/node_modules/globby/index.js deleted file mode 100644 index 587a0fdd1cc0fb..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; -var Promise = require('pinkie-promise'); -var arrayUnion = require('array-union'); -var objectAssign = require('object-assign'); -var glob = require('glob'); -var pify = require('pify'); - -var globP = pify(glob, Promise).bind(glob); - -function isNegative(pattern) { - return pattern[0] === '!'; -} - -function isString(value) { - return typeof value === 'string'; -} - -function assertPatternsInput(patterns) { - if (!patterns.every(isString)) { - throw new TypeError('patterns must be a string or an array of strings'); - } -} - -function generateGlobTasks(patterns, opts) { - patterns = [].concat(patterns); - assertPatternsInput(patterns); - - var globTasks = []; - - opts = objectAssign({ - cache: Object.create(null), - statCache: Object.create(null), - realpathCache: Object.create(null), - symlinks: Object.create(null), - ignore: [] - }, opts); - - patterns.forEach(function (pattern, i) { - if (isNegative(pattern)) { - return; - } - - var ignore = patterns.slice(i).filter(isNegative).map(function (pattern) { - return pattern.slice(1); - }); - - globTasks.push({ - pattern: pattern, - opts: objectAssign({}, opts, { - ignore: opts.ignore.concat(ignore) - }) - }); - }); - - return globTasks; -} - -module.exports = function (patterns, opts) { - var globTasks; - - try { - globTasks = generateGlobTasks(patterns, opts); - } catch (err) { - return Promise.reject(err); - } - - return Promise.all(globTasks.map(function (task) { - return globP(task.pattern, task.opts); - })).then(function (paths) { - return arrayUnion.apply(null, paths); - }); -}; - -module.exports.sync = function (patterns, opts) { - var globTasks = generateGlobTasks(patterns, opts); - - return globTasks.reduce(function (matches, task) { - return arrayUnion(matches, glob.sync(task.pattern, task.opts)); - }, []); -}; - -module.exports.generateGlobTasks = generateGlobTasks; - -module.exports.hasMagic = function (patterns, opts) { - return [].concat(patterns).some(function (pattern) { - return glob.hasMagic(pattern, opts); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/globby/license b/tools/node_modules/eslint/node_modules/globby/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/index.js b/tools/node_modules/eslint/node_modules/globby/node_modules/pify/index.js deleted file mode 100644 index 7c720ebee88727..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var processFn = function (fn, P, opts) { - return function () { - var that = this; - var args = new Array(arguments.length); - - for (var i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return new P(function (resolve, reject) { - args.push(function (err, result) { - if (err) { - reject(err); - } else if (opts.multiArgs) { - var results = new Array(arguments.length - 1); - - for (var i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } - - resolve(results); - } else { - resolve(result); - } - }); - - fn.apply(that, args); - }); - }; -}; - -var pify = module.exports = function (obj, P, opts) { - if (typeof P !== 'function') { - opts = P; - P = Promise; - } - - opts = opts || {}; - opts.exclude = opts.exclude || [/.+Sync$/]; - - var filter = function (key) { - var match = function (pattern) { - return typeof pattern === 'string' ? key === pattern : pattern.test(key); - }; - - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; - - var ret = typeof obj === 'function' ? function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } - - return processFn(obj, P, opts).apply(this, arguments); - } : {}; - - return Object.keys(obj).reduce(function (ret, key) { - var x = obj[key]; - - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; - - return ret; - }, ret); -}; - -pify.all = pify; diff --git a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/license b/tools/node_modules/eslint/node_modules/globby/node_modules/pify/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/package.json b/tools/node_modules/eslint/node_modules/globby/node_modules/pify/package.json deleted file mode 100644 index 40780115cf1d0a..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/pify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Promisify a callback-style function", - "devDependencies": { - "ava": "*", - "pinkie-promise": "^1.0.0", - "v8-natives": "0.0.2", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/pify#readme", - "keywords": [ - "promise", - "promises", - "promisify", - "denodify", - "denodeify", - "callback", - "cb", - "node", - "then", - "thenify", - "convert", - "transform", - "wrap", - "wrapper", - "bind", - "to", - "async", - "es2015" - ], - "license": "MIT", - "name": "pify", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/pify.git" - }, - "scripts": { - "optimization-test": "node --allow-natives-syntax optimization-test.js", - "test": "xo && ava && npm run optimization-test" - }, - "version": "2.3.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/readme.md b/tools/node_modules/eslint/node_modules/globby/node_modules/pify/readme.md deleted file mode 100644 index 97aeeb628b0897..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/node_modules/pify/readme.md +++ /dev/null @@ -1,119 +0,0 @@ -# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) - -> Promisify a callback-style function - - -## Install - -``` -$ npm install --save pify -``` - - -## Usage - -```js -const fs = require('fs'); -const pify = require('pify'); - -// promisify a single function - -pify(fs.readFile)('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); - -// or promisify all methods in a module - -pify(fs).readFile('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); -``` - - -## API - -### pify(input, [promiseModule], [options]) - -Returns a promise wrapped version of the supplied function or module. - -#### input - -Type: `function`, `object` - -Callback-style function or module whose methods you want to promisify. - -#### promiseModule - -Type: `function` - -Custom promise module to use instead of the native one. - -Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. - -#### options - -##### multiArgs - -Type: `boolean` -Default: `false` - -By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. - -```js -const request = require('request'); -const pify = require('pify'); - -pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { - const [httpResponse, body] = result; -}); -``` - -##### include - -Type: `array` of (`string`|`regex`) - -Methods in a module to promisify. Remaining methods will be left untouched. - -##### exclude - -Type: `array` of (`string`|`regex`) -Default: `[/.+Sync$/]` - -Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. - -##### excludeMain - -Type: `boolean` -Default: `false` - -By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. - -```js -const pify = require('pify'); - -function fn() { - return true; -} - -fn.method = (data, callback) => { - setImmediate(() => { - callback(data, null); - }); -}; - -// promisify methods but not fn() -const promiseFn = pify(fn, {excludeMain: true}); - -if (promiseFn()) { - promiseFn.method('hi').then(data => { - console.log(data); - }); -} -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/globby/package.json b/tools/node_modules/eslint/node_modules/globby/package.json deleted file mode 100644 index fad7fc179674cb..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/globby/issues" - }, - "bundleDependencies": false, - "dependencies": { - "array-union": "^1.0.1", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "deprecated": false, - "description": "Extends `glob` with support for multiple patterns and exposes a Promise API", - "devDependencies": { - "ava": "*", - "glob-stream": "github:gulpjs/glob-stream#master", - "globby": "github:sindresorhus/globby#master", - "matcha": "^0.7.0", - "rimraf": "^2.2.8", - "xo": "^0.16.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/globby#readme", - "keywords": [ - "all", - "array", - "directories", - "dirs", - "expand", - "files", - "filesystem", - "filter", - "find", - "fnmatch", - "folders", - "fs", - "glob", - "globbing", - "globs", - "gulpfriendly", - "match", - "matcher", - "minimatch", - "multi", - "multiple", - "paths", - "pattern", - "patterns", - "traverse", - "util", - "utility", - "wildcard", - "wildcards", - "promise" - ], - "license": "MIT", - "name": "globby", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/globby.git" - }, - "scripts": { - "bench": "npm update glob-stream && matcha bench.js", - "test": "xo && ava" - }, - "version": "6.1.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/globby/readme.md b/tools/node_modules/eslint/node_modules/globby/readme.md deleted file mode 100644 index e10a48868f9e29..00000000000000 --- a/tools/node_modules/eslint/node_modules/globby/readme.md +++ /dev/null @@ -1,88 +0,0 @@ -# globby [![Build Status](https://travis-ci.org/sindresorhus/globby.svg?branch=master)](https://travis-ci.org/sindresorhus/globby) - -> Extends [glob](https://github.com/isaacs/node-glob) with support for multiple patterns and exposes a Promise API - - -## Install - -``` -$ npm install --save globby -``` - - -## Usage - -``` -├── unicorn -├── cake -└── rainbow -``` - -```js -const globby = require('globby'); - -globby(['*', '!cake']).then(paths => { - console.log(paths); - //=> ['unicorn', 'rainbow'] -}); -``` - - -## API - -### globby(patterns, [options]) - -Returns a Promise for an array of matching paths. - -### globby.sync(patterns, [options]) - -Returns an array of matching paths. - -### globby.generateGlobTasks(patterns, [options]) - -Returns an array of objects in the format `{ pattern: string, opts: Object }`, which can be passed as arguments to [`node-glob`](https://github.com/isaacs/node-glob). This is useful for other globbing-related packages. - -Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration. - -### globby.hasMagic(patterns, [options]) - -Returns a `boolean` of whether there are any special glob characters in the `patterns`. - -Note that the options affect the results. If `noext: true` is set, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`, then that is considered magical, unless `nobrace: true` is set. - -#### patterns - -Type: `string` `Array` - -See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage). - -#### options - -Type: `Object` - -See the `node-glob` [options](https://github.com/isaacs/node-glob#options). - - -## Globbing patterns - -Just a quick overview. - -- `*` matches any number of characters, but not `/` -- `?` matches a single character, but not `/` -- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part -- `{}` allows for a comma-separated list of "or" expressions -- `!` at the beginning of a pattern will negate the match - -[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/master/test.js) - - -## Related - -- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem -- [glob-stream](https://github.com/wearefractal/glob-stream) - Streaming alternative -- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/inquirer/README.md b/tools/node_modules/eslint/node_modules/inquirer/README.md new file mode 100644 index 00000000000000..1038bbd526336b --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/README.md @@ -0,0 +1,424 @@ +Inquirer Logo + +# Inquirer.js + +[![npm](https://badge.fury.io/js/inquirer.svg)](http://badge.fury.io/js/inquirer) [![tests](https://travis-ci.org/SBoudrias/Inquirer.js.svg?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) [![Coverage Status](https://codecov.io/gh/SBoudrias/Inquirer.js/branch/master/graph/badge.svg)](https://codecov.io/gh/SBoudrias/Inquirer.js) [![dependencies](https://david-dm.org/SBoudrias/Inquirer.js.svg?theme=shields.io)](https://david-dm.org/SBoudrias/Inquirer.js) + +A collection of common interactive command line user interfaces. + +**Version 4.x** only supports Node 6 and over. For Node 4 support please use [version 3.x](https://github.com/SBoudrias/Inquirer.js/tree/v3.3.0). + +## Table of Contents + +1. [Documentation](#documentation) + 1. [Installation](#installation) + 2. [Examples](#examples) + 3. [Methods](#methods) + 4. [Objects](#objects) + 5. [Questions](#questions) + 6. [Answers](#answers) + 7. [Separator](#separator) + 8. [Prompt Types](#prompt) +2. [User Interfaces and Layouts](#layouts) + 1. [Reactive Interface](#reactive) +3. [Support](#support) +4. [News](#news) +5. [Contributing](#contributing) +6. [License](#license) +7. [Plugins](#plugins) + +## Goal and Philosophy + +**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the "CLI [Xanadu](https://en.wikipedia.org/wiki/Citizen_Kane)"). + +**`Inquirer.js`** should ease the process of + +- providing _error feedback_ +- _asking questions_ +- _parsing_ input +- _validating_ answers +- managing _hierarchical prompts_ + +> **Note:** **`Inquirer.js`** provides the user interface and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [commander](https://github.com/visionmedia/commander.js), [vorpal](https://github.com/dthree/vorpal) or [args](https://github.com/leo/args). + +## [Documentation](#documentation) + + + +### Installation + + + +```shell +npm install inquirer +``` + +```javascript +var inquirer = require('inquirer'); +inquirer + .prompt([ + /* Pass your questions in here */ + ]) + .then(answers => { + // Use user feedback for... whatever!! + }); +``` + + + +### Examples (Run it and see it) + +Check out the [`packages/inquirer/examples/`](https://github.com/SBoudrias/Inquirer.js/tree/master/packages/inquirer/examples) folder for code and interface examples. + +```shell +node packages/inquirer/examples/pizza.js +node packages/inquirer/examples/checkbox.js +# etc... +``` + +### Methods + + + +#### `inquirer.prompt(questions) -> promise` + +Launch the prompt interface (inquiry session) + +- **questions** (Array) containing [Question Object](#question) (using the [reactive interface](#reactive-interface), you can also pass a `Rx.Observable` instance) +- returns a **Promise** + +#### `inquirer.registerPrompt(name, prompt)` + +Register prompt plugins under `name`. + +- **name** (string) name of the this new prompt. (used for question `type`) +- **prompt** (object) the prompt object itself (the plugin) + +#### `inquirer.createPromptModule() -> prompt function` + +Create a self contained inquirer module. If you don't want to affect other libraries that also rely on inquirer when you overwrite or add new prompt types. + +```js +var prompt = inquirer.createPromptModule(); + +prompt(questions).then(/* ... */); +``` + +### Objects + + + +#### Question + + +A question object is a `hash` containing question related values: + +- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `confirm`, + `list`, `rawlist`, `expand`, `checkbox`, `password`, `editor` +- **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash. +- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon). +- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers. +- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. + Array values can be simple `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). +- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. +- **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. +- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash. +- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean. +- **pageSize**: (Number) Change the number of lines that will be rendered when using `list`, `rawList`, `expand` or `checkbox`. +- **prefix**: (String) Change the default _prefix_ message. +- **suffix**: (String) Change the default _suffix_ message. + +`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously. Either return a promise or use `this.async()` to get a callback you'll call with the final value. + +```javascript +{ + /* Preferred way: with promise */ + filter() { + return new Promise(/* etc... */); + }, + + /* Legacy way: with this.async */ + validate: function (input) { + // Declare function as asynchronous, and save the done callback + var done = this.async(); + + // Do async stuff + setTimeout(function() { + if (typeof input !== 'number') { + // Pass the return value in the done callback + done('You need to provide a number'); + return; + } + // Pass the return value in the done callback + done(null, true); + }, 3000); + } +} +``` + +### Answers + + +A key/value hash containing the client answers in each prompt. + +- **Key** The `name` property of the _question_ object +- **Value** (Depends on the prompt) + - `confirm`: (Boolean) + - `input` : User input (filtered if `filter` is defined) (String) + - `rawlist`, `list` : Selected choice value (or name if no value specified) (String) + +### Separator + + +A separator can be added to any `choices` array: + +``` +// In the question object +choices: [ "Choice A", new inquirer.Separator(), "choice B" ] + +// Which'll be displayed this way +[?] What do you want to do? + > Order a pizza + Make a reservation + -------- + Ask opening hours + Talk to the receptionist +``` + +The constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`. + +Separator instances have a property `type` equal to `separator`. This should allow tools façading Inquirer interface from detecting separator types in lists. + + + +### Prompt types + +--- + +> **Note:**: _allowed options written inside square brackets (`[]`) are optional. Others are required._ + +#### List - `{type: 'list'}` + +Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that +default must be the choice `index` in the array or a choice `value`) + +![List prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/list.svg) + +--- + +#### Raw List - `{type: 'rawlist'}` + +Take `type`, `name`, `message`, `choices`[, `default`, `filter`] properties. (Note that +default must be the choice `index` in the array) + +![Raw list prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/rawlist.svg) + +--- + +#### Expand - `{type: 'expand'}` + +Take `type`, `name`, `message`, `choices`[, `default`] properties. (Note that +default must be the choice `index` in the array. If `default` key not provided, then `help` will be used as default choice) + +Note that the `choices` object will take an extra parameter called `key` for the `expand` prompt. This parameter must be a single (lowercased) character. The `h` option is added by the prompt and shouldn't be defined by the user. + +See `examples/expand.js` for a running example. + +![Expand prompt closed](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-y.svg) +![Expand prompt expanded](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/expand-d.svg) + +--- + +#### Checkbox - `{type: 'checkbox'}` + +Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`] properties. `default` is expected to be an Array of the checked choices value. + +Choices marked as `{checked: true}` will be checked by default. + +Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string. + +![Checkbox prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/checkbox.svg) + +--- + +#### Confirm - `{type: 'confirm'}` + +Take `type`, `name`, `message`, [`default`] properties. `default` is expected to be a boolean if used. + +![Confirm prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/confirm.svg) + +--- + +#### Input - `{type: 'input'}` + +Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties. + +![Input prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/input.svg) + +--- + +#### Password - `{type: 'password'}` + +Take `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties. + +![Password prompt](https://cdn.rawgit.com/SBoudrias/Inquirer.js/28ae8337ba51d93e359ef4f7ee24e79b69898962/assets/screenshots/password.svg) + +--- + +Note that `mask` is required to hide the actual user input. + +#### Editor - `{type: 'editor'}` + +Take `type`, `name`, `message`[, `default`, `filter`, `validate`] properties + +Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the contents of the temporary file are read in as the result. The editor to use is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, notepad (on Windows) or vim (Linux or Mac) is used. + + + +## User Interfaces and layouts + +Along with the prompts, Inquirer offers some basic text UI. + +#### Bottom Bar - `inquirer.ui.BottomBar` + +This UI present a fixed text at the bottom of a free text zone. This is useful to keep a message to the bottom of the screen while outputting command outputs on the higher section. + +```javascript +var ui = new inquirer.ui.BottomBar(); + +// pipe a Stream to the log zone +outputStream.pipe(ui.log); + +// Or simply write output +ui.log.write('something just happened.'); +ui.log.write('Almost over, standby!'); + +// During processing, update the bottom bar content to display a loader +// or output a progress bar, etc +ui.updateBottomBar('new bottom bar content'); +``` + + + +## Reactive interface + +Internally, Inquirer uses the [JS reactive extension](https://github.com/ReactiveX/rxjs) to handle events and async flows. + +This mean you can take advantage of this feature to provide more advanced flows. For example, you can dynamically add questions to be asked: + +```js +var prompts = new Rx.Subject(); +inquirer.prompt(prompts); + +// At some point in the future, push new questions +prompts.next({ + /* question... */ +}); +prompts.next({ + /* question... */ +}); + +// When you're done +prompts.complete(); +``` + +And using the return value `process` property, you can access more fine grained callbacks: + +```js +inquirer.prompt(prompts).ui.process.subscribe(onEachAnswer, onError, onComplete); +``` + +## Support (OS Terminals) + + + +You should expect mostly good support for the CLI below. This does not mean we won't +look at issues found on other command line - feel free to report any! + +- **Mac OS**: + - Terminal.app + - iTerm +- **Windows**: + - [ConEmu](https://conemu.github.io/) + - cmd.exe + - Powershell + - Cygwin +- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**: + - gnome-terminal (Terminal GNOME) + - konsole + +## News on the march (Release notes) + + + +Please refer to the [Github releases section for the changelog](https://github.com/SBoudrias/Inquirer.js/releases) + +## Contributing + + + +**Unit test** +Unit test are written in [Mocha](https://mochajs.org/). Please add a unit test for every new feature or bug fix. `npm test` to run the test suite. + +**Documentation** +Add documentation for every API change. Feel free to send typo fixes and better docs! + +We're looking to offer good support for multiple prompts and environments. If you want to +help, we'd like to keep a list of testers for each terminal/OS so we can contact you and +get feedback before release. Let us know if you want to be added to the list (just tweet +to [@vaxilart](https://twitter.com/Vaxilart)) or just add your name to [the wiki](https://github.com/SBoudrias/Inquirer.js/wiki/Testers) + +## License + + + +Copyright (c) 2016 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart)) +Licensed under the MIT license. + +## Plugins + + + +### Prompts + +[**autocomplete**](https://github.com/mokkabonna/inquirer-autocomplete-prompt)
+Presents a list of options as the user types, compatible with other packages such as fuzzy (for search)
+
+![autocomplete prompt](https://github.com/mokkabonna/inquirer-autocomplete-prompt/raw/master/inquirer.gif) + +[**checkbox-plus**](https://github.com/faressoft/inquirer-checkbox-plus-prompt)
+Checkbox list with autocomplete and other additions
+
+![checkbox-plus](https://github.com/faressoft/inquirer-checkbox-plus-prompt/raw/master/demo.gif) + +[**datetime**](https://github.com/DerekTBrown/inquirer-datepicker-prompt)
+Customizable date/time selector using both number pad and arrow keys
+
+![Datetime Prompt](https://github.com/DerekTBrown/inquirer-datepicker-prompt/raw/master/example/datetime-prompt.png) + +[**inquirer-select-line**](https://github.com/adam-golab/inquirer-select-line)
+Prompt for selecting index in array where add new element
+
+![inquirer-select-line gif](https://media.giphy.com/media/xUA7b1MxpngddUvdHW/giphy.gif) + +[**command**](https://github.com/sullof/inquirer-command-prompt)
+
+Simple prompt with command history and dynamic autocomplete + +[**inquirer-fuzzy-path**](https://github.com/adelsz/inquirer-fuzzy-path)
+Prompt for fuzzy file/directory selection.
+
+![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif) + +[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)
+Prompt for input chalk-pipe style strings
+
+![inquirer-chalk-pipe](https://github.com/LitoMore/inquirer-chalk-pipe/raw/master/screenshot.gif) + +[**inquirer-search-checkbox**](https://github.com/clinyong/inquirer-search-checkbox)
+Searchable Inquirer checkbox
+ +[**inquirer-prompt-suggest**](https://github.com/olistic/inquirer-prompt-suggest)
+Inquirer prompt for your less creative users. + +![inquirer-prompt-suggest](https://user-images.githubusercontent.com/5600126/40391192-d4f3d6d0-5ded-11e8-932f-4b75b642c09e.gif) diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js index d27d46d85d7b9f..f1e3bad2e52ec2 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/checkbox.js @@ -29,7 +29,6 @@ class CheckboxPrompt extends Base { } this.pointer = 0; - this.firstRender = true; // Make sure no default is set (so it won't be printed) this.opt.default = null; @@ -87,7 +86,7 @@ class CheckboxPrompt extends Base { var message = this.getQuestion(); var bottomContent = ''; - if (this.firstRender) { + if (!this.spaceKeyPressed) { message += '(Press ' + chalk.cyan.bold('') + @@ -166,6 +165,7 @@ class CheckboxPrompt extends Base { } onSpaceKey() { + this.spaceKeyPressed = true; this.toggleChoice(this.pointer); this.render(); } diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/password.js b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/password.js index 1acdc86327d748..6b85d98cf63031 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/password.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/password.js @@ -37,11 +37,9 @@ class PasswordPrompt extends Base { validation.success.forEach(this.onEnd.bind(this)); validation.error.forEach(this.onError.bind(this)); - if (this.opt.mask) { - events.keypress - .pipe(takeUntil(validation.success)) - .forEach(this.onKeypress.bind(this)); - } + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); // Init this.render(); diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js index 33f2ead18a3971..4e0bcab0f6f3ab 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js @@ -67,6 +67,10 @@ class RawListPrompt extends Base { events.keypress .pipe(takeUntil(validation.success)) .forEach(this.onKeypress.bind(this)); + events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(events.line)) + .forEach(this.onDownKey.bind(this)); // Init the prompt this.render(); @@ -146,6 +150,34 @@ class RawListPrompt extends Base { this.render(); } + + /** + * When user press up key + */ + + onUpKey() { + this.onArrowKey('up'); + } + + /** + * When user press down key + */ + + onDownKey() { + this.onArrowKey('down'); + } + + /** + * When user press up or down key + * @param {String} type Arrow type: up or down + */ + + onArrowKey(type) { + var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; + index += type === 'up' ? -1 : 1; + this.rl.line = String(index + 1); + this.onKeypress(); + } } /** diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..76d354a9afffd0 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); +}; diff --git a/tools/node_modules/eslint/node_modules/del/license b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/license similarity index 100% rename from tools/node_modules/eslint/node_modules/del/license rename to tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/license diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..bcc09292f62a6d --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json @@ -0,0 +1,62 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "4.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000000000..1b9d5fa98a0a26 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md @@ -0,0 +1,65 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] +``` + + +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..96e0292c8e2f64 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; diff --git a/tools/node_modules/eslint/node_modules/p-map/license b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/license similarity index 100% rename from tools/node_modules/eslint/node_modules/p-map/license rename to tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/license diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..8b96e6d04b563a --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json @@ -0,0 +1,61 @@ +{ + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^4.0.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes", + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "5.0.0" +} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000000..d4871fb44351c6 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md @@ -0,0 +1,53 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +--- + +
+ + Get professional support for 'strip-ansi' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/tools/node_modules/eslint/node_modules/inquirer/package.json b/tools/node_modules/eslint/node_modules/inquirer/package.json index a9679e830a3986..6f1433efc24094 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/package.json +++ b/tools/node_modules/eslint/node_modules/inquirer/package.json @@ -19,26 +19,26 @@ "run-async": "^2.2.0", "rxjs": "^6.1.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.0.0", "through": "^2.3.6" }, "deprecated": false, "description": "A collection of common interactive command line user interfaces.", "devDependencies": { "chai": "^4.0.1", - "chalk-pipe": "^1.2.0", + "chalk-pipe": "^2.0.0", "cmdify": "^0.0.4", "mocha": "^5.0.0", "mockery": "^2.1.0", - "nsp": "^3.0.0", - "nyc": "^12.0.1", - "sinon": "^5.0.0" + "nyc": "^13.1.0", + "sinon": "^7.1.1" }, "engines": { "node": ">=6.0.0" }, "files": [ - "lib" + "lib", + "README.md" ], "homepage": "https://github.com/SBoudrias/Inquirer.js#readme", "keywords": [ @@ -57,9 +57,10 @@ "url": "git+https://github.com/SBoudrias/Inquirer.js.git" }, "scripts": { + "postpublish": "rm -f README.md", "posttest": "nyc report --reporter=text-lcov > ../../coverage/nyc-report.lcov", - "prepublish": "nsp check", + "prepublishOnly": "cp ../../README.md .", "test": "nyc mocha test/**/* -r ./test/before" }, - "version": "6.2.0" + "version": "6.2.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-path-cwd/index.js b/tools/node_modules/eslint/node_modules/is-path-cwd/index.js deleted file mode 100644 index 24b6fdea37ee36..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-cwd/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var path = require('path'); - -module.exports = function (str) { - return path.resolve(str) === path.resolve(process.cwd()); -}; diff --git a/tools/node_modules/eslint/node_modules/is-path-cwd/package.json b/tools/node_modules/eslint/node_modules/is-path-cwd/package.json deleted file mode 100644 index cfb452cc043352..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-cwd/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-path-cwd/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a path is CWD", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-path-cwd#readme", - "keywords": [ - "path", - "cwd", - "pwd", - "check", - "filepath", - "file", - "folder" - ], - "license": "MIT", - "name": "is-path-cwd", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-path-cwd.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.0.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-path-cwd/readme.md b/tools/node_modules/eslint/node_modules/is-path-cwd/readme.md deleted file mode 100644 index 2d9d65f989c106..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-cwd/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# is-path-cwd [![Build Status](https://travis-ci.org/sindresorhus/is-path-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-cwd) - -> Check if a path is [CWD](http://en.wikipedia.org/wiki/Working_directory) - - -## Install - -```sh -$ npm install --save is-path-cwd -``` - - -## Usage - -```js -var isPathCwd = require('is-path-cwd'); - -isPathCwd(process.cwd()); -//=> true - -isPathCwd('unicorn'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/is-path-in-cwd/index.js b/tools/node_modules/eslint/node_modules/is-path-in-cwd/index.js deleted file mode 100644 index 75611656ae7e3d..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-in-cwd/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var isPathInside = require('is-path-inside'); - -module.exports = function (str) { - return isPathInside(str, process.cwd()); -}; diff --git a/tools/node_modules/eslint/node_modules/is-path-in-cwd/license b/tools/node_modules/eslint/node_modules/is-path-in-cwd/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-in-cwd/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/is-path-in-cwd/package.json b/tools/node_modules/eslint/node_modules/is-path-in-cwd/package.json deleted file mode 100644 index 4110075d9af370..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-in-cwd/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-path-in-cwd/issues" - }, - "bundleDependencies": false, - "dependencies": { - "is-path-inside": "^1.0.0" - }, - "deprecated": false, - "description": "Check if a path is in the current working directory", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-path-in-cwd#readme", - "keywords": [ - "path", - "cwd", - "pwd", - "check", - "filepath", - "file", - "folder", - "in", - "inside" - ], - "license": "MIT", - "name": "is-path-in-cwd", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-path-in-cwd.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.0.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-path-in-cwd/readme.md b/tools/node_modules/eslint/node_modules/is-path-in-cwd/readme.md deleted file mode 100644 index 81185502a810c0..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-in-cwd/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# is-path-in-cwd [![Build Status](https://travis-ci.org/sindresorhus/is-path-in-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-in-cwd) - -> Check if a path is in the [current working directory](http://en.wikipedia.org/wiki/Working_directory) - - -## Install - -```sh -$ npm install --save is-path-in-cwd -``` - - -## Usage - -```js -var isPathInCwd = require('is-path-in-cwd'); - -isPathInCwd('unicorn'); -//=> true - -isPathInCwd('../rainbow'); -//=> false - -isPathInCwd('.'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/is-path-inside/index.js b/tools/node_modules/eslint/node_modules/is-path-inside/index.js deleted file mode 100644 index 0a4d2fd1e58074..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-inside/index.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; -var path = require('path'); -var pathIsInside = require('path-is-inside'); - -module.exports = function (a, b) { - a = path.resolve(a); - b = path.resolve(b); - - if (a === b) { - return false; - } - - return pathIsInside(a, b); -}; diff --git a/tools/node_modules/eslint/node_modules/is-path-inside/license b/tools/node_modules/eslint/node_modules/is-path-inside/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-inside/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/is-path-inside/package.json b/tools/node_modules/eslint/node_modules/is-path-inside/package.json deleted file mode 100644 index 8686a73d3e52be..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-inside/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is-path-inside/issues" - }, - "bundleDependencies": false, - "dependencies": { - "path-is-inside": "^1.0.1" - }, - "deprecated": false, - "description": "Check if a path is inside another path", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/is-path-inside#readme", - "keywords": [ - "path", - "inside", - "folder", - "directory", - "dir", - "file", - "resolve" - ], - "license": "MIT", - "name": "is-path-inside", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-path-inside.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/is-path-inside/readme.md b/tools/node_modules/eslint/node_modules/is-path-inside/readme.md deleted file mode 100644 index cc5f51625d3e9c..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-path-inside/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside) - -> Check if a path is inside another path - - -## Install - -``` -$ npm install --save is-path-inside -``` - - -## Usage - -```js -var isPathInside = require('is-path-inside'); - -isPathInside('a/b/c', 'a/b'); -//=> true - -isPathInside('a/b/c', 'x/y'); -//=> false - -isPathInside('a/b/c', 'a/b/c'); -//=> false - -isPathInside('/Users/sindresorhus/dev/unicorn', '/Users/sindresorhus'); -//=> true -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/is-resolvable/LICENSE b/tools/node_modules/eslint/node_modules/is-resolvable/LICENSE deleted file mode 100644 index b291242ea6dfd4..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-resolvable/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -ISC License (ISC) -Copyright 2018 Shinnosuke Watanabe - -Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/is-resolvable/README.md b/tools/node_modules/eslint/node_modules/is-resolvable/README.md deleted file mode 100644 index 040c165ac8aed7..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-resolvable/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# is-resolvable - -[![npm version](https://img.shields.io/npm/v/is-resolvable.svg)](https://www.npmjs.com/package/is-resolvable) -[![Build Status](https://travis-ci.org/shinnn/is-resolvable.svg?branch=master)](https://travis-ci.org/shinnn/is-resolvable) -[![Build status](https://ci.appveyor.com/api/projects/status/ww1cdpignehlasbs?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/is-resolvable) -[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-resolvable.svg)](https://coveralls.io/r/shinnn/is-resolvable) - -A [Node.js](https://nodejs.org/) module to check if a given module ID is resolvable with [`require()`](https://nodejs.org/api/globals.html#globals_require) - -```javascript -const isResolvable = require('is-resolvable'); - -isResolvable('fs'); //=> true -isResolvable('path'); //=> true - -// When ./index.js exists -isResolvable('./index.js') //=> true -isResolvable('./index') //=> true -isResolvable('.') //=> true -``` - -## Installation - -[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm). - -``` -npm install is-resolvable -``` - -## API - -```javascript -const isResolvable = require('is-resolvable'); -``` - -### isResolvable(*moduleId* [, *options*]) - -*moduleId*: `string` (module ID) -*options*: `Object` ([`require.resolve`](https://nodejs.org/api/modules.html#modules_require_resolve_request_options) options) -Return: `boolean` - -It returns `true` if `require()` can load a file form a given module ID, otherwise `false`. - -```javascript -const isResolvable = require('is-resolvable'); - -// When ./foo.json exists -isResolvable('./foo.json'); //=> true -isResolvable('./foo'); //=> true - -isResolvable('./foo.js'); //=> false - -// When `eslint` module is installed but `jshint` isn't -isResolvable('eslint'); //=> true -isResolvable('jshint'); //=> false - -// When `lodash` module is installed -isResolvable('lodash/isObject'); //=> true -isResolvable('lodash/fp/reject.js'); //=> true -``` - -The second argument accepts an options object for `require.resolve()`. - -```javascript -// When ./bar/baz.js exists - -isResolvable('./baz.js'); //=> false -isResolvable('./baz.js', {paths: ['bar']}); //=> true -``` - -## License - -[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe diff --git a/tools/node_modules/eslint/node_modules/is-resolvable/index.js b/tools/node_modules/eslint/node_modules/is-resolvable/index.js deleted file mode 100644 index 1be95c0258126a..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-resolvable/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var inspect = require('util').inspect; - -module.exports = function isResolvable(moduleId, options) { - if (typeof moduleId !== 'string') { - throw new TypeError(inspect(moduleId) + ' is not a string. Expected a valid Node.js module identifier (), for example \'eslint\', \'./index.js\', \'./lib\'.'); - } - - try { - require.resolve(moduleId, options); - return true; - } catch (err) { - return false; - } -}; diff --git a/tools/node_modules/eslint/node_modules/is-resolvable/package.json b/tools/node_modules/eslint/node_modules/is-resolvable/package.json deleted file mode 100644 index 46538d27f7fced..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-resolvable/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "author": { - "name": "Shinnosuke Watanabe", - "url": "https://github.com/shinnn" - }, - "bugs": { - "url": "https://github.com/shinnn/is-resolvable/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Check if a module ID is resolvable with require()", - "devDependencies": { - "@shinnn/eslint-config-node": "^5.0.0", - "eslint": "^4.16.0", - "istanbul": "^0.4.5", - "tape": "^4.8.0" - }, - "eslintConfig": { - "extends": "@shinnn/node", - "rules": { - "no-var": "off", - "prefer-template": "off" - } - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/shinnn/is-resolvable#readme", - "keywords": [ - "file", - "path", - "resolve", - "resolvable", - "check", - "module" - ], - "license": "ISC", - "name": "is-resolvable", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/is-resolvable.git" - }, - "scripts": { - "coverage": "istanbul cover --print=both test.js", - "pretest": "eslint --fix --format=codeframe index.js test.js", - "test": "node --throw-deprecation --track-heap-objects test.js" - }, - "version": "1.1.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/p-map/index.js b/tools/node_modules/eslint/node_modules/p-map/index.js deleted file mode 100644 index f91477e1f5b3f3..00000000000000 --- a/tools/node_modules/eslint/node_modules/p-map/index.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; -module.exports = (iterable, mapper, opts) => new Promise((resolve, reject) => { - opts = Object.assign({ - concurrency: Infinity - }, opts); - - if (typeof mapper !== 'function') { - throw new TypeError('Mapper function is required'); - } - - const concurrency = opts.concurrency; - - if (!(typeof concurrency === 'number' && concurrency >= 1)) { - throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); - } - - const ret = []; - const iterator = iterable[Symbol.iterator](); - let isRejected = false; - let iterableDone = false; - let resolvingCount = 0; - let currentIdx = 0; - - const next = () => { - if (isRejected) { - return; - } - - const nextItem = iterator.next(); - const i = currentIdx; - currentIdx++; - - if (nextItem.done) { - iterableDone = true; - - if (resolvingCount === 0) { - resolve(ret); - } - - return; - } - - resolvingCount++; - - Promise.resolve(nextItem.value) - .then(el => mapper(el, i)) - .then( - val => { - ret[i] = val; - resolvingCount--; - next(); - }, - err => { - isRejected = true; - reject(err); - } - ); - }; - - for (let i = 0; i < concurrency; i++) { - next(); - - if (iterableDone) { - break; - } - } -}); diff --git a/tools/node_modules/eslint/node_modules/p-map/package.json b/tools/node_modules/eslint/node_modules/p-map/package.json deleted file mode 100644 index 455e05c8bf2ebf..00000000000000 --- a/tools/node_modules/eslint/node_modules/p-map/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-map/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Map over promises concurrently", - "devDependencies": { - "ava": "*", - "delay": "^2.0.0", - "in-range": "^1.0.0", - "random-int": "^1.0.0", - "time-span": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-map#readme", - "keywords": [ - "promise", - "map", - "resolved", - "wait", - "collection", - "iterable", - "iterator", - "race", - "fulfilled", - "async", - "await", - "promises", - "concurrently", - "concurrency", - "parallel", - "bluebird" - ], - "license": "MIT", - "name": "p-map", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-map.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.2.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/p-map/readme.md b/tools/node_modules/eslint/node_modules/p-map/readme.md deleted file mode 100644 index 7727581a0e578c..00000000000000 --- a/tools/node_modules/eslint/node_modules/p-map/readme.md +++ /dev/null @@ -1,81 +0,0 @@ -# p-map [![Build Status](https://travis-ci.org/sindresorhus/p-map.svg?branch=master)](https://travis-ci.org/sindresorhus/p-map) - -> Map over promises concurrently - -Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently. - - -## Install - -``` -$ npm install p-map -``` - - -## Usage - -```js -const pMap = require('p-map'); -const got = require('got'); - -const sites = [ - getWebsiteFromUsername('sindresorhus'), //=> Promise - 'ava.li', - 'todomvc.com', - 'github.com' -]; - -const mapper = el => got.head(el).then(res => res.requestUrl); - -pMap(sites, mapper, {concurrency: 2}).then(result => { - console.log(result); - //=> ['http://sindresorhus.com/', 'http://ava.li/', 'http://todomvc.com/', 'http://github.com/'] -}); -``` - - -## API - -### pMap(input, mapper, [options]) - -Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order. - -#### input - -Type: `Iterable` - -Iterated over concurrently in the `mapper` function. - -#### mapper(element, index) - -Type: `Function` - -Expected to return a `Promise` or value. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`
-Default: `Infinity`
-Minimum: `1` - -Number of concurrently pending promises returned by `mapper`. - - -## Related - -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently -- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently -- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object` -- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/pify/index.js b/tools/node_modules/eslint/node_modules/pify/index.js deleted file mode 100644 index 1dee43ad08f62b..00000000000000 --- a/tools/node_modules/eslint/node_modules/pify/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -const processFn = (fn, opts) => function () { - const P = opts.promiseModule; - const args = new Array(arguments.length); - - for (let i = 0; i < arguments.length; i++) { - args[i] = arguments[i]; - } - - return new P((resolve, reject) => { - if (opts.errorFirst) { - args.push(function (err, result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 1; i < arguments.length; i++) { - results[i - 1] = arguments[i]; - } - - if (err) { - results.unshift(err); - reject(results); - } else { - resolve(results); - } - } else if (err) { - reject(err); - } else { - resolve(result); - } - }); - } else { - args.push(function (result) { - if (opts.multiArgs) { - const results = new Array(arguments.length - 1); - - for (let i = 0; i < arguments.length; i++) { - results[i] = arguments[i]; - } - - resolve(results); - } else { - resolve(result); - } - }); - } - - fn.apply(this, args); - }); -}; - -module.exports = (obj, opts) => { - opts = Object.assign({ - exclude: [/.+(Sync|Stream)$/], - errorFirst: true, - promiseModule: Promise - }, opts); - - const filter = key => { - const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); - return opts.include ? opts.include.some(match) : !opts.exclude.some(match); - }; - - let ret; - if (typeof obj === 'function') { - ret = function () { - if (opts.excludeMain) { - return obj.apply(this, arguments); - } - - return processFn(obj, opts).apply(this, arguments); - }; - } else { - ret = Object.create(Object.getPrototypeOf(obj)); - } - - for (const key in obj) { // eslint-disable-line guard-for-in - const x = obj[key]; - ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; - } - - return ret; -}; diff --git a/tools/node_modules/eslint/node_modules/pify/package.json b/tools/node_modules/eslint/node_modules/pify/package.json deleted file mode 100644 index 37d6bd41a0aeb6..00000000000000 --- a/tools/node_modules/eslint/node_modules/pify/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/pify/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Promisify a callback-style function", - "devDependencies": { - "ava": "*", - "pinkie-promise": "^2.0.0", - "v8-natives": "^1.0.0", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/pify#readme", - "keywords": [ - "promise", - "promises", - "promisify", - "all", - "denodify", - "denodeify", - "callback", - "cb", - "node", - "then", - "thenify", - "convert", - "transform", - "wrap", - "wrapper", - "bind", - "to", - "async", - "await", - "es2015", - "bluebird" - ], - "license": "MIT", - "name": "pify", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/pify.git" - }, - "scripts": { - "optimization-test": "node --allow-natives-syntax optimization-test.js", - "test": "xo && ava && npm run optimization-test" - }, - "version": "3.0.0" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/pify/readme.md b/tools/node_modules/eslint/node_modules/pify/readme.md deleted file mode 100644 index 376ca4e59d74c4..00000000000000 --- a/tools/node_modules/eslint/node_modules/pify/readme.md +++ /dev/null @@ -1,131 +0,0 @@ -# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) - -> Promisify a callback-style function - - -## Install - -``` -$ npm install --save pify -``` - - -## Usage - -```js -const fs = require('fs'); -const pify = require('pify'); - -// Promisify a single function -pify(fs.readFile)('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); - -// Promisify all methods in a module -pify(fs).readFile('package.json', 'utf8').then(data => { - console.log(JSON.parse(data).name); - //=> 'pify' -}); -``` - - -## API - -### pify(input, [options]) - -Returns a `Promise` wrapped version of the supplied function or module. - -#### input - -Type: `Function` `Object` - -Callback-style function or module whose methods you want to promisify. - -#### options - -##### multiArgs - -Type: `boolean`
-Default: `false` - -By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error. - -```js -const request = require('request'); -const pify = require('pify'); - -pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { - const [httpResponse, body] = result; -}); -``` - -##### include - -Type: `string[]` `RegExp[]` - -Methods in a module to promisify. Remaining methods will be left untouched. - -##### exclude - -Type: `string[]` `RegExp[]`
-Default: `[/.+(Sync|Stream)$/]` - -Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. - -##### excludeMain - -Type: `boolean`
-Default: `false` - -If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module. - -```js -const pify = require('pify'); - -function fn() { - return true; -} - -fn.method = (data, callback) => { - setImmediate(() => { - callback(null, data); - }); -}; - -// Promisify methods but not `fn()` -const promiseFn = pify(fn, {excludeMain: true}); - -if (promiseFn()) { - promiseFn.method('hi').then(data => { - console.log(data); - }); -} -``` - -##### errorFirst - -Type: `boolean`
-Default: `true` - -Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc. - -##### promiseModule - -Type: `Function` - -Custom promise module to use instead of the native one. - -Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. - - -## Related - -- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted -- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/tools/node_modules/eslint/node_modules/pinkie-promise/index.js b/tools/node_modules/eslint/node_modules/pinkie-promise/index.js deleted file mode 100644 index 777377a1f777b1..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie-promise/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = typeof Promise === 'function' ? Promise : require('pinkie'); diff --git a/tools/node_modules/eslint/node_modules/pinkie-promise/license b/tools/node_modules/eslint/node_modules/pinkie-promise/license deleted file mode 100644 index 1aeb74fd25e171..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie-promise/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/pinkie-promise/package.json b/tools/node_modules/eslint/node_modules/pinkie-promise/package.json deleted file mode 100644 index fb467d516c196d..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie-promise/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/pinkie-promise/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pinkie": "^2.0.0" - }, - "deprecated": false, - "description": "ES2015 Promise ponyfill", - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/pinkie-promise#readme", - "keywords": [ - "promise", - "promises", - "es2015", - "es6", - "polyfill", - "ponyfill" - ], - "license": "MIT", - "name": "pinkie-promise", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/pinkie-promise.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.1" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/pinkie-promise/readme.md b/tools/node_modules/eslint/node_modules/pinkie-promise/readme.md deleted file mode 100644 index 78477f4297d677..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie-promise/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise) - -> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill - -Module exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill. - -## Install - -``` -$ npm install --save pinkie-promise -``` - -## Usage - -```js -var Promise = require('pinkie-promise'); - -new Promise(function (resolve) { resolve('unicorns'); }); -//=> Promise { 'unicorns' } -``` - -## Related - -- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/tools/node_modules/eslint/node_modules/pinkie/index.js b/tools/node_modules/eslint/node_modules/pinkie/index.js deleted file mode 100644 index 14ce1bfe3d4918..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie/index.js +++ /dev/null @@ -1,292 +0,0 @@ -'use strict'; - -var PENDING = 'pending'; -var SETTLED = 'settled'; -var FULFILLED = 'fulfilled'; -var REJECTED = 'rejected'; -var NOOP = function () {}; -var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; - -var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; -var asyncQueue = []; -var asyncTimer; - -function asyncFlush() { - // run promise callbacks - for (var i = 0; i < asyncQueue.length; i++) { - asyncQueue[i][0](asyncQueue[i][1]); - } - - // reset async asyncQueue - asyncQueue = []; - asyncTimer = false; -} - -function asyncCall(callback, arg) { - asyncQueue.push([callback, arg]); - - if (!asyncTimer) { - asyncTimer = true; - asyncSetTimer(asyncFlush, 0); - } -} - -function invokeResolver(resolver, promise) { - function resolvePromise(value) { - resolve(promise, value); - } - - function rejectPromise(reason) { - reject(promise, reason); - } - - try { - resolver(resolvePromise, rejectPromise); - } catch (e) { - rejectPromise(e); - } -} - -function invokeCallback(subscriber) { - var owner = subscriber.owner; - var settled = owner._state; - var value = owner._data; - var callback = subscriber[settled]; - var promise = subscriber.then; - - if (typeof callback === 'function') { - settled = FULFILLED; - try { - value = callback(value); - } catch (e) { - reject(promise, e); - } - } - - if (!handleThenable(promise, value)) { - if (settled === FULFILLED) { - resolve(promise, value); - } - - if (settled === REJECTED) { - reject(promise, value); - } - } -} - -function handleThenable(promise, value) { - var resolved; - - try { - if (promise === value) { - throw new TypeError('A promises callback cannot return that same promise.'); - } - - if (value && (typeof value === 'function' || typeof value === 'object')) { - // then should be retrieved only once - var then = value.then; - - if (typeof then === 'function') { - then.call(value, function (val) { - if (!resolved) { - resolved = true; - - if (value === val) { - fulfill(promise, val); - } else { - resolve(promise, val); - } - } - }, function (reason) { - if (!resolved) { - resolved = true; - - reject(promise, reason); - } - }); - - return true; - } - } - } catch (e) { - if (!resolved) { - reject(promise, e); - } - - return true; - } - - return false; -} - -function resolve(promise, value) { - if (promise === value || !handleThenable(promise, value)) { - fulfill(promise, value); - } -} - -function fulfill(promise, value) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = value; - - asyncCall(publishFulfillment, promise); - } -} - -function reject(promise, reason) { - if (promise._state === PENDING) { - promise._state = SETTLED; - promise._data = reason; - - asyncCall(publishRejection, promise); - } -} - -function publish(promise) { - promise._then = promise._then.forEach(invokeCallback); -} - -function publishFulfillment(promise) { - promise._state = FULFILLED; - publish(promise); -} - -function publishRejection(promise) { - promise._state = REJECTED; - publish(promise); - if (!promise._handled && isNode) { - global.process.emit('unhandledRejection', promise._data, promise); - } -} - -function notifyRejectionHandled(promise) { - global.process.emit('rejectionHandled', promise); -} - -/** - * @class - */ -function Promise(resolver) { - if (typeof resolver !== 'function') { - throw new TypeError('Promise resolver ' + resolver + ' is not a function'); - } - - if (this instanceof Promise === false) { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - } - - this._then = []; - - invokeResolver(resolver, this); -} - -Promise.prototype = { - constructor: Promise, - - _state: PENDING, - _then: null, - _data: undefined, - _handled: false, - - then: function (onFulfillment, onRejection) { - var subscriber = { - owner: this, - then: new this.constructor(NOOP), - fulfilled: onFulfillment, - rejected: onRejection - }; - - if ((onRejection || onFulfillment) && !this._handled) { - this._handled = true; - if (this._state === REJECTED && isNode) { - asyncCall(notifyRejectionHandled, this); - } - } - - if (this._state === FULFILLED || this._state === REJECTED) { - // already resolved, call callback async - asyncCall(invokeCallback, subscriber); - } else { - // subscribe - this._then.push(subscriber); - } - - return subscriber.then; - }, - - catch: function (onRejection) { - return this.then(null, onRejection); - } -}; - -Promise.all = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.all().'); - } - - return new Promise(function (resolve, reject) { - var results = []; - var remaining = 0; - - function resolver(index) { - remaining++; - return function (value) { - results[index] = value; - if (!--remaining) { - resolve(results); - } - }; - } - - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; - - if (promise && typeof promise.then === 'function') { - promise.then(resolver(i), reject); - } else { - results[i] = promise; - } - } - - if (!remaining) { - resolve(results); - } - }); -}; - -Promise.race = function (promises) { - if (!Array.isArray(promises)) { - throw new TypeError('You must pass an array to Promise.race().'); - } - - return new Promise(function (resolve, reject) { - for (var i = 0, promise; i < promises.length; i++) { - promise = promises[i]; - - if (promise && typeof promise.then === 'function') { - promise.then(resolve, reject); - } else { - resolve(promise); - } - } - }); -}; - -Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); -}; - -Promise.reject = function (reason) { - return new Promise(function (resolve, reject) { - reject(reason); - }); -}; - -module.exports = Promise; diff --git a/tools/node_modules/eslint/node_modules/pinkie/license b/tools/node_modules/eslint/node_modules/pinkie/license deleted file mode 100644 index 1aeb74fd25e171..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tools/node_modules/eslint/node_modules/pinkie/package.json b/tools/node_modules/eslint/node_modules/pinkie/package.json deleted file mode 100644 index e554170bb8a5ba..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "author": { - "name": "Vsevolod Strukchinsky", - "email": "floatdrop@gmail.com", - "url": "github.com/floatdrop" - }, - "bugs": { - "url": "https://github.com/floatdrop/pinkie/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Itty bitty little widdle twinkie pinkie ES2015 Promise implementation", - "devDependencies": { - "core-assert": "^0.1.1", - "coveralls": "^2.11.4", - "mocha": "*", - "nyc": "^3.2.2", - "promises-aplus-tests": "*", - "xo": "^0.10.1" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/floatdrop/pinkie#readme", - "keywords": [ - "promise", - "promises", - "es2015", - "es6" - ], - "license": "MIT", - "name": "pinkie", - "repository": { - "type": "git", - "url": "git+https://github.com/floatdrop/pinkie.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "test": "xo && nyc mocha" - }, - "version": "2.0.4" -} \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/pinkie/readme.md b/tools/node_modules/eslint/node_modules/pinkie/readme.md deleted file mode 100644 index 1565f95889661b..00000000000000 --- a/tools/node_modules/eslint/node_modules/pinkie/readme.md +++ /dev/null @@ -1,83 +0,0 @@ -

-
- pinkie -
-
-

- -> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation - -[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master) - -There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality. - -This module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though). - - -## Install - -``` -$ npm install --save pinkie -``` - - -## Usage - -```js -var fs = require('fs'); -var Promise = require('pinkie'); - -new Promise(function (resolve, reject) { - fs.readFile('foo.json', 'utf8', function (err, data) { - if (err) { - reject(err); - return; - } - - resolve(data); - }); -}); -//=> Promise -``` - - -### API - -`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot: - -#### new Promise(executor) - -Returns new instance of `Promise`. - -##### executor - -*Required* -Type: `function` - -Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. - -#### pinkie.all(promises) - -Returns a promise that resolves when all of the promises in the `promises` Array argument have resolved. - -#### pinkie.race(promises) - -Returns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise. - -#### pinkie.reject(reason) - -Returns a Promise object that is rejected with the given `reason`. - -#### pinkie.resolve(value) - -Returns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`. - - -## Related - -- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module - - -## License - -MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/tools/node_modules/eslint/node_modules/progress/lib/node-progress.js b/tools/node_modules/eslint/node_modules/progress/lib/node-progress.js index 5b56c1529d57b3..8eb0740a721c67 100644 --- a/tools/node_modules/eslint/node_modules/progress/lib/node-progress.js +++ b/tools/node_modules/eslint/node_modules/progress/lib/node-progress.js @@ -98,7 +98,7 @@ ProgressBar.prototype.tick = function(len, tokens){ // progress complete if (this.curr >= this.total) { - this.render(); + this.render(undefined, true); this.complete = true; this.terminate(); this.callback(this); @@ -114,14 +114,15 @@ ProgressBar.prototype.tick = function(len, tokens){ * @api public */ -ProgressBar.prototype.render = function (tokens) { +ProgressBar.prototype.render = function (tokens, force) { + force = force !== undefined ? force : false; if (tokens) this.tokens = tokens; if (!this.stream.isTTY) return; var now = Date.now(); var delta = now - this.lastRender; - if (delta < this.renderThrottle) { + if (!force && (delta < this.renderThrottle)) { return; } else { this.lastRender = now; diff --git a/tools/node_modules/eslint/node_modules/progress/package.json b/tools/node_modules/eslint/node_modules/progress/package.json index d20aaf0f9e27d5..64511f8344114f 100644 --- a/tools/node_modules/eslint/node_modules/progress/package.json +++ b/tools/node_modules/eslint/node_modules/progress/package.json @@ -43,5 +43,5 @@ "type": "git", "url": "git://github.com/visionmedia/node-progress.git" }, - "version": "2.0.1" + "version": "2.0.3" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/index.js b/tools/node_modules/eslint/node_modules/slice-ansi/index.js index 634ee9c7be775b..65a1aef5c83d90 100755 --- a/tools/node_modules/eslint/node_modules/slice-ansi/index.js +++ b/tools/node_modules/eslint/node_modules/slice-ansi/index.js @@ -1,5 +1,7 @@ 'use strict'; const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const astralRegex = require('astral-regex'); +const ansiStyles = require('ansi-styles'); const ESCAPES = [ '\u001B', @@ -7,55 +9,23 @@ const ESCAPES = [ ]; const END_CODE = 39; -const ASTRAL_REGEX = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; - -const ESCAPE_CODES = new Map([ - [0, 0], - [1, 22], - [2, 22], - [3, 23], - [4, 24], - [7, 27], - [8, 28], - [9, 29], - [30, 39], - [31, 39], - [32, 39], - [33, 39], - [34, 39], - [35, 39], - [36, 39], - [37, 39], - [90, 39], - [40, 49], - [41, 49], - [42, 49], - [43, 49], - [44, 49], - [45, 49], - [46, 49], - [47, 49] -]); const wrapAnsi = code => `${ESCAPES[0]}[${code}m`; module.exports = (str, begin, end) => { - const arr = Array.from(str.normalize()); + const arr = [...str.normalize()]; end = typeof end === 'number' ? end : arr.length; let insideEscape = false; - let escapeCode; + let escapeCode = null; let visible = 0; let output = ''; - for (const item of arr.entries()) { - const i = item[0]; - const x = item[1]; - + for (const [i, x] of arr.entries()) { let leftEscape = false; - if (ESCAPES.indexOf(x) !== -1) { + if (ESCAPES.includes(x)) { insideEscape = true; const code = /\d[^m]*/.exec(str.slice(i, i + 4)); escapeCode = code === END_CODE ? null : code; @@ -68,17 +38,17 @@ module.exports = (str, begin, end) => { ++visible; } - if (!ASTRAL_REGEX.test(x) && isFullwidthCodePoint(x.codePointAt())) { + if (!astralRegex({exact: true}).test(x) && isFullwidthCodePoint(x.codePointAt())) { ++visible; } if (visible > begin && visible <= end) { output += x; - } else if (visible === begin && !insideEscape && escapeCode !== undefined && escapeCode !== END_CODE) { + } else if (visible === begin && !insideEscape && escapeCode !== null && escapeCode !== END_CODE) { output += wrapAnsi(escapeCode); } else if (visible >= end) { - if (escapeCode !== undefined) { - output += wrapAnsi(ESCAPE_CODES.get(parseInt(escapeCode, 10)) || END_CODE); + if (escapeCode !== null) { + output += wrapAnsi(ansiStyles.codes.get(parseInt(escapeCode, 10)) || END_CODE); } break; } diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/package.json b/tools/node_modules/eslint/node_modules/slice-ansi/package.json index 7d63fad2d0703b..f0f253539f9dc2 100644 --- a/tools/node_modules/eslint/node_modules/slice-ansi/package.json +++ b/tools/node_modules/eslint/node_modules/slice-ansi/package.json @@ -1,26 +1,24 @@ { - "author": { - "name": "David Caccavella", - "email": "threedeecee@gmail.com" - }, "bugs": { "url": "https://github.com/chalk/slice-ansi/issues" }, "bundleDependencies": false, "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" }, "deprecated": false, "description": "Slice a string with ANSI escape codes", "devDependencies": { - "ava": "*", + "ava": "^0.25.0", "chalk": "^2.0.1", "random-item": "^1.0.0", - "strip-ansi": "^4.0.0", - "xo": "*" + "strip-ansi": "^5.0.0", + "xo": "^0.23.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -58,5 +56,5 @@ "scripts": { "test": "xo && ava" }, - "version": "1.0.0" + "version": "2.0.0" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/slice-ansi/readme.md b/tools/node_modules/eslint/node_modules/slice-ansi/readme.md index 628eed2e5053b4..7e9243e46a9086 100755 --- a/tools/node_modules/eslint/node_modules/slice-ansi/readme.md +++ b/tools/node_modules/eslint/node_modules/slice-ansi/readme.md @@ -1,4 +1,4 @@ -# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/sindresorhus/xo) +# slice-ansi [![Build Status](https://travis-ci.org/chalk/slice-ansi.svg?branch=master)](https://travis-ci.org/chalk/slice-ansi) [![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/xojs/xo) > Slice a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index 3e6fcb12d1985a..ea3580ca152692 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -9,19 +9,19 @@ }, "bundleDependencies": false, "dependencies": { - "ajv": "^6.5.3", - "lodash": "^4.17.10", - "slice-ansi": "1.0.0", + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", "string-width": "^2.1.1" }, "deprecated": false, "description": "Formats data into a string table.", "devDependencies": { - "@babel/cli": "^7.1.2", - "@babel/core": "^7.1.2", + "@babel/cli": "^7.1.5", + "@babel/core": "^7.1.6", "@babel/node": "^7.0.0", - "@babel/plugin-transform-flow-strip-types": "^7.0.0", - "@babel/preset-env": "^7.1.0", + "@babel/plugin-transform-flow-strip-types": "^7.1.6", + "@babel/preset-env": "^7.1.6", "@babel/register": "^7.0.0", "ajv-cli": "^3.0.0", "ajv-keywords": "^3.2.0", @@ -30,16 +30,16 @@ "chai": "^4.2.0", "chalk": "^2.4.1", "coveralls": "^3.0.2", - "eslint": "^5.6.1", + "eslint": "^5.9.0", "eslint-config-canonical": "^13.0.0", - "flow-bin": "^0.81.0", + "flow-bin": "^0.87.0", "flow-copy-source": "^2.0.2", - "gitdown": "^2.5.4", - "husky": "^1.0.1", + "gitdown": "^2.5.5", + "husky": "^1.2.0", "mocha": "^5.2.0", "nyc": "^13.1.0", - "semantic-release": "^15.9.16", - "sinon": "^6.3.4" + "semantic-release": "^15.12.3", + "sinon": "^7.1.1" }, "engines": { "node": ">=6.0.0" @@ -85,5 +85,5 @@ "lint": "npm run build && eslint ./src ./test && flow", "test": "mocha --require @babel/register" }, - "version": "5.1.0" + "version": "5.1.1" } \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/vfile-location/index.js b/tools/node_modules/eslint/node_modules/vfile-location/index.js index e2046ce22b3e4c..2d7c21c1808b7f 100644 --- a/tools/node_modules/eslint/node_modules/vfile-location/index.js +++ b/tools/node_modules/eslint/node_modules/vfile-location/index.js @@ -1,9 +1,7 @@ 'use strict' -/* Expose. */ module.exports = factory -/* Factory. */ function factory(file) { var contents = indices(String(file)) @@ -13,13 +11,12 @@ function factory(file) { } } -/* Factory to get the line and column-based `position` for - * `offset` in the bound indices. */ +// Factory to get the line and column-based `position` for `offset` in the bound +// indices. function offsetToPositionFactory(indices) { return offsetToPosition - /* Get the line and column-based `position` for - * `offset` in the bound indices. */ + // Get the line and column-based `position` for `offset` in the bound indices. function offsetToPosition(offset) { var index = -1 var length = indices.length @@ -42,13 +39,13 @@ function offsetToPositionFactory(indices) { } } -/* Factory to get the `offset` for a line and column-based - * `position` in the bound indices. */ +// Factory to get the `offset` for a line and column-based `position` in the +// bound indices. function positionToOffsetFactory(indices) { return positionToOffset - /* Get the `offset` for a line and column-based - * `position` in the bound indices. */ + // Get the `offset` for a line and column-based `position` in the bound + // indices. function positionToOffset(position) { var line = position && position.line var column = position && position.column @@ -61,7 +58,7 @@ function positionToOffsetFactory(indices) { } } -/* Get indices of line-breaks in `value`. */ +// Get indices of line-breaks in `value`. function indices(value) { var result = [] var index = value.indexOf('\n') diff --git a/tools/node_modules/eslint/node_modules/vfile-location/package.json b/tools/node_modules/eslint/node_modules/vfile-location/package.json index e6f5695ec0c23d..d7e748e789a82b 100644 --- a/tools/node_modules/eslint/node_modules/vfile-location/package.json +++ b/tools/node_modules/eslint/node_modules/vfile-location/package.json @@ -2,7 +2,7 @@ "author": { "name": "Titus Wormer", "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" + "url": "https://wooorm.com" }, "bugs": { "url": "https://github.com/vfile/vfile-location/issues" @@ -12,7 +12,7 @@ { "name": "Titus Wormer", "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" + "url": "https://wooorm.com" } ], "dependencies": {}, @@ -20,14 +20,14 @@ "description": "Convert between positions (line and column-based) and offsets (range-based) locations in a virtual file", "devDependencies": { "browserify": "^16.0.0", - "esmangle": "^1.0.1", - "nyc": "^11.0.0", + "nyc": "^13.0.0", "prettier": "^1.12.1", - "remark-cli": "^5.0.0", + "remark-cli": "^6.0.0", "remark-preset-wooorm": "^4.0.0", "tape": "^4.0.0", - "vfile": "^2.0.0", - "xo": "^0.20.0" + "tinyify": "^2.4.3", + "vfile": "^3.0.0", + "xo": "^0.23.0" }, "files": [ "index.js" @@ -67,14 +67,14 @@ }, "scripts": { "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js --bare -s vfileLocation > vfile-location.js", - "build-mangle": "esmangle vfile-location.js > vfile-location.min.js", + "build-bundle": "browserify . -s vfileLocation > vfile-location.js", + "build-mangle": "browserify . -s vfileLocation -p tinyify > vfile-location.min.js", "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", "test": "npm run format && npm run build && npm run test-coverage", "test-api": "node test", "test-coverage": "nyc --reporter lcov tape test.js" }, - "version": "2.0.3", + "version": "2.0.4", "xo": { "prettier": true, "esnext": false, diff --git a/tools/node_modules/eslint/node_modules/vfile-location/readme.md b/tools/node_modules/eslint/node_modules/vfile-location/readme.md index 87e27dcd8ef0f4..8b2d91f1564e6f 100644 --- a/tools/node_modules/eslint/node_modules/vfile-location/readme.md +++ b/tools/node_modules/eslint/node_modules/vfile-location/readme.md @@ -1,4 +1,9 @@ -# vfile-location [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] +# vfile-location + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Chat][chat-badge]][chat] Convert between positions (line and column-based) and offsets (range-based) locations in a [virtual file][vfile]. @@ -57,19 +62,27 @@ repository, organisation, or community you agree to abide by its terms. -[travis-badge]: https://img.shields.io/travis/vfile/vfile-location.svg +[build-badge]: https://img.shields.io/travis/vfile/vfile-location.svg + +[build]: https://travis-ci.org/vfile/vfile-location + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg + +[coverage]: https://codecov.io/github/vfile/vfile-location + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-location.svg -[travis]: https://travis-ci.org/vfile/vfile-location +[downloads]: https://www.npmjs.com/package/vfile-location -[codecov-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg +[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg -[codecov]: https://codecov.io/github/vfile/vfile-location +[chat]: https://spectrum.chat/unified/vfile [npm]: https://docs.npmjs.com/cli/install -[license]: LICENSE +[license]: license -[author]: http://wooorm.com +[author]: https://wooorm.com [vfile]: https://github.com/vfile/vfile diff --git a/tools/node_modules/eslint/node_modules/vfile-message/index.js b/tools/node_modules/eslint/node_modules/vfile-message/index.js index 1a63df89f5b163..c913753249edad 100644 --- a/tools/node_modules/eslint/node_modules/vfile-message/index.js +++ b/tools/node_modules/eslint/node_modules/vfile-message/index.js @@ -4,12 +4,12 @@ var stringify = require('unist-util-stringify-position') module.exports = VMessage -/* Inherit from `Error#`. */ +// Inherit from `Error#`. function VMessagePrototype() {} VMessagePrototype.prototype = Error.prototype VMessage.prototype = new VMessagePrototype() -/* Message properties. */ +// Message properties. var proto = VMessage.prototype proto.file = '' @@ -21,11 +21,11 @@ proto.fatal = null proto.column = null proto.line = null -/* Construct a new VMessage. - * - * Note: We cannot invoke `Error` on the created context, - * as that adds readonly `line` and `column` attributes on - * Safari 9, thus throwing and failing the data. */ +// Construct a new VMessage. +// +// Note: We cannot invoke `Error` on the created context, as that adds readonly +// `line` and `column` attributes on Safari 9, thus throwing and failing the +// data. function VMessage(reason, position, origin) { var parts var range @@ -44,18 +44,18 @@ function VMessage(reason, position, origin) { end: {line: null, column: null} } - /* Node. */ + // Node. if (position && position.position) { position = position.position } if (position) { - /* Position. */ + // Position. if (position.start) { location = position position = position.start } else { - /* Point. */ + // Point. location.start = position } } diff --git a/tools/node_modules/eslint/node_modules/vfile-message/package.json b/tools/node_modules/eslint/node_modules/vfile-message/package.json index 0e54c49bf5c79d..e514c057c2bfa0 100644 --- a/tools/node_modules/eslint/node_modules/vfile-message/package.json +++ b/tools/node_modules/eslint/node_modules/vfile-message/package.json @@ -2,7 +2,7 @@ "author": { "name": "Titus Wormer", "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" + "url": "https://wooorm.com" }, "bugs": { "url": "https://github.com/vfile/vfile-message/issues" @@ -12,7 +12,7 @@ { "name": "Titus Wormer", "email": "tituswormer@gmail.com", - "url": "http://wooorm.com" + "url": "https://wooorm.com" } ], "dependencies": { @@ -22,13 +22,13 @@ "description": "Create a virtual message", "devDependencies": { "browserify": "^16.0.0", - "esmangle": "^1.0.1", - "nyc": "^11.0.0", + "nyc": "^13.0.0", "prettier": "^1.12.1", - "remark-cli": "^5.0.0", + "remark-cli": "^6.0.0", "remark-preset-wooorm": "^4.0.0", "tape": "^4.0.0", - "xo": "^0.20.0" + "tinyify": "^2.4.3", + "xo": "^0.23.0" }, "files": [ "index.js" @@ -66,14 +66,14 @@ }, "scripts": { "build": "npm run build-bundle && npm run build-mangle", - "build-bundle": "browserify index.js --bare -s vfileMessage > vfile-message.js", - "build-mangle": "esmangle vfile-message.js > vfile-message.min.js", + "build-bundle": "browserify . -s vfileMessage > vfile-message.js", + "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", "format": "remark . -qfo && prettier --write '**/*.js' && xo --fix", "test": "npm run format && npm run build && npm run test-coverage", "test-api": "node test", "test-coverage": "nyc --reporter lcov tape test.js" }, - "version": "1.0.1", + "version": "1.0.2", "xo": { "prettier": true, "esnext": false, diff --git a/tools/node_modules/eslint/node_modules/vfile-message/readme.md b/tools/node_modules/eslint/node_modules/vfile-message/readme.md index c69cc406e35e74..0c88353a53c9cf 100644 --- a/tools/node_modules/eslint/node_modules/vfile-message/readme.md +++ b/tools/node_modules/eslint/node_modules/vfile-message/readme.md @@ -1,4 +1,9 @@ -# vfile-message [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] +# vfile-message + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Chat][chat-badge]][chat] Create [vfile][] messages. @@ -144,19 +149,27 @@ repository, organisation, or community you agree to abide by its terms. -[travis-badge]: https://img.shields.io/travis/vfile/vfile-message.svg +[build-badge]: https://img.shields.io/travis/vfile/vfile-message.svg + +[build]: https://travis-ci.org/vfile/vfile-message + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg + +[coverage]: https://codecov.io/github/vfile/vfile-message + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-message.svg -[travis]: https://travis-ci.org/vfile/vfile-message +[downloads]: https://www.npmjs.com/package/vfile-message -[codecov-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg +[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg -[codecov]: https://codecov.io/github/vfile/vfile-message +[chat]: https://spectrum.chat/unified/vfile [npm]: https://docs.npmjs.com/cli/install -[license]: LICENSE +[license]: license -[author]: http://wooorm.com +[author]: https://wooorm.com [error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index f35659fc8a1c23..39bed7a7e7ef51 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -21,7 +21,7 @@ "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", + "espree": "^5.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", @@ -31,7 +31,6 @@ "ignore": "^4.0.6", "imurmurhash": "^0.1.4", "inquirer": "^6.1.0", - "is-resolvable": "^1.1.0", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", @@ -69,7 +68,7 @@ "eslint-plugin-eslint-plugin": "^1.4.1", "eslint-plugin-node": "^8.0.0", "eslint-plugin-rulesdir": "^0.1.0", - "eslint-release": "^1.0.0", + "eslint-release": "^1.2.0", "eslint-rule-composer": "^0.3.0", "eslump": "^1.6.2", "esprima": "^4.0.1", @@ -135,5 +134,5 @@ "publish-release": "node Makefile.js publishRelease", "test": "node Makefile.js test" }, - "version": "5.9.0" + "version": "5.10.0" } \ No newline at end of file