diff --git a/test/parallel/test-tls-transport-destroy-after-own-gc.js b/test/parallel/test-tls-transport-destroy-after-own-gc.js index 9b9c8353077dfe..819aa0a03d6cb4 100644 --- a/test/parallel/test-tls-transport-destroy-after-own-gc.js +++ b/test/parallel/test-tls-transport-destroy-after-own-gc.js @@ -15,12 +15,12 @@ const makeDuplexPair = require('../common/duplexpair'); let { clientSide } = makeDuplexPair(); let clientTLS = new TLSSocket(clientSide, { isServer: false }); -let clientTLSHandle = clientTLS._handle; +let clientTLSHandle = clientTLS._handle; // eslint-disable-line no-unused-vars setImmediate(() => { clientTLS = null; global.gc(); - clientTLSHandle = null; // eslint-disable-line no-unused-vars + clientTLSHandle = null; global.gc(); setImmediate(() => { clientSide = null; diff --git a/tools/node_modules/eslint/README.md b/tools/node_modules/eslint/README.md index 14ba7e2cb32d9a..1aa25ee3d1d47b 100644 --- a/tools/node_modules/eslint/README.md +++ b/tools/node_modules/eslint/README.md @@ -283,7 +283,7 @@ The following companies, organizations, and individuals support ESLint's ongoing

Automattic

Gold Sponsors

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

Silver Sponsors

Retool Liftoff

Bronze Sponsors

-

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

+

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

## Technology Sponsors diff --git a/tools/node_modules/eslint/lib/linter/linter.js b/tools/node_modules/eslint/lib/linter/linter.js index adb5c215590251..576816b5b7ba6f 100644 --- a/tools/node_modules/eslint/lib/linter/linter.js +++ b/tools/node_modules/eslint/lib/linter/linter.js @@ -1308,9 +1308,9 @@ class Linter { return []; } - // Resolve configuration again if the file extension was changed. - if (configForRecursive && path.extname(blockName) !== originalExtname) { - debug("Resolving configuration again because the file extension was changed."); + // Resolve configuration again if the file content or extension was changed. + if (configForRecursive && (text !== blockText || path.extname(blockName) !== originalExtname)) { + debug("Resolving configuration again because the file content or extension was changed."); return this._verifyWithConfigArray( blockText, configForRecursive, diff --git a/tools/node_modules/eslint/lib/rules/no-unused-vars.js b/tools/node_modules/eslint/lib/rules/no-unused-vars.js index 32589099cf4be7..7619be331fa436 100644 --- a/tools/node_modules/eslint/lib/rules/no-unused-vars.js +++ b/tools/node_modules/eslint/lib/rules/no-unused-vars.js @@ -624,10 +624,18 @@ module.exports = { // Report the first declaration. if (unusedVar.defs.length > 0) { + + // report last write reference, https://github.com/eslint/eslint/issues/14324 + const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && ref.from.variableScope === unusedVar.scope.variableScope); + + let referenceToReport; + + if (writeReferences.length > 0) { + referenceToReport = writeReferences[writeReferences.length - 1]; + } + context.report({ - node: unusedVar.references.length ? unusedVar.references[ - unusedVar.references.length - 1 - ].identifier : unusedVar.identifiers[0], + node: referenceToReport ? referenceToReport.identifier : unusedVar.identifiers[0], messageId: "unusedVar", data: unusedVar.references.some(ref => ref.isWrite()) ? getAssignedMessageData(unusedVar) diff --git a/tools/node_modules/eslint/node_modules/call-bind/LICENSE b/tools/node_modules/eslint/node_modules/call-bind/LICENSE deleted file mode 100644 index 48f05d01d0acae..00000000000000 --- a/tools/node_modules/eslint/node_modules/call-bind/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/call-bind/README.md b/tools/node_modules/eslint/node_modules/call-bind/README.md deleted file mode 100644 index 53649eb4622446..00000000000000 --- a/tools/node_modules/eslint/node_modules/call-bind/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# call-bind -Robustly `.call.bind()` a function. diff --git a/tools/node_modules/eslint/node_modules/call-bind/callBound.js b/tools/node_modules/eslint/node_modules/call-bind/callBound.js deleted file mode 100644 index 8374adfd0549fe..00000000000000 --- a/tools/node_modules/eslint/node_modules/call-bind/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/tools/node_modules/eslint/node_modules/call-bind/index.js b/tools/node_modules/eslint/node_modules/call-bind/index.js deleted file mode 100644 index 6fa3e4af7e19fd..00000000000000 --- a/tools/node_modules/eslint/node_modules/call-bind/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/tools/node_modules/eslint/node_modules/call-bind/package.json b/tools/node_modules/eslint/node_modules/call-bind/package.json deleted file mode 100644 index 4360556a7fa0f1..00000000000000 --- a/tools/node_modules/eslint/node_modules/call-bind/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "call-bind", - "version": "1.0.2", - "description": "Robustly `.call.bind()` a function", - "main": "index.js", - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./callBound": [ - { - "default": "./callBound.js" - }, - "./callBound.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "prepublish": "safe-publish-latest", - "lint": "eslint --ext=.js,.mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/*'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bind/issues" - }, - "homepage": "https://github.com/ljharb/call-bind#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eslint": "^7.17.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.1.1" - }, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/tools/node_modules/eslint/node_modules/chalk/package.json b/tools/node_modules/eslint/node_modules/chalk/package.json index 0d99f0f28621f2..c2d63f67e5e955 100644 --- a/tools/node_modules/eslint/node_modules/chalk/package.json +++ b/tools/node_modules/eslint/node_modules/chalk/package.json @@ -1,6 +1,6 @@ { "name": "chalk", - "version": "4.1.0", + "version": "4.1.1", "description": "Terminal string styling done right", "license": "MIT", "repository": "chalk/chalk", diff --git a/tools/node_modules/eslint/node_modules/chalk/readme.md b/tools/node_modules/eslint/node_modules/chalk/readme.md index 338f42cb8b525b..851259216bc193 100644 --- a/tools/node_modules/eslint/node_modules/chalk/readme.md +++ b/tools/node_modules/eslint/node_modules/chalk/readme.md @@ -13,6 +13,48 @@ +
+ +--- + +
+

+

+ + Sindre Sorhus' open source work is supported by the community on GitHub Sponsors and Dev + +

+ Special thanks to: +
+
+ + + +
+
+ + + +
+
+ +
+ Doppler +
+ All your environment variables, in one place +
+ Stop struggling with scattered API keys, hacking together home-brewed tools, +
+ and avoiding access controls. Keep your team and servers in sync with Doppler. +
+
+

+
+ +--- + +
+ ## Highlights - Expressive API diff --git a/tools/node_modules/eslint/node_modules/function-bind/.jscs.json b/tools/node_modules/eslint/node_modules/function-bind/.jscs.json deleted file mode 100644 index 8c4479480be70d..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/.jscs.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "es3": true, - - "additionalRules": [], - - "requireSemicolons": true, - - "disallowMultipleSpaces": true, - - "disallowIdentifierNames": [], - - "requireCurlyBraces": { - "allExcept": [], - "keywords": ["if", "else", "for", "while", "do", "try", "catch"] - }, - - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], - - "disallowSpaceAfterKeywords": [], - - "disallowSpaceBeforeComma": true, - "disallowSpaceAfterComma": false, - "disallowSpaceBeforeSemicolon": true, - - "disallowNodeTypes": [ - "DebuggerStatement", - "ForInStatement", - "LabeledStatement", - "SwitchCase", - "SwitchStatement", - "WithStatement" - ], - - "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] }, - - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, - "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, - "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, - "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, - - "requireSpaceBetweenArguments": true, - - "disallowSpacesInsideParentheses": true, - - "disallowSpacesInsideArrayBrackets": true, - - "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] }, - - "disallowSpaceAfterObjectKeys": true, - - "requireCommaBeforeLineBreak": true, - - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], - "requireSpaceAfterPrefixUnaryOperators": [], - - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforePostfixUnaryOperators": [], - - "disallowSpaceBeforeBinaryOperators": [], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "disallowSpaceAfterBinaryOperators": [], - - "disallowImplicitTypeConversion": ["binary", "string"], - - "disallowKeywords": ["with", "eval"], - - "requireKeywordsOnNewLine": [], - "disallowKeywordsOnNewLine": ["else"], - - "requireLineFeedAtFileEnd": true, - - "disallowTrailingWhitespace": true, - - "disallowTrailingComma": true, - - "excludeFiles": ["node_modules/**", "vendor/**"], - - "disallowMultipleLineStrings": true, - - "requireDotNotation": { "allExcept": ["keywords"] }, - - "requireParenthesesAroundIIFE": true, - - "validateLineBreaks": "LF", - - "validateQuoteMarks": { - "escape": true, - "mark": "'" - }, - - "disallowOperatorBeforeLineBreak": [], - - "requireSpaceBeforeKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "finally", - "while", - "with", - "return" - ], - - "validateAlignedFunctionParameters": { - "lineBreakAfterOpeningBraces": true, - "lineBreakBeforeClosingBraces": true - }, - - "requirePaddingNewLinesBeforeExport": true, - - "validateNewlineAfterArrayElements": { - "maximum": 8 - }, - - "requirePaddingNewLinesAfterUseStrict": true, - - "disallowArrowFunctions": true, - - "disallowMultiLineTernary": true, - - "validateOrderInObjectKeys": "asc-insensitive", - - "disallowIdenticalDestructuringNames": true, - - "disallowNestedTernaries": { "maxLevel": 1 }, - - "requireSpaceAfterComma": { "allExcept": ["trailing"] }, - "requireAlignedMultilineParams": false, - - "requireSpacesInGenerator": { - "afterStar": true - }, - - "disallowSpacesInGenerator": { - "beforeStar": true - }, - - "disallowVar": false, - - "requireArrayDestructuring": false, - - "requireEnhancedObjectLiterals": false, - - "requireObjectDestructuring": false, - - "requireEarlyReturn": false, - - "requireCapitalizedConstructorsNew": { - "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"] - }, - - "requireImportAlphabetized": false, - - "requireSpaceBeforeObjectValues": true, - "requireSpaceBeforeDestructuredValues": true, - - "disallowSpacesInsideTemplateStringPlaceholders": true, - - "disallowArrayDestructuringReturn": false, - - "requireNewlineBeforeSingleStatementsInIf": false, - - "disallowUnusedVariables": true, - - "requireSpacesInsideImportedObjectBraces": true, - - "requireUseStrict": true -} - diff --git a/tools/node_modules/eslint/node_modules/function-bind/LICENSE b/tools/node_modules/eslint/node_modules/function-bind/LICENSE deleted file mode 100644 index 62d6d237ff179b..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Raynos. - -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/function-bind/README.md b/tools/node_modules/eslint/node_modules/function-bind/README.md deleted file mode 100644 index 81862a02cb940c..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# function-bind - - - - - -Implementation of function.prototype.bind - -## Example - -I mainly do this for unit tests I run on phantomjs. -PhantomJS does not have Function.prototype.bind :( - -```js -Function.prototype.bind = require("function-bind") -``` - -## Installation - -`npm install function-bind` - -## Contributors - - - Raynos - -## MIT Licenced - - [travis-svg]: https://travis-ci.org/Raynos/function-bind.svg - [travis-url]: https://travis-ci.org/Raynos/function-bind - [npm-badge-svg]: https://badge.fury.io/js/function-bind.svg - [npm-url]: https://npmjs.org/package/function-bind - [5]: https://coveralls.io/repos/Raynos/function-bind/badge.png - [6]: https://coveralls.io/r/Raynos/function-bind - [7]: https://gemnasium.com/Raynos/function-bind.png - [8]: https://gemnasium.com/Raynos/function-bind - [deps-svg]: https://david-dm.org/Raynos/function-bind.svg - [deps-url]: https://david-dm.org/Raynos/function-bind - [dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg - [dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies - [11]: https://ci.testling.com/Raynos/function-bind.png - [12]: https://ci.testling.com/Raynos/function-bind diff --git a/tools/node_modules/eslint/node_modules/function-bind/implementation.js b/tools/node_modules/eslint/node_modules/function-bind/implementation.js deleted file mode 100644 index cc4daec1b080a1..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/implementation.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; diff --git a/tools/node_modules/eslint/node_modules/function-bind/index.js b/tools/node_modules/eslint/node_modules/function-bind/index.js deleted file mode 100644 index 3bb6b9609889f8..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var implementation = require('./implementation'); - -module.exports = Function.prototype.bind || implementation; diff --git a/tools/node_modules/eslint/node_modules/function-bind/package.json b/tools/node_modules/eslint/node_modules/function-bind/package.json deleted file mode 100644 index 20a1727cbf8711..00000000000000 --- a/tools/node_modules/eslint/node_modules/function-bind/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "function-bind", - "version": "1.1.1", - "description": "Implementation of Function.prototype.bind", - "keywords": [ - "function", - "bind", - "shim", - "es5" - ], - "author": "Raynos ", - "repository": "git://github.com/Raynos/function-bind.git", - "main": "index", - "homepage": "https://github.com/Raynos/function-bind", - "contributors": [ - { - "name": "Raynos" - }, - { - "name": "Jordan Harband", - "url": "https://github.com/ljharb" - } - ], - "bugs": { - "url": "https://github.com/Raynos/function-bind/issues", - "email": "raynos2@gmail.com" - }, - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "covert": "^1.1.0", - "eslint": "^4.5.0", - "jscs": "^3.0.7", - "tape": "^4.8.0" - }, - "license": "MIT", - "scripts": { - "pretest": "npm run lint", - "test": "npm run tests-only", - "posttest": "npm run coverage -- --quiet", - "tests-only": "node test", - "coverage": "covert test/*.js", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/tools/node_modules/eslint/node_modules/get-intrinsic/LICENSE b/tools/node_modules/eslint/node_modules/get-intrinsic/LICENSE deleted file mode 100644 index 48f05d01d0acae..00000000000000 --- a/tools/node_modules/eslint/node_modules/get-intrinsic/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -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/get-intrinsic/README.md b/tools/node_modules/eslint/node_modules/get-intrinsic/README.md deleted file mode 100644 index 335a3b49b2ebe6..00000000000000 --- a/tools/node_modules/eslint/node_modules/get-intrinsic/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# get-intrinsic [![Version Badge][npm-version-svg]][package-url] - -[![dependency status][deps-svg]][deps-url] -[![dev dependency status][dev-deps-svg]][dev-deps-url] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][npm-badge-png]][package-url] - -Get and robustly cache all JS language-level intrinsics at first require time. - -See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference. - -## Example - -```js -var GetIntrinsic = require('get-intrinsic'); -var assert = require('assert'); - -// static methods -assert.equal(GetIntrinsic('%Math.pow%'), Math.pow); -assert.equal(Math.pow(2, 3), 8); -assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); -delete Math.pow; -assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8); - -// instance methods -var arr = [1]; -assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push); -assert.deepEqual(arr, [1]); - -arr.push(2); -assert.deepEqual(arr, [1, 2]); - -GetIntrinsic('%Array.prototype.push%').call(arr, 3); -assert.deepEqual(arr, [1, 2, 3]); - -delete Array.prototype.push; -GetIntrinsic('%Array.prototype.push%').call(arr, 4); -assert.deepEqual(arr, [1, 2, 3, 4]); - -// missing features -delete JSON.parse; // to simulate a real intrinsic that is missing in the environment -assert.throws(() => GetIntrinsic('%JSON.parse%')); -assert.equal(undefined, GetIntrinsic('%JSON.parse%', true)); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -## Security - -Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report. - -[package-url]: https://npmjs.org/package/get-intrinsic -[npm-version-svg]: http://versionbadg.es/ljharb/get-intrinsic.svg -[deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg -[deps-url]: https://david-dm.org/ljharb/get-intrinsic -[dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg -[dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies -[npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/get-intrinsic.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg -[downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic diff --git a/tools/node_modules/eslint/node_modules/get-intrinsic/index.js b/tools/node_modules/eslint/node_modules/get-intrinsic/index.js deleted file mode 100644 index d6c06c281c0ac7..00000000000000 --- a/tools/node_modules/eslint/node_modules/get-intrinsic/index.js +++ /dev/null @@ -1,330 +0,0 @@ -'use strict'; - -var undefined; - -var $SyntaxError = SyntaxError; -var $Function = Function; -var $TypeError = TypeError; - -// eslint-disable-next-line consistent-return -var getEvalledConstructor = function (expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); - } catch (e) {} -}; - -var $gOPD = Object.getOwnPropertyDescriptor; -if ($gOPD) { - try { - $gOPD({}, ''); - } catch (e) { - $gOPD = null; // this is IE 8, which has a broken gOPD - } -} - -var throwTypeError = function () { - throw new $TypeError(); -}; -var ThrowTypeError = $gOPD - ? (function () { - try { - // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties - arguments.callee; // IE 8 does not throw here - return throwTypeError; - } catch (calleeThrows) { - try { - // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') - return $gOPD(arguments, 'callee').get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }()) - : throwTypeError; - -var hasSymbols = require('has-symbols')(); - -var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto - -var needsEval = {}; - -var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); - -var INTRINSICS = { - '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, - '%Array%': Array, - '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, - '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, - '%AsyncFromSyncIteratorPrototype%': undefined, - '%AsyncFunction%': needsEval, - '%AsyncGenerator%': needsEval, - '%AsyncGeneratorFunction%': needsEval, - '%AsyncIteratorPrototype%': needsEval, - '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, - '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, - '%Boolean%': Boolean, - '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, - '%Date%': Date, - '%decodeURI%': decodeURI, - '%decodeURIComponent%': decodeURIComponent, - '%encodeURI%': encodeURI, - '%encodeURIComponent%': encodeURIComponent, - '%Error%': Error, - '%eval%': eval, // eslint-disable-line no-eval - '%EvalError%': EvalError, - '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, - '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, - '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, - '%Function%': $Function, - '%GeneratorFunction%': needsEval, - '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, - '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, - '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, - '%isFinite%': isFinite, - '%isNaN%': isNaN, - '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, - '%JSON%': typeof JSON === 'object' ? JSON : undefined, - '%Map%': typeof Map === 'undefined' ? undefined : Map, - '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), - '%Math%': Math, - '%Number%': Number, - '%Object%': Object, - '%parseFloat%': parseFloat, - '%parseInt%': parseInt, - '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, - '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, - '%RangeError%': RangeError, - '%ReferenceError%': ReferenceError, - '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, - '%RegExp%': RegExp, - '%Set%': typeof Set === 'undefined' ? undefined : Set, - '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), - '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, - '%String%': String, - '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, - '%Symbol%': hasSymbols ? Symbol : undefined, - '%SyntaxError%': $SyntaxError, - '%ThrowTypeError%': ThrowTypeError, - '%TypedArray%': TypedArray, - '%TypeError%': $TypeError, - '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, - '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, - '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, - '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, - '%URIError%': URIError, - '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, - '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, - '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet -}; - -var doEval = function doEval(name) { - var value; - if (name === '%AsyncFunction%') { - value = getEvalledConstructor('async function () {}'); - } else if (name === '%GeneratorFunction%') { - value = getEvalledConstructor('function* () {}'); - } else if (name === '%AsyncGeneratorFunction%') { - value = getEvalledConstructor('async function* () {}'); - } else if (name === '%AsyncGenerator%') { - var fn = doEval('%AsyncGeneratorFunction%'); - if (fn) { - value = fn.prototype; - } - } else if (name === '%AsyncIteratorPrototype%') { - var gen = doEval('%AsyncGenerator%'); - if (gen) { - value = getProto(gen.prototype); - } - } - - INTRINSICS[name] = value; - - return value; -}; - -var LEGACY_ALIASES = { - '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], - '%ArrayPrototype%': ['Array', 'prototype'], - '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], - '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], - '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], - '%ArrayProto_values%': ['Array', 'prototype', 'values'], - '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], - '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], - '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], - '%BooleanPrototype%': ['Boolean', 'prototype'], - '%DataViewPrototype%': ['DataView', 'prototype'], - '%DatePrototype%': ['Date', 'prototype'], - '%ErrorPrototype%': ['Error', 'prototype'], - '%EvalErrorPrototype%': ['EvalError', 'prototype'], - '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], - '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], - '%FunctionPrototype%': ['Function', 'prototype'], - '%Generator%': ['GeneratorFunction', 'prototype'], - '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], - '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], - '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], - '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], - '%JSONParse%': ['JSON', 'parse'], - '%JSONStringify%': ['JSON', 'stringify'], - '%MapPrototype%': ['Map', 'prototype'], - '%NumberPrototype%': ['Number', 'prototype'], - '%ObjectPrototype%': ['Object', 'prototype'], - '%ObjProto_toString%': ['Object', 'prototype', 'toString'], - '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], - '%PromisePrototype%': ['Promise', 'prototype'], - '%PromiseProto_then%': ['Promise', 'prototype', 'then'], - '%Promise_all%': ['Promise', 'all'], - '%Promise_reject%': ['Promise', 'reject'], - '%Promise_resolve%': ['Promise', 'resolve'], - '%RangeErrorPrototype%': ['RangeError', 'prototype'], - '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], - '%RegExpPrototype%': ['RegExp', 'prototype'], - '%SetPrototype%': ['Set', 'prototype'], - '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], - '%StringPrototype%': ['String', 'prototype'], - '%SymbolPrototype%': ['Symbol', 'prototype'], - '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], - '%TypedArrayPrototype%': ['TypedArray', 'prototype'], - '%TypeErrorPrototype%': ['TypeError', 'prototype'], - '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], - '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], - '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], - '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], - '%URIErrorPrototype%': ['URIError', 'prototype'], - '%WeakMapPrototype%': ['WeakMap', 'prototype'], - '%WeakSetPrototype%': ['WeakSet', 'prototype'] -}; - -var bind = require('function-bind'); -var hasOwn = require('has'); -var $concat = bind.call(Function.call, Array.prototype.concat); -var $spliceApply = bind.call(Function.apply, Array.prototype.splice); -var $replace = bind.call(Function.call, String.prototype.replace); -var $strSlice = bind.call(Function.call, String.prototype.slice); - -/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ -var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; -var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ -var stringToPath = function stringToPath(string) { - var first = $strSlice(string, 0, 1); - var last = $strSlice(string, -1); - if (first === '%' && last !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); - } else if (last === '%' && first !== '%') { - throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); - } - var result = []; - $replace(string, rePropName, function (match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; - }); - return result; -}; -/* end adaptation */ - -var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = '%' + alias[0] + '%'; - } - - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === 'undefined' && !allowMissing) { - throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); - } - - return { - alias: alias, - name: intrinsicName, - value: value - }; - } - - throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); -}; - -module.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== 'string' || name.length === 0) { - throw new $TypeError('intrinsic name must be a non-empty string'); - } - if (arguments.length > 1 && typeof allowMissing !== 'boolean') { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; - - var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first = $strSlice(part, 0, 1); - var last = $strSlice(part, -1); - if ( - ( - (first === '"' || first === "'" || first === '`') - || (last === '"' || last === "'" || last === '`') - ) - && first !== last - ) { - throw new $SyntaxError('property names with quotes must have matching quotes'); - } - if (part === 'constructor' || !isOwn) { - skipFurtherCaching = true; - } - - intrinsicBaseName += '.' + part; - intrinsicRealName = '%' + intrinsicBaseName + '%'; - - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); - } - return void undefined; - } - if ($gOPD && (i + 1) >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - - // By convention, when a data property is converted to an accessor - // property to emulate a data property that does not suffer from - // the override mistake, that accessor's getter is marked with - // an `originalValue` property. Here, when we detect this, we - // uphold the illusion by pretending to see that original data - // property, i.e., returning the value rather than the getter - // itself. - if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; -}; diff --git a/tools/node_modules/eslint/node_modules/get-intrinsic/package.json b/tools/node_modules/eslint/node_modules/get-intrinsic/package.json deleted file mode 100644 index d34894a0681d27..00000000000000 --- a/tools/node_modules/eslint/node_modules/get-intrinsic/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "get-intrinsic", - "version": "1.1.1", - "description": "Get and robustly cache all JS language-level intrinsics at first require time", - "main": "index.js", - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "prelint": "evalmd README.md", - "lint": "eslint --ext=.js,.mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/**/*.js'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/get-intrinsic.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "intrinsic", - "getintrinsic", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/get-intrinsic/issues" - }, - "homepage": "https://github.com/ljharb/get-intrinsic#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.5.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "es-value-fixtures": "^1.0.0", - "eslint": "^7.19.0", - "evalmd": "^0.0.19", - "foreach": "^2.0.5", - "has-bigints": "^1.0.1", - "make-async-function": "^1.0.0", - "make-async-generator-function": "^1.0.0", - "make-generator-function": "^2.0.0", - "nyc": "^10.3.2", - "object-inspect": "^1.9.0", - "tape": "^5.1.1" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } -} diff --git a/tools/node_modules/eslint/node_modules/has-symbols/LICENSE b/tools/node_modules/eslint/node_modules/has-symbols/LICENSE deleted file mode 100644 index df31cbf3c064d0..00000000000000 --- a/tools/node_modules/eslint/node_modules/has-symbols/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Jordan Harband - -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/has-symbols/README.md b/tools/node_modules/eslint/node_modules/has-symbols/README.md deleted file mode 100644 index 3875d7e58d7ea9..00000000000000 --- a/tools/node_modules/eslint/node_modules/has-symbols/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# has-symbols [![Version Badge][2]][1] - -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -Determine if the JS environment has Symbol support. Supports spec, or shams. - -## Example - -```js -var hasSymbols = require('has-symbols'); - -hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable. - -var hasSymbolsKinda = require('has-symbols/shams'); -hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec. -``` - -## Supported Symbol shams - - get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols) - - core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js) - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/has-symbols -[2]: https://versionbadg.es/inspect-js/has-symbols.svg -[5]: https://david-dm.org/inspect-js/has-symbols.svg -[6]: https://david-dm.org/inspect-js/has-symbols -[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg -[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies -[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true -[license-image]: https://img.shields.io/npm/l/has-symbols.svg -[license-url]: LICENSE -[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg -[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols diff --git a/tools/node_modules/eslint/node_modules/has-symbols/index.js b/tools/node_modules/eslint/node_modules/has-symbols/index.js deleted file mode 100644 index 17044fa21daa70..00000000000000 --- a/tools/node_modules/eslint/node_modules/has-symbols/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var origSymbol = typeof Symbol !== 'undefined' && Symbol; -var hasSymbolSham = require('./shams'); - -module.exports = function hasNativeSymbols() { - if (typeof origSymbol !== 'function') { return false; } - if (typeof Symbol !== 'function') { return false; } - if (typeof origSymbol('foo') !== 'symbol') { return false; } - if (typeof Symbol('bar') !== 'symbol') { return false; } - - return hasSymbolSham(); -}; diff --git a/tools/node_modules/eslint/node_modules/has-symbols/package.json b/tools/node_modules/eslint/node_modules/has-symbols/package.json deleted file mode 100644 index 2c2f57278b1747..00000000000000 --- a/tools/node_modules/eslint/node_modules/has-symbols/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "has-symbols", - "version": "1.0.2", - "author": { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "description": "Determine if the JS environment has Symbol support. Supports spec, or shams.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run --silent lint", - "test": "npm run tests-only", - "posttest": "aud --production", - "tests-only": "npm run test:stock && npm run test:staging && npm run test:shams", - "test:stock": "nyc node test", - "test:staging": "nyc node --harmony --es-staging test", - "test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs", - "test:shams:corejs": "nyc node test/shams/core-js.js", - "test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js", - "lint": "eslint --ext=js,mjs .", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git://github.com/inspect-js/has-symbols.git" - }, - "keywords": [ - "Symbol", - "symbols", - "typeof", - "sham", - "polyfill", - "native", - "core-js", - "ES6" - ], - "devDependencies": { - "@ljharb/eslint-config": "^17.5.1", - "aud": "^1.1.4", - "auto-changelog": "^2.2.1", - "core-js": "^2.6.12", - "eslint": "^7.20.0", - "get-own-property-symbols": "^0.9.5", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.2.0" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "greenkeeper": { - "ignore": [ - "core-js" - ] - } -} diff --git a/tools/node_modules/eslint/node_modules/has-symbols/shams.js b/tools/node_modules/eslint/node_modules/has-symbols/shams.js deleted file mode 100644 index 1285210ef7ccef..00000000000000 --- a/tools/node_modules/eslint/node_modules/has-symbols/shams.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -/* eslint complexity: [2, 18], max-statements: [2, 33] */ -module.exports = function hasSymbols() { - if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } - if (typeof Symbol.iterator === 'symbol') { return true; } - - var obj = {}; - var sym = Symbol('test'); - var symObj = Object(sym); - if (typeof sym === 'string') { return false; } - - if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } - if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } - - // temp disabled per https://github.com/ljharb/object.assign/issues/17 - // if (sym instanceof Symbol) { return false; } - // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 - // if (!(symObj instanceof Symbol)) { return false; } - - // if (typeof Symbol.prototype.toString !== 'function') { return false; } - // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } - - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop - if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } - - if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } - - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { return false; } - - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } - - if (typeof Object.getOwnPropertyDescriptor === 'function') { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } - } - - return true; -}; diff --git a/tools/node_modules/eslint/node_modules/has/LICENSE-MIT b/tools/node_modules/eslint/node_modules/has/LICENSE-MIT deleted file mode 100644 index ae7014d385df3d..00000000000000 --- a/tools/node_modules/eslint/node_modules/has/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Thiago de Arruda - -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/has/README.md b/tools/node_modules/eslint/node_modules/has/README.md deleted file mode 100644 index 635e3a4baab00b..00000000000000 --- a/tools/node_modules/eslint/node_modules/has/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# has - -> Object.prototype.hasOwnProperty.call shortcut - -## Installation - -```sh -npm install --save has -``` - -## Usage - -```js -var has = require('has'); - -has({}, 'hasOwnProperty'); // false -has(Object.prototype, 'hasOwnProperty'); // true -``` diff --git a/tools/node_modules/eslint/node_modules/has/package.json b/tools/node_modules/eslint/node_modules/has/package.json deleted file mode 100644 index 7c4592f16de071..00000000000000 --- a/tools/node_modules/eslint/node_modules/has/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "has", - "description": "Object.prototype.hasOwnProperty.call shortcut", - "version": "1.0.3", - "homepage": "https://github.com/tarruda/has", - "author": { - "name": "Thiago de Arruda", - "email": "tpadilha84@gmail.com" - }, - "contributors": [ - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "repository": { - "type": "git", - "url": "git://github.com/tarruda/has.git" - }, - "bugs": { - "url": "https://github.com/tarruda/has/issues" - }, - "license": "MIT", - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT" - } - ], - "main": "./src", - "dependencies": { - "function-bind": "^1.1.1" - }, - "devDependencies": { - "@ljharb/eslint-config": "^12.2.1", - "eslint": "^4.19.1", - "tape": "^4.9.0" - }, - "engines": { - "node": ">= 0.4.0" - }, - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "tape test" - } -} diff --git a/tools/node_modules/eslint/node_modules/has/src/index.js b/tools/node_modules/eslint/node_modules/has/src/index.js deleted file mode 100644 index dd92dd9094edb0..00000000000000 --- a/tools/node_modules/eslint/node_modules/has/src/index.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); diff --git a/tools/node_modules/eslint/node_modules/is-boolean-object/LICENSE b/tools/node_modules/eslint/node_modules/is-boolean-object/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-boolean-object/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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-boolean-object/README.md b/tools/node_modules/eslint/node_modules/is-boolean-object/README.md deleted file mode 100644 index aeadb7c816c545..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-boolean-object/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# is-boolean-object [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag. - -## Example - -```js -var isBoolean = require('is-boolean-object'); -var assert = require('assert'); - -assert.notOk(isBoolean(undefined)); -assert.notOk(isBoolean(null)); -assert.notOk(isBoolean('foo')); -assert.notOk(isBoolean(function () {})); -assert.notOk(isBoolean([])); -assert.notOk(isBoolean({})); -assert.notOk(isBoolean(/a/g)); -assert.notOk(isBoolean(new RegExp('a', 'g'))); -assert.notOk(isBoolean(new Date())); -assert.notOk(isBoolean(42)); -assert.notOk(isBoolean(NaN)); -assert.notOk(isBoolean(Infinity)); - -assert.ok(isBoolean(new Boolean(42))); -assert.ok(isBoolean(false)); -assert.ok(isBoolean(Object(false))); -assert.ok(isBoolean(true)); -assert.ok(isBoolean(Object(true))); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-boolean-object -[2]: http://versionbadg.es/ljharb/is-boolean-object.svg -[3]: https://travis-ci.org/ljharb/is-boolean-object.svg -[4]: https://travis-ci.org/ljharb/is-boolean-object -[5]: https://david-dm.org/ljharb/is-boolean-object.svg -[6]: https://david-dm.org/ljharb/is-boolean-object -[7]: https://david-dm.org/ljharb/is-boolean-object/dev-status.svg -[8]: https://david-dm.org/ljharb/is-boolean-object#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-boolean-object.png -[10]: https://ci.testling.com/ljharb/is-boolean-object -[11]: https://nodei.co/npm/is-boolean-object.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-boolean-object.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-boolean-object.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-boolean-object diff --git a/tools/node_modules/eslint/node_modules/is-boolean-object/index.js b/tools/node_modules/eslint/node_modules/is-boolean-object/index.js deleted file mode 100644 index 69864eb56013af..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-boolean-object/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var callBound = require('call-bind/callBound'); -var $boolToStr = callBound('Boolean.prototype.toString'); -var $toString = callBound('Object.prototype.toString'); - -var tryBooleanObject = function booleanBrandCheck(value) { - try { - $boolToStr(value); - return true; - } catch (e) { - return false; - } -}; -var boolClass = '[object Boolean]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isBoolean(value) { - if (typeof value === 'boolean') { - return true; - } - if (value === null || typeof value !== 'object') { - return false; - } - return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass; -}; diff --git a/tools/node_modules/eslint/node_modules/is-boolean-object/package.json b/tools/node_modules/eslint/node_modules/is-boolean-object/package.json deleted file mode 100644 index a2af900f00905b..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-boolean-object/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "is-boolean-object", - "version": "1.1.0", - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "description": "Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "test": "npm run tests-only && npm run test:harmony", - "tests-only": "nyc tape 'test/**/*.js'", - "test:harmony": "node --harmony --es-staging test", - "posttest": "aud --production", - "prelint": "npm run eccheck", - "lint": "eslint --ext=js,mjs .", - "eccheck": "eclint check $(git ls-files)", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-boolean-object.git" - }, - "keywords": [ - "Boolean", - "ES6", - "toStringTag", - "@@toStringTag", - "Boolean object", - "true", - "false", - "is-boolean" - ], - "dependencies": { - "call-bind": "^1.0.0" - }, - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eclint": "^2.8.1", - "eslint": "^7.15.0", - "foreach": "^2.0.5", - "indexof": "^0.0.1", - "is": "^3.3.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.0.1" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/tools/node_modules/eslint/node_modules/is-number-object/LICENSE b/tools/node_modules/eslint/node_modules/is-number-object/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-number-object/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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-number-object/README.md b/tools/node_modules/eslint/node_modules/is-number-object/README.md deleted file mode 100644 index 5617d7ec6bf981..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-number-object/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# is-number-object [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag. - -## Example - -```js -var isNumber = require('is-number-object'); -var assert = require('assert'); - -assert.notOk(isNumber(undefined)); -assert.notOk(isNumber(null)); -assert.notOk(isNumber(false)); -assert.notOk(isNumber(true)); -assert.notOk(isNumber('foo')); -assert.notOk(isNumber(function () {})); -assert.notOk(isNumber([])); -assert.notOk(isNumber({})); -assert.notOk(isNumber(/a/g)); -assert.notOk(isNumber(new RegExp('a', 'g'))); -assert.notOk(isNumber(new Date())); - -assert.ok(isNumber(42)); -assert.ok(isNumber(NaN)); -assert.ok(isNumber(Infinity)); -assert.ok(isNumber(new Number(42))); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-number-object -[2]: http://versionbadg.es/inspect-js/is-number-object.svg -[3]: https://travis-ci.org/inspect-js/is-number-object.svg -[4]: https://travis-ci.org/inspect-js/is-number-object -[5]: https://david-dm.org/inspect-js/is-number-object.svg -[6]: https://david-dm.org/inspect-js/is-number-object -[7]: https://david-dm.org/inspect-js/is-number-object/dev-status.svg -[8]: https://david-dm.org/inspect-js/is-number-object#info=devDependencies -[11]: https://nodei.co/npm/is-number-object.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-number-object.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-number-object.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-number-object diff --git a/tools/node_modules/eslint/node_modules/is-number-object/index.js b/tools/node_modules/eslint/node_modules/is-number-object/index.js deleted file mode 100644 index de303abe1aae6c..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-number-object/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var numToStr = Number.prototype.toString; -var tryNumberObject = function tryNumberObject(value) { - try { - numToStr.call(value); - return true; - } catch (e) { - return false; - } -}; -var toStr = Object.prototype.toString; -var numClass = '[object Number]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isNumberObject(value) { - if (typeof value === 'number') { - return true; - } - if (typeof value !== 'object') { - return false; - } - return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass; -}; diff --git a/tools/node_modules/eslint/node_modules/is-number-object/package.json b/tools/node_modules/eslint/node_modules/is-number-object/package.json deleted file mode 100644 index f6ab725f69a7b5..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-number-object/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "is-number-object", - "version": "1.0.4", - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "description": "Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "tests-only": "node --harmony --es-staging test", - "test": "npm run tests-only", - "posttest": "npx aud", - "coverage": "covert test/index.js", - "lint": "eslint .", - "eccheck": "eclint check *.js **/*.js > /dev/null", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git://github.com/inspect-js/is-number-object.git" - }, - "keywords": [ - "Number", - "ES6", - "toStringTag", - "@@toStringTag", - "Number object" - ], - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^15.0.2", - "auto-changelog": "^1.16.2", - "covert": "^1.1.1", - "eclint": "^2.8.1", - "eslint": "^6.7.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1", - "indexof": "^0.0.1", - "is": "^3.3.0", - "safe-publish-latest": "^1.1.4", - "tape": "^4.12.0" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false - } -} diff --git a/tools/node_modules/eslint/node_modules/is-string/LICENSE b/tools/node_modules/eslint/node_modules/is-string/LICENSE deleted file mode 100644 index b43df444e51828..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-string/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Jordan Harband - -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-string/README.md b/tools/node_modules/eslint/node_modules/is-string/README.md deleted file mode 100644 index 13895e5f490076..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-string/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# is-string [![Version Badge][2]][1] - -[![Build Status][3]][4] -[![dependency status][5]][6] -[![dev dependency status][7]][8] -[![License][license-image]][license-url] -[![Downloads][downloads-image]][downloads-url] - -[![npm badge][11]][1] - -[![browser support][9]][10] - -Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag. - -## Example - -```js -var isString = require('is-string'); -var assert = require('assert'); - -assert.notOk(isString(undefined)); -assert.notOk(isString(null)); -assert.notOk(isString(false)); -assert.notOk(isString(true)); -assert.notOk(isString(function () {})); -assert.notOk(isString([])); -assert.notOk(isString({})); -assert.notOk(isString(/a/g)); -assert.notOk(isString(new RegExp('a', 'g'))); -assert.notOk(isString(new Date())); -assert.notOk(isString(42)); -assert.notOk(isString(NaN)); -assert.notOk(isString(Infinity)); -assert.notOk(isString(new Number(42))); - -assert.ok(isString('foo')); -assert.ok(isString(Object('foo'))); -``` - -## Tests -Simply clone the repo, `npm install`, and run `npm test` - -[1]: https://npmjs.org/package/is-string -[2]: http://versionbadg.es/ljharb/is-string.svg -[3]: https://travis-ci.org/ljharb/is-string.svg -[4]: https://travis-ci.org/ljharb/is-string -[5]: https://david-dm.org/ljharb/is-string.svg -[6]: https://david-dm.org/ljharb/is-string -[7]: https://david-dm.org/ljharb/is-string/dev-status.svg -[8]: https://david-dm.org/ljharb/is-string#info=devDependencies -[9]: https://ci.testling.com/ljharb/is-string.png -[10]: https://ci.testling.com/ljharb/is-string -[11]: https://nodei.co/npm/is-string.png?downloads=true&stars=true -[license-image]: http://img.shields.io/npm/l/is-string.svg -[license-url]: LICENSE -[downloads-image]: http://img.shields.io/npm/dm/is-string.svg -[downloads-url]: http://npm-stat.com/charts.html?package=is-string diff --git a/tools/node_modules/eslint/node_modules/is-string/index.js b/tools/node_modules/eslint/node_modules/is-string/index.js deleted file mode 100644 index 95b7050cc68b55..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-string/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var strValue = String.prototype.valueOf; -var tryStringObject = function tryStringObject(value) { - try { - strValue.call(value); - return true; - } catch (e) { - return false; - } -}; -var toStr = Object.prototype.toString; -var strClass = '[object String]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isString(value) { - if (typeof value === 'string') { - return true; - } - if (typeof value !== 'object') { - return false; - } - return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; -}; diff --git a/tools/node_modules/eslint/node_modules/is-string/package.json b/tools/node_modules/eslint/node_modules/is-string/package.json deleted file mode 100644 index a0870540424604..00000000000000 --- a/tools/node_modules/eslint/node_modules/is-string/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "is-string", - "version": "1.0.5", - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "description": "Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", - "license": "MIT", - "main": "index.js", - "scripts": { - "prepublish": "safe-publish-latest", - "pretest": "npm run lint", - "tests-only": "node --harmony --es-staging test", - "test": "npm run tests-only", - "posttest": "npx aud", - "coverage": "covert test/index.js", - "lint": "eslint .", - "eccheck": "eclint check *.js **/*.js > /dev/null", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git://github.com/ljharb/is-string.git" - }, - "keywords": [ - "String", - "string", - "ES6", - "toStringTag", - "@@toStringTag", - "String object" - ], - "dependencies": {}, - "devDependencies": { - "@ljharb/eslint-config": "^15.0.2", - "auto-changelog": "^1.16.2", - "covert": "^1.1.1", - "eclint": "^2.8.1", - "eslint": "^6.7.2", - "foreach": "^2.0.5", - "indexof": "^0.0.1", - "is": "^3.3.0", - "safe-publish-latest": "^1.1.4", - "tape": "^4.12.0" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "engines": { - "node": ">= 0.4" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false - } -} diff --git a/tools/node_modules/eslint/node_modules/table/README.md b/tools/node_modules/eslint/node_modules/table/README.md index 22a79962a1a2ee..f34656c5021aa7 100644 --- a/tools/node_modules/eslint/node_modules/table/README.md +++ b/tools/node_modules/eslint/node_modules/table/README.md @@ -14,6 +14,7 @@ * [Cell Content Alignment](#table-usage-cell-content-alignment) * [Column Width](#table-usage-column-width) * [Custom Border](#table-usage-custom-border) + * [Draw Vertical Line](#table-usage-draw-vertical-line) * [Draw Horizontal Line](#table-usage-draw-horizontal-line) * [Single Line Mode](#table-usage-single-line-mode) * [Padding Cell Content](#table-usage-padding-cell-content) @@ -292,6 +293,57 @@ console.log(output); └────┴────┴────┘ ``` + +### Draw Vertical Line + +`{function} config.drawVerticalLine` property is a function that is called for every non-content column in the table. The result of the function `{boolean}` determines whether a border is drawn. + +```js +let data, + output, + options; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ['3A', '3B', '3C'], + ['4A', '4B', '4C'] +]; + +options = { + /** + * @typedef {function} drawVerticalLine + * @param {number} index + * @param {number} size + * @return {boolean} + */ + drawVerticalLine: (index, size) => { + return index === 0 || index === size; + } +}; + +output = table(data, options); + +console.log(output); + +``` + +``` +╔════════════╗ +║ 0A 0B 0C ║ +╟────────────╢ +║ 1A 1B 1C ║ +╟────────────╢ +║ 2A 2B 2C ║ +╟────────────╢ +║ 3A 3B 3C ║ +╟────────────╢ +║ 4A 4B 4C ║ +╚════════════╝ + +``` + ### Draw Horizontal Line @@ -647,7 +699,7 @@ console.log(output); ║ t amet, consectetur ║ ║ adipiscing elit. Pha ║ ║ sellus pulvinar nibh ║ -║ sed mauris conva... ║ +║ sed mauris convall… ║ ╚══════════════════════╝ ``` diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js b/tools/node_modules/eslint/node_modules/table/dist/alignString.js index 09412798ec27f0..c3ff7f3d631a7a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/alignString.js +++ b/tools/node_modules/eslint/node_modules/table/dist/alignString.js @@ -1,107 +1,47 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isNumberObject = _interopRequireDefault(require("is-number-object")); - -var _isString = _interopRequireDefault(require("is-string")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const alignments = ['left', 'right', 'center']; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const string_width_1 = __importDefault(require("string-width")); const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); + return subject + ' '.repeat(width); }; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - - const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; + return ' '.repeat(width) + subject; }; -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ - - const alignCenter = (subject, width) => { - let halfWidth; - halfWidth = width / 2; - - if (width % 2 === 0) { - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); - } else { - halfWidth = Math.floor(halfWidth); - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); - } + let halfWidth; + halfWidth = width / 2; + if (width % 2 === 0) { + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); + } + else { + halfWidth = Math.floor(halfWidth); + return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); + } }; /** * Pads a string to the left and/or right to position the subject * text in a desired alignment within a container. - * - * @param {string} subject - * @param {number} containerWidth - * @param {string} alignment One of the valid options (left, right, center). - * @returns {string} */ - - -const alignString = (subject, containerWidth, alignment) => { - if (!(0, _isString.default)(subject)) { - throw new TypeError('Subject parameter value must be a string.'); - } - - if (!(0, _isNumberObject.default)(containerWidth)) { - throw new TypeError('Container width parameter value must be a number.'); - } - - const subjectWidth = (0, _stringWidth.default)(subject); - - if (subjectWidth > containerWidth) { - // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - - if (!(0, _isString.default)(alignment)) { - throw new TypeError('Alignment parameter value must be a string.'); - } - - if (!alignments.includes(alignment)) { - throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); - } - - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - - const availableWidth = containerWidth - subjectWidth; - - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - - return alignCenter(subject, availableWidth); +exports.default = (subject, containerWidth, alignment) => { + if (typeof subject !== 'string') { + throw new TypeError('Subject parameter value must be a string.'); + } + const subjectWidth = string_width_1.default(subject); + if (subjectWidth > containerWidth) { + throw new Error('Subject parameter value width cannot be greater than the container width.'); + } + if (subjectWidth === 0) { + return ' '.repeat(containerWidth); + } + const availableWidth = containerWidth - subjectWidth; + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + return alignCenter(subject, availableWidth); }; - -var _default = alignString; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow b/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow deleted file mode 100644 index a3739bc2748df5..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/alignString.js.flow +++ /dev/null @@ -1,97 +0,0 @@ -import isNumber from 'is-number-object'; -import isString from 'is-string'; -import stringWidth from 'string-width'; - -const alignments = [ - 'left', - 'right', - 'center', -]; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignLeft = (subject, width) => { - return subject + ' '.repeat(width); -}; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignRight = (subject, width) => { - return ' '.repeat(width) + subject; -}; - -/** - * @param {string} subject - * @param {number} width - * @returns {string} - */ -const alignCenter = (subject, width) => { - let halfWidth; - - halfWidth = width / 2; - - if (width % 2 === 0) { - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth); - } else { - halfWidth = Math.floor(halfWidth); - - return ' '.repeat(halfWidth) + subject + ' '.repeat(halfWidth + 1); - } -}; - -/** - * Pads a string to the left and/or right to position the subject - * text in a desired alignment within a container. - * - * @param {string} subject - * @param {number} containerWidth - * @param {string} alignment One of the valid options (left, right, center). - * @returns {string} - */ -export default (subject, containerWidth, alignment) => { - if (!isString(subject)) { - throw new TypeError('Subject parameter value must be a string.'); - } - - if (!isNumber(containerWidth)) { - throw new TypeError('Container width parameter value must be a number.'); - } - - const subjectWidth = stringWidth(subject); - - if (subjectWidth > containerWidth) { - // console.log('subjectWidth', subjectWidth, 'containerWidth', containerWidth, 'subject', subject); - - throw new Error('Subject parameter value width cannot be greater than the container width.'); - } - - if (!isString(alignment)) { - throw new TypeError('Alignment parameter value must be a string.'); - } - - if (!alignments.includes(alignment)) { - throw new Error('Alignment parameter value must be a known alignment parameter value (left, right, center).'); - } - - if (subjectWidth === 0) { - return ' '.repeat(containerWidth); - } - - const availableWidth = containerWidth - subjectWidth; - - if (alignment === 'left') { - return alignLeft(subject, availableWidth); - } - - if (alignment === 'right') { - return alignRight(subject, availableWidth); - } - - return alignCenter(subject, availableWidth); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js index fc60afe85c1e43..884a26ba5f58dd 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js @@ -1,34 +1,20 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _stringWidth = _interopRequireDefault(require("string-width")); - -var _alignString = _interopRequireDefault(require("./alignString")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -const alignTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - if ((0, _stringWidth.default)(value) === column.width) { - return value; - } else { - return (0, _alignString.default)(value, column.width, column.alignment); - } +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const string_width_1 = __importDefault(require("string-width")); +const alignString_1 = __importDefault(require("./alignString")); +exports.default = (rows, config) => { + return rows.map((row) => { + return row.map((cell, index) => { + const column = config.columns[index]; + if (string_width_1.default(cell) === column.width) { + return cell; + } + else { + return alignString_1.default(cell, column.width, column.alignment); + } + }); }); - }); }; - -var _default = alignTableData; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow deleted file mode 100644 index c82c31e261b70b..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/alignTableData.js.flow +++ /dev/null @@ -1,21 +0,0 @@ -import stringWidth from 'string-width'; -import alignString from './alignString'; - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - if (stringWidth(value) === column.width) { - return value; - } else { - return alignString(value, column.width, column.alignment); - } - }); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js index 8f7ed9fc8b0e2b..fbe9aa9cf424c6 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js @@ -1,37 +1,12 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isString = _interopRequireDefault(require("is-string")); - -var _wrapCell = _interopRequireDefault(require("./wrapCell")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {string} value - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {number} - */ -const calculateCellHeight = (value, columnWidth, useWrapWord = false) => { - if (!(0, _isString.default)(value)) { - throw new TypeError('Value must be a string.'); - } - - if (!Number.isInteger(columnWidth)) { - throw new TypeError('Column width must be an integer.'); - } - - if (columnWidth < 1) { - throw new Error('Column width must be greater than 0.'); - } - - return (0, _wrapCell.default)(value, columnWidth, useWrapWord).length; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const wrapCell_1 = __importDefault(require("./wrapCell")); +exports.default = (value, columnWidth, useWrapWord = false) => { + if (typeof value !== 'string') { + throw new TypeError('Value must be a string.'); + } + return wrapCell_1.default(value, columnWidth, useWrapWord).length; }; - -var _default = calculateCellHeight; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow deleted file mode 100644 index 172604390b2ecb..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellHeight.js.flow +++ /dev/null @@ -1,24 +0,0 @@ -import isString from 'is-string'; -import wrapCell from './wrapCell'; - -/** - * @param {string} value - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {number} - */ -export default (value, columnWidth, useWrapWord = false) => { - if (!isString(value)) { - throw new TypeError('Value must be a string.'); - } - - if (!Number.isInteger(columnWidth)) { - throw new TypeError('Column width must be an integer.'); - } - - if (columnWidth < 1) { - throw new Error('Column width must be greater than 0.'); - } - - return wrapCell(value, columnWidth, useWrapWord).length; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js index c46fb861ddf123..d267e7906d1475 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js @@ -1,27 +1,16 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const string_width_1 = __importDefault(require("string-width")); /** * Calculates width of each cell contents. - * - * @param {string[]} cells - * @returns {number[]} */ -const calculateCellWidthIndex = cells => { - return cells.map(value => { - return Math.max(...value.split('\n').map(line => { - return (0, _stringWidth.default)(line); - })); - }); +exports.default = (cells) => { + return cells.map((value) => { + return Math.max(...value.split('\n').map((line) => { + return string_width_1.default(line); + })); + }); }; - -var _default = calculateCellWidthIndex; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow deleted file mode 100644 index e2539539a5d15d..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateCellWidthIndex.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -import stringWidth from 'string-width'; - -/** - * Calculates width of each cell contents. - * - * @param {string[]} cells - * @returns {number[]} - */ -export default (cells) => { - return cells.map((value) => { - return Math.max( - ...value.split('\n').map((line) => { - return stringWidth(line); - }), - ); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js index 057d0a506d64da..3312f451d876ea 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js @@ -1,36 +1,24 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const calculateCellWidthIndex_1 = __importDefault(require("./calculateCellWidthIndex")); /** * Produces an array of values that describe the largest value length (width) in every column. - * - * @param {Array[]} rows - * @returns {number[]} */ -const calculateMaximumColumnWidthIndex = rows => { - if (!rows[0]) { - throw new Error('Dataset must have at least one row.'); - } - - const columns = new Array(rows[0].length).fill(0); - rows.forEach(row => { - const columnWidthIndex = (0, _calculateCellWidthIndex.default)(row); - columnWidthIndex.forEach((valueWidth, index0) => { - if (columns[index0] < valueWidth) { - columns[index0] = valueWidth; - } +exports.default = (rows) => { + if (!rows[0]) { + throw new Error('Dataset must have at least one row.'); + } + const columns = new Array(rows[0].length).fill(0); + rows.forEach((row) => { + const columnWidthIndex = calculateCellWidthIndex_1.default(row); + columnWidthIndex.forEach((valueWidth, index0) => { + if (columns[index0] < valueWidth) { + columns[index0] = valueWidth; + } + }); }); - }); - return columns; + return columns; }; - -var _default = calculateMaximumColumnWidthIndex; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow deleted file mode 100644 index 5c8c10981cc63b..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.flow +++ /dev/null @@ -1,27 +0,0 @@ -import calculateCellWidthIndex from './calculateCellWidthIndex'; - -/** - * Produces an array of values that describe the largest value length (width) in every column. - * - * @param {Array[]} rows - * @returns {number[]} - */ -export default (rows) => { - if (!rows[0]) { - throw new Error('Dataset must have at least one row.'); - } - - const columns = new Array(rows[0].length).fill(0); - - rows.forEach((row) => { - const columnWidthIndex = calculateCellWidthIndex(row); - - columnWidthIndex.forEach((valueWidth, index0) => { - if (columns[index0] < valueWidth) { - columns[index0] = valueWidth; - } - }); - }); - - return columns; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js index b8175d65626cde..3db65542cd9bfe 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js @@ -1,45 +1,21 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _isBooleanObject = _interopRequireDefault(require("is-boolean-object")); - -var _isNumberObject = _interopRequireDefault(require("is-number-object")); - -var _calculateCellHeight = _interopRequireDefault(require("./calculateCellHeight")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const calculateCellHeight_1 = __importDefault(require("./calculateCellHeight")); /** * Calculates the vertical row span index. - * - * @param {Array[]} rows - * @param {object} config - * @returns {number[]} */ -const calculateRowHeightIndex = (rows, config) => { - const tableWidth = rows[0].length; - const rowSpanIndex = []; - rows.forEach(cells => { - const cellHeightIndex = new Array(tableWidth).fill(1); - cells.forEach((value, index1) => { - if (!(0, _isNumberObject.default)(config.columns[index1].width)) { - throw new TypeError('column[index].width must be a number.'); - } - - if (!(0, _isBooleanObject.default)(config.columns[index1].wrapWord)) { - throw new TypeError('column[index].wrapWord must be a boolean.'); - } - - cellHeightIndex[index1] = (0, _calculateCellHeight.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); +exports.default = (rows, config) => { + const tableWidth = rows[0].length; + const rowSpanIndex = []; + rows.forEach((cells) => { + const cellHeightIndex = new Array(tableWidth).fill(1); + cells.forEach((value, index1) => { + cellHeightIndex[index1] = calculateCellHeight_1.default(value, config.columns[index1].width, config.columns[index1].wrapWord); + }); + rowSpanIndex.push(Math.max(...cellHeightIndex)); }); - rowSpanIndex.push(Math.max(...cellHeightIndex)); - }); - return rowSpanIndex; + return rowSpanIndex; }; - -var _default = calculateRowHeightIndex; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow deleted file mode 100644 index 04c61b3ea040a3..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/calculateRowHeightIndex.js.flow +++ /dev/null @@ -1,36 +0,0 @@ -import isBoolean from 'is-boolean-object'; -import isNumber from 'is-number-object'; -import calculateCellHeight from './calculateCellHeight'; - -/** - * Calculates the vertical row span index. - * - * @param {Array[]} rows - * @param {object} config - * @returns {number[]} - */ -export default (rows, config) => { - const tableWidth = rows[0].length; - - const rowSpanIndex = []; - - rows.forEach((cells) => { - const cellHeightIndex = new Array(tableWidth).fill(1); - - cells.forEach((value, index1) => { - if (!isNumber(config.columns[index1].width)) { - throw new TypeError('column[index].width must be a number.'); - } - - if (!isBoolean(config.columns[index1].wrapWord)) { - throw new TypeError('column[index].wrapWord must be a boolean.'); - } - - cellHeightIndex[index1] = calculateCellHeight(value, config.columns[index1].width, config.columns[index1].wrapWord); - }); - - rowSpanIndex.push(Math.max(...cellHeightIndex)); - }); - - return rowSpanIndex; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js b/tools/node_modules/eslint/node_modules/table/dist/createStream.js index 731f12035d0511..ffe611f8fb2dc3 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js +++ b/tools/node_modules/eslint/node_modules/table/dist/createStream.js @@ -1,124 +1,73 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _alignTableData = _interopRequireDefault(require("./alignTableData")); - -var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); - -var _drawBorder = require("./drawBorder"); - -var _drawRow = _interopRequireDefault(require("./drawRow")); - -var _makeStreamConfig = _interopRequireDefault(require("./makeStreamConfig")); - -var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); - -var _padTableData = _interopRequireDefault(require("./padTableData")); - -var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); - -var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Array} data - * @param {object} config - * @returns {Array} - */ +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const alignTableData_1 = __importDefault(require("./alignTableData")); +const calculateRowHeightIndex_1 = __importDefault(require("./calculateRowHeightIndex")); +const drawBorder_1 = require("./drawBorder"); +const drawRow_1 = __importDefault(require("./drawRow")); +const makeStreamConfig_1 = __importDefault(require("./makeStreamConfig")); +const mapDataUsingRowHeightIndex_1 = __importDefault(require("./mapDataUsingRowHeightIndex")); +const padTableData_1 = __importDefault(require("./padTableData")); +const stringifyTableData_1 = __importDefault(require("./stringifyTableData")); +const truncateTableData_1 = __importDefault(require("./truncateTableData")); const prepareData = (data, config) => { - let rows; - rows = (0, _stringifyTableData.default)(data); - rows = (0, _truncateTableData.default)(data, config); - const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); - rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData.default)(rows, config); - rows = (0, _padTableData.default)(rows, config); - return rows; + let rows = stringifyTableData_1.default(data); + rows = truncateTableData_1.default(rows, config); + const rowHeightIndex = calculateRowHeightIndex_1.default(rows, config); + rows = mapDataUsingRowHeightIndex_1.default(rows, rowHeightIndex, config); + rows = alignTableData_1.default(rows, config); + rows = padTableData_1.default(rows, config); + return rows; }; -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ - - const create = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow.default)(literalRow, config.border); - }).join(''); - let output; - output = ''; - output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); - output += body; - output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - output = output.trimEnd(); - process.stdout.write(output); + const rows = prepareData([row], config); + const body = rows.map((literalRow) => { + return drawRow_1.default(literalRow, config); + }).join(''); + let output; + output = ''; + output += drawBorder_1.drawBorderTop(columnWidthIndex, config); + output += body; + output += drawBorder_1.drawBorderBottom(columnWidthIndex, config); + output = output.trimEnd(); + process.stdout.write(output); }; -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ - - const append = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - const body = rows.map(literalRow => { - return (0, _drawRow.default)(literalRow, config.border); - }).join(''); - let output = ''; - const bottom = (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); - - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - - output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); - output += body; - output += bottom; - output = output.trimEnd(); - process.stdout.write(output); -}; -/** - * @param {object} userConfig - * @returns {object} - */ - - -const createStream = (userConfig = {}) => { - const config = (0, _makeStreamConfig.default)(userConfig); - const columnWidthIndex = Object.values(config.columns).map(column => { - return column.width + column.paddingLeft + column.paddingRight; - }); - let empty; - empty = true; - return { - /** - * @param {string[]} row - * @returns {undefined} - */ - write: row => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - - if (empty) { - empty = false; - return create(row, columnWidthIndex, config); - } else { - return append(row, columnWidthIndex, config); - } + const rows = prepareData([row], config); + const body = rows.map((literalRow) => { + return drawRow_1.default(literalRow, config); + }).join(''); + let output = ''; + const bottom = drawBorder_1.drawBorderBottom(columnWidthIndex, config); + if (bottom !== '\n') { + output = '\r\u001B[K'; } - }; + output += drawBorder_1.drawBorderJoin(columnWidthIndex, config); + output += body; + output += bottom; + output = output.trimEnd(); + process.stdout.write(output); +}; +exports.default = (userConfig) => { + const config = makeStreamConfig_1.default(userConfig); + const columnWidthIndex = Object.values(config.columns).map((column) => { + return column.width + column.paddingLeft + column.paddingRight; + }); + let empty = true; + return { + write: (row) => { + if (row.length !== config.columnCount) { + throw new Error('Row cell count does not match the config.columnCount.'); + } + if (empty) { + empty = false; + create(row, columnWidthIndex, config); + } + else { + append(row, columnWidthIndex, config); + } + }, + }; }; - -var _default = createStream; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow b/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow deleted file mode 100644 index 747ba6a7595bd4..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/createStream.js.flow +++ /dev/null @@ -1,125 +0,0 @@ -import alignTableData from './alignTableData'; -import calculateRowHeightIndex from './calculateRowHeightIndex'; -import { - drawBorderBottom, - drawBorderJoin, - drawBorderTop, -} from './drawBorder'; -import drawRow from './drawRow'; -import makeStreamConfig from './makeStreamConfig'; -import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; -import padTableData from './padTableData'; -import stringifyTableData from './stringifyTableData'; -import truncateTableData from './truncateTableData'; - -/** - * @param {Array} data - * @param {object} config - * @returns {Array} - */ -const prepareData = (data, config) => { - let rows; - - rows = stringifyTableData(data); - - rows = truncateTableData(data, config); - - const rowHeightIndex = calculateRowHeightIndex(rows, config); - - rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); - rows = alignTableData(rows, config); - rows = padTableData(rows, config); - - return rows; -}; - -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ -const create = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - - const body = rows.map((literalRow) => { - return drawRow(literalRow, config.border); - }).join(''); - - let output; - - output = ''; - - output += drawBorderTop(columnWidthIndex, config.border); - output += body; - output += drawBorderBottom(columnWidthIndex, config.border); - - output = output.trimEnd(); - - process.stdout.write(output); -}; - -/** - * @param {string[]} row - * @param {number[]} columnWidthIndex - * @param {object} config - * @returns {undefined} - */ -const append = (row, columnWidthIndex, config) => { - const rows = prepareData([row], config); - - const body = rows.map((literalRow) => { - return drawRow(literalRow, config.border); - }).join(''); - - let output = ''; - const bottom = drawBorderBottom(columnWidthIndex, config.border); - - if (bottom !== '\n') { - output = '\r\u001B[K'; - } - - output += drawBorderJoin(columnWidthIndex, config.border); - output += body; - output += bottom; - - output = output.trimEnd(); - - process.stdout.write(output); -}; - -/** - * @param {object} userConfig - * @returns {object} - */ -export default (userConfig = {}) => { - const config = makeStreamConfig(userConfig); - - const columnWidthIndex = Object.values(config.columns).map((column) => { - return column.width + column.paddingLeft + column.paddingRight; - }); - - let empty; - - empty = true; - - return { - /** - * @param {string[]} row - * @returns {undefined} - */ - write: (row) => { - if (row.length !== config.columnCount) { - throw new Error('Row cell count does not match the config.columnCount.'); - } - - if (empty) { - empty = false; - - return create(row, columnWidthIndex, config); - } else { - return append(row, columnWidthIndex, config); - } - }, - }; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js index 965e8539d42749..7620eba3dd5cdf 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js @@ -1,109 +1,54 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = void 0; - -/** - * @typedef drawBorder~parts - * @property {string} left - * @property {string} right - * @property {string} body - * @property {string} join - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorder~parts} parts - * @returns {string} - */ -const drawBorder = (columnSizeIndex, parts) => { - const columns = columnSizeIndex.map(size => { - return parts.body.repeat(size); - }).join(parts.join); - return parts.left + columns + parts.right + '\n'; +const drawHorizontalContent_1 = __importDefault(require("./drawHorizontalContent")); +const drawBorder = (columnSizeIndex, config) => { + const columns = columnSizeIndex.map((size) => { + return config.separator.body.repeat(size); + }); + return drawHorizontalContent_1.default(columns, config); }; -/** - * @typedef drawBorderTop~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderTop~parts} parts - * @returns {string} - */ - - exports.drawBorder = drawBorder; - -const drawBorderTop = (columnSizeIndex, parts) => { - const border = drawBorder(columnSizeIndex, { - body: parts.topBody, - join: parts.topJoin, - left: parts.topLeft, - right: parts.topRight - }); - - if (border === '\n') { - return ''; - } - - return border; +const drawBorderTop = (columnSizeIndex, config) => { + const result = drawBorder(columnSizeIndex, { + ...config, + separator: { + body: config.border.topBody, + join: config.border.topJoin, + left: config.border.topLeft, + right: config.border.topRight, + }, + }); + if (result === '\n') { + return ''; + } + return result; }; -/** - * @typedef drawBorderJoin~parts - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinBody - * @property {string} joinJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderJoin~parts} parts - * @returns {string} - */ - - exports.drawBorderTop = drawBorderTop; - -const drawBorderJoin = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.joinBody, - join: parts.joinJoin, - left: parts.joinLeft, - right: parts.joinRight - }); +const drawBorderJoin = (columnSizeIndex, config) => { + return drawBorder(columnSizeIndex, { + ...config, + separator: { + body: config.border.joinBody, + join: config.border.joinJoin, + left: config.border.joinLeft, + right: config.border.joinRight, + }, + }); }; -/** - * @typedef drawBorderBottom~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderBottom~parts} parts - * @returns {string} - */ - - exports.drawBorderJoin = drawBorderJoin; - -const drawBorderBottom = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.bottomBody, - join: parts.bottomJoin, - left: parts.bottomLeft, - right: parts.bottomRight - }); +const drawBorderBottom = (columnSizeIndex, config) => { + return drawBorder(columnSizeIndex, { + ...config, + separator: { + body: config.border.bottomBody, + join: config.border.bottomJoin, + left: config.border.bottomLeft, + right: config.border.bottomRight, + }, + }); }; - -exports.drawBorderBottom = drawBorderBottom; \ No newline at end of file +exports.drawBorderBottom = drawBorderBottom; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow deleted file mode 100644 index 85de2475e8b294..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/drawBorder.js.flow +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @typedef drawBorder~parts - * @property {string} left - * @property {string} right - * @property {string} body - * @property {string} join - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorder~parts} parts - * @returns {string} - */ -const drawBorder = (columnSizeIndex, parts) => { - const columns = columnSizeIndex - .map((size) => { - return parts.body.repeat(size); - }) - .join(parts.join); - - return parts.left + columns + parts.right + '\n'; -}; - -/** - * @typedef drawBorderTop~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderTop~parts} parts - * @returns {string} - */ -const drawBorderTop = (columnSizeIndex, parts) => { - const border = drawBorder(columnSizeIndex, { - body: parts.topBody, - join: parts.topJoin, - left: parts.topLeft, - right: parts.topRight, - }); - - if (border === '\n') { - return ''; - } - - return border; -}; - -/** - * @typedef drawBorderJoin~parts - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinBody - * @property {string} joinJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderJoin~parts} parts - * @returns {string} - */ -const drawBorderJoin = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.joinBody, - join: parts.joinJoin, - left: parts.joinLeft, - right: parts.joinRight, - }); -}; - -/** - * @typedef drawBorderBottom~parts - * @property {string} topLeft - * @property {string} topRight - * @property {string} topBody - * @property {string} topJoin - */ - -/** - * @param {number[]} columnSizeIndex - * @param {drawBorderBottom~parts} parts - * @returns {string} - */ -const drawBorderBottom = (columnSizeIndex, parts) => { - return drawBorder(columnSizeIndex, { - body: parts.bottomBody, - join: parts.bottomJoin, - left: parts.bottomLeft, - right: parts.bottomRight, - }); -}; - -export { - drawBorder, - drawBorderBottom, - drawBorderJoin, - drawBorderTop, -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawHorizontalContent.js b/tools/node_modules/eslint/node_modules/table/dist/drawHorizontalContent.js new file mode 100644 index 00000000000000..ceee448495f579 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/drawHorizontalContent.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function drawHorizontalContent(contents, config) { + const { separator, drawVerticalLine } = config; + const contentSize = contents.length; + const result = []; + result.push(drawVerticalLine(0, contentSize) ? separator.left : ''); + contents.forEach((content, index) => { + result.push(content); + // Only append the join separator if it is not the last content + if (index + 1 < contentSize) { + result.push(drawVerticalLine(index + 1, contentSize) ? separator.join : ''); + } + }); + result.push(drawVerticalLine(contentSize, contentSize) ? separator.right : ''); + return result.join('') + '\n'; +} +exports.default = drawHorizontalContent; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js index 432f5bce1f9cdd..c03fb780b1174e 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js @@ -1,25 +1,16 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @typedef {object} drawRow~border - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - */ - -/** - * @param {number[]} columns - * @param {drawRow~border} border - * @returns {string} - */ -const drawRow = (columns, border) => { - return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const drawHorizontalContent_1 = __importDefault(require("./drawHorizontalContent")); +exports.default = (row, config) => { + return drawHorizontalContent_1.default(row, { + ...config, + separator: { + join: config.border.bodyJoin, + left: config.border.bodyLeft, + right: config.border.bodyRight, + }, + }); }; - -var _default = drawRow; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow deleted file mode 100644 index 978eab2de19941..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/drawRow.js.flow +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @typedef {object} drawRow~border - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - */ - -/** - * @param {number[]} columns - * @param {drawRow~border} border - * @returns {string} - */ -export default (columns, border) => { - return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js index 4c49d0fff50de8..a7e10193d62d45 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js +++ b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js @@ -1,58 +1,48 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _drawBorder = require("./drawBorder"); - -var _drawRow = _interopRequireDefault(require("./drawRow")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const drawBorder_1 = require("./drawBorder"); +const drawRow_1 = __importDefault(require("./drawRow")); /** - * @param {Array} rows - * @param {object} border - * @param {Array} columnSizeIndex - * @param {Array} rowSpanIndex - * @param {Function} drawHorizontalLine - * @param {boolean} singleLine - * @returns {string} + * Group the array into sub-arrays by sizes. + * + * @example + * chunkBySizes(['a', 'b', 'c', 'd', 'e'], [2, 1, 2]) = [ ['a', 'b'], ['c'], ['d', 'e'] ] */ -const drawTable = (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { - let output; - let realRowIndex; - let rowHeight; - const rowCount = rows.length; - realRowIndex = 0; - output = ''; - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderTop)(columnSizeIndex, border); - } - - rows.forEach((row, index0) => { - output += (0, _drawRow.default)(row, border); - - if (!rowHeight) { - rowHeight = rowSpanIndex[realRowIndex]; - realRowIndex++; +const groupBySizes = (array, sizes) => { + let startIndex = 0; + return sizes.map((rowHeight) => { + const chunk = array.slice(startIndex, startIndex + rowHeight); + startIndex += rowHeight; + return chunk; + }); +}; +const shouldDrawBorderJoin = (rowIndex, rowCount, config) => { + const { singleLine, drawHorizontalLine } = config; + return !singleLine && rowIndex + 1 < rowCount && drawHorizontalLine(rowIndex + 1, rowCount); +}; +exports.default = (rows, columnWidths, rowHeights, config) => { + const { drawHorizontalLine, } = config; + const groupedRows = groupBySizes(rows, rowHeights).map((group) => { + return group.map((row) => { + return drawRow_1.default(row, config); + }).join(''); + }); + const rowCount = groupedRows.length; + let output = ''; + if (drawHorizontalLine(0, rowCount)) { + output += drawBorder_1.drawBorderTop(columnWidths, config); } - - rowHeight--; - - if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderJoin)(columnSizeIndex, border); + groupedRows.forEach((row, rowIndex) => { + output += row; + if (shouldDrawBorderJoin(rowIndex, rowCount, config)) { + output += drawBorder_1.drawBorderJoin(columnWidths, config); + } + }); + if (drawHorizontalLine(rowCount, rowCount)) { + output += drawBorder_1.drawBorderBottom(columnWidths, config); } - }); - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += (0, _drawBorder.drawBorderBottom)(columnSizeIndex, border); - } - - return output; + return output; }; - -var _default = drawTable; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow b/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow deleted file mode 100644 index 84707caa83d04b..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/drawTable.js.flow +++ /dev/null @@ -1,53 +0,0 @@ -import { - drawBorderTop, - drawBorderJoin, - drawBorderBottom, -} from './drawBorder'; -import drawRow from './drawRow'; - -/** - * @param {Array} rows - * @param {object} border - * @param {Array} columnSizeIndex - * @param {Array} rowSpanIndex - * @param {Function} drawHorizontalLine - * @param {boolean} singleLine - * @returns {string} - */ -export default (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine, singleLine) => { - let output; - let realRowIndex; - let rowHeight; - - const rowCount = rows.length; - - realRowIndex = 0; - - output = ''; - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderTop(columnSizeIndex, border); - } - - rows.forEach((row, index0) => { - output += drawRow(row, border); - - if (!rowHeight) { - rowHeight = rowSpanIndex[realRowIndex]; - - realRowIndex++; - } - - rowHeight--; - - if (!singleLine && rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderJoin(columnSizeIndex, border); - } - }); - - if (drawHorizontalLine(realRowIndex, rowCount)) { - output += drawBorderBottom(columnSizeIndex, border); - } - - return output; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/validators.js b/tools/node_modules/eslint/node_modules/table/dist/generated/validators.js similarity index 63% rename from tools/node_modules/eslint/node_modules/table/dist/validators.js rename to tools/node_modules/eslint/node_modules/table/dist/generated/validators.js index 51783aa08b8595..99119828de034a 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validators.js +++ b/tools/node_modules/eslint/node_modules/table/dist/generated/validators.js @@ -14,6 +14,9 @@ const schema13 = { "columnDefault": { "$ref": "shared.json#/definitions/column" }, + "drawVerticalLine": { + "typeof": "function" + }, "drawHorizontalLine": { "typeof": "function" }, @@ -78,13 +81,7 @@ const func8 = Object.prototype.hasOwnProperty; const schema16 = { "type": "string" }; - -function validate46(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (typeof data !== "string") { @@ -99,7 +96,8 @@ function validate46(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -107,13 +105,7 @@ function validate46(data, { validate46.errors = vErrors; return errors === 0; } - -function validate45(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { @@ -130,7 +122,8 @@ function validate45(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -138,170 +131,171 @@ function validate45(data, { } if (data.topBody !== undefined) { if (!(validate46(data.topBody, { - instancePath: instancePath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { + instancePath: instancePath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topJoin !== undefined) { if (!(validate46(data.topJoin, { - instancePath: instancePath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { + instancePath: instancePath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topLeft !== undefined) { if (!(validate46(data.topLeft, { - instancePath: instancePath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { + instancePath: instancePath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topRight !== undefined) { if (!(validate46(data.topRight, { - instancePath: instancePath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { + instancePath: instancePath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomBody !== undefined) { if (!(validate46(data.bottomBody, { - instancePath: instancePath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { + instancePath: instancePath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomJoin !== undefined) { if (!(validate46(data.bottomJoin, { - instancePath: instancePath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { + instancePath: instancePath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomLeft !== undefined) { if (!(validate46(data.bottomLeft, { - instancePath: instancePath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { + instancePath: instancePath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomRight !== undefined) { if (!(validate46(data.bottomRight, { - instancePath: instancePath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { + instancePath: instancePath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyLeft !== undefined) { if (!(validate46(data.bodyLeft, { - instancePath: instancePath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { + instancePath: instancePath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyRight !== undefined) { if (!(validate46(data.bodyRight, { - instancePath: instancePath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { + instancePath: instancePath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyJoin !== undefined) { if (!(validate46(data.bodyJoin, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { + instancePath: instancePath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinBody !== undefined) { if (!(validate46(data.joinBody, { - instancePath: instancePath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { + instancePath: instancePath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinLeft !== undefined) { if (!(validate46(data.joinLeft, { - instancePath: instancePath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { + instancePath: instancePath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinRight !== undefined) { if (!(validate46(data.joinRight, { - instancePath: instancePath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { + instancePath: instancePath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinJoin !== undefined) { if (!(validate46(data.joinJoin, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { + instancePath: instancePath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } - } else { + } + else { const err1 = { instancePath, schemaPath: "#/type", @@ -313,7 +307,8 @@ function validate45(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; @@ -322,13 +317,20 @@ function validate45(data, { return errors === 0; } const schema17 = { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false + "oneOf": [{ + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, { + "type": "array", + "items": { + "$ref": "#/definitions/column" + } + }] }; const pattern0 = new RegExp("^[0-9]+$", "u"); const schema18 = { @@ -339,7 +341,9 @@ const schema18 = { "enum": ["left", "right", "center"] }, "width": { - "type": "number" + "type": "number", + "minimum": 1, + "multipleOf": 1 }, "wrapWord": { "type": "boolean" @@ -357,13 +361,7 @@ const schema18 = { "additionalProperties": false }; const func0 = require("ajv/dist/runtime/equal").default; - -function validate64(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate64(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { @@ -380,7 +378,8 @@ function validate64(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -400,7 +399,8 @@ function validate64(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; @@ -417,7 +417,8 @@ function validate64(data, { }; if (vErrors === null) { vErrors = [err2]; - } else { + } + else { vErrors.push(err2); } errors++; @@ -425,8 +426,48 @@ function validate64(data, { } if (data.width !== undefined) { let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { + if ((typeof data1 == "number") && (isFinite(data1))) { + if (data1 < 1 || isNaN(data1)) { + const err3 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + let res0; + if ((1 === 0 || (res0 = data1 / 1, res0 !== parseInt(res0)))) { + const err4 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/multipleOf", + keyword: "multipleOf", + params: { + multipleOf: 1 + }, + message: "must be multiple of 1" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + else { + const err5 = { instancePath: instancePath + "/width", schemaPath: "#/properties/width/type", keyword: "type", @@ -436,16 +477,17 @@ function validate64(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); + vErrors = [err5]; + } + else { + vErrors.push(err5); } errors++; } } if (data.wrapWord !== undefined) { if (typeof data.wrapWord !== "boolean") { - const err4 = { + const err6 = { instancePath: instancePath + "/wrapWord", schemaPath: "#/properties/wrapWord/type", keyword: "type", @@ -455,9 +497,10 @@ function validate64(data, { message: "must be boolean" }; if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); + vErrors = [err6]; + } + else { + vErrors.push(err6); } errors++; } @@ -465,7 +508,7 @@ function validate64(data, { if (data.truncate !== undefined) { let data3 = data.truncate; if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { + const err7 = { instancePath: instancePath + "/truncate", schemaPath: "#/properties/truncate/type", keyword: "type", @@ -475,9 +518,10 @@ function validate64(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); + vErrors = [err7]; + } + else { + vErrors.push(err7); } errors++; } @@ -485,7 +529,7 @@ function validate64(data, { if (data.paddingLeft !== undefined) { let data4 = data.paddingLeft; if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { + const err8 = { instancePath: instancePath + "/paddingLeft", schemaPath: "#/properties/paddingLeft/type", keyword: "type", @@ -495,9 +539,10 @@ function validate64(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); + vErrors = [err8]; + } + else { + vErrors.push(err8); } errors++; } @@ -505,7 +550,7 @@ function validate64(data, { if (data.paddingRight !== undefined) { let data5 = data.paddingRight; if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { + const err9 = { instancePath: instancePath + "/paddingRight", schemaPath: "#/properties/paddingRight/type", keyword: "type", @@ -515,15 +560,17 @@ function validate64(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); + vErrors = [err9]; + } + else { + vErrors.push(err9); } errors++; } } - } else { - const err8 = { + } + else { + const err10 = { instancePath, schemaPath: "#/type", keyword: "type", @@ -533,30 +580,29 @@ function validate64(data, { message: "must be object" }; if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); + vErrors = [err10]; + } + else { + vErrors.push(err10); } errors++; } validate64.errors = vErrors; return errors === 0; } - -function validate63(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate63(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; + const _errs0 = errors; + let valid0 = false; + let passing0 = null; + const _errs1 = errors; if (data && typeof data == "object" && !Array.isArray(data)) { for (const key0 in data) { if (!(pattern0.test(key0))) { const err0 = { instancePath, - schemaPath: "#/additionalProperties", + schemaPath: "#/oneOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 @@ -565,7 +611,8 @@ function validate63(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -574,20 +621,21 @@ function validate63(data, { for (const key1 in data) { if (pattern0.test(key1)) { if (!(validate64(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { + instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); errors = vErrors.length; } } } - } else { + } + else { const err1 = { instancePath, - schemaPath: "#/type", + schemaPath: "#/oneOf/0/type", keyword: "type", params: { type: "object" @@ -596,21 +644,94 @@ function validate63(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; } + var _valid0 = _errs1 === errors; + if (_valid0) { + valid0 = true; + passing0 = 0; + } + const _errs5 = errors; + if (Array.isArray(data)) { + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + if (!(validate64(data[i0], { + instancePath: instancePath + "/" + i0, + parentData: data, + parentDataProperty: i0, + rootData + }))) { + vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); + errors = vErrors.length; + } + } + } + else { + const err2 = { + instancePath, + schemaPath: "#/oneOf/1/type", + keyword: "type", + params: { + type: "array" + }, + message: "must be array" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + var _valid0 = _errs5 === errors; + if (_valid0 && valid0) { + valid0 = false; + passing0 = [passing0, 1]; + } + else { + if (_valid0) { + valid0 = true; + passing0 = 1; + } + } + if (!valid0) { + const err3 = { + instancePath, + schemaPath: "#/oneOf", + keyword: "oneOf", + params: { + passingSchemas: passing0 + }, + message: "must match exactly one schema in oneOf" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } + else { + vErrors = null; + } + } + } validate63.errors = vErrors; return errors === 0; } - -function validate67(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate68(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { @@ -627,7 +748,8 @@ function validate67(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -647,7 +769,8 @@ function validate67(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; @@ -664,7 +787,8 @@ function validate67(data, { }; if (vErrors === null) { vErrors = [err2]; - } else { + } + else { vErrors.push(err2); } errors++; @@ -672,8 +796,48 @@ function validate67(data, { } if (data.width !== undefined) { let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { + if ((typeof data1 == "number") && (isFinite(data1))) { + if (data1 < 1 || isNaN(data1)) { + const err3 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + let res0; + if ((1 === 0 || (res0 = data1 / 1, res0 !== parseInt(res0)))) { + const err4 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/multipleOf", + keyword: "multipleOf", + params: { + multipleOf: 1 + }, + message: "must be multiple of 1" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + else { + const err5 = { instancePath: instancePath + "/width", schemaPath: "#/properties/width/type", keyword: "type", @@ -683,16 +847,17 @@ function validate67(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); + vErrors = [err5]; + } + else { + vErrors.push(err5); } errors++; } } if (data.wrapWord !== undefined) { if (typeof data.wrapWord !== "boolean") { - const err4 = { + const err6 = { instancePath: instancePath + "/wrapWord", schemaPath: "#/properties/wrapWord/type", keyword: "type", @@ -702,9 +867,10 @@ function validate67(data, { message: "must be boolean" }; if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); + vErrors = [err6]; + } + else { + vErrors.push(err6); } errors++; } @@ -712,7 +878,7 @@ function validate67(data, { if (data.truncate !== undefined) { let data3 = data.truncate; if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { + const err7 = { instancePath: instancePath + "/truncate", schemaPath: "#/properties/truncate/type", keyword: "type", @@ -722,9 +888,10 @@ function validate67(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); + vErrors = [err7]; + } + else { + vErrors.push(err7); } errors++; } @@ -732,7 +899,7 @@ function validate67(data, { if (data.paddingLeft !== undefined) { let data4 = data.paddingLeft; if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { + const err8 = { instancePath: instancePath + "/paddingLeft", schemaPath: "#/properties/paddingLeft/type", keyword: "type", @@ -742,9 +909,10 @@ function validate67(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); + vErrors = [err8]; + } + else { + vErrors.push(err8); } errors++; } @@ -752,7 +920,7 @@ function validate67(data, { if (data.paddingRight !== undefined) { let data5 = data.paddingRight; if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { + const err9 = { instancePath: instancePath + "/paddingRight", schemaPath: "#/properties/paddingRight/type", keyword: "type", @@ -762,15 +930,17 @@ function validate67(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); + vErrors = [err9]; + } + else { + vErrors.push(err9); } errors++; } } - } else { - const err8 = { + } + else { + const err10 = { instancePath, schemaPath: "#/type", keyword: "type", @@ -780,28 +950,23 @@ function validate67(data, { message: "must be object" }; if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); + vErrors = [err10]; + } + else { + vErrors.push(err10); } errors++; } - validate67.errors = vErrors; + validate68.errors = vErrors; return errors === 0; } - -function validate43(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { /*# sourceURL="config.json" */ ; let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { for (const key0 in data) { - if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine"))) { + if (!((((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "drawVerticalLine")) || (key0 === "drawHorizontalLine")) || (key0 === "singleLine"))) { const err0 = { instancePath, schemaPath: "#/additionalProperties", @@ -813,7 +978,8 @@ function validate43(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -821,40 +987,58 @@ function validate43(data, { } if (data.border !== undefined) { if (!(validate45(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { + instancePath: instancePath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors); errors = vErrors.length; } } if (data.columns !== undefined) { if (!(validate63(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { + instancePath: instancePath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors); errors = vErrors.length; } } if (data.columnDefault !== undefined) { - if (!(validate67(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate67.errors : vErrors.concat(validate67.errors); + if (!(validate68(data.columnDefault, { + instancePath: instancePath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors); errors = vErrors.length; } } + if (data.drawVerticalLine !== undefined) { + if (typeof data.drawVerticalLine != "function") { + const err1 = { + instancePath: instancePath + "/drawVerticalLine", + schemaPath: "#/properties/drawVerticalLine/typeof", + keyword: "typeof", + params: {}, + message: "should pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err1]; + } + else { + vErrors.push(err1); + } + errors++; + } + } if (data.drawHorizontalLine !== undefined) { if (typeof data.drawHorizontalLine != "function") { - const err1 = { + const err2 = { instancePath: instancePath + "/drawHorizontalLine", schemaPath: "#/properties/drawHorizontalLine/typeof", keyword: "typeof", @@ -862,16 +1046,17 @@ function validate43(data, { message: "should pass \"typeof\" keyword validation" }; if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); + vErrors = [err2]; + } + else { + vErrors.push(err2); } errors++; } } if (data.singleLine !== undefined) { if (typeof data.singleLine != "boolean") { - const err2 = { + const err3 = { instancePath: instancePath + "/singleLine", schemaPath: "#/properties/singleLine/typeof", keyword: "typeof", @@ -879,15 +1064,17 @@ function validate43(data, { message: "should pass \"typeof\" keyword validation" }; if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); + vErrors = [err3]; + } + else { + vErrors.push(err3); } errors++; } } - } else { - const err3 = { + } + else { + const err4 = { instancePath, schemaPath: "#/type", keyword: "type", @@ -897,16 +1084,17 @@ function validate43(data, { message: "must be object" }; if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); + vErrors = [err4]; + } + else { + vErrors.push(err4); } errors++; } validate43.errors = vErrors; return errors === 0; } -exports["streamConfig.json"] = validate69; +exports["streamConfig.json"] = validate70; const schema20 = { "$id": "streamConfig.json", "$schema": "http://json-schema.org/draft-07/schema#", @@ -923,17 +1111,14 @@ const schema20 = { }, "columnCount": { "type": "number" + }, + "drawVerticalLine": { + "typeof": "function" } }, "additionalProperties": false }; - -function validate70(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate71(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { @@ -950,7 +1135,8 @@ function validate70(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -958,170 +1144,171 @@ function validate70(data, { } if (data.topBody !== undefined) { if (!(validate46(data.topBody, { - instancePath: instancePath + "/topBody", - parentData: data, - parentDataProperty: "topBody", - rootData - }))) { + instancePath: instancePath + "/topBody", + parentData: data, + parentDataProperty: "topBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topJoin !== undefined) { if (!(validate46(data.topJoin, { - instancePath: instancePath + "/topJoin", - parentData: data, - parentDataProperty: "topJoin", - rootData - }))) { + instancePath: instancePath + "/topJoin", + parentData: data, + parentDataProperty: "topJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topLeft !== undefined) { if (!(validate46(data.topLeft, { - instancePath: instancePath + "/topLeft", - parentData: data, - parentDataProperty: "topLeft", - rootData - }))) { + instancePath: instancePath + "/topLeft", + parentData: data, + parentDataProperty: "topLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.topRight !== undefined) { if (!(validate46(data.topRight, { - instancePath: instancePath + "/topRight", - parentData: data, - parentDataProperty: "topRight", - rootData - }))) { + instancePath: instancePath + "/topRight", + parentData: data, + parentDataProperty: "topRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomBody !== undefined) { if (!(validate46(data.bottomBody, { - instancePath: instancePath + "/bottomBody", - parentData: data, - parentDataProperty: "bottomBody", - rootData - }))) { + instancePath: instancePath + "/bottomBody", + parentData: data, + parentDataProperty: "bottomBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomJoin !== undefined) { if (!(validate46(data.bottomJoin, { - instancePath: instancePath + "/bottomJoin", - parentData: data, - parentDataProperty: "bottomJoin", - rootData - }))) { + instancePath: instancePath + "/bottomJoin", + parentData: data, + parentDataProperty: "bottomJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomLeft !== undefined) { if (!(validate46(data.bottomLeft, { - instancePath: instancePath + "/bottomLeft", - parentData: data, - parentDataProperty: "bottomLeft", - rootData - }))) { + instancePath: instancePath + "/bottomLeft", + parentData: data, + parentDataProperty: "bottomLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bottomRight !== undefined) { if (!(validate46(data.bottomRight, { - instancePath: instancePath + "/bottomRight", - parentData: data, - parentDataProperty: "bottomRight", - rootData - }))) { + instancePath: instancePath + "/bottomRight", + parentData: data, + parentDataProperty: "bottomRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyLeft !== undefined) { if (!(validate46(data.bodyLeft, { - instancePath: instancePath + "/bodyLeft", - parentData: data, - parentDataProperty: "bodyLeft", - rootData - }))) { + instancePath: instancePath + "/bodyLeft", + parentData: data, + parentDataProperty: "bodyLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyRight !== undefined) { if (!(validate46(data.bodyRight, { - instancePath: instancePath + "/bodyRight", - parentData: data, - parentDataProperty: "bodyRight", - rootData - }))) { + instancePath: instancePath + "/bodyRight", + parentData: data, + parentDataProperty: "bodyRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.bodyJoin !== undefined) { if (!(validate46(data.bodyJoin, { - instancePath: instancePath + "/bodyJoin", - parentData: data, - parentDataProperty: "bodyJoin", - rootData - }))) { + instancePath: instancePath + "/bodyJoin", + parentData: data, + parentDataProperty: "bodyJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinBody !== undefined) { if (!(validate46(data.joinBody, { - instancePath: instancePath + "/joinBody", - parentData: data, - parentDataProperty: "joinBody", - rootData - }))) { + instancePath: instancePath + "/joinBody", + parentData: data, + parentDataProperty: "joinBody", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinLeft !== undefined) { if (!(validate46(data.joinLeft, { - instancePath: instancePath + "/joinLeft", - parentData: data, - parentDataProperty: "joinLeft", - rootData - }))) { + instancePath: instancePath + "/joinLeft", + parentData: data, + parentDataProperty: "joinLeft", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinRight !== undefined) { if (!(validate46(data.joinRight, { - instancePath: instancePath + "/joinRight", - parentData: data, - parentDataProperty: "joinRight", - rootData - }))) { + instancePath: instancePath + "/joinRight", + parentData: data, + parentDataProperty: "joinRight", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } if (data.joinJoin !== undefined) { if (!(validate46(data.joinJoin, { - instancePath: instancePath + "/joinJoin", - parentData: data, - parentDataProperty: "joinJoin", - rootData - }))) { + instancePath: instancePath + "/joinJoin", + parentData: data, + parentDataProperty: "joinJoin", + rootData + }))) { vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors); errors = vErrors.length; } } - } else { + } + else { const err1 = { instancePath, schemaPath: "#/type", @@ -1133,29 +1320,28 @@ function validate70(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; } - validate70.errors = vErrors; + validate71.errors = vErrors; return errors === 0; } - -function validate87(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate88(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; + const _errs0 = errors; + let valid0 = false; + let passing0 = null; + const _errs1 = errors; if (data && typeof data == "object" && !Array.isArray(data)) { for (const key0 in data) { if (!(pattern0.test(key0))) { const err0 = { instancePath, - schemaPath: "#/additionalProperties", + schemaPath: "#/oneOf/0/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 @@ -1164,7 +1350,8 @@ function validate87(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -1173,20 +1360,21 @@ function validate87(data, { for (const key1 in data) { if (pattern0.test(key1)) { if (!(validate64(data[key1], { - instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), - parentData: data, - parentDataProperty: key1, - rootData - }))) { + instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), + parentData: data, + parentDataProperty: key1, + rootData + }))) { vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); errors = vErrors.length; } } } - } else { + } + else { const err1 = { instancePath, - schemaPath: "#/type", + schemaPath: "#/oneOf/0/type", keyword: "type", params: { type: "object" @@ -1195,21 +1383,94 @@ function validate87(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; } - validate87.errors = vErrors; + var _valid0 = _errs1 === errors; + if (_valid0) { + valid0 = true; + passing0 = 0; + } + const _errs5 = errors; + if (Array.isArray(data)) { + const len0 = data.length; + for (let i0 = 0; i0 < len0; i0++) { + if (!(validate64(data[i0], { + instancePath: instancePath + "/" + i0, + parentData: data, + parentDataProperty: i0, + rootData + }))) { + vErrors = vErrors === null ? validate64.errors : vErrors.concat(validate64.errors); + errors = vErrors.length; + } + } + } + else { + const err2 = { + instancePath, + schemaPath: "#/oneOf/1/type", + keyword: "type", + params: { + type: "array" + }, + message: "must be array" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + var _valid0 = _errs5 === errors; + if (_valid0 && valid0) { + valid0 = false; + passing0 = [passing0, 1]; + } + else { + if (_valid0) { + valid0 = true; + passing0 = 1; + } + } + if (!valid0) { + const err3 = { + instancePath, + schemaPath: "#/oneOf", + keyword: "oneOf", + params: { + passingSchemas: passing0 + }, + message: "must match exactly one schema in oneOf" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + else { + errors = _errs0; + if (vErrors !== null) { + if (_errs0) { + vErrors.length = _errs0; + } + else { + vErrors = null; + } + } + } + validate88.errors = vErrors; return errors === 0; } - -function validate90(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate92(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { @@ -1226,7 +1487,8 @@ function validate90(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; @@ -1246,7 +1508,8 @@ function validate90(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; @@ -1263,7 +1526,8 @@ function validate90(data, { }; if (vErrors === null) { vErrors = [err2]; - } else { + } + else { vErrors.push(err2); } errors++; @@ -1271,8 +1535,48 @@ function validate90(data, { } if (data.width !== undefined) { let data1 = data.width; - if (!((typeof data1 == "number") && (isFinite(data1)))) { - const err3 = { + if ((typeof data1 == "number") && (isFinite(data1))) { + if (data1 < 1 || isNaN(data1)) { + const err3 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/minimum", + keyword: "minimum", + params: { + comparison: ">=", + limit: 1 + }, + message: "must be >= 1" + }; + if (vErrors === null) { + vErrors = [err3]; + } + else { + vErrors.push(err3); + } + errors++; + } + let res0; + if ((1 === 0 || (res0 = data1 / 1, res0 !== parseInt(res0)))) { + const err4 = { + instancePath: instancePath + "/width", + schemaPath: "#/properties/width/multipleOf", + keyword: "multipleOf", + params: { + multipleOf: 1 + }, + message: "must be multiple of 1" + }; + if (vErrors === null) { + vErrors = [err4]; + } + else { + vErrors.push(err4); + } + errors++; + } + } + else { + const err5 = { instancePath: instancePath + "/width", schemaPath: "#/properties/width/type", keyword: "type", @@ -1282,16 +1586,17 @@ function validate90(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); + vErrors = [err5]; + } + else { + vErrors.push(err5); } errors++; } } if (data.wrapWord !== undefined) { if (typeof data.wrapWord !== "boolean") { - const err4 = { + const err6 = { instancePath: instancePath + "/wrapWord", schemaPath: "#/properties/wrapWord/type", keyword: "type", @@ -1301,9 +1606,10 @@ function validate90(data, { message: "must be boolean" }; if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); + vErrors = [err6]; + } + else { + vErrors.push(err6); } errors++; } @@ -1311,7 +1617,7 @@ function validate90(data, { if (data.truncate !== undefined) { let data3 = data.truncate; if (!((typeof data3 == "number") && (isFinite(data3)))) { - const err5 = { + const err7 = { instancePath: instancePath + "/truncate", schemaPath: "#/properties/truncate/type", keyword: "type", @@ -1321,9 +1627,10 @@ function validate90(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); + vErrors = [err7]; + } + else { + vErrors.push(err7); } errors++; } @@ -1331,7 +1638,7 @@ function validate90(data, { if (data.paddingLeft !== undefined) { let data4 = data.paddingLeft; if (!((typeof data4 == "number") && (isFinite(data4)))) { - const err6 = { + const err8 = { instancePath: instancePath + "/paddingLeft", schemaPath: "#/properties/paddingLeft/type", keyword: "type", @@ -1341,9 +1648,10 @@ function validate90(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); + vErrors = [err8]; + } + else { + vErrors.push(err8); } errors++; } @@ -1351,7 +1659,7 @@ function validate90(data, { if (data.paddingRight !== undefined) { let data5 = data.paddingRight; if (!((typeof data5 == "number") && (isFinite(data5)))) { - const err7 = { + const err9 = { instancePath: instancePath + "/paddingRight", schemaPath: "#/properties/paddingRight/type", keyword: "type", @@ -1361,15 +1669,17 @@ function validate90(data, { message: "must be number" }; if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); + vErrors = [err9]; + } + else { + vErrors.push(err9); } errors++; } } - } else { - const err8 = { + } + else { + const err10 = { instancePath, schemaPath: "#/type", keyword: "type", @@ -1379,28 +1689,23 @@ function validate90(data, { message: "must be object" }; if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); + vErrors = [err10]; + } + else { + vErrors.push(err10); } errors++; } - validate90.errors = vErrors; + validate92.errors = vErrors; return errors === 0; } - -function validate69(data, { - instancePath = "", - parentData, - parentDataProperty, - rootData = data -} = {}) { +function validate70(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { /*# sourceURL="streamConfig.json" */ ; let vErrors = null; let errors = 0; if (data && typeof data == "object" && !Array.isArray(data)) { for (const key0 in data) { - if (!((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount"))) { + if (!(((((key0 === "border") || (key0 === "columns")) || (key0 === "columnDefault")) || (key0 === "columnCount")) || (key0 === "drawVerticalLine"))) { const err0 = { instancePath, schemaPath: "#/additionalProperties", @@ -1412,42 +1717,43 @@ function validate69(data, { }; if (vErrors === null) { vErrors = [err0]; - } else { + } + else { vErrors.push(err0); } errors++; } } if (data.border !== undefined) { - if (!(validate70(data.border, { - instancePath: instancePath + "/border", - parentData: data, - parentDataProperty: "border", - rootData - }))) { - vErrors = vErrors === null ? validate70.errors : vErrors.concat(validate70.errors); + if (!(validate71(data.border, { + instancePath: instancePath + "/border", + parentData: data, + parentDataProperty: "border", + rootData + }))) { + vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors); errors = vErrors.length; } } if (data.columns !== undefined) { - if (!(validate87(data.columns, { - instancePath: instancePath + "/columns", - parentData: data, - parentDataProperty: "columns", - rootData - }))) { - vErrors = vErrors === null ? validate87.errors : vErrors.concat(validate87.errors); + if (!(validate88(data.columns, { + instancePath: instancePath + "/columns", + parentData: data, + parentDataProperty: "columns", + rootData + }))) { + vErrors = vErrors === null ? validate88.errors : vErrors.concat(validate88.errors); errors = vErrors.length; } } if (data.columnDefault !== undefined) { - if (!(validate90(data.columnDefault, { - instancePath: instancePath + "/columnDefault", - parentData: data, - parentDataProperty: "columnDefault", - rootData - }))) { - vErrors = vErrors === null ? validate90.errors : vErrors.concat(validate90.errors); + if (!(validate92(data.columnDefault, { + instancePath: instancePath + "/columnDefault", + parentData: data, + parentDataProperty: "columnDefault", + rootData + }))) { + vErrors = vErrors === null ? validate92.errors : vErrors.concat(validate92.errors); errors = vErrors.length; } } @@ -1465,14 +1771,34 @@ function validate69(data, { }; if (vErrors === null) { vErrors = [err1]; - } else { + } + else { vErrors.push(err1); } errors++; } } - } else { - const err2 = { + if (data.drawVerticalLine !== undefined) { + if (typeof data.drawVerticalLine != "function") { + const err2 = { + instancePath: instancePath + "/drawVerticalLine", + schemaPath: "#/properties/drawVerticalLine/typeof", + keyword: "typeof", + params: {}, + message: "should pass \"typeof\" keyword validation" + }; + if (vErrors === null) { + vErrors = [err2]; + } + else { + vErrors.push(err2); + } + errors++; + } + } + } + else { + const err3 = { instancePath, schemaPath: "#/type", keyword: "type", @@ -1482,12 +1808,13 @@ function validate69(data, { message: "must be object" }; if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); + vErrors = [err3]; + } + else { + vErrors.push(err3); } errors++; } - validate69.errors = vErrors; + validate70.errors = vErrors; return errors === 0; -} \ No newline at end of file +} diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js index e7fe968a4b54b1..6d96a0ce29863e 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js +++ b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js @@ -1,118 +1,82 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - /* eslint-disable sort-keys-fix/sort-keys-fix */ - -/** - * @typedef border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * @param {string} name - * @returns {border} - */ -const getBorderCharacters = name => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼' - }; - } - - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼' - }; - } - - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|' - }; - } - - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '' - }; - } - - throw new Error('Unknown border template "' + name + '".'); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = (name) => { + if (name === 'honeywell') { + return { + topBody: '═', + topJoin: '╤', + topLeft: '╔', + topRight: '╗', + bottomBody: '═', + bottomJoin: '╧', + bottomLeft: '╚', + bottomRight: '╝', + bodyLeft: '║', + bodyRight: '║', + bodyJoin: '│', + joinBody: '─', + joinLeft: '╟', + joinRight: '╢', + joinJoin: '┼', + }; + } + if (name === 'norc') { + return { + topBody: '─', + topJoin: '┬', + topLeft: '┌', + topRight: '┐', + bottomBody: '─', + bottomJoin: '┴', + bottomLeft: '└', + bottomRight: '┘', + bodyLeft: '│', + bodyRight: '│', + bodyJoin: '│', + joinBody: '─', + joinLeft: '├', + joinRight: '┤', + joinJoin: '┼', + }; + } + if (name === 'ramac') { + return { + topBody: '-', + topJoin: '+', + topLeft: '+', + topRight: '+', + bottomBody: '-', + bottomJoin: '+', + bottomLeft: '+', + bottomRight: '+', + bodyLeft: '|', + bodyRight: '|', + bodyJoin: '|', + joinBody: '-', + joinLeft: '|', + joinRight: '|', + joinJoin: '|', + }; + } + if (name === 'void') { + return { + topBody: '', + topJoin: '', + topLeft: '', + topRight: '', + bottomBody: '', + bottomJoin: '', + bottomLeft: '', + bottomRight: '', + bodyLeft: '', + bodyRight: '', + bodyJoin: '', + joinBody: '', + joinLeft: '', + joinRight: '', + joinJoin: '', + }; + } + throw new Error('Unknown border template "' + name + '".'); }; - -var _default = getBorderCharacters; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow b/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow deleted file mode 100644 index bc8b0f263a1e07..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/getBorderCharacters.js.flow +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable sort-keys-fix/sort-keys-fix */ - -/** - * @typedef border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * @param {string} name - * @returns {border} - */ -export default (name) => { - if (name === 'honeywell') { - return { - topBody: '═', - topJoin: '╤', - topLeft: '╔', - topRight: '╗', - - bottomBody: '═', - bottomJoin: '╧', - bottomLeft: '╚', - bottomRight: '╝', - - bodyLeft: '║', - bodyRight: '║', - bodyJoin: '│', - - joinBody: '─', - joinLeft: '╟', - joinRight: '╢', - joinJoin: '┼', - }; - } - - if (name === 'norc') { - return { - topBody: '─', - topJoin: '┬', - topLeft: '┌', - topRight: '┐', - - bottomBody: '─', - bottomJoin: '┴', - bottomLeft: '└', - bottomRight: '┘', - - bodyLeft: '│', - bodyRight: '│', - bodyJoin: '│', - - joinBody: '─', - joinLeft: '├', - joinRight: '┤', - joinJoin: '┼', - }; - } - - if (name === 'ramac') { - return { - topBody: '-', - topJoin: '+', - topLeft: '+', - topRight: '+', - - bottomBody: '-', - bottomJoin: '+', - bottomLeft: '+', - bottomRight: '+', - - bodyLeft: '|', - bodyRight: '|', - bodyJoin: '|', - - joinBody: '-', - joinLeft: '|', - joinRight: '|', - joinJoin: '|', - }; - } - - if (name === 'void') { - return { - topBody: '', - topJoin: '', - topLeft: '', - topRight: '', - - bottomBody: '', - bottomJoin: '', - bottomLeft: '', - bottomRight: '', - - bodyLeft: '', - bodyRight: '', - bodyJoin: '', - - joinBody: '', - joinLeft: '', - joinRight: '', - joinJoin: '', - }; - } - - throw new Error('Unknown border template "' + name + '".'); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js b/tools/node_modules/eslint/node_modules/table/dist/index.js index 069dcccb36ff73..6e93edc0317f71 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/index.js +++ b/tools/node_modules/eslint/node_modules/table/dist/index.js @@ -1,31 +1,23 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "createStream", { - enumerable: true, - get: function () { - return _createStream.default; - } -}); -Object.defineProperty(exports, "getBorderCharacters", { - enumerable: true, - get: function () { - return _getBorderCharacters.default; - } -}); -Object.defineProperty(exports, "table", { - enumerable: true, - get: function () { - return _table.default; - } -}); - -var _createStream = _interopRequireDefault(require("./createStream")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _table = _interopRequireDefault(require("./table")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } \ No newline at end of file +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBorderCharacters = exports.createStream = exports.table = void 0; +const createStream_1 = __importDefault(require("./createStream")); +exports.createStream = createStream_1.default; +const getBorderCharacters_1 = __importDefault(require("./getBorderCharacters")); +exports.getBorderCharacters = getBorderCharacters_1.default; +const table_1 = __importDefault(require("./table")); +exports.table = table_1.default; +__exportStar(require("./types/api"), exports); diff --git a/tools/node_modules/eslint/node_modules/table/dist/index.js.flow b/tools/node_modules/eslint/node_modules/table/dist/index.js.flow deleted file mode 100644 index 4a47c502576564..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/index.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -import createStream from './createStream'; -import getBorderCharacters from './getBorderCharacters'; -import table from './table'; - -export { - table, - createStream, - getBorderCharacters, -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js index a80d9a06acf1c9..4189a6d21b544e 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js @@ -1,91 +1,58 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _lodash = _interopRequireDefault(require("lodash.clonedeep")); - -var _calculateMaximumColumnWidthIndex = _interopRequireDefault(require("./calculateMaximumColumnWidthIndex")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _validateConfig = _interopRequireDefault(require("./validateConfig")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep")); +const calculateMaximumColumnWidthIndex_1 = __importDefault(require("./calculateMaximumColumnWidthIndex")); +const getBorderCharacters_1 = __importDefault(require("./getBorderCharacters")); +const validateConfig_1 = __importDefault(require("./validateConfig")); /** * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} */ -const makeBorder = (border = {}) => { - return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); +const makeBorder = (border) => { + return { + ...getBorderCharacters_1.default('honeywell'), + ...border, + }; }; /** * Creates a configuration for every column using default * values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} columns - * @param {object} columnDefault - * @returns {object} */ - - -const makeColumns = (rows, columns = {}, columnDefault = {}) => { - const maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex.default)(rows); - - for (let index = 0; index < rows[0].length; index++) { - if (typeof columns[index] === 'undefined') { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - width: maximumColumnWidthIndex[index], - wrapWord: false - }, columnDefault, columns[index]); - } - - return columns; +const makeColumns = (rows, columns, columnDefault) => { + const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex_1.default(rows); + return rows[0].map((_cell, index) => { + return { + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Number.POSITIVE_INFINITY, + width: maximumColumnWidthIndex[index], + wrapWord: false, + ...columnDefault, + ...columns === null || columns === void 0 ? void 0 : columns[index], + }; + }); }; /** * Makes a new configuration object out of the userConfig object * using default values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} userConfig - * @returns {object} */ - - -const makeConfig = (rows, userConfig = {}) => { - (0, _validateConfig.default)('config.json', userConfig); - const config = (0, _lodash.default)(userConfig); - config.border = makeBorder(config.border); - config.columns = makeColumns(rows, config.columns, config.columnDefault); - - if (!config.drawHorizontalLine) { - /** - * @returns {boolean} - */ - config.drawHorizontalLine = () => { - return true; +exports.default = (rows, userConfig = {}) => { + var _a, _b, _c; + validateConfig_1.default('config.json', userConfig); + const config = lodash_clonedeep_1.default(userConfig); + return { + ...config, + border: makeBorder(config.border), + columns: makeColumns(rows, config.columns, config.columnDefault), + drawHorizontalLine: (_a = config.drawHorizontalLine) !== null && _a !== void 0 ? _a : (() => { + return true; + }), + drawVerticalLine: (_b = config.drawVerticalLine) !== null && _b !== void 0 ? _b : (() => { + return true; + }), + singleLine: (_c = config.singleLine) !== null && _c !== void 0 ? _c : false, }; - } - - if (config.singleLine === undefined) { - config.singleLine = false; - } - - return config; }; - -var _default = makeConfig; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow deleted file mode 100644 index 3fcbc79c555f0b..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/makeConfig.js.flow +++ /dev/null @@ -1,76 +0,0 @@ -import cloneDeep from 'lodash.clonedeep'; -import calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex'; -import getBorderCharacters from './getBorderCharacters'; -import validateConfig from './validateConfig'; - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, getBorderCharacters('honeywell'), border); -}; - -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ -const makeColumns = (rows, columns = {}, columnDefault = {}) => { - const maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows); - - for (let index = 0; index < rows[0].length; index++) { - if (typeof columns[index] === 'undefined') { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - width: maximumColumnWidthIndex[index], - wrapWord: false, - }, columnDefault, columns[index]); - } - - return columns; -}; - -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {Array[]} rows - * @param {object} userConfig - * @returns {object} - */ -export default (rows, userConfig = {}) => { - validateConfig('config.json', userConfig); - - const config = cloneDeep(userConfig); - - config.border = makeBorder(config.border); - config.columns = makeColumns(rows, config.columns, config.columnDefault); - - if (!config.drawHorizontalLine) { - /** - * @returns {boolean} - */ - config.drawHorizontalLine = () => { - return true; - }; - } - - if (config.singleLine === undefined) { - config.singleLine = false; - } - - return config; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js index 6ca9733dd358e2..92f577adbff1aa 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js @@ -1,97 +1,59 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _lodash = _interopRequireDefault(require("lodash.clonedeep")); - -var _getBorderCharacters = _interopRequireDefault(require("./getBorderCharacters")); - -var _validateConfig = _interopRequireDefault(require("./validateConfig")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep")); +const getBorderCharacters_1 = __importDefault(require("./getBorderCharacters")); +const validateConfig_1 = __importDefault(require("./validateConfig")); /** * Merges user provided border characters with the default border ("honeywell") characters. * - * @param {object} border - * @returns {object} */ -const makeBorder = (border = {}) => { - return Object.assign({}, (0, _getBorderCharacters.default)('honeywell'), border); +const makeBorder = (border) => { + return { + ...getBorderCharacters_1.default('honeywell'), + ...border, + }; }; /** * Creates a configuration for every column using default * values for the missing configuration properties. - * - * @param {number} columnCount - * @param {object} columns - * @param {object} columnDefault - * @returns {object} */ - - -const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { - for (let index = 0; index < columnCount; index++) { - if (typeof columns[index] === 'undefined') { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - wrapWord: false - }, columnDefault, columns[index]); - } - - return columns; +const makeColumns = (columnCount, columns = {}, columnDefault) => { + return Array.from({ length: columnCount }).map((_, index) => { + return { + alignment: 'left', + paddingLeft: 1, + paddingRight: 1, + truncate: Number.POSITIVE_INFINITY, + wrapWord: false, + ...columnDefault, + ...columns[index], + }; + }); }; -/** - * @typedef {object} columnConfig - * @property {string} alignment - * @property {number} width - * @property {number} truncate - * @property {number} paddingLeft - * @property {number} paddingRight - */ - -/** - * @typedef {object} streamConfig - * @property {columnConfig} columnDefault - * @property {object} border - * @property {columnConfig[]} - * @property {number} columnCount Number of columns in the table (required). - */ - /** * Makes a new configuration object out of the userConfig object * using default values for the missing configuration properties. - * - * @param {streamConfig} userConfig - * @returns {object} */ - - -const makeStreamConfig = (userConfig = {}) => { - (0, _validateConfig.default)('streamConfig.json', userConfig); - const config = (0, _lodash.default)(userConfig); - - if (!config.columnDefault || !config.columnDefault.width) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - - if (!config.columnCount) { - throw new Error('Must provide config.columnCount.'); - } - - config.border = makeBorder(config.border); - config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); - return config; +exports.default = (userConfig) => { + var _a; + validateConfig_1.default('streamConfig.json', userConfig); + const config = lodash_clonedeep_1.default(userConfig); + if (!config.columnDefault || !config.columnDefault.width) { + throw new Error('Must provide config.columnDefault.width when creating a stream.'); + } + if (!config.columnCount) { + throw new Error('Must provide config.columnCount.'); + } + return { + ...config, + border: makeBorder(config.border), + columnCount: config.columnCount, + columns: makeColumns(config.columnCount, config.columns, config.columnDefault), + drawVerticalLine: (_a = config.drawVerticalLine) !== null && _a !== void 0 ? _a : (() => { + return true; + }), + }; }; - -var _default = makeStreamConfig; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow deleted file mode 100644 index 8536bf5b37a0c1..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/makeStreamConfig.js.flow +++ /dev/null @@ -1,83 +0,0 @@ -import cloneDeep from 'lodash.clonedeep'; -import getBorderCharacters from './getBorderCharacters'; -import validateConfig from './validateConfig'; - -/** - * Merges user provided border characters with the default border ("honeywell") characters. - * - * @param {object} border - * @returns {object} - */ -const makeBorder = (border = {}) => { - return Object.assign({}, getBorderCharacters('honeywell'), border); -}; - -/** - * Creates a configuration for every column using default - * values for the missing configuration properties. - * - * @param {number} columnCount - * @param {object} columns - * @param {object} columnDefault - * @returns {object} - */ -const makeColumns = (columnCount, columns = {}, columnDefault = {}) => { - for (let index = 0; index < columnCount; index++) { - if (typeof columns[index] === 'undefined') { - columns[index] = {}; - } - - columns[index] = Object.assign({ - alignment: 'left', - paddingLeft: 1, - paddingRight: 1, - truncate: Number.POSITIVE_INFINITY, - wrapWord: false, - }, columnDefault, columns[index]); - } - - return columns; -}; - -/** - * @typedef {object} columnConfig - * @property {string} alignment - * @property {number} width - * @property {number} truncate - * @property {number} paddingLeft - * @property {number} paddingRight - */ - -/** - * @typedef {object} streamConfig - * @property {columnConfig} columnDefault - * @property {object} border - * @property {columnConfig[]} - * @property {number} columnCount Number of columns in the table (required). - */ - -/** - * Makes a new configuration object out of the userConfig object - * using default values for the missing configuration properties. - * - * @param {streamConfig} userConfig - * @returns {object} - */ -export default (userConfig = {}) => { - validateConfig('streamConfig.json', userConfig); - - const config = cloneDeep(userConfig); - - if (!config.columnDefault || !config.columnDefault.width) { - throw new Error('Must provide config.columnDefault.width when creating a stream.'); - } - - if (!config.columnCount) { - throw new Error('Must provide config.columnCount.'); - } - - config.border = makeBorder(config.border); - config.columns = makeColumns(config.columnCount, config.columns, config.columnDefault); - - return config; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js index 1708570759dde0..4b79669cf5081c 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js +++ b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -1,41 +1,26 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _lodash = _interopRequireDefault(require("lodash.flatten")); - -var _wrapCell = _interopRequireDefault(require("./wrapCell")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {Array} unmappedRows - * @param {number[]} rowHeightIndex - * @param {object} config - * @returns {Array} - */ -const mapDataUsingRowHeightIndex = (unmappedRows, rowHeightIndex, config) => { - const tableWidth = unmappedRows[0].length; - const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = Array.from(new Array(rowHeightIndex[index0]), () => { - return new Array(tableWidth).fill(''); - }); // rowHeight - // [{row index within rowSaw; index2}] - // [{cell index within a virtual row; index1}] - - cells.forEach((value, index1) => { - const cellLines = (0, _wrapCell.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); - cellLines.forEach((cellLine, index2) => { - rowHeight[index2][index1] = cellLine; - }); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lodash_flatten_1 = __importDefault(require("lodash.flatten")); +const wrapCell_1 = __importDefault(require("./wrapCell")); +exports.default = (unmappedRows, rowHeightIndex, config) => { + const tableWidth = unmappedRows[0].length; + const mappedRows = unmappedRows.map((row, index0) => { + const rowHeight = Array.from({ length: rowHeightIndex[index0] }, () => { + return new Array(tableWidth).fill(''); + }); + // rowHeight + // [{row index within rowSaw; index2}] + // [{cell index within a virtual row; index1}] + row.forEach((cell, index1) => { + const cellLines = wrapCell_1.default(cell, config.columns[index1].width, config.columns[index1].wrapWord); + cellLines.forEach((cellLine, index2) => { + rowHeight[index2][index1] = cellLine; + }); + }); + return rowHeight; }); - return rowHeight; - }); - return (0, _lodash.default)(mappedRows); + return lodash_flatten_1.default(mappedRows); }; - -var _default = mapDataUsingRowHeightIndex; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow b/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow deleted file mode 100644 index 5d59b059a0ad00..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.flow +++ /dev/null @@ -1,34 +0,0 @@ -import flatten from 'lodash.flatten'; -import wrapCell from './wrapCell'; - -/** - * @param {Array} unmappedRows - * @param {number[]} rowHeightIndex - * @param {object} config - * @returns {Array} - */ -export default (unmappedRows, rowHeightIndex, config) => { - const tableWidth = unmappedRows[0].length; - - const mappedRows = unmappedRows.map((cells, index0) => { - const rowHeight = Array.from(new Array(rowHeightIndex[index0]), () => { - return new Array(tableWidth).fill(''); - }); - - // rowHeight - // [{row index within rowSaw; index2}] - // [{cell index within a virtual row; index1}] - - cells.forEach((value, index1) => { - const cellLines = wrapCell(value, config.columns[index1].width, config.columns[index1].wrapWord); - - cellLines.forEach((cellLine, index2) => { - rowHeight[index2][index1] = cellLine; - }); - }); - - return rowHeight; - }); - - return flatten(mappedRows); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js index 4b7fd4dfeca503..e539f3d7a08629 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js @@ -1,23 +1,10 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -const padTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = (rows, config) => { + return rows.map((cells) => { + return cells.map((value, index1) => { + const column = config.columns[index1]; + return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); + }); }); - }); }; - -var _default = padTableData; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow deleted file mode 100644 index a4e6b142c1839f..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/padTableData.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((value, index1) => { - const column = config.columns[index1]; - - return ' '.repeat(column.paddingLeft) + value + ' '.repeat(column.paddingRight); - }); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json deleted file mode 100644 index 10fc74ab93cfc1..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/config.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "$id": "config.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "drawHorizontalLine": { - "typeof": "function" - }, - "singleLine": { - "typeof": "boolean" - } - }, - "additionalProperties": false -} diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json deleted file mode 100644 index 7d03f9269455a5..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/shared.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "$id": "shared.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "definitions": { - "columns": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "$ref": "#/definitions/column" - } - }, - "additionalProperties": false - }, - "column": { - "type": "object", - "properties": { - "alignment": { - "type": "string", - "enum": [ - "left", - "right", - "center" - ] - }, - "width": { - "type": "number" - }, - "wrapWord": { - "type": "boolean" - }, - "truncate": { - "type": "number" - }, - "paddingLeft": { - "type": "number" - }, - "paddingRight": { - "type": "number" - } - }, - "additionalProperties": false - }, - "borders": { - "type": "object", - "properties": { - "topBody": { - "$ref": "#/definitions/border" - }, - "topJoin": { - "$ref": "#/definitions/border" - }, - "topLeft": { - "$ref": "#/definitions/border" - }, - "topRight": { - "$ref": "#/definitions/border" - }, - "bottomBody": { - "$ref": "#/definitions/border" - }, - "bottomJoin": { - "$ref": "#/definitions/border" - }, - "bottomLeft": { - "$ref": "#/definitions/border" - }, - "bottomRight": { - "$ref": "#/definitions/border" - }, - "bodyLeft": { - "$ref": "#/definitions/border" - }, - "bodyRight": { - "$ref": "#/definitions/border" - }, - "bodyJoin": { - "$ref": "#/definitions/border" - }, - "joinBody": { - "$ref": "#/definitions/border" - }, - "joinLeft": { - "$ref": "#/definitions/border" - }, - "joinRight": { - "$ref": "#/definitions/border" - }, - "joinJoin": { - "$ref": "#/definitions/border" - } - }, - "additionalProperties": false - }, - "border": { - "type": "string" - } - } -} diff --git a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json b/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json deleted file mode 100644 index 24dfa56282541a..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/schemas/streamConfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$id": "streamConfig.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "properties": { - "border": { - "$ref": "shared.json#/definitions/borders" - }, - "columns": { - "$ref": "shared.json#/definitions/columns" - }, - "columnDefault": { - "$ref": "shared.json#/definitions/column" - }, - "columnCount": { - "type": "number" - } - }, - "additionalProperties": false -} diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js index 99640e16551ddc..16d88d553c2886 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js @@ -1,21 +1,7 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * Casts all cell values to a string. - * - * @param {table~row[]} rows - * @returns {table~row[]} - */ -const stringifyTableData = rows => { - return rows.map(cells => { - return cells.map(String); - }); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = (rows) => { + return rows.map((cells) => { + return cells.map(String); + }); }; - -var _default = stringifyTableData; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow deleted file mode 100644 index a4dffac13d9be6..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/stringifyTableData.js.flow +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Casts all cell values to a string. - * - * @param {table~row[]} rows - * @returns {table~row[]} - */ -export default (rows) => { - return rows.map((cells) => { - return cells.map(String); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js b/tools/node_modules/eslint/node_modules/table/dist/table.js index 8c053d81f773b4..94177acc7bd101 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/table.js +++ b/tools/node_modules/eslint/node_modules/table/dist/table.js @@ -1,109 +1,27 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _alignTableData = _interopRequireDefault(require("./alignTableData")); - -var _calculateCellWidthIndex = _interopRequireDefault(require("./calculateCellWidthIndex")); - -var _calculateRowHeightIndex = _interopRequireDefault(require("./calculateRowHeightIndex")); - -var _drawTable = _interopRequireDefault(require("./drawTable")); - -var _makeConfig = _interopRequireDefault(require("./makeConfig")); - -var _mapDataUsingRowHeightIndex = _interopRequireDefault(require("./mapDataUsingRowHeightIndex")); - -var _padTableData = _interopRequireDefault(require("./padTableData")); - -var _stringifyTableData = _interopRequireDefault(require("./stringifyTableData")); - -var _truncateTableData = _interopRequireDefault(require("./truncateTableData")); - -var _validateTableData = _interopRequireDefault(require("./validateTableData")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @typedef {string} table~cell - */ - -/** - * @typedef {table~cell[]} table~row - */ - -/** - * @typedef {object} table~columns - * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). - * @property {number} width Column width (default: auto). - * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). - * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters - * @property {number} paddingLeft Cell content padding width left (default: 1). - * @property {number} paddingRight Cell content padding width right (default: 1). - */ - -/** - * @typedef {object} table~border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * Used to tell whether to draw a horizontal line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - * - * @typedef {Function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @returns {boolean} - */ - -/** - * @typedef {object} table~config - * @property {table~border} border - * @property {table~columns[]} columns Column specific configuration. - * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawHorizontalLine} drawHorizontalLine - * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. - */ - -/** - * Generates a text table. - * - * @param {table~row[]} data - * @param {table~config} userConfig - * @returns {string} - */ -const table = (data, userConfig = {}) => { - let rows; - (0, _validateTableData.default)(data); - rows = (0, _stringifyTableData.default)(data); - const config = (0, _makeConfig.default)(rows, userConfig); - rows = (0, _truncateTableData.default)(data, config); - const rowHeightIndex = (0, _calculateRowHeightIndex.default)(rows, config); - rows = (0, _mapDataUsingRowHeightIndex.default)(rows, rowHeightIndex, config); - rows = (0, _alignTableData.default)(rows, config); - rows = (0, _padTableData.default)(rows, config); - const cellWidthIndex = (0, _calculateCellWidthIndex.default)(rows[0]); - return (0, _drawTable.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const alignTableData_1 = __importDefault(require("./alignTableData")); +const calculateCellWidthIndex_1 = __importDefault(require("./calculateCellWidthIndex")); +const calculateRowHeightIndex_1 = __importDefault(require("./calculateRowHeightIndex")); +const drawTable_1 = __importDefault(require("./drawTable")); +const makeConfig_1 = __importDefault(require("./makeConfig")); +const mapDataUsingRowHeightIndex_1 = __importDefault(require("./mapDataUsingRowHeightIndex")); +const padTableData_1 = __importDefault(require("./padTableData")); +const stringifyTableData_1 = __importDefault(require("./stringifyTableData")); +const truncateTableData_1 = __importDefault(require("./truncateTableData")); +const validateTableData_1 = __importDefault(require("./validateTableData")); +exports.default = (data, userConfig = {}) => { + validateTableData_1.default(data); + let rows = stringifyTableData_1.default(data); + const config = makeConfig_1.default(rows, userConfig); + rows = truncateTableData_1.default(rows, config); + const rowHeightIndex = calculateRowHeightIndex_1.default(rows, config); + rows = mapDataUsingRowHeightIndex_1.default(rows, rowHeightIndex, config); + rows = alignTableData_1.default(rows, config); + rows = padTableData_1.default(rows, config); + const cellWidthIndex = calculateCellWidthIndex_1.default(rows[0]); + return drawTable_1.default(rows, cellWidthIndex, rowHeightIndex, config); }; - -var _default = table; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/table.js.flow b/tools/node_modules/eslint/node_modules/table/dist/table.js.flow deleted file mode 100644 index 6790e8cc550f2c..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/table.js.flow +++ /dev/null @@ -1,96 +0,0 @@ -import alignTableData from './alignTableData'; -import calculateCellWidthIndex from './calculateCellWidthIndex'; -import calculateRowHeightIndex from './calculateRowHeightIndex'; -import drawTable from './drawTable'; -import makeConfig from './makeConfig'; -import mapDataUsingRowHeightIndex from './mapDataUsingRowHeightIndex'; -import padTableData from './padTableData'; -import stringifyTableData from './stringifyTableData'; -import truncateTableData from './truncateTableData'; -import validateTableData from './validateTableData'; - -/** - * @typedef {string} table~cell - */ - -/** - * @typedef {table~cell[]} table~row - */ - -/** - * @typedef {object} table~columns - * @property {string} alignment Cell content alignment (enum: left, center, right) (default: left). - * @property {number} width Column width (default: auto). - * @property {number} truncate Number of characters are which the content will be truncated (default: Infinity). - * @property {boolean} wrapWord When true the text is broken at the nearest space or one of the special characters - * @property {number} paddingLeft Cell content padding width left (default: 1). - * @property {number} paddingRight Cell content padding width right (default: 1). - */ - -/** - * @typedef {object} table~border - * @property {string} topBody - * @property {string} topJoin - * @property {string} topLeft - * @property {string} topRight - * @property {string} bottomBody - * @property {string} bottomJoin - * @property {string} bottomLeft - * @property {string} bottomRight - * @property {string} bodyLeft - * @property {string} bodyRight - * @property {string} bodyJoin - * @property {string} joinBody - * @property {string} joinLeft - * @property {string} joinRight - * @property {string} joinJoin - */ - -/** - * Used to tell whether to draw a horizontal line. - * This callback is called for each non-content line of the table. - * The default behavior is to always return true. - * - * @typedef {Function} drawHorizontalLine - * @param {number} index - * @param {number} size - * @returns {boolean} - */ - -/** - * @typedef {object} table~config - * @property {table~border} border - * @property {table~columns[]} columns Column specific configuration. - * @property {table~columns} columnDefault Default values for all columns. Column specific settings overwrite the default values. - * @property {table~drawHorizontalLine} drawHorizontalLine - * @property {table~singleLine} singleLine Horizontal lines inside the table are not drawn. - */ - -/** - * Generates a text table. - * - * @param {table~row[]} data - * @param {table~config} userConfig - * @returns {string} - */ -export default (data, userConfig = {}) => { - let rows; - - validateTableData(data); - - rows = stringifyTableData(data); - - const config = makeConfig(rows, userConfig); - - rows = truncateTableData(data, config); - - const rowHeightIndex = calculateRowHeightIndex(rows, config); - - rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config); - rows = alignTableData(rows, config); - rows = padTableData(rows, config); - - const cellWidthIndex = calculateCellWidthIndex(rows[0]); - - return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine, config.singleLine); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js index 72f8bfd8d261b1..8d0f7a31a4d669 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js @@ -1,29 +1,19 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _lodash = _interopRequireDefault(require("lodash.truncate")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lodash_truncate_1 = __importDefault(require("lodash.truncate")); /** * @todo Make it work with ASCII content. - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} */ -const truncateTableData = (rows, config) => { - return rows.map(cells => { - return cells.map((content, index) => { - return (0, _lodash.default)(content, { - length: config.columns[index].truncate - }); +exports.default = (rows, config) => { + return rows.map((cells) => { + return cells.map((content, index) => { + return lodash_truncate_1.default(content, { + length: config.columns[index].truncate, + omission: '…', + }); + }); }); - }); }; - -var _default = truncateTableData; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow deleted file mode 100644 index e78b7ec7898682..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/truncateTableData.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -import truncate from 'lodash.truncate'; - -/** - * @todo Make it work with ASCII content. - * @param {table~row[]} rows - * @param {object} config - * @returns {table~row[]} - */ -export default (rows, config) => { - return rows.map((cells) => { - return cells.map((content, index) => { - return truncate(content, { - length: config.columns[index].truncate, - }); - }); - }); -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/types/api.js b/tools/node_modules/eslint/node_modules/table/dist/types/api.js new file mode 100644 index 00000000000000..c8ad2e549bdc68 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/types/api.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/node_modules/eslint/node_modules/table/dist/types/internal.js b/tools/node_modules/eslint/node_modules/table/dist/types/internal.js new file mode 100644 index 00000000000000..c8ad2e549bdc68 --- /dev/null +++ b/tools/node_modules/eslint/node_modules/table/dist/types/internal.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js index b01a94b54aad0a..50d837c00ec7e0 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js @@ -1,40 +1,23 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _validators = _interopRequireDefault(require("../dist/validators")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {string} schemaId - * @param {formatData~config} config - * @returns {undefined} - */ -const validateConfig = (schemaId, config = {}) => { - const validate = _validators.default[schemaId]; - - if (!validate(config)) { - const errors = validate.errors.map(error => { - return { - dataPath: error.dataPath, - message: error.message, - params: error.params, - schemaPath: error.schemaPath - }; - }); - /* eslint-disable no-console */ - - console.log('config', config); - console.log('errors', errors); - /* eslint-enable no-console */ - - throw new Error('Invalid config.'); - } +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const validators_1 = __importDefault(require("./generated/validators")); +exports.default = (schemaId, config) => { + const validate = validators_1.default[schemaId]; + if (!validate(config) && validate.errors) { + const errors = validate.errors.map((error) => { + return { + message: error.message, + params: error.params, + schemaPath: error.schemaPath, + }; + }); + /* eslint-disable no-console */ + console.log('config', config); + console.log('errors', errors); + /* eslint-enable no-console */ + throw new Error('Invalid config.'); + } }; - -var _default = validateConfig; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow deleted file mode 100644 index 2873880b7577c1..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/validateConfig.js.flow +++ /dev/null @@ -1,27 +0,0 @@ -import validators from '../dist/validators'; - -/** - * @param {string} schemaId - * @param {formatData~config} config - * @returns {undefined} - */ -export default (schemaId, config = {}) => { - const validate = validators[schemaId]; - if (!validate(config)) { - const errors = validate.errors.map((error) => { - return { - dataPath: error.dataPath, - message: error.message, - params: error.params, - schemaPath: error.schemaPath, - }; - }); - - /* eslint-disable no-console */ - console.log('config', config); - console.log('errors', errors); - /* eslint-enable no-console */ - - throw new Error('Invalid config.'); - } -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js index d80c2e26612765..3a11457c714660 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js +++ b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js @@ -1,54 +1,28 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/** - * @typedef {string} cell - */ - -/** - * @typedef {cell[]} validateData~column - */ - -/** - * @param {column[]} rows - * @returns {undefined} - */ -const validateTableData = rows => { - if (!Array.isArray(rows)) { - throw new TypeError('Table data must be an array.'); - } - - if (rows.length === 0) { - throw new Error('Table must define at least one row.'); - } - - if (rows[0].length === 0) { - throw new Error('Table must define at least one column.'); - } - - const columnNumber = rows[0].length; - - for (const cells of rows) { - if (!Array.isArray(cells)) { - throw new TypeError('Table row data must be an array.'); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = (rows) => { + if (!Array.isArray(rows)) { + throw new TypeError('Table data must be an array.'); } - - if (cells.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); + if (rows.length === 0) { + throw new Error('Table must define at least one row.'); } - - for (const cell of cells) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) { - throw new Error('Table data must not contain control characters.'); - } + if (rows[0].length === 0) { + throw new Error('Table must define at least one column.'); + } + const columnNumber = rows[0].length; + for (const row of rows) { + if (!Array.isArray(row)) { + throw new TypeError('Table row data must be an array.'); + } + if (row.length !== columnNumber) { + throw new Error('Table must have a consistent number of cells.'); + } + for (const cell of row) { + // eslint-disable-next-line no-control-regex + if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + } } - } }; - -var _default = validateTableData; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow b/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow deleted file mode 100644 index dcc7fc1d139154..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/validateTableData.js.flow +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @typedef {string} cell - */ - -/** - * @typedef {cell[]} validateData~column - */ - -/** - * @param {column[]} rows - * @returns {undefined} - */ -export default (rows) => { - if (!Array.isArray(rows)) { - throw new TypeError('Table data must be an array.'); - } - - if (rows.length === 0) { - throw new Error('Table must define at least one row.'); - } - - if (rows[0].length === 0) { - throw new Error('Table must define at least one column.'); - } - - const columnNumber = rows[0].length; - - for (const cells of rows) { - if (!Array.isArray(cells)) { - throw new TypeError('Table row data must be an array.'); - } - - if (cells.length !== columnNumber) { - throw new Error('Table must have a consistent number of cells.'); - } - - for (const cell of cells) { - // eslint-disable-next-line no-control-regex - if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) { - throw new Error('Table data must not contain control characters.'); - } - } - } -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js index 040787ddeb8a67..df64e7568c0756 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js @@ -1,47 +1,47 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _wrapString = _interopRequireDefault(require("./wrapString")); - -var _wrapWord = _interopRequireDefault(require("./wrapWord")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const strip_ansi_1 = __importDefault(require("strip-ansi")); +const wrapString_1 = __importDefault(require("./wrapString")); +const wrapWord_1 = __importDefault(require("./wrapWord")); +const splitAnsi = (input) => { + const lengths = strip_ansi_1.default(input).split('\n').map(({ length }) => { + return length; + }); + const result = []; + let startIndex = 0; + lengths.forEach((length) => { + result.push(length === 0 ? '' : slice_ansi_1.default(input, startIndex, startIndex + length)); + // Plus 1 for the newline character itself + startIndex += length + 1; + }); + return result; +}; /** * Wrap a single cell value into a list of lines * * Always wraps on newlines, for the remainder uses either word or string wrapping * depending on user configuration. * - * @param {string} cellValue - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {Array} */ -const wrapCell = (cellValue, columnWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = cellValue.split('\n'); // Then iterate over the list and word-wrap every remaining line if necessary. - - for (let lineNr = 0; lineNr < cellLines.length;) { - let lineChunks; - - if (useWrapWord) { - lineChunks = (0, _wrapWord.default)(cellLines[lineNr], columnWidth); - } else { - lineChunks = (0, _wrapString.default)(cellLines[lineNr], columnWidth); - } // Replace our original array element with whatever the wrapping returned - - - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - - return cellLines; +exports.default = (cellValue, columnWidth, useWrapWord) => { + // First split on literal newlines + const cellLines = splitAnsi(cellValue); + // Then iterate over the list and word-wrap every remaining line if necessary. + for (let lineNr = 0; lineNr < cellLines.length;) { + let lineChunks; + if (useWrapWord) { + lineChunks = wrapWord_1.default(cellLines[lineNr], columnWidth); + } + else { + lineChunks = wrapString_1.default(cellLines[lineNr], columnWidth); + } + // Replace our original array element with whatever the wrapping returned + cellLines.splice(lineNr, 1, ...lineChunks); + lineNr += lineChunks.length; + } + return cellLines; }; - -var _default = wrapCell; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow deleted file mode 100644 index 0c66260e2599f9..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapCell.js.flow +++ /dev/null @@ -1,35 +0,0 @@ -import wrapString from './wrapString'; -import wrapWord from './wrapWord'; - -/** - * Wrap a single cell value into a list of lines - * - * Always wraps on newlines, for the remainder uses either word or string wrapping - * depending on user configuration. - * - * @param {string} cellValue - * @param {number} columnWidth - * @param {boolean} useWrapWord - * @returns {Array} - */ -export default (cellValue, columnWidth, useWrapWord) => { - // First split on literal newlines - const cellLines = cellValue.split('\n'); - - // Then iterate over the list and word-wrap every remaining line if necessary. - for (let lineNr = 0; lineNr < cellLines.length;) { - let lineChunks; - - if (useWrapWord) { - lineChunks = wrapWord(cellLines[lineNr], columnWidth); - } else { - lineChunks = wrapString(cellLines[lineNr], columnWidth); - } - - // Replace our original array element with whatever the wrapping returned - cellLines.splice(lineNr, 1, ...lineChunks); - lineNr += lineChunks.length; - } - - return cellLines; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js index f97f798c450948..d61620857e2e17 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js @@ -1,16 +1,10 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const string_width_1 = __importDefault(require("string-width")); /** * Creates an array of strings split into groups the length of size. * This function works with strings that contain ASCII characters. @@ -18,22 +12,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * wrapText is different from would-be "chunk" implementation * in that whitespace characters that occur on a chunk size limit are trimmed. * - * @param {string} subject - * @param {number} size - * @returns {Array} */ -const wrapString = (subject, size) => { - let subjectSlice; - subjectSlice = subject; - const chunks = []; - - do { - chunks.push((0, _sliceAnsi.default)(subjectSlice, 0, size)); - subjectSlice = (0, _sliceAnsi.default)(subjectSlice, size).trim(); - } while ((0, _stringWidth.default)(subjectSlice)); - - return chunks; +exports.default = (subject, size) => { + let subjectSlice = subject; + const chunks = []; + do { + chunks.push(slice_ansi_1.default(subjectSlice, 0, size)); + subjectSlice = slice_ansi_1.default(subjectSlice, size).trim(); + } while (string_width_1.default(subjectSlice)); + return chunks; }; - -var _default = wrapString; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow deleted file mode 100644 index bbb40721e34f99..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapString.js.flow +++ /dev/null @@ -1,29 +0,0 @@ -import slice from 'slice-ansi'; -import stringWidth from 'string-width'; - -/** - * Creates an array of strings split into groups the length of size. - * This function works with strings that contain ASCII characters. - * - * wrapText is different from would-be "chunk" implementation - * in that whitespace characters that occur on a chunk size limit are trimmed. - * - * @param {string} subject - * @param {number} size - * @returns {Array} - */ -export default (subject, size) => { - let subjectSlice; - - subjectSlice = subject; - - const chunks = []; - - do { - chunks.push(slice(subjectSlice, 0, size)); - - subjectSlice = slice(subjectSlice, size).trim(); - } while (stringWidth(subjectSlice)); - - return chunks; -}; diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js index 52a8095ab5aa7d..bc864ace513b35 100644 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js +++ b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js @@ -1,46 +1,39 @@ "use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _sliceAnsi = _interopRequireDefault(require("slice-ansi")); - -var _stringWidth = _interopRequireDefault(require("string-width")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * @param {string} input - * @param {number} size - * @returns {Array} - */ -const wrapWord = (input, size) => { - let subject; - subject = input; - const chunks = []; // https://regex101.com/r/gY5kZ1/1 - - const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); - - do { - let chunk; - chunk = subject.match(re); - - if (chunk) { - chunk = chunk[0]; - subject = (0, _sliceAnsi.default)(subject, (0, _stringWidth.default)(chunk)); - chunk = chunk.trim(); - } else { - chunk = (0, _sliceAnsi.default)(subject, 0, size); - subject = (0, _sliceAnsi.default)(subject, size); - } - - chunks.push(chunk); - } while ((0, _stringWidth.default)(subject)); - - return chunks; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const slice_ansi_1 = __importDefault(require("slice-ansi")); +const strip_ansi_1 = __importDefault(require("strip-ansi")); +const calculateStringLengths = (input, size) => { + let subject = strip_ansi_1.default(input); + const chunks = []; + // https://regex101.com/r/gY5kZ1/1 + const re = new RegExp('(^.{1,' + String(size) + '}(\\s+|$))|(^.{1,' + String(size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); + do { + let chunk; + const match = re.exec(subject); + if (match) { + chunk = match[0]; + subject = subject.slice(chunk.length); + const trimmedLength = chunk.trim().length; + const offset = chunk.length - trimmedLength; + chunks.push([trimmedLength, offset]); + } + else { + chunk = subject.slice(0, size); + subject = subject.slice(size); + chunks.push([chunk.length, 0]); + } + } while (subject.length); + return chunks; +}; +exports.default = (input, size) => { + const result = []; + let startIndex = 0; + calculateStringLengths(input, size).forEach(([length, offset]) => { + result.push(slice_ansi_1.default(input, startIndex, startIndex + length)); + startIndex += length + offset; + }); + return result; }; - -var _default = wrapWord; -exports.default = _default; \ No newline at end of file diff --git a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow b/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow deleted file mode 100644 index 02a8d45ea4c9bd..00000000000000 --- a/tools/node_modules/eslint/node_modules/table/dist/wrapWord.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -import slice from 'slice-ansi'; -import stringWidth from 'string-width'; - -/** - * @param {string} input - * @param {number} size - * @returns {Array} - */ -export default (input, size) => { - let subject; - - subject = input; - - const chunks = []; - - // https://regex101.com/r/gY5kZ1/1 - const re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|-))'); - - do { - let chunk; - - chunk = subject.match(re); - - if (chunk) { - chunk = chunk[0]; - - subject = slice(subject, stringWidth(chunk)); - - chunk = chunk.trim(); - } else { - chunk = slice(subject, 0, size); - subject = slice(subject, size); - } - - chunks.push(chunk); - } while (stringWidth(subject)); - - return chunks; -}; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js index 42b2e7a33759b6..47f6176b1109cf 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/compile/validate/keyword.js @@ -99,7 +99,7 @@ function validSchemaType(schema, schemaType, allowUndefined = false) { : typeof schema == st || (allowUndefined && typeof schema == "undefined"))); } exports.validSchemaType = validSchemaType; -function validateKeywordUsage({ schema, opts, self }, def, keyword) { +function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { /* istanbul ignore if */ if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { throw new Error("ajv implementation error"); @@ -111,7 +111,8 @@ function validateKeywordUsage({ schema, opts, self }, def, keyword) { if (def.validateSchema) { const valid = def.validateSchema(schema[keyword]); if (!valid) { - const msg = "keyword value is invalid: " + self.errorsText(def.validateSchema.errors); + const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + + self.errorsText(def.validateSchema.errors); if (opts.validateSchema === "log") self.logger.error(msg); else diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js index 9eba9f49d9e1e8..a1aae13883da38 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/core.js @@ -61,7 +61,7 @@ const deprecatedOptions = { const MAX_EXPRESSION = 200; // eslint-disable-next-line complexity function requiredOptions(o) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v; const s = o.strict; const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; @@ -80,6 +80,7 @@ function requiredOptions(o) { addUsedSchema: (_s = o.addUsedSchema) !== null && _s !== void 0 ? _s : true, validateSchema: (_t = o.validateSchema) !== null && _t !== void 0 ? _t : true, validateFormats: (_u = o.validateFormats) !== null && _u !== void 0 ? _u : true, + unicodeRegExp: (_v = o.unicodeRegExp) !== null && _v !== void 0 ? _v : true, }; } class Ajv { diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js index 91672bc0846023..09da8547ec735b 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js @@ -50,7 +50,7 @@ const def = { definedProp = codegen_1.nil; } if (patProps.length) { - definedProp = codegen_1.or(definedProp, ...patProps.map((p) => codegen_1._ `${code_1.usePattern(gen, p)}.test(${key})`)); + definedProp = codegen_1.or(definedProp, ...patProps.map((p) => codegen_1._ `${code_1.usePattern(cxt, p)}.test(${key})`)); } return codegen_1.not(definedProp); } diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js index 1f2f9fe71434cf..ff68c82e1061ec 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js @@ -45,7 +45,7 @@ const def = { } function validateProperties(pat) { gen.forIn("key", data, (key) => { - gen.if(codegen_1._ `${code_1.usePattern(gen, pat)}.test(${key})`, () => { + gen.if(codegen_1._ `${code_1.usePattern(cxt, pat)}.test(${key})`, () => { cxt.subschema({ keyword: "patternProperties", schemaProp: pat, diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js index 848a72c88f4c9b..c6f852daf9190f 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/code.js @@ -65,11 +65,12 @@ function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPat return context !== codegen_1.nil ? codegen_1._ `${func}.call(${context}, ${args})` : codegen_1._ `${func}(${args})`; } exports.callValidateCode = callValidateCode; -function usePattern(gen, pattern) { +function usePattern({ gen, it: { opts } }, pattern) { + const u = opts.unicodeRegExp ? "u" : ""; return gen.scopeValue("pattern", { key: pattern, - ref: new RegExp(pattern, "u"), - code: codegen_1._ `new RegExp(${pattern}, "u")`, + ref: new RegExp(pattern, u), + code: codegen_1._ `new RegExp(${pattern}, ${u})`, }); } exports.usePattern = usePattern; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js index 7bb1587d98d5b5..b0862db342257f 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.js @@ -13,8 +13,10 @@ const def = { $data: true, error, code(cxt) { - const { gen, data, $data, schema, schemaCode } = cxt; - const regExp = $data ? codegen_1._ `(new RegExp(${schemaCode}, "u"))` : code_1.usePattern(gen, schema); // TODO regexp should be wrapped in try/catch + const { data, $data, schema, schemaCode, it } = cxt; + // TODO regexp should be wrapped in try/catchs + const u = it.opts.unicodeRegExp ? "u" : ""; + const regExp = $data ? codegen_1._ `(new RegExp(${schemaCode}, ${u}))` : code_1.usePattern(cxt, schema); cxt.fail$data(codegen_1._ `!${regExp}.test(${data})`); }, }; diff --git a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json index ec9f333b117190..22f7a782c40b27 100644 --- a/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json +++ b/tools/node_modules/eslint/node_modules/table/node_modules/ajv/package.json @@ -1,6 +1,6 @@ { "name": "ajv", - "version": "8.0.5", + "version": "8.1.0", "description": "Another JSON Schema Validator", "main": "dist/ajv.js", "types": "dist/ajv.d.ts", diff --git a/tools/node_modules/eslint/node_modules/table/package.json b/tools/node_modules/eslint/node_modules/table/package.json index c1e2f61bacdcd4..5d331e4b5287bf 100644 --- a/tools/node_modules/eslint/node_modules/table/package.json +++ b/tools/node_modules/eslint/node_modules/table/package.json @@ -6,43 +6,42 @@ }, "dependencies": { "ajv": "^8.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", "lodash.clonedeep": "^4.5.0", "lodash.flatten": "^4.4.0", "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "description": "Formats data into a string table.", "devDependencies": { - "@babel/cli": "^7.12.10", - "@babel/core": "^7.12.10", - "@babel/plugin-transform-flow-strip-types": "^7.12.10", - "@babel/preset-env": "^7.12.11", - "@babel/register": "^7.12.10", + "@types/chai": "^4.2.16", + "@types/lodash.clonedeep": "^4.5.6", + "@types/lodash.flatten": "^4.4.6", + "@types/lodash.mapvalues": "^4.6.6", + "@types/lodash.truncate": "^4.4.6", + "@types/mocha": "^8.2.2", + "@types/node": "^14.14.37", + "@types/sinon": "^10.0.0", + "@types/slice-ansi": "^4.0.0", "ajv-cli": "^5.0.0", "ajv-keywords": "^5.0.0", - "babel-plugin-istanbul": "^6.0.0", - "babel-plugin-transform-export-default-name": "^2.1.0", "chai": "^4.2.0", "chalk": "^4.1.0", "coveralls": "^3.1.0", "eslint": "^7.16.0", "eslint-config-canonical": "^25.0.0", - "flow-bin": "^0.141.0", - "flow-copy-source": "^2.0.9", "gitdown": "^3.1.3", "husky": "^4.3.6", "js-beautify": "^1.13.0", "lodash.mapvalues": "^4.6.0", - "lodash.random": "^3.2.0", - "lodash.sample": "^4.2.1", + "mkdirp": "^1.0.4", "mocha": "^8.2.1", "nyc": "^15.1.0", "semantic-release": "^17.3.1", - "sinon": "^9.2.2" + "sinon": "^9.2.2", + "ts-node": "^9.1.1", + "typescript": "4.2.4" }, "engines": { "node": ">=10.0.0" @@ -50,7 +49,7 @@ "husky": { "hooks": { "post-commit": "npm run create-readme && git add README.md && git commit -m 'docs: generate docs' --no-verify", - "pre-commit": "npm run lint && npm run test && npm run build" + "pre-commit": "npm run build && npm run lint && npm run test" } }, "keywords": [ @@ -62,30 +61,35 @@ ], "license": "BSD-3-Clause", "main": "./dist/index.js", + "files": [ + "dist/**/*.js", + "dist/**/*.d.ts" + ], "name": "table", "nyc": { - "include": [ - "src/**/*.js" + "extensions": [ + ".ts" + ], + "exclude": [ + "src/generated/validators.js", + "test/**/*.ts" ], - "instrument": false, "reporter": [ "text-lcov" - ], - "require": [ - "@babel/register" - ], - "sourceMap": false + ] }, "repository": { "type": "git", "url": "https://github.com/gajus/table" }, "scripts": { - "build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files && npm run create-validators && flow-copy-source src dist", + "compile": "tsc", + "prebuild": "rm -fr ./dist && mkdirp dist", + "build": "npm run create-validators && npm run compile", "create-readme": "gitdown ./.README/README.md --output-file ./README.md", - "create-validators": "ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > dist/validators.js", - "lint": "npm run build && eslint ./src ./test && flow", - "test": "mocha --require @babel/register" + "create-validators": "rm -fr ./src/generated && mkdirp ./src/generated && ajv compile --all-errors --inline-refs=false -s src/schemas/config -s src/schemas/streamConfig -r src/schemas/shared -c ajv-keywords/dist/keywords/typeof -o | js-beautify > ./src/generated/validators.js", + "lint": "eslint --ignore-path .gitignore ./src ./test", + "test": "npm run create-validators && mocha --require ts-node/register ./test/**/*.ts" }, - "version": "6.0.9" + "version": "6.5.1" } diff --git a/tools/node_modules/eslint/package.json b/tools/node_modules/eslint/package.json index b414ca6eae5671..4f87ef6403bc82 100644 --- a/tools/node_modules/eslint/package.json +++ b/tools/node_modules/eslint/package.json @@ -1,6 +1,6 @@ { "name": "eslint", - "version": "7.24.0", + "version": "7.25.0", "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": { @@ -27,10 +27,7 @@ "pre-commit": "lint-staged" }, "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ], + "*.js": "eslint --fix", "*.md": "markdownlint" }, "files": [ @@ -103,7 +100,7 @@ "eslint-plugin-jsdoc": "^25.4.3", "eslint-plugin-node": "^11.1.0", "eslint-release": "^2.0.0", - "eslump": "^2.0.0", + "eslump": "^3.0.0", "esprima": "^4.0.1", "fs-teardown": "^0.1.0", "glob": "^7.1.6",